Open renovate[bot] opened 5 years ago
This pull request is automatically deployed with Now. To access deployments, click Details below or on the icon next to each push.
Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.
You can manually request rebase by checking the rebase/retry box above.
⚠️ Warning: custom changes will be lost.
This PR contains the following updates:
^2.1.11
->^3.0.0
Release Notes
apollographql/react-apollo
### [`v3.1.5`](https://togithub.com/apollographql/react-apollo/compare/@apollo/react-hooks@3.1.4...@apollo/react-hooks@3.1.5) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/react-apollo@3.1.4...react-apollo@3.1.5) ### [`v3.1.4`](https://togithub.com/apollographql/react-apollo/compare/@apollo/react-testing@3.1.3...@apollo/react-testing@3.1.4) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/react-apollo@3.1.3...react-apollo@3.1.4) ### [`v3.1.3`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#313-2019-10-15) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/react-apollo@3.1.2...react-apollo@3.1.3) - Revert the changes made in [#3497](https://togithub.com/apollographql/react-apollo/pull/3497), which have lead to problems with `onCompleted` being called more often than necessary.[@hwillson](https://togithub.com/hwillson) in [0901f4a](https://togithub.com/apollographql/react-apollo/commit/0901f4ac2b1800dab423b63bd9e041c863a2425f) ### [`v3.1.2`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#312-2019-10-01) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/react-apollo@3.1.1...react-apollo@3.1.2) ##### Bug Fixes - Make sure SSR is fully disabled when using `ssr: false` and `ssrMode: true`.
[@maapteh](https://togithub.com/maapteh) in [#3515](https://togithub.com/apollographql/react-apollo/pull/3515) - Fixed `MockLink`'s broken `newData` function handling.
[@pawelkleczek](https://togithub.com/pawelkleczek) in [#3539](https://togithub.com/apollographql/react-apollo/pull/3539) - Fixed an issue that prevented `networkStatus` from changing `ready` at the end of pagination.
[@mu29](https://togithub.com/mu29) in [#3514](https://togithub.com/apollographql/react-apollo/pull/3514) ### [`v3.1.1`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#311-2019-09-15) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/react-apollo@3.1.0...react-apollo@3.1.1) ##### Improvements - Calling `startPolling` or `stopPolling` after a component has unmounted is now a no-op (instead of throwing an exception). Polling is automatically stopped when a component is unmounted, so it doesn't need to be called manually.
[@hwillson](https://togithub.com/hwillson) in [#3485](https://togithub.com/apollographql/react-apollo/pull/3485) - Allow `ignoreResults` to be controlled through `graphql` and `withMutation` options.
[@tim-stasse](https://togithub.com/tim-stasse) in [#3431](https://togithub.com/apollographql/react-apollo/pull/3431) - Be a bit more defensive when it comes to accessing the internal `ObservableQuery` instance, to avoid attempting to use it after a component has unmounted.
[@jfrolich](https://togithub.com/jfrolich) in [#3490](https://togithub.com/apollographql/react-apollo/pull/3490) ##### Bug Fixes - A fix has been applied to prevent an unchanging `loading` state when an error occurs after a refetch, that is the same as the previous error.
[@jet2jet](https://togithub.com/jet2jet) in [#3477](https://togithub.com/apollographql/react-apollo/pull/3477) - Add back in the removed `ChildDataProps` and `ChildMutateProps` types.
[@hwillson](https://togithub.com/hwillson) in [#3495](https://togithub.com/apollographql/react-apollo/pull/3495) - Make sure `onCompleted` is called each time a `useLazyQuery` based query completes, after the execution function is called.
[@hwillson](https://togithub.com/hwillson) in [#3497](https://togithub.com/apollographql/react-apollo/pull/3497) ### [`v3.1.0`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#310-2019-09-06) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/react-apollo@3.0.1...react-apollo@3.1.0) ##### Potentially Breaking Change - Change the default query `data` state from `{}` to `undefined`. This change aligns all parts of the React Apollo query cycle so that `data` is always `undefined` if there is no data, instead of `data` being converted into an empty object. This change impacts the initial query response, initial SSR response, `data` value when errors occur, `data` value when skipping, etc. All of these areas are now aligned to only ever return a value for `data` if there really is a value to return (instead of making it seem like there is one by converting to `{}`).
[@hwillson](https://togithub.com/hwillson) in [#3388](https://togithub.com/apollographql/react-apollo/pull/3388) ##### Bug Fixes - Adds support for the `skip` option when using `useSubscription`.
[@n1ru4l](https://togithub.com/n1ru4l) in [#3356](https://togithub.com/apollographql/react-apollo/pull/3356) - Makes sure `refetch`, `fetchMore`, `updateQuery`, `startPolling`, `stopPolling`, and `subscribeToMore` maintain a stable identity when they're passed back alongside query results.
[@hwillson](https://togithub.com/hwillson) in [#3422](https://togithub.com/apollographql/react-apollo/pull/3422) - Fixed problematic re-renders that were caused by using `fetchMore.updateQuery` with `notifyOnNetworkStatusChange` set to true. When `notifyOnNetworkStatusChange` is true, re-renders will now wait until `updateQuery` has completed, to make sure the updated data is used during the render.
[@hwillson](https://togithub.com/hwillson) in [#3433](https://togithub.com/apollographql/react-apollo/pull/3433) - Add `client` to the `useMutation` result.
[@joshalling](https://togithub.com/joshalling) in [#3417](https://togithub.com/apollographql/react-apollo/pull/3417) - Prevent inline `onError` and `onCompleted` callbacks from being part of the internal memoization that's used to decide when certain after render units of functionality are run, when using `useQuery`. This fixes issues related to un-necessary component cleanup, like `error` disappearing from results when it should be present.
[@dylanwulf](https://togithub.com/dylanwulf) in [#3419](https://togithub.com/apollographql/react-apollo/pull/3419) - `useLazyQuery`'s execution function can now be called multiple times in a row, and will properly submit network requests each time called, when using a fetch policy of `network-only`.
[@hwillson](https://togithub.com/hwillson) in [#3453](https://togithub.com/apollographql/react-apollo/pull/3453) - SSR enhancements to support `network-only` and `cache-and-network` fetch policies, along with changes to ensure disabled SSR queries are not fired.
[@mikebm](https://togithub.com/mikebm) in [#3435](https://togithub.com/apollographql/react-apollo/pull/3435) - Remove `void` from the `MutationFunction`'s returned Promise types.
[@hwillson](https://togithub.com/hwillson) in [#3458](https://togithub.com/apollographql/react-apollo/pull/3458) - Prevent duplicate `onCompleted` calls during the same query execution cycle.
[@hwillson](https://togithub.com/hwillson) in [#3461](https://togithub.com/apollographql/react-apollo/pull/3461) - Make sure polling is stopped when a component is unmounted.
[@dqunbp](https://togithub.com/dqunbp) in [#3273](https://togithub.com/apollographql/react-apollo/pull/3273) - Documentation fixes.
[@SeanRoberts](https://togithub.com/SeanRoberts) in [#3380](https://togithub.com/apollographql/react-apollo/pull/3380) ### [`v3.0.1`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#301-2019-08-15) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/react-apollo@3.0.0...react-apollo@3.0.1) ##### Improvements - Documentation updates.
[@joshalling](https://togithub.com/joshalling) in [#3324](https://togithub.com/apollographql/react-apollo/pull/3324) ##### Bug Fixes - Dedupe `onError` callback calls and ensure `refetch` sets `loading` state properly.
[@hwillson](https://togithub.com/hwillson) in [#3339](https://togithub.com/apollographql/react-apollo/pull/3339) - Add missing `useLazyQuery` export to the `react-apollo` (all) package.
[@hwillson](https://togithub.com/hwillson) in [#3320](https://togithub.com/apollographql/react-apollo/pull/3320) - Remove `void` from being one of the `MutationTuple` mutate function possible generics. This will make it easier to properly destructure results returned by the mutate function Promise.
[@hwillson](https://togithub.com/hwillson) in [#3334](https://togithub.com/apollographql/react-apollo/pull/3334) - Export `MockedProviderProps` and `MockedProviderState` from `@apollo/react-testing`.
[@hwillson](https://togithub.com/hwillson) in [#3337](https://togithub.com/apollographql/react-apollo/pull/3337) - Add `@types/react` as a peer dep, to address potential TS compilation errors when using `ApolloProvider`.
[@zkochan](https://togithub.com/zkochan) in [#3278](https://togithub.com/apollographql/react-apollo/pull/3278) - Make sure `error`'s are maintained after re-renders, when they should be.
[@hwillson](https://togithub.com/hwillson) in [#3362](https://togithub.com/apollographql/react-apollo/pull/3362) ### [`v3.0.0`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#300-2019-08-06) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/2.5.8...react-apollo@3.0.0) ##### Overview This major release includes a large refactoring of the existing React Apollo codebase, to introduce new improvements, changes, features and bug fixes. The biggest new features are: - Provides new `useQuery`, `useLazyQuery`, `useMutation`, `useSubscription`, and `useApolloClient` hooks, following [React's Hooks API](https://reactjs.org/docs/hooks-intro.html). - Maintains support for React Apollo's `graphql` HOC and render proper components. - Introduces a new monorepo structure, with separately published packages, making it easier to use just the parts of React Apollo you're interested in: - `@apollo/react-common` - `@apollo/react-hooks` - `@apollo/react-components` - `@apollo/react-hoc` - `@apollo/react-ssr` - `@apollo/react-testing` - Thorough codebase pruning and cleaning to reduce the overall React Apollo bundle size. - And more! Consult the [Hooks migration guide](https://www.apollographql.com/docs/react/hooks-migration/) for more details around upgrading. For more information regarding how to use the new hooks, please consult the updated [React Apollo docs](https://www.apollographql.com/docs/react/) (all docs have been updated to be hooks first). ##### Breaking Changes - The minimum supported React version is now 16.8. - The `react-apollo@3` package preserves most of the functionality of `react-apollo@2` by re-exporting existing components and functions from `@apollo/react-components` and `@apollo/react-hoc`. If you want to use Hooks, Components, or HOC directly, import the new `@apollo/react-hooks`, `@apollo/react-components`, and/or `@apollo/react-hoc` packages instead. - React Apollo testing utilities are no longer available as part of the `react-apollo` package. They should now be imported from the new `@apollo/react-testing` package. - The deprecated `walkTree` function has been removed ([9b24d756](https://togithub.com/apollographql/react-apollo/pull/2892/commits/9b24d7567be194c454395365bb5db4fbd7a5caca)). - The deprecated `GraphqlQueryControls` and `MutationFunc` types have been removed ([ade881f0](https://togithub.com/apollographql/react-apollo/pull/2892/commits/ade881f07b1175d28b0aae79915bfc5ed8dd9e5a)). - Preact is no longer supported ([b742ae63](https://togithub.com/apollographql/react-apollo/pull/2892/commits/b742ae6382039eac79e050a9b0f54183dafaf4a3)). - Various Typescript type changes. Since we've introduced a third way of managing data with React (Hooks), we had to rework many of the existing exported types to better align with the Hooks way of doing things. Base types are used to hold common properties across Hooks, Components and the `graphql` HOC, and these types are then extended when needed to provide properties that are specific to a certain React paradigm ([30edb1b0](https://togithub.com/apollographql/react-apollo/pull/2892/commits/30edb1b080b64253b9074a5e7347c544618ea2ea) and [3d138db3](https://togithub.com/apollographql/react-apollo/pull/2892/commits/3d138db386fe44e35203b991eb6caca0eec19d3d)). - `catchAsyncError`, `wrap`, and `compose` utilities have been removed ([2c3a262](https://togithub.com/apollographql/react-apollo/pull/2892/commits/2c3a262f9eb1cfb9e58b40ceaeda16a628e3964c), [7de864e](https://togithub.com/apollographql/react-apollo/pull/2892/commits/7de864ecb90521fc2e1f211023fe436486af2324), and [e6089a7](https://togithub.com/apollographql/react-apollo/pull/2892/commits/e6089a716b2b19b57f36200db378b8613a91612d)). Previously, `compose` was imported then exported directly from lodash using [`flowRight`](https://lodash.com/docs/4.17.15#flowRight). To keep using `compose`, install the [`lodash.flowright`](https://www.npmjs.com/package/lodash.flowright) package, then update your `compose` imports as: ```js import compose from 'lodash.flowright'; ``` - Render prop components (`Query`, `Mutation` and `Subscription`) can no longer be extended. In other words, this is no longer possible: ```js class SomeQuery extends Query
[@jure](https://togithub.com/jure) in [#3029](https://togithub.com/apollographql/react-apollo/pull/3029). - Adjust the `ApolloContext` definition to play a bit more nicely with `React.createContext` types.
[@JoviDeCroock](https://togithub.com/JoviDeCroock) in [#3018](https://togithub.com/apollographql/react-apollo/pull/3018) - The result of a mutation is now made available to the wrapped component, when using the `graphql` HOC.
[@andycarrell](https://togithub.com/andycarrell) in [#3008](https://togithub.com/apollographql/react-apollo/pull/3008) - Check equality of stringified variables in the `MockLink` to improve debugging experience used by `MockedProvider`.
[@evans](https://togithub.com/evans) in [#3078](https://togithub.com/apollographql/react-apollo/pull/3078) ##### Bug Fixes - Removed leftover `apollo-client@beta` peer dep.
[@brentertz](https://togithub.com/brentertz) in [#3064](https://togithub.com/apollographql/react-apollo/pull/3064) - Stop setting optional input to `null`, when using the `graphql` HOC.
[@ZhengYuTay](https://togithub.com/ZhengYuTay) in [#3056](https://togithub.com/apollographql/react-apollo/pull/3056) - Fix typescript error caused by `query` being mandatory in the `fetchMore` signature.
[@HsuTing](https://togithub.com/HsuTing) in [#3065](https://togithub.com/apollographql/react-apollo/pull/3065) - Fixes an issue that caused the `Query` component to get stuck in an always loading state, caused by receiving an error (meaning subsequent valid responses couldn't be handled). The `Query` component can now handle an error in a response, then continue to handle a valid response afterwards.
[@hwillson](https://togithub.com/hwillson) in [#3107](https://togithub.com/apollographql/react-apollo/pull/3107) - Reorder `Subscription` component code to avoid setting state on unmounted component.
[@jasonpaulos](https://togithub.com/jasonpaulos) in [#3139](https://togithub.com/apollographql/react-apollo/pull/3139) - Fix component stuck in `loading` state for `network-only` fetch policy.
[@jasonpaulos](https://togithub.com/jasonpaulos) in [#3126](https://togithub.com/apollographql/react-apollo/pull/3126) ### [`v2.5.6`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#256-2019-05-22) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.5.5...v2.5.6) ##### Improvements - Both the `Query` component and `graphql` HOC now accept a `returnPartialData` prop. This is an important new feature, that should help address a lot of open Apollo Client / React Apollo issues, so we'll explain it here with an example. Before this release, if you run a query that looks like: ```js const GET_MEMBER = gql` query GetMember($id: ID!) { member(id: $id) { id name } } `; ``` in one component, the results are cached, then you run a superset query like the following in another component: ```js const GET_MEMBER_WITH_PLANS = gql` query GetMemberWithPlans($id: ID!) { member(id: $id) { id name plans { id title duration } } } `; ``` Apollo Client will not re-use the partial data that was cached from the first query, when it preps and displays the second component. It can't find a cache hit for the full second query, so it fires the full query over the network. With this release, if you set a `returnPartialData` prop to `true` on the second component, the `data` available to that component will be automatically pre-loaded with the parts of the query that can be found in the cache, before the full query is fired over the network. This means you can do things like showing partial data in your components, while the rest of the data is being loaded over the network. ### [`v2.5.5`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#255-2019-04-22) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.5.4...v2.5.5) ##### Improvements - Export the Apollo Context provider (`ApolloContext`).
[@MrLoh](https://togithub.com/MrLoh) in [#2961](https://togithub.com/apollographql/react-apollo/pull/2961) ### [`v2.5.4`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#254-2019-04-05) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.5.3...v2.5.4) ##### Bug Fixes - Fixes `Could not find "client" in the context of ApolloConsumer` errors when using `MockedProvider`.
[@hwillson](https://togithub.com/hwillson) in [#2907](https://togithub.com/apollographql/react-apollo/pull/2907) - Ensure `Query` components using a `fetchPolicy` of `no-cache` have their data preserved when the components tree is re-rendered.
[@hwillson](https://togithub.com/hwillson) in [#2914](https://togithub.com/apollographql/react-apollo/pull/2914) ##### Improvements - Documentation updates.
[@afenton90](https://togithub.com/afenton90) in [#2932](https://togithub.com/apollographql/react-apollo/pull/2932) ### [`v2.5.3`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#253) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.5.2...v2.5.3) ##### Bug Fixes - Fixed an infinite loop caused by using `setState` in the `onError` / `onCompleted` callbacks of the `Query` component.
[@chenesan](https://togithub.com/chenesan) in [#2751](https://togithub.com/apollographql/react-apollo/pull/2751) - Fixed an issue that prevented good results from showing up in a `Query` component, after an error was received, variables were adjusted, and then the good data was fetched.
[@MerzDaniel](https://togithub.com/MerzDaniel) in [#2718](https://togithub.com/apollographql/react-apollo/pull/2718) - Fixed an issue that prevented `Query` component updates from firing (under certain circumstances) due to the internal `lastResult` value (that's used to help prevent unnecessary re-renders) not being updated.
[@Glennrs](https://togithub.com/Glennrs) in [#2840](https://togithub.com/apollographql/react-apollo/pull/2840) ##### Improvements - `MockedProvider` now accepts a `childProps` prop that can be used to pass props down to a child component.
[@miachenmtl](https://togithub.com/miachenmtl) in [#2482](https://togithub.com/apollographql/react-apollo/pull/2482) - `onCompleted` callbacks now use a destructuring-friendly type definition.
[@jozanza](https://togithub.com/jozanza) in [#2496](https://togithub.com/apollographql/react-apollo/pull/2496) - `@connection` directives are now properly stripped from `MockedResponse`'s, when using `MockedProvider`.
[@ajmath](https://togithub.com/ajmath) in [#2523](https://togithub.com/apollographql/react-apollo/pull/2523) - `MockedProvider` has been updated to stop setting a default `resolvers` value of `{}`, which means by default Apollo Client 2.5 local resolver functionality is not enabled when mocking with `MockedProvider`. This allows `@client` fields to be passed through the mocked link chain, like people were used to before AC 2.5. When using this default mode you will see a dev only warning message about this like: > Found [@client](https://togithub.com/client) directives in query but no client resolvers were specified. > You can now pass apollo-link-state resolvers to the ApolloClient > constructor. This message can be safely ignored. If you want to use `MockedProvider` with AC 2.5's new local resolver functionality, you can pass your local resolver map into the `MockedProvider` `resolvers` prop.
[@ajmath](https://togithub.com/ajmath) in [#2524](https://togithub.com/apollographql/react-apollo/pull/2524) - Improvements to the `graphql` HOC generics for `fetchMore` and `refetch`.
[@EricMcRay](https://togithub.com/EricMcRay) in [#2525](https://togithub.com/apollographql/react-apollo/pull/2525) - The `ApolloProvider` / `ApolloConsumer` implementations have been refactored to use [React 16.3's new context API](https://reactjs.org/docs/context.html).
[@wzrdzl](https://togithub.com/wzrdzl) in [#2540](https://togithub.com/apollographql/react-apollo/pull/2540) - All `dependencies` and `devDependencies` have been updated to their latest versions, and related Typescript changes have been applied.
[@hwillson](https://togithub.com/hwillson) in [#2873](https://togithub.com/apollographql/react-apollo/pull/2873) ### [`v2.5.2`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#v252) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.5.1...v2.5.2) ##### Bug Fixes - Export `Context` type from `types.ts` instead of `walkTree.ts`, to reenable `import { Context } from 'react-apollo'` (which has been broken since 2.4.0).
[@benjamn](https://togithub.com/benjamn) in [#2825](https://togithub.com/apollographql/react-apollo/pull/2832) ##### Improvements - Add [`examples/rollup`](https://togithub.com/apollographql/react-apollo/tree/master/examples/rollup) to enable application-level bundle measurement and demonstrate Rollup configuration best practices.
[@benjamn](https://togithub.com/benjamn) in [#2839](https://togithub.com/apollographql/react-apollo/pull/2839) - Bundle size reductions inspired by `examples/rollup` app.
[@benjamn](https://togithub.com/benjamn) in [#2842](https://togithub.com/apollographql/react-apollo/pull/2842) ### [`v2.5.1`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#251) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.5.0...v2.5.1) ##### Bug Fixes - Make sure `MockedProvider` enables Apollo Client 2.5's local state handling, and allow custom / mocked resolvers to be passed in as props, and used with the created test `ApolloClient` instance.
[@hwillson](https://togithub.com/hwillson) in [#2825](https://togithub.com/apollographql/react-apollo/pull/2825) ### [`v2.5.0`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#250) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.4.1...v2.5.0) ##### Improvements - Ready to be used with Apollo Client 2.5 and its new local state management features, as well as many overall code improvements to help reduce the React Apollo bundle size.
[#2758](https://togithub.com/apollographql/react-apollo/pull/2758) - A function can now be set as a `MockedResponse` `result` when using `MockedProvider`, such that every time the mocked result is returned, the function is run to calculate the result. This opens up new testing possibilities, like being able to verify if a mocked result was actually requested and received by a test.
[@hwillson](https://togithub.com/hwillson) in [#2788](https://togithub.com/apollographql/react-apollo/pull/2788) ### [`v2.4.1`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#241) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.4.0...v2.4.1) ##### Improvements - Adds a `onSubscriptionComplete` prop to the `Subscription` component, that can be passed a callback to be called when the subscription observable is completed.
[@sujeetsr](https://togithub.com/sujeetsr) in [#2716](https://togithub.com/apollographql/react-apollo/pull/2716) - During server-side rendering, `ObservableQuery` objects created in previous rendering passes will now be preserved in later passes (within the same `getDataFromTree` or `getMarkupFromTree` call), so that errors can be handled properly when using the `errorPolicy: "all"` option.
[PR #2753](https://togithub.com/apollographql/react-apollo/pull/2753) ### [`v2.4.0`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#240) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.3.3...v2.4.0) ##### Bug Fixes - Invoke `onCompleted`/`onError` even if `Mutation` unmounts.
[PR #2710](https://togithub.com/apollographql/react-apollo/pull/2710) ##### Improvements - The `walkTree` function has been deprecated, since there's no way to make its behavior consistent with the latest versions of React. To save bundle size, `walkTree` is no longer exported from `react-apollo`, though you can still access it as follows: ```js import { walkTree } from 'react-apollo/walkTree'; ``` ### [`v2.3.3`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#233) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.3.2...v2.3.3) ##### Bug Fixes - Add `react-dom` as a peer dependency (since it's used by `getDataFromTree` and `renderToStringWithData`).
[@hwillson](https://togithub.com/hwillson) in [#2660](https://togithub.com/apollographql/react-apollo/pull/2660) ##### Improvements - Drop `react` 14.x support, since the 14.x release line is 2 years old now, and `react-apollo` is no longer tested against it.
[@hwillson](https://togithub.com/hwillson) in [#2660](https://togithub.com/apollographql/react-apollo/pull/2660) ### [`v2.3.2`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#232) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.3.1...v2.3.2) ##### Improvements ##### Bug Fixes - This package no longer imports `react-dom/server` unconditionally at the top level, making `react-apollo` safer to use in environments like React Native that are neither browser-like nor Node-like, and thus struggle to import `react-dom/server` and its dependencies. Additionally, the React Native bundler has been instructed to ignore all `react-dom/server` dependencies within `react-apollo`, so `react-dom` will not be bundled in React Native apps simply because they import `react-apollo`. [PR #2627](https://togithub.com/apollographql/react-apollo/pull/2627) ### [`v2.3.1`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#231-November-15-2018) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.3.0...v2.3.1) ##### Improvements - Restore original `getDataFromTree(tree, context)` API, and introduce a new alternative called `getMarkupFromTree` to enable custom rendering functions: ```typescript export default function getDataFromTree( tree: React.ReactNode, context: { [key: string]: any } = {}, ) { return getMarkupFromTree({ tree, context, renderFunction: renderToStaticMarkup, }); } export type GetMarkupFromTreeOptions = { tree: React.ReactNode; context?: { [key: string]: any }; renderFunction?: typeof renderToStaticMarkup; }; export function getMarkupFromTree({ tree, context = {}, renderFunction = renderToStaticMarkup, }: GetMarkupFromTreeOptions): Promise
[@steelbrain](https://togithub.com/steelbrain) in [#2493](https://togithub.com/apollographql/react-apollo/pull/2493) ##### Improvements - Reimplement `getDataFromTree` using `ReactDOM.renderToStaticMarkup` to make asynchronous server-side rendering compatible with [React hooks](https://reactjs.org/docs/hooks-intro.html). Although the rendering function used by `getDataFromTree` defaults to `renderToStaticMarkup`, any suitable rendering function can be passed as the optional second argument to `getDataFromTree`, which now returns a `Promise
[@danilobuerger](https://togithub.com/danilobuerger) in [#2449](https://togithub.com/apollographql/react-apollo/pull/2449) ##### Improvements - The `Subscription` component now accepts a `fetchPolicy` prop.
[@MatthieuLemoine](https://togithub.com/MatthieuLemoine) in [#2298](https://togithub.com/apollographql/react-apollo/pull/2298) ##### Typescript - Make sure the `TVariables` generic is passed to `ObservableQuery`.
[@tgriesser](https://togithub.com/tgriesser) in [#2311](https://togithub.com/apollographql/react-apollo/pull/2311) ### [`v2.2.3`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#223-September-30-2018) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.2.2...v2.2.3) ##### Bug Fixes - Mutation errors are now properly returned as a render prop, when using a default `errorPolicy` of `all`.
[@amacleay](https://togithub.com/amacleay) in [#2374](https://togithub.com/apollographql/react-apollo/pull/2374) - `
[@fracmal](https://togithub.com/fracmak) in [#2422](https://togithub.com/apollographql/react-apollo/pull/2422) ##### Improvements - Replace the `lodash` dependency with `lodash.flowright` (since that's the only non-dev `lodash` function we're dependent on). Dev `lodash` dependencies have also been updated to use their individual module equivalent.
[@hwillson](https://togithub.com/hwillson) in [#2435](https://togithub.com/apollographql/react-apollo/pull/2435) - Removed `rollup-plugin-babel-minify` as it's no longer being used.
[@hwillson](https://togithub.com/hwillson) in [#2436](https://togithub.com/apollographql/react-apollo/pull/2436) - Small `getDataFromTree.ts` logic adjustment to avoid unnecessary calls when a falsy `element` is encountered.
[@HOUCe](https://togithub.com/HOUCe) in [#2429](https://togithub.com/apollographql/react-apollo/pull/2429) - `graphql` 14 updates.
[@hwillson](https://togithub.com/hwillson) in [#2437](https://togithub.com/apollographql/react-apollo/pull/2437) - All example apps (included in the repo) have been updated to work with the latest version of React Apollo.
[@hwillson](https://togithub.com/hwillson) in [#2439](https://togithub.com/apollographql/react-apollo/pull/2439) ##### Typescript - Fix `lodash` typings.
[@williamboman](https://togithub.com/williamboman) in [#2430](https://togithub.com/apollographql/react-apollo/pull/2430) - Typings: added `context` to `MutationOptions`.
[@danilobuerger](https://togithub.com/danilobuerger) in [#2354](https://togithub.com/apollographql/react-apollo/pull/2354) - Typings: more `MutationOptions` changes/fixes.
[@danilobuerger](https://togithub.com/danilobuerger) in [#2340](https://togithub.com/apollographql/react-apollo/pul/2340) - Remove `allowSyntheticDefaultImports` use. Typescript's `allowSyntheticDefaultImports` compiler option is something we'd like to start using, but we jumped the gun a bit by introducing it in https://github.com/apollographql/react-apollo/commit/9a96519d390783dfd9a431dc2dbaa476a24f7b80. Including it means that anyone who wants to use Typescript with React Apollo would have to also include it in their own local `tsconfig.json`, to be able to handle default imports properly. This is because we're also using Typescript's `es2015` `module` option, which means `allowSyntheticDefaultImports` has to be enabled explicitly. We've switched back to using a combination of `import * as X` and `require` syntax, to work with default imports. We'll re-introduce `allowSyntheticDefaultImports` use in React Apollo 3.
[@hwillson](https://togithub.com/hwillson) in [#2438](https://togithub.com/apollographql/react-apollo/pull/2438) ### [`v2.2.2`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#222-September-28-2018) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/v2.2.1...v2.2.2) - When using `React.createContext` and SSR, we now make sure the context provider value is reset to the previous value it had after its children are walked.
[@mitchellhamilton](https://togithub.com/mitchellhamilton) in [#2304](https://togithub.com/apollographql/react-apollo/pull/2304) - Revert:
When a query failed on the first result, the query result `data` was being returned as `undefined`. This behavior has been changed so that `data` is returned as an empty object. This makes checking for data (e.g. instead of `data && data.user` you can just check `data.user`) and destructring (e.g. `{ data: { user } }`) easier. **Note:** this could potentially hurt applications that are relying on a falsey check of `data` to see if any query errors have occurred. A better (and supported) way to check for errors is to use the result `errors` property.
[#1983](https://togithub.com/apollographql/react-apollo/pull/1983) ### [`v2.2.1`](https://togithub.com/apollographql/react-apollo/blob/HEAD/Changelog.md#221-September-26-2018) [Compare Source](https://togithub.com/apollographql/react-apollo/compare/2.2.0...v2.2.1) - Revert: "Typescript: use `Partial
[@danilobuerger](https://togithub.com/danilobuerger) in [#2322](https://togithub.com/apollographql/react-apollo/pull/2322) - Added an example app that shows how to test mutations.
[@excitement-engineer](https://togithub.com/excitement-engineer) in [#1998](https://togithub.com/apollographql/react-apollo/pull/1998) - The `
[@jedwards1211](https://togithub.com/jedwards1211) in [#1966](https://togithub.com/apollographql/react-apollo/pull/1966) - The `graphql` `options` object is no longer mutated, when calculating variables from props. This now prevents an issue where components created with `graphql` were not having their query variables updated properly, when props changed.
[@ksmth](https://togithub.com/ksmth) in [#1968](https://togithub.com/apollographql/react-apollo/pull/1968) - When a query failed on the first result, the query result `data` was being returned as `undefined`. This behavior has been changed so that `data` is returned as an empty object. This makes checking for data (e.g. instead of `data && data.user` you can just check `data.user`) and destructring (e.g. `{ data: { user } }`) easier. **Note:** this could potentially hurt applications that are relying on a falsey check of `data` to see if any query errors have occurred. A better (and supported) way to check for errors is to use the result `errors` property.
[@TLadd](https://togithub.com/TLadd) in [#1983](https://togithub.com/apollographql/react-apollo/pull/1983) - Allow a custom `cache` object to be passed into the test-utils `MockedProvider`.
[@palmfjord](https://togithub.com/palmfjord) in [#2254](https://togithub.com/apollographql/react-apollo/pull/2254) - Make the `MockedProvider` `mocks` prop read only.
[@amacleay](https://togithub.com/amacleay) in [#2284](https://togithub.com/apollographql/react-apollo/pull/2284) - Remove duplicate `FetchMoreOptions` and `FetchMoreQueryOptions` types, and instead import them from Apollo Client.
[@skovy](https://togithub.com/skovy) in [#2281](https://togithub.com/apollographql/react-apollo/pull/2281) - Type changes for the `graphql` HOC `options.skip` property.
[@jameslaneconkling](https://togithub.com/jameslaneconkling) in [#2208](https://togithub.com/apollographql/react-apollo/pull/2208) - Avoid importing `lodash` directly.
[@shahyar](https://togithub.com/shahyar) in [#2045](https://togithub.com/apollographql/react-apollo/pull/2045) - When the `Query` `skip` prop is set to `true`, make sure the render prop `loading` param is set to `false`, since we're not actually loading anything.
[@edorivai](https://togithub.com/edorivai) in [#1916](https://togithub.com/apollographql/react-apollo/pull/1916) - No longer building against Node 9
[@hwillson](https://togithub.com/hwillson) in [#2404](https://togithub.com/apollographql/react-apollo/pull/2404) - Make sure `
[@quentin-](https://togithub.com/quentin-) in [#1956](https://togithub.com/apollographql/react-apollo/pull/1956) - Typescript: use `Partial
[@tgriesser](https://togithub.com/tgriesser) in [#2313](https://togithub.com/apollographql/react-apollo/pull/2313) - Adjust `
[@Pajn](https://togithub.com/Pajn) in [#2332](https://togithub.com/apollographql/react-apollo/pull/2332) - Fixed a regression where `variables` passed in `graphql` HOC `options` were not merged with mutation `variables`.
[@samginn](https://togithub.com/samginn) in [#2216](https://togithub.com/apollographql/react-apollo/pull/2216) - Added a new `partialRefetch` prop (`false` by default). When a `Query` component is mounted, and a mutation is executed that returns the same ID as the mounted `Query`, but has less fields in its result, Apollo Client's `QueryManager` returns the data as an empty Object since a hit can't be found in the cache. This can lead to application errors when the UI elements rendered by the original `Query` component are expecting certain data values to exist, and they're all of a sudden stripped away. The recommended way to handle this is to use the mutations `update` prop to reconcile the mutation result with the data in the cache, getting everything into the expected state. This can definitely be a cumbersome process however, so to help address this the `partialRefetch` prop can be used to automatically `refetch` the original query and update the cache.
[@steelbrain](https://togithub.com/steelbrain) in [#2003](https://togithub.com/apollographql/react-apollo/pull/2003)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.