graphql-react
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
# graphql-react changelog | ||
## 1.0.0-alpha.2 | ||
* Updated dependencies. | ||
* Significantly reduced the bundle size to < 4 KB by simplifying Babel helpers and reusing the [`object-assign`](https://npm.im/object-assign) React dependency with [`babel-plugin-transform-replace-object-assign`](https://npm.im/babel-plugin-transform-replace-object-assign). | ||
* Removed the `Promise` polyfill; consumers can polyfill as required for optimal bundle size. | ||
* Document required polyfills in the readme. | ||
* Updated ESLint config: | ||
* `parserOptions` is unnecessary when using `babel-eslint`. | ||
* Enabled `prefer-destructuring` rule. | ||
## 1.0.0-alpha.1 | ||
@@ -4,0 +14,0 @@ |
'use strict' | ||
var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault') | ||
exports.__esModule = true | ||
exports.Query = exports.Consumer = exports.Provider = void 0 | ||
var _extends2 = _interopRequireDefault( | ||
require('@babel/runtime/helpers/extends') | ||
) | ||
var _objectAssign = _interopRequireDefault(require('object-assign')) | ||
require('core-js/modules/es6.object.assign') | ||
var _inheritsLoose2 = _interopRequireDefault( | ||
require('@babel/runtime/helpers/inheritsLoose') | ||
) | ||
var _react = _interopRequireDefault(require('react')) | ||
@@ -26,2 +16,12 @@ | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { default: obj } | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
subClass.prototype = Object.create(superClass.prototype) | ||
subClass.prototype.constructor = subClass | ||
subClass.__proto__ = superClass | ||
} | ||
var _React$createContext = _react.default.createContext(), | ||
@@ -35,3 +35,3 @@ Provider = _React$createContext.Provider, | ||
var GraphQLQuery = (function(_React$Component) { | ||
;(0, _inheritsLoose2.default)(GraphQLQuery, _React$Component) | ||
_inheritsLoose(GraphQLQuery, _React$Component) | ||
@@ -151,3 +151,3 @@ function GraphQLQuery(props) { | ||
return this.props.children( | ||
Object.assign( | ||
(0, _objectAssign.default)( | ||
{ | ||
@@ -180,3 +180,3 @@ load: this.load, | ||
GraphQLQuery, | ||
(0, _extends2.default)( | ||
(0, _objectAssign.default)( | ||
{ | ||
@@ -183,0 +183,0 @@ graphql: graphql |
'use strict' | ||
var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault') | ||
exports.__esModule = true | ||
exports.GraphQL = void 0 | ||
require('core-js/modules/es6.function.name') | ||
var _objectWithoutProperties2 = _interopRequireDefault( | ||
require('@babel/runtime/helpers/objectWithoutProperties') | ||
) | ||
var _fnv1a = _interopRequireDefault(require('fnv1a')) | ||
@@ -18,2 +10,28 @@ | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { default: obj } | ||
} | ||
function _objectWithoutProperties(source, excluded) { | ||
if (source == null) return {} | ||
var target = {} | ||
var sourceKeys = Object.keys(source) | ||
var key, i | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i] | ||
if (excluded.indexOf(key) >= 0) continue | ||
target[key] = source[key] | ||
} | ||
if (Object.getOwnPropertySymbols) { | ||
var sourceSymbolKeys = Object.getOwnPropertySymbols(source) | ||
for (i = 0; i < sourceSymbolKeys.length; i++) { | ||
key = sourceSymbolKeys[i] | ||
if (excluded.indexOf(key) >= 0) continue | ||
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue | ||
target[key] = source[key] | ||
} | ||
} | ||
return target | ||
} | ||
var GraphQL = (function() { | ||
@@ -72,3 +90,4 @@ function GraphQL(_temp) { | ||
var url = _ref2.url, | ||
options = (0, _objectWithoutProperties2.default)(_ref2, ['url']) | ||
options = _objectWithoutProperties(_ref2, ['url']) | ||
var requestCache = {} | ||
@@ -75,0 +94,0 @@ return (_this.requests[fetchOptionsHash] = fetch(url, options)).then( |
@@ -6,8 +6,8 @@ 'use strict' | ||
require('core-js/modules/es6.promise') | ||
var _objectAssign = _interopRequireDefault(require('object-assign')) | ||
require('core-js/modules/es6.function.name') | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { default: obj } | ||
} | ||
require('core-js/modules/es6.object.assign') | ||
function preload(element) { | ||
@@ -35,3 +35,7 @@ var recursePreload = function recursePreload(rootElement, loadRoot) { | ||
) { | ||
var props = Object.assign({}, element.type.defaultProps, element.props) | ||
var props = (0, _objectAssign.default)( | ||
{}, | ||
element.type.defaultProps, | ||
element.props | ||
) | ||
if (element.type.Consumer) | ||
@@ -50,3 +54,7 @@ recurse(element.props.children(element.type.currentValue)) | ||
newState = newState(instance.state, instance.props) | ||
instance.state = Object.assign({}, instance.state, newState) | ||
instance.state = (0, _objectAssign.default)( | ||
{}, | ||
instance.state, | ||
newState | ||
) | ||
} | ||
@@ -53,0 +61,0 @@ |
{ | ||
"name": "graphql-react", | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "A lightweight GraphQL client for React.", | ||
@@ -38,15 +38,15 @@ "license": "MIT", | ||
"dependencies": { | ||
"@babel/runtime": "^7.0.0-beta.40", | ||
"extract-files": "^3.1.0", | ||
"fast-deep-equal": "^1.1.0", | ||
"fnv1a": "^1.0.1", | ||
"object-assign": "^4.1.1", | ||
"prop-types": "^15.6.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-beta.40", | ||
"@babel/core": "^7.0.0-beta.40", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.40", | ||
"@babel/plugin-transform-runtime": "^7.0.0-beta.40", | ||
"@babel/preset-env": "^7.0.0-beta.40", | ||
"@babel/preset-react": "^7.0.0-beta.40", | ||
"@babel/cli": "^7.0.0-beta.42", | ||
"@babel/core": "^7.0.0-beta.42", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.42", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.42", | ||
"@babel/preset-env": "^7.0.0-beta.42", | ||
"@babel/preset-react": "^7.0.0-beta.42", | ||
"apollo-server-koa": "^1.3.2", | ||
@@ -56,10 +56,11 @@ "apollo-upload-server": "^5.0.0", | ||
"babel-eslint": "^8.2.2", | ||
"babel-plugin-transform-replace-object-assign": "^2.0.0-beta.0", | ||
"cross-env": "^5.1.4", | ||
"documentation": "^6.1.0", | ||
"eslint": "^4.18.2", | ||
"eslint": "^4.19.0", | ||
"eslint-plugin-prettier": "^2.5.0", | ||
"eslint-plugin-react": "^7.7.0", | ||
"get-port": "^3.2.0", | ||
"graphql": "^0.13.1", | ||
"graphql-tools": "^2.21.0", | ||
"graphql": "^0.13.2", | ||
"graphql-tools": "^2.23.1", | ||
"husky": "^0.14.3", | ||
@@ -72,7 +73,7 @@ "isomorphic-unfetch": "^2.0.0", | ||
"prettier": "^1.11.1", | ||
"react": "^16.3.0-alpha.1", | ||
"react-dom": "^16.3.0-alpha.1", | ||
"react-test-renderer": "^16.3.0-alpha.1", | ||
"react": "^16.3.0-alpha.2", | ||
"react-dom": "^16.3.0-alpha.2", | ||
"react-test-renderer": "^16.3.0-alpha.2", | ||
"rimraf": "^2.6.2", | ||
"size-limit": "^0.16.2" | ||
"size-limit": "^0.17.0" | ||
}, | ||
@@ -84,3 +85,3 @@ "scripts": { | ||
"build:js": "babel src -d lib", | ||
"build:mjs": "cross-env MODULE=true babel src -d lib --keep-file-extension", | ||
"build:mjs": "cross-env ESM=true babel src -d lib --keep-file-extension", | ||
"postbuild": "prettier 'lib/**/*.{mjs,js}' --write", | ||
@@ -113,12 +114,5 @@ "jsdoc": | ||
}, | ||
"eslintIgnore": ["!.*", "node_modules", ".next", "lib"], | ||
"eslintIgnore": ["!.*", "node_modules", "lib", ".next"], | ||
"eslintConfig": { | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": 2017, | ||
"ecmaFeatures": { | ||
"experimentalObjectRestSpread": true | ||
} | ||
}, | ||
"env": { | ||
@@ -140,2 +134,9 @@ "es6": true, | ||
"curly": ["error", "multi"], | ||
"prefer-destructuring": [ | ||
"error", | ||
{ | ||
"array": true, | ||
"object": true | ||
} | ||
], | ||
"prettier/prettier": "error" | ||
@@ -153,3 +154,3 @@ } | ||
"path": "lib/index.js", | ||
"limit": "11 KB" | ||
"limit": "4 KB" | ||
}, | ||
@@ -159,3 +160,3 @@ { | ||
"path": "lib/index.mjs", | ||
"limit": "11 KB" | ||
"limit": "4 KB" | ||
} | ||
@@ -162,0 +163,0 @@ ], |
@@ -63,2 +63,7 @@ ![Logo](https://cdn.rawgit.com/jaydenseric/graphql-react/b2e60e80/graphql-react-logo.svg) | ||
Consider polyfilling: | ||
* [`fetch`](https://developer.mozilla.org/docs/Web/API/Fetch_API) | ||
* [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) | ||
## API | ||
@@ -65,0 +70,0 @@ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50395
796
452
31
+ Addedobject-assign@^4.1.1
- Removed@babel/runtime@^7.0.0-beta.40