Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apollo/react-hoc

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apollo/react-hoc - npm Package Compare versions

Comparing version 0.1.0-beta.7 to 0.1.0-beta.8

1

lib/index.d.ts

@@ -7,3 +7,2 @@ export { graphql } from './graphql';

export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext } from '@apollo/react-common';
export { getMarkupFromTree, getDataFromTree, renderToStringWithData } from '@apollo/react-components';
export * from './types';

@@ -7,3 +7,2 @@ export { graphql } from './graphql';

export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext } from '@apollo/react-common';
export { getMarkupFromTree, getDataFromTree, renderToStringWithData } from '@apollo/react-components';
//# sourceMappingURL=index.js.map

@@ -7,3 +7,3 @@ exports.__esModule = true;

exports.withSubscription = withSubscription;
exports.renderToStringWithData = exports.getMarkupFromTree = exports.getDataFromTree = exports.resetApolloContext = exports.getApolloContext = exports.ApolloProvider = void 0;
exports.resetApolloContext = exports.getApolloContext = exports.ApolloProvider = void 0;

@@ -25,6 +25,2 @@ var _reactCommon = require("@apollo/react-common");

exports.getDataFromTree = _reactComponents.getDataFromTree;
exports.getMarkupFromTree = _reactComponents.getMarkupFromTree;
exports.renderToStringWithData = _reactComponents.renderToStringWithData;
var _tsInvariant = require("ts-invariant");

@@ -31,0 +27,0 @@

2

lib/react-hoc.cjs.min.js

@@ -1,1 +0,1 @@

exports.__esModule=!0,exports.graphql=function(t,r){void 0===r&&(r={});switch((0,e.parser)(t).type){case e.DocumentType.Mutation:return f(t,r);case e.DocumentType.Subscription:return v(t,r);case e.DocumentType.Query:default:return d(t,r)}},exports.withApollo=function(a,i){void 0===i&&(i={});var s="withApollo("+function(e){return e.displayName||e.name||"Component"}(a)+")",p=function(n){function p(e){var t=n.call(this,e)||this;return t.setWrappedInstance=t.setWrappedInstance.bind(t),t}return(0,t.__extends)(p,n),p.prototype.getWrappedInstance=function(){return(0,o.invariant)(i.withRef,1),this.wrappedInstance},p.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},p.prototype.render=function(){var n=this;return r.default.createElement(e.ApolloConsumer,null,function(e){var o=Object.assign({},n.props,{client:e,ref:i.withRef?n.setWrappedInstance:void 0});return r.default.createElement(a,(0,t.__assign)({},o))})},p.displayName=s,p.WrappedComponent=a,p}(r.default.Component);return(0,n.default)(p,a,{})},exports.withMutation=f,exports.withQuery=d,exports.withSubscription=v,exports.renderToStringWithData=exports.getMarkupFromTree=exports.getDataFromTree=exports.resetApolloContext=exports.getApolloContext=exports.ApolloProvider=void 0;var e=require("@apollo/react-common");exports.ApolloConsumer=e.ApolloConsumer,exports.ApolloProvider=e.ApolloProvider,exports.getApolloContext=e.getApolloContext,exports.resetApolloContext=e.resetApolloContext;var t=require("tslib"),r=i(require("react")),n=i(require("hoist-non-react-statics")),a=require("@apollo/react-components");exports.getDataFromTree=a.getDataFromTree,exports.getMarkupFromTree=a.getMarkupFromTree,exports.renderToStringWithData=a.renderToStringWithData;var o=require("ts-invariant");function i(e){return e&&e.__esModule?e:{default:e}}var s=function(){return{}},p=function(){return!1};function u(e){return e.displayName||e.name||"Component"}function l(e,t){for(var r={},n=0,a=e.variables;n<a.length;n++){var o=a[n],i=o.variable,s=o.type;if(i.name&&i.name.value){var p=i.name.value,u=t[p];void 0===u?"NonNullType"!==s.kind&&(r[p]=void 0):r[p]=u}}return r}var c=function(e){function r(t){var r=e.call(this,t)||this;return r.withRef=!1,r.setWrappedInstance=r.setWrappedInstance.bind(r),r}return(0,t.__extends)(r,e),r.prototype.getWrappedInstance=function(){return(0,o.invariant)(this.withRef,2),this.wrappedInstance},r.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},r}(r.default.Component);function d(o,i){void 0===i&&(i={});var d=(0,e.parser)(o),f=i.options,v=void 0===f?s:f,h=i.skip,m=void 0===h?p:h,_=i.alias,b=void 0===_?"Apollo":_,g=v;"function"!=typeof g&&(g=function(){return v});var y,x=m;return"function"!=typeof x&&(x=function(){return m}),function(e){var s=b+"("+u(e)+")",p=function(n){function p(){return null!==n&&n.apply(this,arguments)||this}return(0,t.__extends)(p,n),p.prototype.render=function(){var n=this,p=this.props,u=x(p),c=u?Object.create(null):(0,t.__assign)({},g(p));return!u&&!c.variables&&d.variables.length>0&&(c.variables=l(d,p)),r.default.createElement(a.Query,(0,t.__assign)({},c,{displayName:s,skip:u,query:o}),function(a){a.client;var o,s,l=a.data,c=(0,t.__rest)(a,["client","data"]);if(i.withRef&&(n.withRef=!0,p=Object.assign({},p,{ref:n.setWrappedInstance})),u)return r.default.createElement(e,(0,t.__assign)({},p,{}));var d=Object.assign(c,l||{}),f=i.name||"data",v=((o={})[f]=d,o);if(i.props){var h=((s={})[f]=d,s.ownProps=p,s);v=y=i.props(h,y)}return r.default.createElement(e,(0,t.__assign)({},p,v))})},p.displayName=s,p.WrappedComponent=e,p}(c);return(0,n.default)(p,e,{})}}function f(o,i){void 0===i&&(i={});var p=(0,e.parser)(o),d=i.options,f=void 0===d?s:d,v=i.alias,h=void 0===v?"Apollo":v,m=f;return"function"!=typeof m&&(m=function(){return f}),function(e){var s=h+"("+u(e)+")",d=function(n){function u(){return null!==n&&n.apply(this,arguments)||this}return(0,t.__extends)(u,n),u.prototype.render=function(){var n=this.props,s=m(n);return i.withRef&&(this.withRef=!0,n=Object.assign({},n,{ref:this.setWrappedInstance})),!s.variables&&p.variables.length>0&&(s.variables=l(p,n)),r.default.createElement(a.Mutation,(0,t.__assign)({},s,{mutation:o,ignoreResults:!0}),function(a,o){var s,p,u=o.data,l=(0,t.__rest)(o,["data"]),c=Object.assign(l,u||{}),d=i.name||"mutate",f=i.name?d+"Result":"result",v=((s={})[d]=a,s[f]=c,s);if(i.props){var h=((p={})[d]=a,p[f]=c,p.ownProps=n,p);v=i.props(h)}return r.default.createElement(e,(0,t.__assign)({},n,v))})},u.displayName=s,u.WrappedComponent=e,u}(c);return(0,n.default)(d,e,{})}}function v(o,i){void 0===i&&(i={});var d=(0,e.parser)(o),f=i.options,v=void 0===f?s:f,h=i.skip,m=void 0===h?p:h,_=i.alias,b=void 0===_?"Apollo":_,g=i.shouldResubscribe,y=v;"function"!=typeof y&&(y=function(){return v});var x,w=m;return"function"!=typeof w&&(w=function(){return m}),function(e){var s=b+"("+u(e)+")",p=function(n){function p(e){var t=n.call(this,e)||this;return t.state={resubscribe:!1},t}return(0,t.__extends)(p,n),p.prototype.componentDidUpate=function(e){g&&this.setState({resubscribe:g(e,this.props)})},p.prototype.render=function(){var n=this,p=this.props,u=w(p),c=u?Object.create(null):y(p);return!u&&!c.variables&&d.variables.length>0&&(c.variables=l(d,p)),r.default.createElement(a.Subscription,(0,t.__assign)({},c,{displayName:s,skip:u,subscription:o,shouldResubscribe:this.state.resubscribe}),function(a){var o,s,l=a.data,c=(0,t.__rest)(a,["data"]);if(i.withRef&&(n.withRef=!0,p=Object.assign({},p,{ref:n.setWrappedInstance})),u)return r.default.createElement(e,(0,t.__assign)({},p,{}));var d=Object.assign(c,l||{}),f=i.name||"data",v=((o={})[f]=d,o);if(i.props){var h=((s={})[f]=d,s.ownProps=p,s);v=x=i.props(h,x)}return r.default.createElement(e,(0,t.__assign)({},p,v))})},p.displayName=s,p.WrappedComponent=e,p}(c);return(0,n.default)(p,e,{})}}
exports.__esModule=!0,exports.graphql=function(t,n){void 0===n&&(n={});switch((0,e.parser)(t).type){case e.DocumentType.Mutation:return f(t,n);case e.DocumentType.Subscription:return v(t,n);case e.DocumentType.Query:default:return d(t,n)}},exports.withApollo=function(a,i){void 0===i&&(i={});var s="withApollo("+function(e){return e.displayName||e.name||"Component"}(a)+")",p=function(r){function p(e){var t=r.call(this,e)||this;return t.setWrappedInstance=t.setWrappedInstance.bind(t),t}return(0,t.__extends)(p,r),p.prototype.getWrappedInstance=function(){return(0,o.invariant)(i.withRef,1),this.wrappedInstance},p.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},p.prototype.render=function(){var r=this;return n.default.createElement(e.ApolloConsumer,null,function(e){var o=Object.assign({},r.props,{client:e,ref:i.withRef?r.setWrappedInstance:void 0});return n.default.createElement(a,(0,t.__assign)({},o))})},p.displayName=s,p.WrappedComponent=a,p}(n.default.Component);return(0,r.default)(p,a,{})},exports.withMutation=f,exports.withQuery=d,exports.withSubscription=v,exports.resetApolloContext=exports.getApolloContext=exports.ApolloProvider=void 0;var e=require("@apollo/react-common");exports.ApolloConsumer=e.ApolloConsumer,exports.ApolloProvider=e.ApolloProvider,exports.getApolloContext=e.getApolloContext,exports.resetApolloContext=e.resetApolloContext;var t=require("tslib"),n=i(require("react")),r=i(require("hoist-non-react-statics")),a=require("@apollo/react-components"),o=require("ts-invariant");function i(e){return e&&e.__esModule?e:{default:e}}var s=function(){return{}},p=function(){return!1};function u(e){return e.displayName||e.name||"Component"}function l(e,t){for(var n={},r=0,a=e.variables;r<a.length;r++){var o=a[r],i=o.variable,s=o.type;if(i.name&&i.name.value){var p=i.name.value,u=t[p];void 0===u?"NonNullType"!==s.kind&&(n[p]=void 0):n[p]=u}}return n}var c=function(e){function n(t){var n=e.call(this,t)||this;return n.withRef=!1,n.setWrappedInstance=n.setWrappedInstance.bind(n),n}return(0,t.__extends)(n,e),n.prototype.getWrappedInstance=function(){return(0,o.invariant)(this.withRef,2),this.wrappedInstance},n.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},n}(n.default.Component);function d(o,i){void 0===i&&(i={});var d=(0,e.parser)(o),f=i.options,v=void 0===f?s:f,h=i.skip,m=void 0===h?p:h,_=i.alias,b=void 0===_?"Apollo":_,y=v;"function"!=typeof y&&(y=function(){return v});var g,x=m;return"function"!=typeof x&&(x=function(){return m}),function(e){var s=b+"("+u(e)+")",p=function(r){function p(){return null!==r&&r.apply(this,arguments)||this}return(0,t.__extends)(p,r),p.prototype.render=function(){var r=this,p=this.props,u=x(p),c=u?Object.create(null):(0,t.__assign)({},y(p));return!u&&!c.variables&&d.variables.length>0&&(c.variables=l(d,p)),n.default.createElement(a.Query,(0,t.__assign)({},c,{displayName:s,skip:u,query:o}),function(a){a.client;var o,s,l=a.data,c=(0,t.__rest)(a,["client","data"]);if(i.withRef&&(r.withRef=!0,p=Object.assign({},p,{ref:r.setWrappedInstance})),u)return n.default.createElement(e,(0,t.__assign)({},p,{}));var d=Object.assign(c,l||{}),f=i.name||"data",v=((o={})[f]=d,o);if(i.props){var h=((s={})[f]=d,s.ownProps=p,s);v=g=i.props(h,g)}return n.default.createElement(e,(0,t.__assign)({},p,v))})},p.displayName=s,p.WrappedComponent=e,p}(c);return(0,r.default)(p,e,{})}}function f(o,i){void 0===i&&(i={});var p=(0,e.parser)(o),d=i.options,f=void 0===d?s:d,v=i.alias,h=void 0===v?"Apollo":v,m=f;return"function"!=typeof m&&(m=function(){return f}),function(e){var s=h+"("+u(e)+")",d=function(r){function u(){return null!==r&&r.apply(this,arguments)||this}return(0,t.__extends)(u,r),u.prototype.render=function(){var r=this.props,s=m(r);return i.withRef&&(this.withRef=!0,r=Object.assign({},r,{ref:this.setWrappedInstance})),!s.variables&&p.variables.length>0&&(s.variables=l(p,r)),n.default.createElement(a.Mutation,(0,t.__assign)({},s,{mutation:o,ignoreResults:!0}),function(a,o){var s,p,u=o.data,l=(0,t.__rest)(o,["data"]),c=Object.assign(l,u||{}),d=i.name||"mutate",f=i.name?d+"Result":"result",v=((s={})[d]=a,s[f]=c,s);if(i.props){var h=((p={})[d]=a,p[f]=c,p.ownProps=r,p);v=i.props(h)}return n.default.createElement(e,(0,t.__assign)({},r,v))})},u.displayName=s,u.WrappedComponent=e,u}(c);return(0,r.default)(d,e,{})}}function v(o,i){void 0===i&&(i={});var d=(0,e.parser)(o),f=i.options,v=void 0===f?s:f,h=i.skip,m=void 0===h?p:h,_=i.alias,b=void 0===_?"Apollo":_,y=i.shouldResubscribe,g=v;"function"!=typeof g&&(g=function(){return v});var x,w=m;return"function"!=typeof w&&(w=function(){return m}),function(e){var s=b+"("+u(e)+")",p=function(r){function p(e){var t=r.call(this,e)||this;return t.state={resubscribe:!1},t}return(0,t.__extends)(p,r),p.prototype.componentDidUpate=function(e){y&&this.setState({resubscribe:y(e,this.props)})},p.prototype.render=function(){var r=this,p=this.props,u=w(p),c=u?Object.create(null):g(p);return!u&&!c.variables&&d.variables.length>0&&(c.variables=l(d,p)),n.default.createElement(a.Subscription,(0,t.__assign)({},c,{displayName:s,skip:u,subscription:o,shouldResubscribe:this.state.resubscribe}),function(a){var o,s,l=a.data,c=(0,t.__rest)(a,["data"]);if(i.withRef&&(r.withRef=!0,p=Object.assign({},p,{ref:r.setWrappedInstance})),u)return n.default.createElement(e,(0,t.__assign)({},p,{}));var d=Object.assign(c,l||{}),f=i.name||"data",v=((o={})[f]=d,o);if(i.props){var h=((s={})[f]=d,s.ownProps=p,s);v=x=i.props(h,x)}return n.default.createElement(e,(0,t.__assign)({},p,v))})},p.displayName=s,p.WrappedComponent=e,p}(c);return(0,r.default)(p,e,{})}}

@@ -7,3 +7,2 @@ import { parser, DocumentType, ApolloConsumer } from '@apollo/react-common';

import { Query, Mutation, Subscription } from '@apollo/react-components';
export { getDataFromTree, getMarkupFromTree, renderToStringWithData } from '@apollo/react-components';
import { invariant } from 'ts-invariant';

@@ -10,0 +9,0 @@

@@ -21,3 +21,3 @@ (function (global, factory) {

_exports.withSubscription = withSubscription;
_exports.renderToStringWithData = _exports.getMarkupFromTree = _exports.getDataFromTree = _exports.resetApolloContext = _exports.getApolloContext = _exports.ApolloProvider = void 0;
_exports.resetApolloContext = _exports.getApolloContext = _exports.ApolloProvider = void 0;
_exports.ApolloConsumer = _reactCommon.ApolloConsumer;

@@ -29,5 +29,2 @@ _exports.ApolloProvider = _reactCommon.ApolloProvider;

_hoistNonReactStatics = _interopRequireDefault(_hoistNonReactStatics);
_exports.getDataFromTree = _reactComponents.getDataFromTree;
_exports.getMarkupFromTree = _reactComponents.getMarkupFromTree;
_exports.renderToStringWithData = _reactComponents.renderToStringWithData;

@@ -34,0 +31,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -7,2 +7,2 @@ import React from 'react';

};
export declare function withApollo<TProps, TResult = any>(WrappedComponent: React.ComponentType<WithApolloClient<TProps>>, operationOptions?: OperationOption<TProps, TResult>): React.ComponentClass<TProps>;
export declare function withApollo<TProps, TResult = any>(WrappedComponent: React.ComponentType<WithApolloClient<Omit<TProps, 'client'>>>, operationOptions?: OperationOption<TProps, TResult>): React.ComponentClass<Omit<TProps, 'client'>>;
{
"name": "@apollo/react-hoc",
"description": "React Apollo `graphql` higher-order component.",
"version": "0.1.0-beta.7",
"version": "0.1.0-beta.8",
"author": "opensource@apollographql.com",

@@ -25,3 +25,3 @@ "keywords": [

"scripts": {
"clean": "rm -Rf ./lib/* ./meta/bundlesize/* ./meta/coverage/*",
"clean": "rm -Rf ./lib/* ./meta/bundlesize/* ./meta/coverage/* ./.rpt2_cache",
"prepare": "npm run build",

@@ -46,4 +46,5 @@ "prebuild": "npm run clean",

"dependencies": {
"@apollo/react-common": "^0.1.0-beta.8",
"@apollo/react-components": "^0.1.0-beta.7",
"@apollo/react-common": "^0.1.0-beta.9",
"@apollo/react-components": "^0.1.0-beta.8",
"hoist-non-react-statics": "^3.3.0",
"ts-invariant": "^0.4.4",

@@ -59,8 +60,9 @@ "tslib": "^1.10.0"

"devDependencies": {
"jest": "^24.8.0",
"rollup": "1.16.2",
"tsc-watch": "^2.2.1",
"typescript": "^3.5.2"
"@apollo/react-ssr": "^0.1.0-beta.1",
"jest": "24.8.0",
"rollup": "1.16.7",
"tsc-watch": "2.2.1",
"typescript": "3.5.3"
},
"gitHead": "808e66755990a649202a662a6c6e8b8d20a0e9fb"
"gitHead": "bd87da901113c81e3e7e2a7edaeac791895abb96"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc