From 71a884a1daef14667b74ef2dabc97699798e943d Mon Sep 17 00:00:00 2001 From: Peggy Rayzis Date: Fri, 8 Dec 2017 21:12:52 -0500 Subject: [PATCH 1/2] Rolled back on the lodash-es changes --- Changelog.md | 603 +++++++++++++++++++++++++++++++++--------------- package.json | 47 ++-- src/browser.ts | 4 +- src/graphql.tsx | 11 +- 4 files changed, 448 insertions(+), 217 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9ef2e23811..8d4869e4e6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,240 +1,400 @@ # Change log -### vNext -- Use lodash-es to allow lodash functions to be used in ES modules [#1344](https://github.com/apollographql/react-apollo/pull/1344) -- turn back on flow checking +### 2.0.4 + +* rolled back on the lodash-es changes from + [#1344](https://github.com/apollographql/react-apollo/pull/1344) due to build + errors reported on slack + +### 2.0.3 + +* Use lodash-es to allow lodash functions to be used in ES modules + [#1344](https://github.com/apollographql/react-apollo/pull/1344) +* turn back on flow checking ### 2.0.2 -- upgraded required apollo-client for bugfix for subscriptions -- add component name in unhandled error message [#1362](https://github.com/apollographql/react-apollo/pull/1362) -- upgraded flow support to 0.59.0 :tada: [#1354](https://github.com/apollographql/react-apollo/pull/1354) -- skip null / undefined items on SSR if present [#1355](https://github.com/apollographql/react-apollo/pull/1355) +* upgraded required apollo-client for bugfix for subscriptions +* add component name in unhandled error message + [#1362](https://github.com/apollographql/react-apollo/pull/1362) +* upgraded flow support to 0.59.0 :tada: + [#1354](https://github.com/apollographql/react-apollo/pull/1354) +* skip null / undefined items on SSR if present + [#1355](https://github.com/apollographql/react-apollo/pull/1355) ### 2.0.1 -- fix skip on component update [#1330](https://github.com/apollographql/react-apollo/pull/1330) -- Correctly provide the generic cache type to ApolloProvider [#1319](https://github.com/apollographql/react-apollo/pull/1319) -- Correctly initializes component state as null (not undefined) [#1300](https://github.com/apollographql/react-apollo/pull/1310) + +* fix skip on component update + [#1330](https://github.com/apollographql/react-apollo/pull/1330) +* Correctly provide the generic cache type to ApolloProvider + [#1319](https://github.com/apollographql/react-apollo/pull/1319) +* Correctly initializes component state as null (not undefined) + [#1300](https://github.com/apollographql/react-apollo/pull/1310) ### 2.0.0 -- BREAKING: removed cleanupApolloState as it is no longer needed! -- Exported getDataFromTree on the client -- Removed `redux` from peer dependencies. [Issue #1223](https://github.com/apollographql/react-apollo/issues/1223) [PR #1224](https://github.com/apollographql/react-apollo/pull/1224) -- Support arrays being returned from render in SSR [#1158](https://github.com/apollographql/react-apollo/pull/1158) -- Support passing an updater function to `setState` in SSR mode [#1263](https://github.com/apollographql/react-apollo/pull/1263) + +* BREAKING: removed cleanupApolloState as it is no longer needed! +* Exported getDataFromTree on the client +* Removed `redux` from peer dependencies. + [Issue #1223](https://github.com/apollographql/react-apollo/issues/1223) + [PR #1224](https://github.com/apollographql/react-apollo/pull/1224) +* Support arrays being returned from render in SSR + [#1158](https://github.com/apollographql/react-apollo/pull/1158) +* Support passing an updater function to `setState` in SSR mode + [#1263](https://github.com/apollographql/react-apollo/pull/1263) ### 2.0.0-beta.0 -- upgrade to Apollo Client 2.0 -- remove direct dependencies on Apollo Client, graphql-tag -- fix skip on component update. -- Fix: ensure `client` option can be used with mutation query [#1145](https://github.com/apollographql/react-apollo/pull/1145) -- Made `OptionProps.data`'s `TResult` partial [#1231](https://github.com/apollographql/react-apollo/pull/1231) + +* upgrade to Apollo Client 2.0 +* remove direct dependencies on Apollo Client, graphql-tag +* fix skip on component update. +* Fix: ensure `client` option can be used with mutation query + [#1145](https://github.com/apollographql/react-apollo/pull/1145) +* Made `OptionProps.data`'s `TResult` partial + [#1231](https://github.com/apollographql/react-apollo/pull/1231) ### 1.4.16 -- upgrade to react-16 -- fix shallowEqual bug. -- Added notifyOnNetworkStatusChange to QueryOpts and MutationOpts Typesccript definitions [#1034](https://github.com/apollographql/react-apollo/pull/1034) -- Added variables types with Typescript [#997](https://github.com/apollographql/react-apollo/pull/997) -- Made `ChildProps.data` non-optional [#1143](https://github.com/apollographql/react-apollo/pull/1143) + +* upgrade to react-16 +* fix shallowEqual bug. +* Added notifyOnNetworkStatusChange to QueryOpts and MutationOpts Typesccript + definitions [#1034](https://github.com/apollographql/react-apollo/pull/1034) +* Added variables types with Typescript + [#997](https://github.com/apollographql/react-apollo/pull/997) +* Made `ChildProps.data` non-optional + [#1143](https://github.com/apollographql/react-apollo/pull/1143) ### 1.4.15 -- Fix: handle calling refetch in child componentDidMount -- Fix: ensure options gets up to date props [#1025](https://github.com/apollographql/react-apollo/pull/1005) -- Fix: ensure queryRecycler exists before using it -- MockNetworkInterface match mock requests regardless of variable order [#973](https://github.com/apollographql/react-apollo/pull/973) -- Allow to pass removeTypenames to MockedProvider [#1001](https://github.com/apollographql/react-apollo/pull/1001) + +* Fix: handle calling refetch in child componentDidMount +* Fix: ensure options gets up to date props + [#1025](https://github.com/apollographql/react-apollo/pull/1005) +* Fix: ensure queryRecycler exists before using it +* MockNetworkInterface match mock requests regardless of variable order + [#973](https://github.com/apollographql/react-apollo/pull/973) +* Allow to pass removeTypenames to MockedProvider + [#1001](https://github.com/apollographql/react-apollo/pull/1001) ### 1.4.14 -- Fix: Scope query recyclers by client [#876](https://github.com/apollographql/react-apollo/pull/876) + +* Fix: Scope query recyclers by client + [#876](https://github.com/apollographql/react-apollo/pull/876) ### 1.4.13 [DEPRECATED] -- Support apollo-client 2.0 + +* Support apollo-client 2.0 ### 1.4.12 -- Fix: fix issue with bad deploy + +* Fix: fix issue with bad deploy ### 1.4.11 (BROKEN) -- Replace string refs with callback refs [#908](https://github.com/apollographql/react-apollo/pull/908) + +* Replace string refs with callback refs + [#908](https://github.com/apollographql/react-apollo/pull/908) ### 1.4.10 -- Fix: fix UMD bundle pointing to apolloClient for some reason + +* Fix: fix UMD bundle pointing to apolloClient for some reason ### 1.4.9 -- Fix: fix matching types with exports for flow and ts + +* Fix: fix matching types with exports for flow and ts ### 1.4.8 -- Fix: Ensure typescript and flow type definitions match in name + +* Fix: Ensure typescript and flow type definitions match in name ### 1.4.7 -- Feature: Add support for flow typecheck to work out of the box (without any configuration) + +* Feature: Add support for flow typecheck to work out of the box (without any + configuration) ### 1.4.6 -- Fix: Fix issue where `withRef`-option of `graphql` did not work when the query was skipped [#865](https://github.com/apollographql/react-apollo/pull/865) + +* Fix: Fix issue where `withRef`-option of `graphql` did not work when the query + was skipped [#865](https://github.com/apollographql/react-apollo/pull/865) ### 1.4.5 -- Fix: export all types from main type file + +* Fix: export all types from main type file ### 1.4.4 -- Fix: Fix issue around hoisting non react statics for RN [#859](https://github.com/apollographql/react-apollo/pull/859) -- Fix: Fix issue where options was called even though skip was present [#859](https://github.com/apollographql/react-apollo/pull/859) -- Improvement: Allow for better typescript usage with improved types [#862](https://github.com/apollographql/react-apollo/pull/862) + +* Fix: Fix issue around hoisting non react statics for RN + [#859](https://github.com/apollographql/react-apollo/pull/859) +* Fix: Fix issue where options was called even though skip was present + [#859](https://github.com/apollographql/react-apollo/pull/859) +* Improvement: Allow for better typescript usage with improved types + [#862](https://github.com/apollographql/react-apollo/pull/862) ### 1.4.3 -- Feature: You can now supply a client in options object passed to the `graphql` high oder component. [PR #729](https://github.com/apollographql/react-apollo/pull/729) -- Fix: Fix issue when using flow definitions [PR# 787](https://github.com/apollographql/react-apollo/pull/787) -- Improvement: Reduce re-renders by using forceUpdate instead of setState({ }) [PR #775](https://github.com/apollographql/react-apollo/pull/775) -- Improvement: Refactor dataForChild to use bound function to reduce rerenders [PR #772](https://github.com/apollographql/react-apollo/pull/772) -- Fix: Add in missing types for MutationOpts [PR #770](https://github.com/apollographql/react-apollo/pull/770) + +* Feature: You can now supply a client in options object passed to the `graphql` + high oder component. + [PR #729](https://github.com/apollographql/react-apollo/pull/729) +* Fix: Fix issue when using flow definitions + [PR# 787](https://github.com/apollographql/react-apollo/pull/787) +* Improvement: Reduce re-renders by using forceUpdate instead of setState({ }) + [PR #775](https://github.com/apollographql/react-apollo/pull/775) +* Improvement: Refactor dataForChild to use bound function to reduce rerenders + [PR #772](https://github.com/apollographql/react-apollo/pull/772) +* Fix: Add in missing types for MutationOpts + [PR #770](https://github.com/apollographql/react-apollo/pull/770) ### 1.4.2 -- Fix: Fix component reference and variable statement for flow types + +* Fix: Fix component reference and variable statement for flow types ### 1.4.1 -- Fix: Fix compilation of test-utils from move to ES bundles + +* Fix: Fix compilation of test-utils from move to ES bundles ### 1.4.0 + #### BREAKING FOR TYPESCRIPT USERS -- Feature: Enhanced typescript definitions to allow for more valid type checking of graphql HOC [PR #695](https://github.com/apollographql/react-apollo/pull/695) -- Feature: Flow types: [PR #695](https://github.com/apollographql/react-apollo/pull/695) -- Fix: Fix bug with sync re-renders and recyled queries [PR #740](https://github.com/apollographql/react-apollo/pull/740) + +* Feature: Enhanced typescript definitions to allow for more valid type checking + of graphql HOC + [PR #695](https://github.com/apollographql/react-apollo/pull/695) +* Feature: Flow types: + [PR #695](https://github.com/apollographql/react-apollo/pull/695) +* Fix: Fix bug with sync re-renders and recyled queries + [PR #740](https://github.com/apollographql/react-apollo/pull/740) ### 1.3.0 -- Feature: Support tree shaking and smaller (marginally) bundles via rollup [PR #691](https://github.com/apollographql/react-apollo/pull/691) -- Fix: Render full markup on the server when using the `cache-and-network` fetchPolicy [PR #688](https://github.com/apollographql/react-apollo/pull/688) + +* Feature: Support tree shaking and smaller (marginally) bundles via rollup + [PR #691](https://github.com/apollographql/react-apollo/pull/691) +* Fix: Render full markup on the server when using the `cache-and-network` + fetchPolicy [PR #688](https://github.com/apollographql/react-apollo/pull/688) ### 1.2.0 -- Fix: Use `standby` fetchPolicy for recycled queries [PR #671](https://github.com/apollographql/react-apollo/pull/671) + +* Fix: Use `standby` fetchPolicy for recycled queries + [PR #671](https://github.com/apollographql/react-apollo/pull/671) ### 1.1.3 -- Perf: Removed unneeded usage of shouldComponentUpdate [PR #661](https://github.com/apollographql/react-apollo/pull/661) inspired by [PR #653](https://github.com/apollographql/react-apollo/pull/653) -- Perf: Removed unneeded usage of shouldComponentUpdate in Provider [PR #669](https://github.com/apollographql/react-apollo/pull/669) -- Chore: remove unused immutable prop [PR #539](https://github.com/apollographql/react-apollo/pull/539) + +* Perf: Removed unneeded usage of shouldComponentUpdate + [PR #661](https://github.com/apollographql/react-apollo/pull/661) inspired by + [PR #653](https://github.com/apollographql/react-apollo/pull/653) +* Perf: Removed unneeded usage of shouldComponentUpdate in Provider + [PR #669](https://github.com/apollographql/react-apollo/pull/669) +* Chore: remove unused immutable prop + [PR #539](https://github.com/apollographql/react-apollo/pull/539) ### 1.1.2 -- Fix: Re-export all Apollo Client exports from react-apollo [PR #650](https://github.com/apollographql/react-apollo/pull/650) -- Chore: Include React 16 alpha in dependency version range [PR #647](https://github.com/apollographql/react-apollo/pull/647) + +* Fix: Re-export all Apollo Client exports from react-apollo + [PR #650](https://github.com/apollographql/react-apollo/pull/650) +* Chore: Include React 16 alpha in dependency version range + [PR #647](https://github.com/apollographql/react-apollo/pull/647) ### 1.1.1 -- Fix: move prop-types from devDependencies to dependencies [PR #656](https://github.com/apollographql/react-apollo/pull/656) + +* Fix: move prop-types from devDependencies to dependencies + [PR #656](https://github.com/apollographql/react-apollo/pull/656) ### 1.1.0 (deprecated) -- Pass cached data to the child component along with the error. [PR #548](https://github.com/apollographql/react-apollo/pull/548) -- Fix version lock down for peer dependency version of React. [PR #626](https://github.com/apollographql/react-apollo/pull/626) -- Switch `graphql-tag` dependency to `2.0.0`. This isn't really a breaking change because we only export `gql` from `react-apollo`. -- Fix: convert deprecated `React.PropTypes` to `PropTypes` provided by the `prop-types` package. [PR #628](https://github.com/apollographql/react-apollo/pull/628) + +* Pass cached data to the child component along with the error. + [PR #548](https://github.com/apollographql/react-apollo/pull/548) +* Fix version lock down for peer dependency version of React. + [PR #626](https://github.com/apollographql/react-apollo/pull/626) +* Switch `graphql-tag` dependency to `2.0.0`. This isn't really a breaking + change because we only export `gql` from `react-apollo`. +* Fix: convert deprecated `React.PropTypes` to `PropTypes` provided by the + `prop-types` package. + [PR #628](https://github.com/apollographql/react-apollo/pull/628) ### 1.0.2 -- Exposed `createBatchingNetworkInterface` from apollo-client so that it can be imported from react-apollo just like `createNetworkInterface`. [PR #618](https://github.com/apollographql/react-apollo/pull/618) + +* Exposed `createBatchingNetworkInterface` from apollo-client so that it can be + imported from react-apollo just like `createNetworkInterface`. + [PR #618](https://github.com/apollographql/react-apollo/pull/618) ### 1.0.1 -- Fix: Make sure recycled queries are in cache only mode so they do not trigger network requests. [PR #531](https://github.com/apollographql/react-apollo/pull/531) + +* Fix: Make sure recycled queries are in cache only mode so they do not trigger + network requests. + [PR #531](https://github.com/apollographql/react-apollo/pull/531) ### 1.0.0 -- ApolloProvider now won't put its `store` on `context` unless it was given. [PR #550](https://github.com/apollographql/react-apollo/pull/550) -- MockedProvider now accepts a `store` prop to be passed to ApolloProvider so that react-redux store is not overwritten + +* ApolloProvider now won't put its `store` on `context` unless it was given. + [PR #550](https://github.com/apollographql/react-apollo/pull/550) +* MockedProvider now accepts a `store` prop to be passed to ApolloProvider so + that react-redux store is not overwritten ### 1.0.0-rc.3 -- Fix bug where `options` was mutated causing variables to not update appropriately. [PR #537](https://github.com/apollographql/react-apollo/pull/537) -- Make sure that all queries resolve or reject if an error was thrown when server side rendering. [PR #488](https://github.com/apollographql/react-apollo/pull/488) -- ApolloProvider now changes its client and store when those props change. [PR #479](https://github.com/apollographql/react-apollo/pull/479) + +* Fix bug where `options` was mutated causing variables to not update + appropriately. + [PR #537](https://github.com/apollographql/react-apollo/pull/537) +* Make sure that all queries resolve or reject if an error was thrown when + server side rendering. + [PR #488](https://github.com/apollographql/react-apollo/pull/488) +* ApolloProvider now changes its client and store when those props change. + [PR #479](https://github.com/apollographql/react-apollo/pull/479) ### 1.0.0-rc.1 -- Update dependency to Apollo Client 1.0.0-rc.1 [PR #520](https://github.com/apollographql/react-apollo/pull/520) + +* Update dependency to Apollo Client 1.0.0-rc.1 + [PR #520](https://github.com/apollographql/react-apollo/pull/520) ### 0.13.3 -- Make sure that the cached rendered element has the correct type before returning it. [PR #505](https://github.com/apollographql/react-apollo/pull/505) -- Move constructor initializing of props to componentWillMount. [PR #506](https://github.com/apollographql/react-apollo/pull/506) ([Issue #509](https://github.com/apollographql/react-apollo/issues/509)). + +* Make sure that the cached rendered element has the correct type before + returning it. + [PR #505](https://github.com/apollographql/react-apollo/pull/505) +* Move constructor initializing of props to componentWillMount. + [PR #506](https://github.com/apollographql/react-apollo/pull/506) + ([Issue #509](https://github.com/apollographql/react-apollo/issues/509)). ### 0.13.2 -- Address deprecation warnings coming from `graphql-tag` [graphql-tag#54](https://github.com/apollographql/graphql-tag/issues/54) -- Make sure ApolloClient and gql are exported from browser bundle [PR #501](https://github.com/apollographql/react-apollo/pull/501) + +* Address deprecation warnings coming from `graphql-tag` + [graphql-tag#54](https://github.com/apollographql/graphql-tag/issues/54) +* Make sure ApolloClient and gql are exported from browser bundle + [PR #501](https://github.com/apollographql/react-apollo/pull/501) ### 0.13.1 -- Add apollo-client ^0.10.0 to dependency range + +* Add apollo-client ^0.10.0 to dependency range ### 0.13.0 -- Make apollo-client and graphql-tag dependencies and re-export them from this package [PR #490](https://github.com/apollographql/react-apollo/pull/490) -- Print errors to console if they are not handled by component [PR #476](https://github.com/apollographql/react-apollo/pull/476) + +* Make apollo-client and graphql-tag dependencies and re-export them from this + package [PR #490](https://github.com/apollographql/react-apollo/pull/490) +* Print errors to console if they are not handled by component + [PR #476](https://github.com/apollographql/react-apollo/pull/476) ### 0.12.0 -- Update Apollo Client to 0.9.0 and bump a lot of other dependencies [PR #484](https://github.com/apollographql/react-apollo/pull/484) + +* Update Apollo Client to 0.9.0 and bump a lot of other dependencies + [PR #484](https://github.com/apollographql/react-apollo/pull/484) ### 0.11.2 -- Remove `@types/chai` dev dependency which called a reference to the `chai` types in the production build. [PR #471](https://github.com/apollographql/react-apollo/pull/471) + +* Remove `@types/chai` dev dependency which called a reference to the `chai` + types in the production build. + [PR #471](https://github.com/apollographql/react-apollo/pull/471) ### 0.11.1 -- Fix `updateQueries` not running for queries attached to unmounted components. [PR #462](https://github.com/apollographql/react-apollo/pull/462) + +* Fix `updateQueries` not running for queries attached to unmounted components. + [PR #462](https://github.com/apollographql/react-apollo/pull/462) ### 0.10.1 -- Fix wrong invariant sanity checks for GraphQL document [PR #457](https://github.com/apollostack/react-apollo/issues/457) + +* Fix wrong invariant sanity checks for GraphQL document + [PR #457](https://github.com/apollostack/react-apollo/issues/457) ### 0.10.0 -- Feature: [typescript] Add better typings to graphql HOC [Issue #379](https://github.com/apollostack/react-apollo/issues/379) + +* Feature: [typescript] Add better typings to graphql HOC + [Issue #379](https://github.com/apollostack/react-apollo/issues/379) ### 0.9.0 -- Update apollo-client peerDependency to 0.8.0 [PR #438](https://github.com/apollostack/react-apollo/pull/438) + +* Update apollo-client peerDependency to 0.8.0 + [PR #438](https://github.com/apollostack/react-apollo/pull/438) ### 0.8.3 -- Bug: [Issue #404](https://github.com/apollostack/react-apollo/issues/404) fix issue with network errors thrown when changing variables. -- Feature: Allow access to `withApollo`'s wrapped instance thanks to `{withRef: true}` option [Issue #331](https://github.com/apollostack/react-apollo/issues/331). -- Feature: Add an `alias` option to the `graphql` function to allow customizing the display name of the wrapped component ([Issue #354](https://github.com/apollostack/react-apollo/issues/354)). + +* Bug: [Issue #404](https://github.com/apollostack/react-apollo/issues/404) fix + issue with network errors thrown when changing variables. +* Feature: Allow access to `withApollo`'s wrapped instance thanks to `{withRef: + true}` option + [Issue #331](https://github.com/apollostack/react-apollo/issues/331). +* Feature: Add an `alias` option to the `graphql` function to allow customizing + the display name of the wrapped component + ([Issue #354](https://github.com/apollostack/react-apollo/issues/354)). ### 0.8.2 -- Chore: [PR #403](https://github.com/apollostack/react-apollo/pull/403) move react-dom to be an optional dependency for better react-native builds. + +* Chore: [PR #403](https://github.com/apollostack/react-apollo/pull/403) move + react-dom to be an optional dependency for better react-native builds. ### 0.8.1 -- Same as 0.8.0, but properly built + +* Same as 0.8.0, but properly built ### 0.8.0 (deprecated - build was missing files) -- Update typings dependency from typed-grapqhl to @types/graphql [PR #393](https://github.com/apollostack/react-apollo/pull/393) -- Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets rid of warning during queries test. -- Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets rid of warnings during redux test. +* Update typings dependency from typed-grapqhl to @types/graphql + [PR #393](https://github.com/apollostack/react-apollo/pull/393) +* Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets + rid of warning during queries test. + +* Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets + rid of warnings during redux test. -- Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added a shouldResubscribe option to allow subscriptions to automatically resubscribe when props change. +* Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added + a shouldResubscribe option to allow subscriptions to automatically resubscribe + when props change. ### v0.7.4 -- Identical to 0.7.2 because 0.7.3 contained breaking change (updated typings) + +* Identical to 0.7.2 because 0.7.3 contained breaking change (updated typings) ### v0.7.3 (deprecated - contained breaking changes) -- Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets rid of warning during queries test. -- Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets rid of warnings during redux test. +* Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets + rid of warning during queries test. -- Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added a shouldResubscribe option to allow subscriptions to automatically resubscribe when props change. +* Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets + rid of warnings during redux test. + +* Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added + a shouldResubscribe option to allow subscriptions to automatically resubscribe + when props change. ### v0.7.2 -- Bug: fix issue where changing variables while unskipping didn't result in the variables actually changing - [Issue #374](https://github.com/apollostack/react-apollo/issues/374) +* Bug: fix issue where changing variables while unskipping didn't result in the + variables actually changing - + [Issue #374](https://github.com/apollostack/react-apollo/issues/374) -- Bug: fix issue with no longer passing errors to components w/ `apollo-client@0.5.23` - [Issue #378](https://github.com/apollostack/react-apollo/issues/378) +* Bug: fix issue with no longer passing errors to components w/ + `apollo-client@0.5.23` - + [Issue #378](https://github.com/apollostack/react-apollo/issues/378) -- Add `react-dom` to `peerDependencies` because since React 15.4 it is no longer "secretly" included. - _(ref: https://github.com/facebook/react/releases/tag/v15.4.0)_ +* Add `react-dom` to `peerDependencies` because since React 15.4 it is no longer + "secretly" included. _(ref: + https://github.com/facebook/react/releases/tag/v15.4.0)_ ### v0.7.1 #### Breaking + ```js // old -import { getDataFromTree, renderToStringWithData } from 'react-apollo/server' +import { getDataFromTree, renderToStringWithData } from 'react-apollo/server'; // new -import { getDataFromTree, renderToStringWithData } from 'react-apollo' +import { getDataFromTree, renderToStringWithData } from 'react-apollo'; ``` -- Feature: Better packaging [PR #306](https://github.com/apollostack/react-apollo/pull/306) -- Feature: Add networkStatus prop to connected components[Issue #322](https://github.com/apollostack/react-apollo/issues/322) -- Feature: Pass component display name as watchQuery metadata for experimental devtools [PR #363](https://github.com/apollostack/react-apollo/pull/363) -- Feature: Removed use of `createFragment` and bumped AC version [PR #357](https://github.com/apollostack/react-apollo/pull/357) -- Bug: fix issue with Redux's `connect` and SSR - [Issue #350](https://github.com/apollostack/react-apollo/issues/350) +* Feature: Better packaging + [PR #306](https://github.com/apollostack/react-apollo/pull/306) +* Feature: Add networkStatus prop to connected + components[Issue #322](https://github.com/apollostack/react-apollo/issues/322) +* Feature: Pass component display name as watchQuery metadata for experimental + devtools [PR #363](https://github.com/apollostack/react-apollo/pull/363) +* Feature: Removed use of `createFragment` and bumped AC version + [PR #357](https://github.com/apollostack/react-apollo/pull/357) +* Bug: fix issue with Redux's `connect` and SSR - + [Issue #350](https://github.com/apollostack/react-apollo/issues/350) ### v0.6.0 #### Breaking + ```js // old -- we attempted to get the state out of your apollo provider for your -renderToStringWithData(component).then({ markup, initialState }) +renderToStringWithData(component).then({ markup, initialState }); // new -- you must get it yourself renderToStringWithData(component).then(markup => { @@ -242,191 +402,245 @@ renderToStringWithData(component).then(markup => { // ... }); - ``` -This release refactors the server side rendering and data access code, hopefully making it easier to contribute to in the future and fixing a few bugs along the way: +This release refactors the server side rendering and data access code, hopefully +making it easier to contribute to in the future and fixing a few bugs along the +way: -- Bug: Fix bug in SSR in React Production mode [Issue #237](https://github.com/apollostack/react-apollo/issues/237) -- Bug: Fix issue fetching multiple levels of queries [Issue #250](https://github.com/apollostack/react-apollo/issues/250) -- Bug: Fix issue with Stateless components in SSR [Issue #297](https://github.com/apollostack/react-apollo/issues/297) -- Feature: Refactored to collect data in one place [Issue 264](https://github.com/apollostack/react-apollo/issues/264) +* Bug: Fix bug in SSR in React Production mode + [Issue #237](https://github.com/apollostack/react-apollo/issues/237) +* Bug: Fix issue fetching multiple levels of queries + [Issue #250](https://github.com/apollostack/react-apollo/issues/250) +* Bug: Fix issue with Stateless components in SSR + [Issue #297](https://github.com/apollostack/react-apollo/issues/297) +* Feature: Refactored to collect data in one place + [Issue 264](https://github.com/apollostack/react-apollo/issues/264) ### v0.5.15 -- Feature: Added test utilities and examples to library. + +* Feature: Added test utilities and examples to library. ### v0.5.14 -- Bug: Fix issue with usage in TypeScript projects caused by 'compose' re-export. [PR #291](https://github.com/apollostack/react-apollo/pull/291) -- Bug: Fix issue with forceFetch during SSR [PR #293](https://github.com/apollostack/react-apollo/pull/293) +* Bug: Fix issue with usage in TypeScript projects caused by 'compose' + re-export. [PR #291](https://github.com/apollostack/react-apollo/pull/291) +* Bug: Fix issue with forceFetch during SSR + [PR #293](https://github.com/apollostack/react-apollo/pull/293) ### v0.5.12 -- Full support for both Apollo Client 0.4.21 and 0.5.0. [PR #277](https://github.com/apollostack/react-apollo/pull/277) +* Full support for both Apollo Client 0.4.21 and 0.5.0. + [PR #277](https://github.com/apollostack/react-apollo/pull/277) ### v0.5.11 -- Bug: Fix issue with SSR queries running twice when a mutation wraps a query [#274](https://github.com/apollostack/react-apollo/issue/274) +* Bug: Fix issue with SSR queries running twice when a mutation wraps a query + [#274](https://github.com/apollostack/react-apollo/issue/274) ### v0.5.10 -- Bug: Fix issue with changing outer props *and not changing variables*, ultimately caused by https://github.com/apollostack/apollo-client/pull/694 +* Bug: Fix issue with changing outer props _and not changing variables_, + ultimately caused by https://github.com/apollostack/apollo-client/pull/694 ### v0.5.9 -- Bug: Fix and test some subtle bugs around skipping and subscriptions. [#260](https://github.com/apollostack/react-apollo/pull/260) +* Bug: Fix and test some subtle bugs around skipping and subscriptions. + [#260](https://github.com/apollostack/react-apollo/pull/260) ### v0.5.8 -- Feature: Remove nested imports for apollo-client. Making local development eaiser. [#234](https://github.com/apollostack/react-apollo/pull/234) -- Feature: Move types to dev deps [#251](https://github.com/apollostack/react-apollo/pull/251) -- Feature: New method for skipping queries which bypasses HOC internals [#253](https://github.com/apollostack/react-apollo/pull/253) -- Feature: Integrated subscriptions! [#256](https://github.com/apollostack/react-apollo/pull/256) -- Feature: Refactor loading state managment to use apollo-client fully. Reduces library size by ~50% [#211](https://github.com/apollostack/react-apollo/pull/211) +* Feature: Remove nested imports for apollo-client. Making local development + eaiser. [#234](https://github.com/apollostack/react-apollo/pull/234) +* Feature: Move types to dev deps + [#251](https://github.com/apollostack/react-apollo/pull/251) +* Feature: New method for skipping queries which bypasses HOC internals + [#253](https://github.com/apollostack/react-apollo/pull/253) +* Feature: Integrated subscriptions! + [#256](https://github.com/apollostack/react-apollo/pull/256) +* Feature: Refactor loading state managment to use apollo-client fully. Reduces + library size by ~50% + [#211](https://github.com/apollostack/react-apollo/pull/211) ### v0.5.7 - - Feature: Upgraded to typescript 2.0 [#217](https://github.com/apollostack/react-apollo/pull/217) - - Feature: Allow usage of redux key or selector [#226](https://github.com/apollostack/react-apollo/pull/226) +* Feature: Upgraded to typescript 2.0 + [#217](https://github.com/apollostack/react-apollo/pull/217) +* Feature: Allow usage of redux key or selector + [#226](https://github.com/apollostack/react-apollo/pull/226) ### v0.5.6 -- Bug: Passing immutable to ApolloProvider breaks ssr. `renderToStringWithData` fails to reference the right store. - [#222](https://github.com/apollostack/react-apollo/pull/222) - - Bug: Fixed issue with context in SSR [#218](https://github.com/apollostack/react-apollo/issues/218) +* Bug: Passing immutable to ApolloProvider breaks ssr. `renderToStringWithData` + fails to reference the right store. + [#222](https://github.com/apollostack/react-apollo/pull/222) +* Bug: Fixed issue with context in SSR + [#218](https://github.com/apollostack/react-apollo/issues/218) ### v0.5.5 -- Bug: Fixed lifecycle events for componentWillMount() on the server [#205](https://github.com/apollostack/react-apollo/pull/205) +* Bug: Fixed lifecycle events for componentWillMount() on the server + [#205](https://github.com/apollostack/react-apollo/pull/205) ### v0.5.4 -- Bug: Created better reference to updateQuery when bound early. It will also throw if called before it should be. +* Bug: Created better reference to updateQuery when bound early. It will also + throw if called before it should be. ### v0.5.3 -- Bug: Fixed issue with updateQuery not being present during componentWillMount [#203](https://github.com/apollostack/react-apollo/pull/203) +* Bug: Fixed issue with updateQuery not being present during componentWillMount + [#203](https://github.com/apollostack/react-apollo/pull/203) ### v0.5.2 -- Feature: Allow optional variables by passing null value on behalf of the variable [#200](https://github.com/apollostack/react-apollo/pull/200) +* Feature: Allow optional variables by passing null value on behalf of the + variable [#200](https://github.com/apollostack/react-apollo/pull/200) ### v0.5.1 -- Feature: Added link to [recompose](https://github.com/acdlite/recompose) to use the `compose` function. This makes it easy to combine multiple queries on a single component. [#194](https://github.com/apollostack/react-apollo/pull/194) +* Feature: Added link to [recompose](https://github.com/acdlite/recompose) to + use the `compose` function. This makes it easy to combine multiple queries on + a single component. + [#194](https://github.com/apollostack/react-apollo/pull/194) ### v0.5.0 #### Breaking + ```js // old -renderToStringWithData(component).then(markup) // markup had a script tag +renderToStringWithData(component).then(markup); // markup had a script tag // new -renderToStringWithData(component).then({ markup, initialState }) // markup has not tag, and state is passed +renderToStringWithData(component).then({ markup, initialState }); // markup has not tag, and state is passed ``` -- Feature: Removed client as a prop and fixed warnings when not using ApolloProvider [#189](https://github.com/apollostack/react-apollo/pull/189) -- Feature: Added updateQuery to data props - -- Bug: Fixed renderToStringWithData causing react warning [#169](https://github.com/apollostack/react-apollo/issues/169) -- Bug: Fixed ssr fragment issue [#178](https://github.com/apollostack/react-apollo/pull/178) -- Bug: Fixed loading state for skipped queries [#190](https://github.com/apollostack/react-apollo/pull/190) -- Bug: Fixed loading state on remounted component with different variables +* Feature: Removed client as a prop and fixed warnings when not using + ApolloProvider [#189](https://github.com/apollostack/react-apollo/pull/189) +* Feature: Added updateQuery to data props +* Bug: Fixed renderToStringWithData causing react warning + [#169](https://github.com/apollostack/react-apollo/issues/169) +* Bug: Fixed ssr fragment issue + [#178](https://github.com/apollostack/react-apollo/pull/178) +* Bug: Fixed loading state for skipped queries + [#190](https://github.com/apollostack/react-apollo/pull/190) +* Bug: Fixed loading state on remounted component with different variables ### v0.4.7 -- Bug: Fixed SSR issue with context [#165](https://github.com/apollostack/react-apollo/pull/165) -- Bug: Fixed issue when context changes in parent container not going through to child; [#162](https://github.com/apollostack/react-apollo/pull/162) -- Bug: Fixed loading state on remount of forceFetch operations; [#161](https://github.com/apollostack/react-apollo/pull/161) +* Bug: Fixed SSR issue with context + [#165](https://github.com/apollostack/react-apollo/pull/165) +* Bug: Fixed issue when context changes in parent container not going through to + child; [#162](https://github.com/apollostack/react-apollo/pull/162) +* Bug: Fixed loading state on remount of forceFetch operations; + [#161](https://github.com/apollostack/react-apollo/pull/161) ### v0.4.6 -- Bug: Fixed issue with variable merging after fetchMore [#150](https://github.com/apollostack/react-apollo/pull/150) +* Bug: Fixed issue with variable merging after fetchMore + [#150](https://github.com/apollostack/react-apollo/pull/150) ### v0.4.5 -- Feature: Allow options value to be an object instead of a method. [#144](https://github.com/apollostack/react-apollo/issues/144) -- Bug: Fixed issue with missing methods on initial props [#142](https://github.com/apollostack/react-apollo/issues/142) -- Bug: Fixed oddity with multi nested enhancers on SSR [#141](https://github.com/apollostack/react-apollo/issues/141) +* Feature: Allow options value to be an object instead of a method. + [#144](https://github.com/apollostack/react-apollo/issues/144) +* Bug: Fixed issue with missing methods on initial props + [#142](https://github.com/apollostack/react-apollo/issues/142) +* Bug: Fixed oddity with multi nested enhancers on SSR + [#141](https://github.com/apollostack/react-apollo/issues/141) ### v0.4.4 -- Bug: Fixed issue with variable merging [#139](https://github.com/apollostack/react-apollo/pull/139) +* Bug: Fixed issue with variable merging + [#139](https://github.com/apollostack/react-apollo/pull/139) ### v0.4.3 -- Feature: Support a different store in the tree that is immutable (support immutable redux) [#137](https://github.com/apollostack/react-apollo/pull/137) +* Feature: Support a different store in the tree that is immutable (support + immutable redux) [#137](https://github.com/apollostack/react-apollo/pull/137) ### v0.4.2 -- Bug: Fixed refetch methods when no result is returned +* Bug: Fixed refetch methods when no result is returned ### v0.4.1 -- BREAKING Feature: [Brand new API! See the docs for more information](http://docs.apollostack.com/apollo-client/react.html); +* BREAKING Feature: + [Brand new API! See the docs for more information](http://docs.apollostack.com/apollo-client/react.html); ### v0.3.20 -- Bug: Fixed loading state on refetch more when data doesn't change -- Feature: added fetchMore [#123](https://github.com/apollostack/react-apollo/pull/123) +* Bug: Fixed loading state on refetch more when data doesn't change +* Feature: added fetchMore + [#123](https://github.com/apollostack/react-apollo/pull/123) ### v0.3.19 -- Bug: Retain compatibility with version 0.3.0 of Apollo Client via a backcompat shim. [#109](https://github.com/apollostack/react-apollo/pull/109) +* Bug: Retain compatibility with version 0.3.0 of Apollo Client via a backcompat + shim. [#109](https://github.com/apollostack/react-apollo/pull/109) ### v0.3.18 -- Feature: Support 0.4.0 of Apollo Client, and pass through new mutation options [#105](https://github.com/apollostack/react-apollo/pull/105) [#106](https://github.com/apollostack/react-apollo/pull/106) +* Feature: Support 0.4.0 of Apollo Client, and pass through new mutation options + [#105](https://github.com/apollostack/react-apollo/pull/105) + [#106](https://github.com/apollostack/react-apollo/pull/106) ### v0.3.17 -- Bug: Fixed but where SSR wouldn't get calculated props from redux actions [#103](https://github.com/apollostack/react-apollo/pull/103) +* Bug: Fixed but where SSR wouldn't get calculated props from redux actions + [#103](https://github.com/apollostack/react-apollo/pull/103) ### v0.3.16 -- Feature: integrated SSR [#83](https://github.com/apollostack/react-apollo/pull/83) -- Feature: added ability to hoist statics on components [#99](https://github.com/apollostack/react-apollo/pull/99) -- Bug: Don't strip data away from the component when the query errors [#98](https://github.com/apollostack/react-apollo/pull/98) +* Feature: integrated SSR + [#83](https://github.com/apollostack/react-apollo/pull/83) +* Feature: added ability to hoist statics on components + [#99](https://github.com/apollostack/react-apollo/pull/99) +* Bug: Don't strip data away from the component when the query errors + [#98](https://github.com/apollostack/react-apollo/pull/98) ### v0.3.15 -- Bug: Fixed issue where react native would error on aggressive cloneing of client +* Bug: Fixed issue where react native would error on aggressive cloneing of + client ### v0.3.14 -- Feature: pass through all methods on apollo client +* Feature: pass through all methods on apollo client ### v0.3.13 -- Bug: fixed issue causing errors to be passed to apollo-client [#89](https://github.com/apollostack/react-apollo/pull/89) +* Bug: fixed issue causing errors to be passed to apollo-client + [#89](https://github.com/apollostack/react-apollo/pull/89) ### v0.3.11/12 -- Bug: fixed overrendering of components on redux state changes +* Bug: fixed overrendering of components on redux state changes ### v0.3.10 -- Bug: fixed bug where SSR would fail due to later updates. This should also prevent unmounted components from throwing errors. +* Bug: fixed bug where SSR would fail due to later updates. This should also + prevent unmounted components from throwing errors. ### v0.3.9 -- Feature: provide add `watchQuery` to components via `connect` +* Feature: provide add `watchQuery` to components via `connect` ### v.0.3.8 -- Bug: Don't use old props on store change change +* Bug: Don't use old props on store change change ### v.0.3.7 -- Bug: Reset loading state when a refetched query has returned +* Bug: Reset loading state when a refetched query has returned ### v0.3.6 -- Bug: Loading state is no longer true on uncalled mutations. -- Improvement: don't set the loading state to false if forceFetch is true +* Bug: Loading state is no longer true on uncalled mutations. +* Improvement: don't set the loading state to false if forceFetch is true ### v0.3.5 @@ -434,32 +648,34 @@ Return promise from the refetch method ### v0.3.4 -- Bug: Fix bug where state / props weren't accurate when executing mutations. -- - Improvement: Increase performance by limiting re-renders and re-execution of queries. -Chore: Split tests to make them easier to maintain. +* Bug: Fix bug where state / props weren't accurate when executing mutations. +* * Improvement: Increase performance by limiting re-renders and re-execution of + queries. Chore: Split tests to make them easier to maintain. ### v0.3.2 || v0.3.3 (publish fix) -- Feature: add `startPolling` and `stopPolling` to the prop object for queries -- Bug: Fix bug where full options were not being passed to watchQuery +* Feature: add `startPolling` and `stopPolling` to the prop object for queries +* Bug: Fix bug where full options were not being passed to watchQuery ### v0.3.1 -- Feature: Support 0.3.0 of apollo-client +* Feature: Support 0.3.0 of apollo-client ### v0.3.0 -- Feature: Change Provider export to be ApolloProvider and use Provider from react-redux +* Feature: Change Provider export to be ApolloProvider and use Provider from + react-redux ### v0.2.1 -- Feature: Support 0.1.0 and 0.2.0 of apollo-client +* Feature: Support 0.1.0 and 0.2.0 of apollo-client ### v0.2.0 **Breaking change:** -- Feature: Remove `result` key in favor of dynamic key matching root fields of the query or mutation. (https://github.com/apollostack/react-apollo/pull/31) +* Feature: Remove `result` key in favor of dynamic key matching root fields of + the query or mutation. (https://github.com/apollostack/react-apollo/pull/31) ```js { @@ -481,22 +697,25 @@ becomes ### v0.1.5 -- Bug: Get state directly from redux store internally +* Bug: Get state directly from redux store internally ### v0.1.4 -- Bug: Fix bug with willReceiveProps +* Bug: Fix bug with willReceiveProps ### v0.1.2 -Bug: - Adjust loading lifecycle marker to better match the behavior of apollo-client [#11](https://github.com/apollostack/react-apollo/pull/11) +Bug: - Adjust loading lifecycle marker to better match the behavior of +apollo-client [#11](https://github.com/apollostack/react-apollo/pull/11) ### v0.1.1 -Feature: - Update to support new observable API from apollo-client [#9](https://github.com/apollostack/react-apollo/pull/9) +Feature: - Update to support new observable API from apollo-client +[#9](https://github.com/apollostack/react-apollo/pull/9) ### v0.1.0 -Initial release. Brings in support for binding GraphQL data to components easily as well as perform mutations. +Initial release. Brings in support for binding GraphQL data to components easily +as well as perform mutations. We didn't track changes before this version. diff --git a/package.json b/package.json index c57532c3c9..43518c5ba0 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "browser": "lib/react-apollo.browser.umd.js", "typings": "lib/index.d.ts", "scripts": { - "analyze": - "npm run compile && webpack -p --config scripts/webpack.inspect.js", + "analyze": "npm run compile && webpack -p --config scripts/webpack.inspect.js", "deploy": "./scripts/deploy.sh", "danger": "danger run --verbose", "test": "npm run compile && jest", @@ -17,20 +16,15 @@ "test-watch": "jest --watch", "posttest": "npm run lint && npm run type-check", "filesize": "npm run compile:browser && bundlesize", - "flow-typed": - "npm install && flow-typed install --ignoreDeps peer --ignoreDeps dev", - "type-check": - "tsc ./test/typescript.ts --noEmit --jsx react --noEmitOnError --lib es6,dom --experimentalDecorators && flow check", + "flow-typed": "npm install && flow-typed install --ignoreDeps peer --ignoreDeps dev", + "type-check": "tsc ./test/typescript.ts --noEmit --jsx react --noEmitOnError --lib es6,dom --experimentalDecorators && flow check", "compile": "tsc", - "bundle": - "rollup -c && rollup -c rollup.browser.config.js && rollup -c rollup.test-utils.config.js", - "compile:browser": - "rm -rf ./dist && mkdir ./dist && NODE_ENV=production webpack -p ./lib/react-apollo.browser.umd.js ./dist/index.min.js --config ./scripts/webpack.config.js", + "bundle": "rollup -c && rollup -c rollup.browser.config.js && rollup -c rollup.test-utils.config.js", + "compile:browser": "rm -rf ./dist && mkdir ./dist && NODE_ENV=production webpack -p ./lib/react-apollo.browser.umd.js ./dist/index.min.js --config ./scripts/webpack.config.js", "watch": "tsc -w", "lint": "tslint 'src/*.ts*' --type-check -p tsconfig.json", "lint-staged": "lint-staged", - "lint-fix": - "prettier --trailing-comma all --single-quote --write \"{src,test}/**/*.ts*\"", + "lint-fix": "prettier --trailing-comma all --single-quote --write \"{src,test}/**/*.ts*\"", "postcompile": "npm run bundle", "prepublishOnly": "npm run compile" }, @@ -45,7 +39,10 @@ "prettier --trailing-comma all --single-quote --write", "git add" ], - "*.js*": ["prettier --trailing-comma all --single-quote --write", "git add"] + "*.js*": [ + "prettier --trailing-comma all --single-quote --write", + "git add" + ] }, "pre-commit": "lint-staged", "repository": { @@ -63,7 +60,9 @@ ], "author": "James Baxley ", "babel": { - "presets": ["react-native"] + "presets": [ + "react-native" + ] }, "jest": { "preset": "jest-react-native", @@ -74,15 +73,25 @@ "transformIgnorePatterns": [ "/node_modules/(?!(lodash-es|react-native)/)" ], - "moduleFileExtensions": ["ts", "tsx", "js", "json"], + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ], "modulePathIgnorePatterns": [ "/examples", "/test/flow.js", "/test/typescript.ts" ], - "projects": ["", "/examples/*"], + "projects": [ + "", + "/examples/*" + ], "testRegex": "(/test/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "setupFiles": ["/scripts/tests.js"] + "setupFiles": [ + "/scripts/tests.js" + ] }, "license": "MIT", "peerDependencies": { @@ -96,7 +105,6 @@ "@types/isomorphic-fetch": "0.0.34", "@types/jest": "20.0.8", "@types/lodash": "4.14.86", - "@types/lodash-es": "4.17.0", "@types/node": "8.0.31", "@types/object-assign": "4.0.30", "@types/react": "16.0.28", @@ -166,7 +174,8 @@ "apollo-link": "^1.0.0", "hoist-non-react-statics": "^2.2.0", "invariant": "^2.2.1", - "lodash-es": "^4.17.4", + "lodash.flowright": "^3.5.0", + "lodash.pick": "^4.4.0", "prop-types": "^15.5.8" } } diff --git a/src/browser.ts b/src/browser.ts index 6c4852a6e6..fb38bebc80 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -16,5 +16,5 @@ export { withApollo } from './withApollo'; export { getDataFromTree } from './getDataFromTree'; // expose easy way to join queries from redux -import flowRight from 'lodash-es/flowRight'; -export { flowRight as compose }; +import * as compose from 'lodash.flowright'; +export { compose }; diff --git a/src/graphql.tsx b/src/graphql.tsx index ad546c200c..f6da8046d6 100644 --- a/src/graphql.tsx +++ b/src/graphql.tsx @@ -5,7 +5,7 @@ import shallowEqual from './shallowEqual'; const invariant = require('invariant'); const assign = require('object-assign'); -import pick from 'lodash-es/pick'; +const pick = require('lodash.pick'); const hoistNonReactStatics = require('hoist-non-react-statics'); @@ -306,8 +306,9 @@ export default function graphql< `The operation '${operation.name}' wrapping '${getDisplayName( WrappedComponent, )}' ` + - `is expecting a variable: '${variable.name - .value}' but it was not found in the props ` + + `is expecting a variable: '${ + variable.name.value + }' but it was not found in the props ` + `passed to '${graphQLDisplayName}'`, ); } @@ -445,7 +446,9 @@ export default function graphql< const clashingKeys = Object.keys(observableQueryFields(results.data)); invariant( clashingKeys.length === 0, - `the result of the '${graphQLDisplayName}' operation contains keys that ` + + `the result of the '${ + graphQLDisplayName + }' operation contains keys that ` + `conflict with the return object.` + clashingKeys.map(k => `'${k}'`).join(', ') + ` not allowed.`, From f9daad78d57645c01b2e4cb6af86a2d06603b894 Mon Sep 17 00:00:00 2001 From: Peggy Rayzis Date: Fri, 8 Dec 2017 21:16:13 -0500 Subject: [PATCH 2/2] Version bump to 2.0.4 Fixed changelog --- Changelog.md | 599 +++++++++++++++++---------------------------------- package.json | 45 ++-- 2 files changed, 211 insertions(+), 433 deletions(-) diff --git a/Changelog.md b/Changelog.md index 8d4869e4e6..1d389d8a04 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,400 +1,246 @@ # Change log ### 2.0.4 - -* rolled back on the lodash-es changes from +- rolled back on the lodash-es changes from [#1344](https://github.com/apollographql/react-apollo/pull/1344) due to build errors reported on slack + [#1393](https://github.com/apollographql/react-apollo/pull/1393) ### 2.0.3 - -* Use lodash-es to allow lodash functions to be used in ES modules - [#1344](https://github.com/apollographql/react-apollo/pull/1344) -* turn back on flow checking +- Use lodash-es to allow lodash functions to be used in ES modules [#1344](https://github.com/apollographql/react-apollo/pull/1344) +- turn back on flow checking ### 2.0.2 +- upgraded required apollo-client for bugfix for subscriptions +- add component name in unhandled error message [#1362](https://github.com/apollographql/react-apollo/pull/1362) +- upgraded flow support to 0.59.0 :tada: [#1354](https://github.com/apollographql/react-apollo/pull/1354) +- skip null / undefined items on SSR if present [#1355](https://github.com/apollographql/react-apollo/pull/1355) -* upgraded required apollo-client for bugfix for subscriptions -* add component name in unhandled error message - [#1362](https://github.com/apollographql/react-apollo/pull/1362) -* upgraded flow support to 0.59.0 :tada: - [#1354](https://github.com/apollographql/react-apollo/pull/1354) -* skip null / undefined items on SSR if present - [#1355](https://github.com/apollographql/react-apollo/pull/1355) ### 2.0.1 - -* fix skip on component update - [#1330](https://github.com/apollographql/react-apollo/pull/1330) -* Correctly provide the generic cache type to ApolloProvider - [#1319](https://github.com/apollographql/react-apollo/pull/1319) -* Correctly initializes component state as null (not undefined) - [#1300](https://github.com/apollographql/react-apollo/pull/1310) +- fix skip on component update [#1330](https://github.com/apollographql/react-apollo/pull/1330) +- Correctly provide the generic cache type to ApolloProvider [#1319](https://github.com/apollographql/react-apollo/pull/1319) +- Correctly initializes component state as null (not undefined) [#1300](https://github.com/apollographql/react-apollo/pull/1310) ### 2.0.0 - -* BREAKING: removed cleanupApolloState as it is no longer needed! -* Exported getDataFromTree on the client -* Removed `redux` from peer dependencies. - [Issue #1223](https://github.com/apollographql/react-apollo/issues/1223) - [PR #1224](https://github.com/apollographql/react-apollo/pull/1224) -* Support arrays being returned from render in SSR - [#1158](https://github.com/apollographql/react-apollo/pull/1158) -* Support passing an updater function to `setState` in SSR mode - [#1263](https://github.com/apollographql/react-apollo/pull/1263) +- BREAKING: removed cleanupApolloState as it is no longer needed! +- Exported getDataFromTree on the client +- Removed `redux` from peer dependencies. [Issue #1223](https://github.com/apollographql/react-apollo/issues/1223) [PR #1224](https://github.com/apollographql/react-apollo/pull/1224) +- Support arrays being returned from render in SSR [#1158](https://github.com/apollographql/react-apollo/pull/1158) +- Support passing an updater function to `setState` in SSR mode [#1263](https://github.com/apollographql/react-apollo/pull/1263) ### 2.0.0-beta.0 - -* upgrade to Apollo Client 2.0 -* remove direct dependencies on Apollo Client, graphql-tag -* fix skip on component update. -* Fix: ensure `client` option can be used with mutation query - [#1145](https://github.com/apollographql/react-apollo/pull/1145) -* Made `OptionProps.data`'s `TResult` partial - [#1231](https://github.com/apollographql/react-apollo/pull/1231) +- upgrade to Apollo Client 2.0 +- remove direct dependencies on Apollo Client, graphql-tag +- fix skip on component update. +- Fix: ensure `client` option can be used with mutation query [#1145](https://github.com/apollographql/react-apollo/pull/1145) +- Made `OptionProps.data`'s `TResult` partial [#1231](https://github.com/apollographql/react-apollo/pull/1231) ### 1.4.16 - -* upgrade to react-16 -* fix shallowEqual bug. -* Added notifyOnNetworkStatusChange to QueryOpts and MutationOpts Typesccript - definitions [#1034](https://github.com/apollographql/react-apollo/pull/1034) -* Added variables types with Typescript - [#997](https://github.com/apollographql/react-apollo/pull/997) -* Made `ChildProps.data` non-optional - [#1143](https://github.com/apollographql/react-apollo/pull/1143) +- upgrade to react-16 +- fix shallowEqual bug. +- Added notifyOnNetworkStatusChange to QueryOpts and MutationOpts Typesccript definitions [#1034](https://github.com/apollographql/react-apollo/pull/1034) +- Added variables types with Typescript [#997](https://github.com/apollographql/react-apollo/pull/997) +- Made `ChildProps.data` non-optional [#1143](https://github.com/apollographql/react-apollo/pull/1143) ### 1.4.15 - -* Fix: handle calling refetch in child componentDidMount -* Fix: ensure options gets up to date props - [#1025](https://github.com/apollographql/react-apollo/pull/1005) -* Fix: ensure queryRecycler exists before using it -* MockNetworkInterface match mock requests regardless of variable order - [#973](https://github.com/apollographql/react-apollo/pull/973) -* Allow to pass removeTypenames to MockedProvider - [#1001](https://github.com/apollographql/react-apollo/pull/1001) +- Fix: handle calling refetch in child componentDidMount +- Fix: ensure options gets up to date props [#1025](https://github.com/apollographql/react-apollo/pull/1005) +- Fix: ensure queryRecycler exists before using it +- MockNetworkInterface match mock requests regardless of variable order [#973](https://github.com/apollographql/react-apollo/pull/973) +- Allow to pass removeTypenames to MockedProvider [#1001](https://github.com/apollographql/react-apollo/pull/1001) ### 1.4.14 - -* Fix: Scope query recyclers by client - [#876](https://github.com/apollographql/react-apollo/pull/876) +- Fix: Scope query recyclers by client [#876](https://github.com/apollographql/react-apollo/pull/876) ### 1.4.13 [DEPRECATED] - -* Support apollo-client 2.0 +- Support apollo-client 2.0 ### 1.4.12 - -* Fix: fix issue with bad deploy +- Fix: fix issue with bad deploy ### 1.4.11 (BROKEN) - -* Replace string refs with callback refs - [#908](https://github.com/apollographql/react-apollo/pull/908) +- Replace string refs with callback refs [#908](https://github.com/apollographql/react-apollo/pull/908) ### 1.4.10 - -* Fix: fix UMD bundle pointing to apolloClient for some reason +- Fix: fix UMD bundle pointing to apolloClient for some reason ### 1.4.9 - -* Fix: fix matching types with exports for flow and ts +- Fix: fix matching types with exports for flow and ts ### 1.4.8 - -* Fix: Ensure typescript and flow type definitions match in name +- Fix: Ensure typescript and flow type definitions match in name ### 1.4.7 - -* Feature: Add support for flow typecheck to work out of the box (without any - configuration) +- Feature: Add support for flow typecheck to work out of the box (without any configuration) ### 1.4.6 - -* Fix: Fix issue where `withRef`-option of `graphql` did not work when the query - was skipped [#865](https://github.com/apollographql/react-apollo/pull/865) +- Fix: Fix issue where `withRef`-option of `graphql` did not work when the query was skipped [#865](https://github.com/apollographql/react-apollo/pull/865) ### 1.4.5 - -* Fix: export all types from main type file +- Fix: export all types from main type file ### 1.4.4 - -* Fix: Fix issue around hoisting non react statics for RN - [#859](https://github.com/apollographql/react-apollo/pull/859) -* Fix: Fix issue where options was called even though skip was present - [#859](https://github.com/apollographql/react-apollo/pull/859) -* Improvement: Allow for better typescript usage with improved types - [#862](https://github.com/apollographql/react-apollo/pull/862) +- Fix: Fix issue around hoisting non react statics for RN [#859](https://github.com/apollographql/react-apollo/pull/859) +- Fix: Fix issue where options was called even though skip was present [#859](https://github.com/apollographql/react-apollo/pull/859) +- Improvement: Allow for better typescript usage with improved types [#862](https://github.com/apollographql/react-apollo/pull/862) ### 1.4.3 - -* Feature: You can now supply a client in options object passed to the `graphql` - high oder component. - [PR #729](https://github.com/apollographql/react-apollo/pull/729) -* Fix: Fix issue when using flow definitions - [PR# 787](https://github.com/apollographql/react-apollo/pull/787) -* Improvement: Reduce re-renders by using forceUpdate instead of setState({ }) - [PR #775](https://github.com/apollographql/react-apollo/pull/775) -* Improvement: Refactor dataForChild to use bound function to reduce rerenders - [PR #772](https://github.com/apollographql/react-apollo/pull/772) -* Fix: Add in missing types for MutationOpts - [PR #770](https://github.com/apollographql/react-apollo/pull/770) +- Feature: You can now supply a client in options object passed to the `graphql` high oder component. [PR #729](https://github.com/apollographql/react-apollo/pull/729) +- Fix: Fix issue when using flow definitions [PR# 787](https://github.com/apollographql/react-apollo/pull/787) +- Improvement: Reduce re-renders by using forceUpdate instead of setState({ }) [PR #775](https://github.com/apollographql/react-apollo/pull/775) +- Improvement: Refactor dataForChild to use bound function to reduce rerenders [PR #772](https://github.com/apollographql/react-apollo/pull/772) +- Fix: Add in missing types for MutationOpts [PR #770](https://github.com/apollographql/react-apollo/pull/770) ### 1.4.2 - -* Fix: Fix component reference and variable statement for flow types +- Fix: Fix component reference and variable statement for flow types ### 1.4.1 - -* Fix: Fix compilation of test-utils from move to ES bundles +- Fix: Fix compilation of test-utils from move to ES bundles ### 1.4.0 - #### BREAKING FOR TYPESCRIPT USERS - -* Feature: Enhanced typescript definitions to allow for more valid type checking - of graphql HOC - [PR #695](https://github.com/apollographql/react-apollo/pull/695) -* Feature: Flow types: - [PR #695](https://github.com/apollographql/react-apollo/pull/695) -* Fix: Fix bug with sync re-renders and recyled queries - [PR #740](https://github.com/apollographql/react-apollo/pull/740) +- Feature: Enhanced typescript definitions to allow for more valid type checking of graphql HOC [PR #695](https://github.com/apollographql/react-apollo/pull/695) +- Feature: Flow types: [PR #695](https://github.com/apollographql/react-apollo/pull/695) +- Fix: Fix bug with sync re-renders and recyled queries [PR #740](https://github.com/apollographql/react-apollo/pull/740) ### 1.3.0 - -* Feature: Support tree shaking and smaller (marginally) bundles via rollup - [PR #691](https://github.com/apollographql/react-apollo/pull/691) -* Fix: Render full markup on the server when using the `cache-and-network` - fetchPolicy [PR #688](https://github.com/apollographql/react-apollo/pull/688) +- Feature: Support tree shaking and smaller (marginally) bundles via rollup [PR #691](https://github.com/apollographql/react-apollo/pull/691) +- Fix: Render full markup on the server when using the `cache-and-network` fetchPolicy [PR #688](https://github.com/apollographql/react-apollo/pull/688) ### 1.2.0 - -* Fix: Use `standby` fetchPolicy for recycled queries - [PR #671](https://github.com/apollographql/react-apollo/pull/671) +- Fix: Use `standby` fetchPolicy for recycled queries [PR #671](https://github.com/apollographql/react-apollo/pull/671) ### 1.1.3 - -* Perf: Removed unneeded usage of shouldComponentUpdate - [PR #661](https://github.com/apollographql/react-apollo/pull/661) inspired by - [PR #653](https://github.com/apollographql/react-apollo/pull/653) -* Perf: Removed unneeded usage of shouldComponentUpdate in Provider - [PR #669](https://github.com/apollographql/react-apollo/pull/669) -* Chore: remove unused immutable prop - [PR #539](https://github.com/apollographql/react-apollo/pull/539) +- Perf: Removed unneeded usage of shouldComponentUpdate [PR #661](https://github.com/apollographql/react-apollo/pull/661) inspired by [PR #653](https://github.com/apollographql/react-apollo/pull/653) +- Perf: Removed unneeded usage of shouldComponentUpdate in Provider [PR #669](https://github.com/apollographql/react-apollo/pull/669) +- Chore: remove unused immutable prop [PR #539](https://github.com/apollographql/react-apollo/pull/539) ### 1.1.2 - -* Fix: Re-export all Apollo Client exports from react-apollo - [PR #650](https://github.com/apollographql/react-apollo/pull/650) -* Chore: Include React 16 alpha in dependency version range - [PR #647](https://github.com/apollographql/react-apollo/pull/647) +- Fix: Re-export all Apollo Client exports from react-apollo [PR #650](https://github.com/apollographql/react-apollo/pull/650) +- Chore: Include React 16 alpha in dependency version range [PR #647](https://github.com/apollographql/react-apollo/pull/647) ### 1.1.1 - -* Fix: move prop-types from devDependencies to dependencies - [PR #656](https://github.com/apollographql/react-apollo/pull/656) +- Fix: move prop-types from devDependencies to dependencies [PR #656](https://github.com/apollographql/react-apollo/pull/656) ### 1.1.0 (deprecated) - -* Pass cached data to the child component along with the error. - [PR #548](https://github.com/apollographql/react-apollo/pull/548) -* Fix version lock down for peer dependency version of React. - [PR #626](https://github.com/apollographql/react-apollo/pull/626) -* Switch `graphql-tag` dependency to `2.0.0`. This isn't really a breaking - change because we only export `gql` from `react-apollo`. -* Fix: convert deprecated `React.PropTypes` to `PropTypes` provided by the - `prop-types` package. - [PR #628](https://github.com/apollographql/react-apollo/pull/628) +- Pass cached data to the child component along with the error. [PR #548](https://github.com/apollographql/react-apollo/pull/548) +- Fix version lock down for peer dependency version of React. [PR #626](https://github.com/apollographql/react-apollo/pull/626) +- Switch `graphql-tag` dependency to `2.0.0`. This isn't really a breaking change because we only export `gql` from `react-apollo`. +- Fix: convert deprecated `React.PropTypes` to `PropTypes` provided by the `prop-types` package. [PR #628](https://github.com/apollographql/react-apollo/pull/628) ### 1.0.2 - -* Exposed `createBatchingNetworkInterface` from apollo-client so that it can be - imported from react-apollo just like `createNetworkInterface`. - [PR #618](https://github.com/apollographql/react-apollo/pull/618) +- Exposed `createBatchingNetworkInterface` from apollo-client so that it can be imported from react-apollo just like `createNetworkInterface`. [PR #618](https://github.com/apollographql/react-apollo/pull/618) ### 1.0.1 - -* Fix: Make sure recycled queries are in cache only mode so they do not trigger - network requests. - [PR #531](https://github.com/apollographql/react-apollo/pull/531) +- Fix: Make sure recycled queries are in cache only mode so they do not trigger network requests. [PR #531](https://github.com/apollographql/react-apollo/pull/531) ### 1.0.0 - -* ApolloProvider now won't put its `store` on `context` unless it was given. - [PR #550](https://github.com/apollographql/react-apollo/pull/550) -* MockedProvider now accepts a `store` prop to be passed to ApolloProvider so - that react-redux store is not overwritten +- ApolloProvider now won't put its `store` on `context` unless it was given. [PR #550](https://github.com/apollographql/react-apollo/pull/550) +- MockedProvider now accepts a `store` prop to be passed to ApolloProvider so that react-redux store is not overwritten ### 1.0.0-rc.3 - -* Fix bug where `options` was mutated causing variables to not update - appropriately. - [PR #537](https://github.com/apollographql/react-apollo/pull/537) -* Make sure that all queries resolve or reject if an error was thrown when - server side rendering. - [PR #488](https://github.com/apollographql/react-apollo/pull/488) -* ApolloProvider now changes its client and store when those props change. - [PR #479](https://github.com/apollographql/react-apollo/pull/479) +- Fix bug where `options` was mutated causing variables to not update appropriately. [PR #537](https://github.com/apollographql/react-apollo/pull/537) +- Make sure that all queries resolve or reject if an error was thrown when server side rendering. [PR #488](https://github.com/apollographql/react-apollo/pull/488) +- ApolloProvider now changes its client and store when those props change. [PR #479](https://github.com/apollographql/react-apollo/pull/479) ### 1.0.0-rc.1 - -* Update dependency to Apollo Client 1.0.0-rc.1 - [PR #520](https://github.com/apollographql/react-apollo/pull/520) +- Update dependency to Apollo Client 1.0.0-rc.1 [PR #520](https://github.com/apollographql/react-apollo/pull/520) ### 0.13.3 - -* Make sure that the cached rendered element has the correct type before - returning it. - [PR #505](https://github.com/apollographql/react-apollo/pull/505) -* Move constructor initializing of props to componentWillMount. - [PR #506](https://github.com/apollographql/react-apollo/pull/506) - ([Issue #509](https://github.com/apollographql/react-apollo/issues/509)). +- Make sure that the cached rendered element has the correct type before returning it. [PR #505](https://github.com/apollographql/react-apollo/pull/505) +- Move constructor initializing of props to componentWillMount. [PR #506](https://github.com/apollographql/react-apollo/pull/506) ([Issue #509](https://github.com/apollographql/react-apollo/issues/509)). ### 0.13.2 - -* Address deprecation warnings coming from `graphql-tag` - [graphql-tag#54](https://github.com/apollographql/graphql-tag/issues/54) -* Make sure ApolloClient and gql are exported from browser bundle - [PR #501](https://github.com/apollographql/react-apollo/pull/501) +- Address deprecation warnings coming from `graphql-tag` [graphql-tag#54](https://github.com/apollographql/graphql-tag/issues/54) +- Make sure ApolloClient and gql are exported from browser bundle [PR #501](https://github.com/apollographql/react-apollo/pull/501) ### 0.13.1 - -* Add apollo-client ^0.10.0 to dependency range +- Add apollo-client ^0.10.0 to dependency range ### 0.13.0 - -* Make apollo-client and graphql-tag dependencies and re-export them from this - package [PR #490](https://github.com/apollographql/react-apollo/pull/490) -* Print errors to console if they are not handled by component - [PR #476](https://github.com/apollographql/react-apollo/pull/476) +- Make apollo-client and graphql-tag dependencies and re-export them from this package [PR #490](https://github.com/apollographql/react-apollo/pull/490) +- Print errors to console if they are not handled by component [PR #476](https://github.com/apollographql/react-apollo/pull/476) ### 0.12.0 - -* Update Apollo Client to 0.9.0 and bump a lot of other dependencies - [PR #484](https://github.com/apollographql/react-apollo/pull/484) +- Update Apollo Client to 0.9.0 and bump a lot of other dependencies [PR #484](https://github.com/apollographql/react-apollo/pull/484) ### 0.11.2 - -* Remove `@types/chai` dev dependency which called a reference to the `chai` - types in the production build. - [PR #471](https://github.com/apollographql/react-apollo/pull/471) +- Remove `@types/chai` dev dependency which called a reference to the `chai` types in the production build. [PR #471](https://github.com/apollographql/react-apollo/pull/471) ### 0.11.1 - -* Fix `updateQueries` not running for queries attached to unmounted components. - [PR #462](https://github.com/apollographql/react-apollo/pull/462) +- Fix `updateQueries` not running for queries attached to unmounted components. [PR #462](https://github.com/apollographql/react-apollo/pull/462) ### 0.10.1 - -* Fix wrong invariant sanity checks for GraphQL document - [PR #457](https://github.com/apollostack/react-apollo/issues/457) +- Fix wrong invariant sanity checks for GraphQL document [PR #457](https://github.com/apollostack/react-apollo/issues/457) ### 0.10.0 - -* Feature: [typescript] Add better typings to graphql HOC - [Issue #379](https://github.com/apollostack/react-apollo/issues/379) +- Feature: [typescript] Add better typings to graphql HOC [Issue #379](https://github.com/apollostack/react-apollo/issues/379) ### 0.9.0 - -* Update apollo-client peerDependency to 0.8.0 - [PR #438](https://github.com/apollostack/react-apollo/pull/438) +- Update apollo-client peerDependency to 0.8.0 [PR #438](https://github.com/apollostack/react-apollo/pull/438) ### 0.8.3 - -* Bug: [Issue #404](https://github.com/apollostack/react-apollo/issues/404) fix - issue with network errors thrown when changing variables. -* Feature: Allow access to `withApollo`'s wrapped instance thanks to `{withRef: - true}` option - [Issue #331](https://github.com/apollostack/react-apollo/issues/331). -* Feature: Add an `alias` option to the `graphql` function to allow customizing - the display name of the wrapped component - ([Issue #354](https://github.com/apollostack/react-apollo/issues/354)). +- Bug: [Issue #404](https://github.com/apollostack/react-apollo/issues/404) fix issue with network errors thrown when changing variables. +- Feature: Allow access to `withApollo`'s wrapped instance thanks to `{withRef: true}` option [Issue #331](https://github.com/apollostack/react-apollo/issues/331). +- Feature: Add an `alias` option to the `graphql` function to allow customizing the display name of the wrapped component ([Issue #354](https://github.com/apollostack/react-apollo/issues/354)). ### 0.8.2 - -* Chore: [PR #403](https://github.com/apollostack/react-apollo/pull/403) move - react-dom to be an optional dependency for better react-native builds. +- Chore: [PR #403](https://github.com/apollostack/react-apollo/pull/403) move react-dom to be an optional dependency for better react-native builds. ### 0.8.1 - -* Same as 0.8.0, but properly built +- Same as 0.8.0, but properly built ### 0.8.0 (deprecated - build was missing files) +- Update typings dependency from typed-grapqhl to @types/graphql [PR #393](https://github.com/apollostack/react-apollo/pull/393) +- Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets rid of warning during queries test. -* Update typings dependency from typed-grapqhl to @types/graphql - [PR #393](https://github.com/apollostack/react-apollo/pull/393) -* Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets - rid of warning during queries test. - -* Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets - rid of warnings during redux test. +- Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets rid of warnings during redux test. -* Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added - a shouldResubscribe option to allow subscriptions to automatically resubscribe - when props change. +- Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added a shouldResubscribe option to allow subscriptions to automatically resubscribe when props change. ### v0.7.4 - -* Identical to 0.7.2 because 0.7.3 contained breaking change (updated typings) +- Identical to 0.7.2 because 0.7.3 contained breaking change (updated typings) ### v0.7.3 (deprecated - contained breaking changes) +- Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets rid of warning during queries test. -* Chore: [PR #390](https://github.com/apollostack/react-apollo/pull/390) gets - rid of warning during queries test. +- Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets rid of warnings during redux test. -* Chore: [PR #391](https://github.com/apollostack/react-apollo/pull/391) gets - rid of warnings during redux test. - -* Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added - a shouldResubscribe option to allow subscriptions to automatically resubscribe - when props change. +- Feature: [PR #389](https://github.com/apollostack/react-apollo/pull/389) added a shouldResubscribe option to allow subscriptions to automatically resubscribe when props change. ### v0.7.2 -* Bug: fix issue where changing variables while unskipping didn't result in the - variables actually changing - - [Issue #374](https://github.com/apollostack/react-apollo/issues/374) +- Bug: fix issue where changing variables while unskipping didn't result in the variables actually changing - [Issue #374](https://github.com/apollostack/react-apollo/issues/374) -* Bug: fix issue with no longer passing errors to components w/ - `apollo-client@0.5.23` - - [Issue #378](https://github.com/apollostack/react-apollo/issues/378) +- Bug: fix issue with no longer passing errors to components w/ `apollo-client@0.5.23` - [Issue #378](https://github.com/apollostack/react-apollo/issues/378) -* Add `react-dom` to `peerDependencies` because since React 15.4 it is no longer - "secretly" included. _(ref: - https://github.com/facebook/react/releases/tag/v15.4.0)_ +- Add `react-dom` to `peerDependencies` because since React 15.4 it is no longer "secretly" included. + _(ref: https://github.com/facebook/react/releases/tag/v15.4.0)_ ### v0.7.1 #### Breaking - ```js // old -import { getDataFromTree, renderToStringWithData } from 'react-apollo/server'; +import { getDataFromTree, renderToStringWithData } from 'react-apollo/server' // new -import { getDataFromTree, renderToStringWithData } from 'react-apollo'; +import { getDataFromTree, renderToStringWithData } from 'react-apollo' ``` -* Feature: Better packaging - [PR #306](https://github.com/apollostack/react-apollo/pull/306) -* Feature: Add networkStatus prop to connected - components[Issue #322](https://github.com/apollostack/react-apollo/issues/322) -* Feature: Pass component display name as watchQuery metadata for experimental - devtools [PR #363](https://github.com/apollostack/react-apollo/pull/363) -* Feature: Removed use of `createFragment` and bumped AC version - [PR #357](https://github.com/apollostack/react-apollo/pull/357) -* Bug: fix issue with Redux's `connect` and SSR - - [Issue #350](https://github.com/apollostack/react-apollo/issues/350) +- Feature: Better packaging [PR #306](https://github.com/apollostack/react-apollo/pull/306) +- Feature: Add networkStatus prop to connected components[Issue #322](https://github.com/apollostack/react-apollo/issues/322) +- Feature: Pass component display name as watchQuery metadata for experimental devtools [PR #363](https://github.com/apollostack/react-apollo/pull/363) +- Feature: Removed use of `createFragment` and bumped AC version [PR #357](https://github.com/apollostack/react-apollo/pull/357) +- Bug: fix issue with Redux's `connect` and SSR - [Issue #350](https://github.com/apollostack/react-apollo/issues/350) ### v0.6.0 #### Breaking - ```js // old -- we attempted to get the state out of your apollo provider for your -renderToStringWithData(component).then({ markup, initialState }); +renderToStringWithData(component).then({ markup, initialState }) // new -- you must get it yourself renderToStringWithData(component).then(markup => { @@ -402,245 +248,191 @@ renderToStringWithData(component).then(markup => { // ... }); + ``` -This release refactors the server side rendering and data access code, hopefully -making it easier to contribute to in the future and fixing a few bugs along the -way: +This release refactors the server side rendering and data access code, hopefully making it easier to contribute to in the future and fixing a few bugs along the way: -* Bug: Fix bug in SSR in React Production mode - [Issue #237](https://github.com/apollostack/react-apollo/issues/237) -* Bug: Fix issue fetching multiple levels of queries - [Issue #250](https://github.com/apollostack/react-apollo/issues/250) -* Bug: Fix issue with Stateless components in SSR - [Issue #297](https://github.com/apollostack/react-apollo/issues/297) -* Feature: Refactored to collect data in one place - [Issue 264](https://github.com/apollostack/react-apollo/issues/264) +- Bug: Fix bug in SSR in React Production mode [Issue #237](https://github.com/apollostack/react-apollo/issues/237) +- Bug: Fix issue fetching multiple levels of queries [Issue #250](https://github.com/apollostack/react-apollo/issues/250) +- Bug: Fix issue with Stateless components in SSR [Issue #297](https://github.com/apollostack/react-apollo/issues/297) +- Feature: Refactored to collect data in one place [Issue 264](https://github.com/apollostack/react-apollo/issues/264) ### v0.5.15 - -* Feature: Added test utilities and examples to library. +- Feature: Added test utilities and examples to library. ### v0.5.14 -* Bug: Fix issue with usage in TypeScript projects caused by 'compose' - re-export. [PR #291](https://github.com/apollostack/react-apollo/pull/291) -* Bug: Fix issue with forceFetch during SSR - [PR #293](https://github.com/apollostack/react-apollo/pull/293) +- Bug: Fix issue with usage in TypeScript projects caused by 'compose' re-export. [PR #291](https://github.com/apollostack/react-apollo/pull/291) +- Bug: Fix issue with forceFetch during SSR [PR #293](https://github.com/apollostack/react-apollo/pull/293) ### v0.5.12 -* Full support for both Apollo Client 0.4.21 and 0.5.0. - [PR #277](https://github.com/apollostack/react-apollo/pull/277) +- Full support for both Apollo Client 0.4.21 and 0.5.0. [PR #277](https://github.com/apollostack/react-apollo/pull/277) ### v0.5.11 -* Bug: Fix issue with SSR queries running twice when a mutation wraps a query - [#274](https://github.com/apollostack/react-apollo/issue/274) +- Bug: Fix issue with SSR queries running twice when a mutation wraps a query [#274](https://github.com/apollostack/react-apollo/issue/274) ### v0.5.10 -* Bug: Fix issue with changing outer props _and not changing variables_, - ultimately caused by https://github.com/apollostack/apollo-client/pull/694 +- Bug: Fix issue with changing outer props *and not changing variables*, ultimately caused by https://github.com/apollostack/apollo-client/pull/694 ### v0.5.9 -* Bug: Fix and test some subtle bugs around skipping and subscriptions. - [#260](https://github.com/apollostack/react-apollo/pull/260) +- Bug: Fix and test some subtle bugs around skipping and subscriptions. [#260](https://github.com/apollostack/react-apollo/pull/260) ### v0.5.8 -* Feature: Remove nested imports for apollo-client. Making local development - eaiser. [#234](https://github.com/apollostack/react-apollo/pull/234) -* Feature: Move types to dev deps - [#251](https://github.com/apollostack/react-apollo/pull/251) -* Feature: New method for skipping queries which bypasses HOC internals - [#253](https://github.com/apollostack/react-apollo/pull/253) -* Feature: Integrated subscriptions! - [#256](https://github.com/apollostack/react-apollo/pull/256) -* Feature: Refactor loading state managment to use apollo-client fully. Reduces - library size by ~50% - [#211](https://github.com/apollostack/react-apollo/pull/211) +- Feature: Remove nested imports for apollo-client. Making local development eaiser. [#234](https://github.com/apollostack/react-apollo/pull/234) +- Feature: Move types to dev deps [#251](https://github.com/apollostack/react-apollo/pull/251) +- Feature: New method for skipping queries which bypasses HOC internals [#253](https://github.com/apollostack/react-apollo/pull/253) +- Feature: Integrated subscriptions! [#256](https://github.com/apollostack/react-apollo/pull/256) +- Feature: Refactor loading state managment to use apollo-client fully. Reduces library size by ~50% [#211](https://github.com/apollostack/react-apollo/pull/211) ### v0.5.7 -* Feature: Upgraded to typescript 2.0 - [#217](https://github.com/apollostack/react-apollo/pull/217) -* Feature: Allow usage of redux key or selector - [#226](https://github.com/apollostack/react-apollo/pull/226) + - Feature: Upgraded to typescript 2.0 [#217](https://github.com/apollostack/react-apollo/pull/217) + - Feature: Allow usage of redux key or selector [#226](https://github.com/apollostack/react-apollo/pull/226) ### v0.5.6 -* Bug: Passing immutable to ApolloProvider breaks ssr. `renderToStringWithData` - fails to reference the right store. - [#222](https://github.com/apollostack/react-apollo/pull/222) -* Bug: Fixed issue with context in SSR - [#218](https://github.com/apollostack/react-apollo/issues/218) +- Bug: Passing immutable to ApolloProvider breaks ssr. `renderToStringWithData` fails to reference the right store. + [#222](https://github.com/apollostack/react-apollo/pull/222) + - Bug: Fixed issue with context in SSR [#218](https://github.com/apollostack/react-apollo/issues/218) ### v0.5.5 -* Bug: Fixed lifecycle events for componentWillMount() on the server - [#205](https://github.com/apollostack/react-apollo/pull/205) +- Bug: Fixed lifecycle events for componentWillMount() on the server [#205](https://github.com/apollostack/react-apollo/pull/205) ### v0.5.4 -* Bug: Created better reference to updateQuery when bound early. It will also - throw if called before it should be. +- Bug: Created better reference to updateQuery when bound early. It will also throw if called before it should be. ### v0.5.3 -* Bug: Fixed issue with updateQuery not being present during componentWillMount - [#203](https://github.com/apollostack/react-apollo/pull/203) +- Bug: Fixed issue with updateQuery not being present during componentWillMount [#203](https://github.com/apollostack/react-apollo/pull/203) ### v0.5.2 -* Feature: Allow optional variables by passing null value on behalf of the - variable [#200](https://github.com/apollostack/react-apollo/pull/200) +- Feature: Allow optional variables by passing null value on behalf of the variable [#200](https://github.com/apollostack/react-apollo/pull/200) ### v0.5.1 -* Feature: Added link to [recompose](https://github.com/acdlite/recompose) to - use the `compose` function. This makes it easy to combine multiple queries on - a single component. - [#194](https://github.com/apollostack/react-apollo/pull/194) +- Feature: Added link to [recompose](https://github.com/acdlite/recompose) to use the `compose` function. This makes it easy to combine multiple queries on a single component. [#194](https://github.com/apollostack/react-apollo/pull/194) ### v0.5.0 #### Breaking - ```js // old -renderToStringWithData(component).then(markup); // markup had a script tag +renderToStringWithData(component).then(markup) // markup had a script tag // new -renderToStringWithData(component).then({ markup, initialState }); // markup has not tag, and state is passed +renderToStringWithData(component).then({ markup, initialState }) // markup has not tag, and state is passed ``` -* Feature: Removed client as a prop and fixed warnings when not using - ApolloProvider [#189](https://github.com/apollostack/react-apollo/pull/189) -* Feature: Added updateQuery to data props +- Feature: Removed client as a prop and fixed warnings when not using ApolloProvider [#189](https://github.com/apollostack/react-apollo/pull/189) +- Feature: Added updateQuery to data props + +- Bug: Fixed renderToStringWithData causing react warning [#169](https://github.com/apollostack/react-apollo/issues/169) +- Bug: Fixed ssr fragment issue [#178](https://github.com/apollostack/react-apollo/pull/178) +- Bug: Fixed loading state for skipped queries [#190](https://github.com/apollostack/react-apollo/pull/190) +- Bug: Fixed loading state on remounted component with different variables -* Bug: Fixed renderToStringWithData causing react warning - [#169](https://github.com/apollostack/react-apollo/issues/169) -* Bug: Fixed ssr fragment issue - [#178](https://github.com/apollostack/react-apollo/pull/178) -* Bug: Fixed loading state for skipped queries - [#190](https://github.com/apollostack/react-apollo/pull/190) -* Bug: Fixed loading state on remounted component with different variables ### v0.4.7 -* Bug: Fixed SSR issue with context - [#165](https://github.com/apollostack/react-apollo/pull/165) -* Bug: Fixed issue when context changes in parent container not going through to - child; [#162](https://github.com/apollostack/react-apollo/pull/162) -* Bug: Fixed loading state on remount of forceFetch operations; - [#161](https://github.com/apollostack/react-apollo/pull/161) +- Bug: Fixed SSR issue with context [#165](https://github.com/apollostack/react-apollo/pull/165) +- Bug: Fixed issue when context changes in parent container not going through to child; [#162](https://github.com/apollostack/react-apollo/pull/162) +- Bug: Fixed loading state on remount of forceFetch operations; [#161](https://github.com/apollostack/react-apollo/pull/161) ### v0.4.6 -* Bug: Fixed issue with variable merging after fetchMore - [#150](https://github.com/apollostack/react-apollo/pull/150) +- Bug: Fixed issue with variable merging after fetchMore [#150](https://github.com/apollostack/react-apollo/pull/150) ### v0.4.5 -* Feature: Allow options value to be an object instead of a method. - [#144](https://github.com/apollostack/react-apollo/issues/144) -* Bug: Fixed issue with missing methods on initial props - [#142](https://github.com/apollostack/react-apollo/issues/142) -* Bug: Fixed oddity with multi nested enhancers on SSR - [#141](https://github.com/apollostack/react-apollo/issues/141) +- Feature: Allow options value to be an object instead of a method. [#144](https://github.com/apollostack/react-apollo/issues/144) +- Bug: Fixed issue with missing methods on initial props [#142](https://github.com/apollostack/react-apollo/issues/142) +- Bug: Fixed oddity with multi nested enhancers on SSR [#141](https://github.com/apollostack/react-apollo/issues/141) ### v0.4.4 -* Bug: Fixed issue with variable merging - [#139](https://github.com/apollostack/react-apollo/pull/139) +- Bug: Fixed issue with variable merging [#139](https://github.com/apollostack/react-apollo/pull/139) ### v0.4.3 -* Feature: Support a different store in the tree that is immutable (support - immutable redux) [#137](https://github.com/apollostack/react-apollo/pull/137) +- Feature: Support a different store in the tree that is immutable (support immutable redux) [#137](https://github.com/apollostack/react-apollo/pull/137) ### v0.4.2 -* Bug: Fixed refetch methods when no result is returned +- Bug: Fixed refetch methods when no result is returned ### v0.4.1 -* BREAKING Feature: - [Brand new API! See the docs for more information](http://docs.apollostack.com/apollo-client/react.html); +- BREAKING Feature: [Brand new API! See the docs for more information](http://docs.apollostack.com/apollo-client/react.html); ### v0.3.20 -* Bug: Fixed loading state on refetch more when data doesn't change -* Feature: added fetchMore - [#123](https://github.com/apollostack/react-apollo/pull/123) +- Bug: Fixed loading state on refetch more when data doesn't change +- Feature: added fetchMore [#123](https://github.com/apollostack/react-apollo/pull/123) ### v0.3.19 -* Bug: Retain compatibility with version 0.3.0 of Apollo Client via a backcompat - shim. [#109](https://github.com/apollostack/react-apollo/pull/109) +- Bug: Retain compatibility with version 0.3.0 of Apollo Client via a backcompat shim. [#109](https://github.com/apollostack/react-apollo/pull/109) ### v0.3.18 -* Feature: Support 0.4.0 of Apollo Client, and pass through new mutation options - [#105](https://github.com/apollostack/react-apollo/pull/105) - [#106](https://github.com/apollostack/react-apollo/pull/106) +- Feature: Support 0.4.0 of Apollo Client, and pass through new mutation options [#105](https://github.com/apollostack/react-apollo/pull/105) [#106](https://github.com/apollostack/react-apollo/pull/106) ### v0.3.17 -* Bug: Fixed but where SSR wouldn't get calculated props from redux actions - [#103](https://github.com/apollostack/react-apollo/pull/103) +- Bug: Fixed but where SSR wouldn't get calculated props from redux actions [#103](https://github.com/apollostack/react-apollo/pull/103) ### v0.3.16 -* Feature: integrated SSR - [#83](https://github.com/apollostack/react-apollo/pull/83) -* Feature: added ability to hoist statics on components - [#99](https://github.com/apollostack/react-apollo/pull/99) -* Bug: Don't strip data away from the component when the query errors - [#98](https://github.com/apollostack/react-apollo/pull/98) +- Feature: integrated SSR [#83](https://github.com/apollostack/react-apollo/pull/83) +- Feature: added ability to hoist statics on components [#99](https://github.com/apollostack/react-apollo/pull/99) +- Bug: Don't strip data away from the component when the query errors [#98](https://github.com/apollostack/react-apollo/pull/98) ### v0.3.15 -* Bug: Fixed issue where react native would error on aggressive cloneing of - client +- Bug: Fixed issue where react native would error on aggressive cloneing of client ### v0.3.14 -* Feature: pass through all methods on apollo client +- Feature: pass through all methods on apollo client ### v0.3.13 -* Bug: fixed issue causing errors to be passed to apollo-client - [#89](https://github.com/apollostack/react-apollo/pull/89) +- Bug: fixed issue causing errors to be passed to apollo-client [#89](https://github.com/apollostack/react-apollo/pull/89) ### v0.3.11/12 -* Bug: fixed overrendering of components on redux state changes +- Bug: fixed overrendering of components on redux state changes ### v0.3.10 -* Bug: fixed bug where SSR would fail due to later updates. This should also - prevent unmounted components from throwing errors. +- Bug: fixed bug where SSR would fail due to later updates. This should also prevent unmounted components from throwing errors. ### v0.3.9 -* Feature: provide add `watchQuery` to components via `connect` +- Feature: provide add `watchQuery` to components via `connect` ### v.0.3.8 -* Bug: Don't use old props on store change change +- Bug: Don't use old props on store change change ### v.0.3.7 -* Bug: Reset loading state when a refetched query has returned +- Bug: Reset loading state when a refetched query has returned ### v0.3.6 -* Bug: Loading state is no longer true on uncalled mutations. -* Improvement: don't set the loading state to false if forceFetch is true +- Bug: Loading state is no longer true on uncalled mutations. +- Improvement: don't set the loading state to false if forceFetch is true ### v0.3.5 @@ -648,34 +440,32 @@ Return promise from the refetch method ### v0.3.4 -* Bug: Fix bug where state / props weren't accurate when executing mutations. -* * Improvement: Increase performance by limiting re-renders and re-execution of - queries. Chore: Split tests to make them easier to maintain. +- Bug: Fix bug where state / props weren't accurate when executing mutations. +- - Improvement: Increase performance by limiting re-renders and re-execution of queries. +Chore: Split tests to make them easier to maintain. ### v0.3.2 || v0.3.3 (publish fix) -* Feature: add `startPolling` and `stopPolling` to the prop object for queries -* Bug: Fix bug where full options were not being passed to watchQuery +- Feature: add `startPolling` and `stopPolling` to the prop object for queries +- Bug: Fix bug where full options were not being passed to watchQuery ### v0.3.1 -* Feature: Support 0.3.0 of apollo-client +- Feature: Support 0.3.0 of apollo-client ### v0.3.0 -* Feature: Change Provider export to be ApolloProvider and use Provider from - react-redux +- Feature: Change Provider export to be ApolloProvider and use Provider from react-redux ### v0.2.1 -* Feature: Support 0.1.0 and 0.2.0 of apollo-client +- Feature: Support 0.1.0 and 0.2.0 of apollo-client ### v0.2.0 **Breaking change:** -* Feature: Remove `result` key in favor of dynamic key matching root fields of - the query or mutation. (https://github.com/apollostack/react-apollo/pull/31) +- Feature: Remove `result` key in favor of dynamic key matching root fields of the query or mutation. (https://github.com/apollostack/react-apollo/pull/31) ```js { @@ -697,25 +487,22 @@ becomes ### v0.1.5 -* Bug: Get state directly from redux store internally +- Bug: Get state directly from redux store internally ### v0.1.4 -* Bug: Fix bug with willReceiveProps +- Bug: Fix bug with willReceiveProps ### v0.1.2 -Bug: - Adjust loading lifecycle marker to better match the behavior of -apollo-client [#11](https://github.com/apollostack/react-apollo/pull/11) +Bug: - Adjust loading lifecycle marker to better match the behavior of apollo-client [#11](https://github.com/apollostack/react-apollo/pull/11) ### v0.1.1 -Feature: - Update to support new observable API from apollo-client -[#9](https://github.com/apollostack/react-apollo/pull/9) +Feature: - Update to support new observable API from apollo-client [#9](https://github.com/apollostack/react-apollo/pull/9) ### v0.1.0 -Initial release. Brings in support for binding GraphQL data to components easily -as well as perform mutations. +Initial release. Brings in support for binding GraphQL data to components easily as well as perform mutations. We didn't track changes before this version. diff --git a/package.json b/package.json index 43518c5ba0..8051f4b0e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-apollo", - "version": "2.0.1", + "version": "2.0.4", "description": "React data container for Apollo Client", "main": "lib/react-apollo.umd.js", "module": "./lib/index.js", @@ -8,7 +8,8 @@ "browser": "lib/react-apollo.browser.umd.js", "typings": "lib/index.d.ts", "scripts": { - "analyze": "npm run compile && webpack -p --config scripts/webpack.inspect.js", + "analyze": + "npm run compile && webpack -p --config scripts/webpack.inspect.js", "deploy": "./scripts/deploy.sh", "danger": "danger run --verbose", "test": "npm run compile && jest", @@ -16,15 +17,20 @@ "test-watch": "jest --watch", "posttest": "npm run lint && npm run type-check", "filesize": "npm run compile:browser && bundlesize", - "flow-typed": "npm install && flow-typed install --ignoreDeps peer --ignoreDeps dev", - "type-check": "tsc ./test/typescript.ts --noEmit --jsx react --noEmitOnError --lib es6,dom --experimentalDecorators && flow check", + "flow-typed": + "npm install && flow-typed install --ignoreDeps peer --ignoreDeps dev", + "type-check": + "tsc ./test/typescript.ts --noEmit --jsx react --noEmitOnError --lib es6,dom --experimentalDecorators && flow check", "compile": "tsc", - "bundle": "rollup -c && rollup -c rollup.browser.config.js && rollup -c rollup.test-utils.config.js", - "compile:browser": "rm -rf ./dist && mkdir ./dist && NODE_ENV=production webpack -p ./lib/react-apollo.browser.umd.js ./dist/index.min.js --config ./scripts/webpack.config.js", + "bundle": + "rollup -c && rollup -c rollup.browser.config.js && rollup -c rollup.test-utils.config.js", + "compile:browser": + "rm -rf ./dist && mkdir ./dist && NODE_ENV=production webpack -p ./lib/react-apollo.browser.umd.js ./dist/index.min.js --config ./scripts/webpack.config.js", "watch": "tsc -w", "lint": "tslint 'src/*.ts*' --type-check -p tsconfig.json", "lint-staged": "lint-staged", - "lint-fix": "prettier --trailing-comma all --single-quote --write \"{src,test}/**/*.ts*\"", + "lint-fix": + "prettier --trailing-comma all --single-quote --write \"{src,test}/**/*.ts*\"", "postcompile": "npm run bundle", "prepublishOnly": "npm run compile" }, @@ -39,10 +45,7 @@ "prettier --trailing-comma all --single-quote --write", "git add" ], - "*.js*": [ - "prettier --trailing-comma all --single-quote --write", - "git add" - ] + "*.js*": ["prettier --trailing-comma all --single-quote --write", "git add"] }, "pre-commit": "lint-staged", "repository": { @@ -60,9 +63,7 @@ ], "author": "James Baxley ", "babel": { - "presets": [ - "react-native" - ] + "presets": ["react-native"] }, "jest": { "preset": "jest-react-native", @@ -73,25 +74,15 @@ "transformIgnorePatterns": [ "/node_modules/(?!(lodash-es|react-native)/)" ], - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ], + "moduleFileExtensions": ["ts", "tsx", "js", "json"], "modulePathIgnorePatterns": [ "/examples", "/test/flow.js", "/test/typescript.ts" ], - "projects": [ - "", - "/examples/*" - ], + "projects": ["", "/examples/*"], "testRegex": "(/test/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "setupFiles": [ - "/scripts/tests.js" - ] + "setupFiles": ["/scripts/tests.js"] }, "license": "MIT", "peerDependencies": {