apollo-cache-persist icon indicating copy to clipboard operation
apollo-cache-persist copied to clipboard

chore(deps): pin dependency @apollo/client to v3.6.9

Open renovate[bot] opened this issue 5 years ago • 0 comments

Mend Renovate

This PR contains the following updates:

Package Type Update Change Age Adoption Passing Confidence
@apollo/client (source) peerDependencies pin ^3.2.5 -> 3.6.9 age adoption passing confidence
@apollo/client (source) devDependencies minor 3.2.4 -> 3.6.9 age adoption passing confidence

Add the preset :preserveSemverRanges to your config if you don't want to pin your dependencies.


Release Notes

apollographql/apollo-client

v3.6.9

Compare Source

Bug Fixes
  • Leave fetchPolicy unchanged when skip: true (or in standby) and nextFetchPolicy is available, even if variables change.
    @​benjamn in #​9823

v3.6.8

Compare Source

Bug Fixes

v3.6.7

Compare Source

Bug Fixes
  • Fix regression (introduced in v3.6.0) that caused BatchHttpLink to discard pending batched queries on early completion of the underlying Observable.
    @​benjamn in #​9793

v3.6.6

Compare Source

Bug Fixes
  • Allow useLazyQuery(query, { defaultOptions }) to benefit from defaultOptions.variables and client.defaultOptions.watchQuery.variables merging.
    @​benjamn in #​9762

v3.6.5

Compare Source

Bug Fixes
  • Restore pre-v3.6 variables replacement behavior of ObservableQuery#reobserve method, fixing a regression that prevented removal of variables.
    @​benjamn in #​9741

  • Preserve previousData even when different query or client provided to useQuery, instead of resetting previousData to undefined in those cases, matching behavior prior to v3.6.0.
    @​benjamn in #​9734

  • Fix bug where onCompleted() and onError() are stale for useMutation().
    @​charle692 in #​9740

  • Limit scope of DeepMerger object reuse, and avoid using Object.isFrozen, which can introduce differences between development and production if objects that were frozen using Object.freeze in development are left unfrozen in production.
    @​benjamn in #​9742

  • Properly merge variables from original useLazyQuery(query, { variables }) with variables passed to execution function.
    @​benjamn in #​9758

v3.6.4

Compare Source

Bug Fixes
  • Guarantee Concast cleanup without Observable cancelled prematurely rejection, potentially solving long-standing issues involving that error.
    @​benjamn in #​9701

  • Ensure useSubscription subscriptions are properly restarted after unmounting/remounting by React 18 in <StrictMode>.
    @​kazekyo in #​9707

Improvements
  • Internalize useSyncExternalStore shim, for more control than use-sync-external-store provides, fixing some React Native issues.
    @​benjamn in #​9675 and #​9709

  • Provide @apollo/client/**/*.cjs.native.js versions of every @apollo/client/**/*.cjs bundle (including dependencies ts-invariant and zen-observable-ts) to help React Native's Metro bundler automatically resolve CommonJS entry point modules. These changes should render unnecessary the advice we gave in the v3.5.4 section below about metro.config.js.
    @​benjamn in #​9716

  • Handle falsy incoming data more gracefully in offetLimitPagination().merge function.
    @​shobhitsharma in #​9705

v3.6.3

Compare Source

Bug Fixes

v3.6.2

Compare Source

Bug Fixes
  • Pass getServerSnapshot function to useSyncExternalStore in addition to getSnapshot, though the two functions behave identically. This change should fix/unbreak React 18 server rendering.
    @​hungphongbk in #​9652
Improvements

v3.6.1

Compare Source

Improvements
  • The client options (variables, context, etc.) used for mutation calls are now available as the second argument to the onCompleted and onError callback functions.
    @​MrDoomBringer in #​10052

v3.6.0

Compare Source

Potentially disruptive changes
  • Calling fetchMore for queries using the cache-and-network or network-only fetch policies will no longer trigger additional network requests when cache results are complete. Instead, those complete cache results will be delivered as if using the cache-first fetch policy.
    @​benjamn in #​9504

  • Reimplement useQuery and useLazyQuery to use the proposed useSyncExternalStore API from React 18.
    @​brainkim and @​benjamn in #​8785 and #​9596

  • Fixed bug where the useLazyQuery execution function would always use the refetch method of ObservableQuery, instead of properly reapplying the current fetchPolicy using the reobserve method.
    @​benjamn in #​9564

    Since this reobserve method is useful and used internally, we have now exposed it as use[Lazy]Query(...).reobserve (which optionally takes a Partial<WatchQueryOptions> of new options), to supplement the existing refetch method. Note that reobserve permanently updates the variables and other options of the ObservableQuery, unlike refetch({ ...variables }), which does not save those variables.

  • The internal use of options.fetchBlockingPromise by useQuery and useLazyQuery may slightly delay the delivery of network results, compared to previous versions of Apollo Client. Since network results are already delivered asynchronously, these timing differences should not be disruptive in most cases. Nevertheless, please open an issue if the timing differences are a problem for you (and you have no easy workaround).
    @​benjamn in #​9599

React 18

In both its peerDependencies and its internal implementation, Apollo Client v3.6 should no longer prevent you from updating to React 18 in your applications.

Internally, we have refactored useQuery and useLazyQuery to be implemented in terms of React's new (shimmable) useSyncExternalStore hook, demonstrating Apollo Client can serve as an external store with a referentially stable, synchronous API, as needed by React.

As part of this refactoring, we also improved the behavior of useQuery and useLazyQuery when used in <React.StrictMode>, which double-renders components in development. While this double-rendering always results in calling useQuery twice, forcing Apollo Client to create and then discard an unnecessary ObservableQuery object, we now have multiple defenses in place against executing any network queries for the unused ObservableQuery objects.

In upcoming v3.6.x and v3.7 (beta) releases, we will be completely overhauling our server-side rendering utilities (getDataFromTree et al.), and introducing suspenseful versions of our hooks, to take full advantage of the new patterns React 18+ enables for data management libraries like Apollo Client.

Improvements

v3.5.10

Compare Source

Improvements
  • Add GraphQLWsLink in @apollo/client/link/subscriptions. This link is similar to the existing WebSocketLink in @apollo/client/link/ws, but uses the newer graphql-ws package and protocol instead of the older subscriptions-transport-ws implementation.
    @​glasser in #​9369

    Note from @​benjamn: since GraphQLWsLink is new functionality, we would normally wait for the next minor version (v3.6), but we were asked to expedite this release. These changes are strictly additive/opt-in/backwards-compatible, so shipping them in a patch release (3.5.10) seems safe, if unusual.

v3.5.9

Compare Source

Improvements
  • Interpret keyFields: [...] and keyArgs: [...] configurations in InMemoryCache type/field policies as ReadonlyArrays, since they are never mutated internally.
    @​julienfouilhe in #​9339

  • Avoid declaring a global type for the __DEV__ constant, to avoid conflict with other such global declarations.
    @​benjamn in #​9386

Bug Fixes

v3.5.8

Compare Source

Bug Fixes
Bug Fixes (by @​brainkim in #​9328)
  • Fix refetch() not being called when skip is true.
  • Fix the promise returned from the useLazyQuery() execution function having stale variables.
  • Fix the promise returned from the useLazyQuery() execution function not rejecting when a query errors.

v3.5.7

Compare Source

Bug Fixes

v3.5.6

Compare Source

Bug Fixes (by @​brainkim in #​9144)
  • Restores old behavior where the callback passed to useMutation() is constant.
  • Fix useMutation() callbacks having stale closures.
  • Fix useQuery() variables being out of date.

v3.5.5

Compare Source

Bug Fixes
  • Remove printer: Printer positional parameter from publicly-exported selectHttpOptionsAndBody function, whose addition in #​8699 was a breaking change (starting in Apollo Client 3.5.0) for direct consumers of selectHttpOptionsAndBody.
    @​benjamn in #​9103

v3.5.4

Compare Source

Notices

⚠️ The following advice about metro.config.js should no longer be necessary, as of Apollo Client v3.6.4.

  • [Relevant if you use Apollo Client with React Native] Since Apollo Client v3.5.0, CommonJS bundles provided by @apollo/client use a .cjs file extension rather than .cjs.js, so Node.js won't interpret them as ECMAScript modules. While this change should be an implementation detail, it may cause problems for the Metro bundler used by React Native, whose resolver.sourceExts configuration does not include the cjs extension by default.

    As a workaround until this issue is resolved, you can configure Metro to understand the .cjs file extension by creating a metro.config.js file in the root of your React Native project:

    // NOTE: No longer necessary in @&#8203;apollo/[email protected]!
    const { getDefaultConfig } = require("metro-config");
    const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues();
    exports.resolver = {
      ...defaultResolver,
      sourceExts: [
        ...defaultResolver.sourceExts,
        "cjs",
      ],
    };
    
Improvements
  • Restore the ability to pass onError() and onCompleted() to the mutation execution function.
    @​brainkim in #​9076

  • Work around webpack 5 errors of the form The request 'ts-invariant/process' failed to resolve only because it was resolved as fully specified by ensuring import ... from 'ts-invariant/process' is internally written to import ... from 'ts-invariant/process/index.js'.
    @​benjamn in #​9083

v3.5.3

Compare Source

  • Avoid rewriting non-relative imported module specifiers in config/rewriteModuleIds.ts script, thereby allowing bundlers to resolve those imports as they see fit.
    @​benjamn in #​9073

  • Ensure only current file is matched when running VSCode debugger.
    @​eps1lon in #​9050

v3.5.2

Compare Source

v3.5.1

Compare Source

Improvements
  • Add GraphQLWsLink in @apollo/client/link/subscriptions. This link is similar to the existing WebSocketLink in @apollo/client/link/ws, but uses the newer graphql-ws package and protocol instead of the older subscriptions-transport-ws implementation.
    @​glasser in #​9369

    Note from @​benjamn: since GraphQLWsLink is new functionality, we would normally wait for the next minor version (v3.6), but we were asked to expedite this release. These changes are strictly additive/opt-in/backwards-compatible, so shipping them in a patch release (3.5.10) seems safe, if unusual.

v3.5.0

Compare Source

Improvements
  • Add updateQuery and updateFragment methods to ApolloCache, simplifying common readQuery/writeQuery cache update patterns.
    @​wassim-k in #​8382

  • Field directives and their arguments can now be included along with field argument names when using field policy keyArgs: [...] notation. For example, if you have a Query.feed field that takes an argument called type and uses a @connection(key:...) directive to keep feed data from different queries separate within the cache, you might configure both using the following InMemoryCache field policy:

    new InMemoryCache({
      typePolicies: {
        Query: {
          fields: {
            feed: {
              keyArgs: ["type", "@&#8203;connection", ["key"]],
            },
          },
        },
      },
    })
    

    @​benjamn in #​8678

  • Report single MissingFieldError instead of a potentially very large MissingFieldError[] array for incomplete cache reads, improving performance and memory usage.
    @​benjamn in #​8734

  • When writing results into InMemoryCache, each written object is now identified using policies.identify after traversing the fields of the object (rather than before), simplifying identification and reducing duplicate work. If you have custom keyFields functions, they still receive the raw result object as their first parameter, but the KeyFieldsContext parameter now provides context.storeObject (the StoreObject just processed by processSelectionSet) and context.readField (a helper function for reading fields from context.storeObject and any References it might contain, similar to readField for read, merge, and cache.modify functions).
    @​benjamn in #​8996

  • Ensure cache.identify never throws when primary key fields are missing, and include the source object in the error message when keyFields processing fails.
    @​benjamn in #​8679

  • The HttpLink constructor now accepts an optional print function that can be used to customize how GraphQL DocumentNode objects are transformed back into strings before they are sent over the network.
    @​sarahgp in #​8699

  • Make @apollo/client/testing a fully-fledged, independent entry point, instead of re-exporting @apollo/client/utilities/testing (which was never an entry point and no longer exists).
    @​benjamn in #​8769

  • A new nested entry point called @apollo/client/testing/core has been created. Importing from this entry point instead of @apollo/client/testing excludes any React-related dependencies.
    @​wassim-k in #​8687

  • Make cache.batch return the result of calling the options.update function.
    @​benjamn in #​8696

  • The NetworkError and ErrorResponse types have been changed to align more closely.
    @​korywka in #​8424

  • Include graphql@16 in peer deps.
    @​brainkim in #​8997

  • Update zen-observable-ts to eliminate transitive dependency on @types/zen-observable.
    @​benjamn in #​8695

React Refactoring
Improvements (due to @​brainkim in #​8875):
  • The useLazyQuery function now returns a promise with the result.
  • The useMutation result now exposes a method which can be reset.
Bug Fixes (due to @​brainkim in #​8596):
  • The useQuery and useLazyQuery hooks will now have ObservableQuery methods defined consistently.
  • Calling useLazyQuery methods like startPolling will start the query.
  • Calling the useLazyQuery execution function will now behave more like refetch. previousData will be preserved.
  • standby fetchPolicies will now act like skip: true more consistently.
  • Calling refetch on a skipped query will have no effect (issue #​8270).
  • Prevent onError and onCompleted functions from firing continuously, and improving their polling behavior.

v3.4.17

Compare Source

Improvements

v3.4.16

Compare Source

Improvements
  • Prevent webpack from misresolving the graphql package as the local @apollo/client/utilities/globals/graphql.js module when module.exports.resolve.preferRelative is enabled in webpack.config.js.

    Note: if you encounter strange module resolution errors like export 'isType' (imported as 'isType') was not found in 'graphql' (possible exports: removeTemporaryGlobals) please try removing preferRelative: true from your webpack.config.js file, or find a way to disable that resolution behavior for packages within node_modules.

    @​benjamn in #​8862

  • Avoid importing isType from the graphql package internally, to prevent bundlers from including as much as 3.4kB of unnecessary code.
    @​benjamn in #​8891

  • Make client.resetStore and client.clearStore pass appropriate discardWatches option to cache.reset.
    @​benjamn in #​8873

v3.4.15

Compare Source

Bug Fixes

v3.4.14

Compare Source

Bug Fixes

v3.4.13

Compare Source

Bug Fixes

v3.4.12

Compare Source

Bug Fixes
  • Improve handling of falsy existing and/or incoming parameters in relayStylePagination field policy helper function.
    @​bubba and @​benjamn in #​8733

  • Associate Apollo context with React.createContext (instead of using a local WeakMap) again, so multiple copies of @apollo/client (uncommon) can share the same context.
    @​benjamn in #​8798

v3.4.11

Compare Source

Bug Fixes
  • Fix Vite tree-shaking by calling the checkDEV() function (at least once) in the module that exports it, @apollo/client/utilities/globals/index.ts.
    @​benjamn in #​8767
Improvements
Documentation

v3.4.10

Compare Source

Improvements
  • Warn when calling refetch({ variables }) instead of refetch(variables), except for queries that declare a variable named $variables (uncommon).
    @​benjamn in #​8702
Bug Fixes

v3.4.9

Compare Source

Bug Fixes
  • Fix unhandled Promise rejection warnings/errors whose message is Observable cancelled prematurely.
    @​benjamn in #​8676

  • Enforce that __DEV__ is polyfilled by every @apollo/client/* entry point that uses it. This build step considers not only explicit __DEV__ usage but also __DEV__ references injected near invariant(...) and new InvariantError(...) expressions.
    @​benjamn in #​8689

v3.4.8

Compare Source

Bug Fixes
  • Fix error thrown by nested keyFields: ["a", ["b", "c"], "d"] type policies when writing results into the cache where any of the key fields (.a, .a.b, .a.c, or .d) have been renamed by query field alias syntax.
    @​benjamn in #​8643

  • Fix regression from PR #​8422 (first released in @apollo/[email protected]) that caused result.data to be set to undefined in some cases after ObservableQuery#getCurrentResult reads an incomplete result from the cache.
    @​benjamn in #​8642

v3.4.7

Compare Source

Bug Fixes

v3.4.6

Compare Source

Improvements
  • Reevaluate window.fetch each time HttpLink uses it, if not configured using options.fetch. This change enables a variety of strategies for instrumenting window.fetch, without requiring those strategies to run before @apollo/client/link/http is first imported.
    @​benjamn in #​8603

  • Clarify mutation fetchPolicy options ("network-only" or "no-cache") using MutationFetchPolicy union type.
    @​benjamn in #​8602

Bug Fixes
  • Restore full @apollo/client/apollo-client.cjs.js CommonJS bundle for older bundlers.

    Note that Node.js and CommonJS bundlers typically use the bundles specified by "main" fields in our generated package.json files, which are all independent and non-overlapping CommonJS modules. However, apollo-client.cjs.js is just one big bundle, so mixing imports of apollo-client.cjs.js with the other CommonJS bundles is discouraged, as it could trigger the dual package hazard. In other words, please don't start using apollo-client.cjs.js if you're not already.

    @​benjamn in #​8592

  • Log MissingFieldErrors in ObservableQuery#getCurrentResult using invariant.debug, rather than reporting them via result.error.
    @​benjamn in #​8604

v3.4.5

Compare Source

Bug Fixes
  • Fix double registration bug for mutation refetchQueries specified using legacy one-time refetchQueries: [{ query, variables }] style. Though the bug is fixed, we recommend using refetchQueries: [query] instead (when possible) to refetch an existing query using its DocumentNode, rather than creating, executing, and then deleting a new query, as the legacy { query, variables } style unfortunately does.
    @​benjamn in #​8586

  • Fix useQuery/useLazyQuery stalling when clients or queries change.
    @​brainkim in #​8589

v3.4.4

Compare Source

Bug Fixes

v3.4.3

Compare Source

Bug Fixes

v3.4.2

Compare Source

Bug Fixes
  • Use more default type parameters for mutation-related types in react/types/types.ts, to provide smoother backwards compatibility for code using those types explicitly.
    @​benjamn in #​8573

v3.4.1

Compare Source

Improvements

v3.4.0

Compare Source

New documentation
Improvements
  • InMemoryCache now guarantees that any two result objects returned by the cache (from readQuery, readFragment, etc.) will be referentially equal (===) if they are deeply equal. Previously, === equality was often achievable for results for the same query, on a best-effort basis. Now, equivalent result objects will be automatically shared among the result trees of completely different queries. This guarantee is important for taking full advantage of optimistic updates that correctly guess the final data, and for "pure" UI components that can skip re-rendering when their input data are unchanged.
    @​benjamn in #​7439

  • Mutations now accept an optional callback function called onQueryUpdated, which will be passed the ObservableQuery and Cache.DiffResult objects for any queries invalidated by cache writes performed by the mutation's final update function. Using onQueryUpdated, you can override the default FetchPolicy of the query, by (for example) calling ObservableQuery methods like refetch to force a network request. This automatic detection of invalidated queries provides an alternative to manually enumerating queries using the refetchQueries mutation option. Also, if you return a Promise from onQueryUpdated, the mutation will automatically await that Promise, rendering the awaitRefetchQueries option unnecessary.
    @​benjamn in #​7827

  • Support client.refetchQueries as an imperative way to refetch queries, without having to pass options.refetchQueries to client.mutate.
    @​dannycochran in #​7431

  • Improve standalone client.refetchQueries method to support automatic detection of queries needing to be refetched.
    @​benjamn in #​8000

  • Fix remaining barriers to loading @apollo/client/core as native ECMAScript modules from a CDN like esm.run. Importing @apollo/client from a CDN will become possible once we move all React-related dependencies into @apollo/client/react in Apollo Client 4.
    @​benjamn in #​8266

  • InMemoryCache supports a new method called batch, which is similar to performTransaction but takes named options rather than positional parameters. One of these named options is an onDirty(watch, diff) callback, which can be used to determine which watched queries were invalidated by the batch operation.
    @​benjamn in #​7819

  • Allow merge: true field policy to merge Reference objects with non-normalized objects, and vice-versa.
    @​benjamn in #​7778

  • Allow identical subscriptions to be deduplicated by default, like queries.
    @​jkossis in #​6910

  • Always use POST request when falling back to sending full query with @apollo/client/link/persisted-queries.
    @​rieset in #​7456

  • The FetchMoreQueryOptions type now takes two instead of three type parameters (<TVariables, TData>), thanks to using Partial<TVariables> instead of K extends typeof TVariables and Pick<TVariables, K>.
    @​ArnaudBarre in #​7476

  • Pass variables and context to a mutation's update function. Note: The type of the update function is now named MutationUpdaterFunction rather than MutationUpdaterFn, since the older type was broken beyond repair. If you are using MutationUpdaterFn in your own code, please use MutationUpdaterFunction instead.
    @​jcreighton in #​7902

  • A resultCacheMaxSize option may be passed to the InMemoryCache constructor to limit the number of result objects that will be retained in memory (to speed up repeated reads), and calling cache.reset() now releases all such memory.
    @​SofianHn in #​8107

  • Fully remove result cache entries from LRU dependency system when the corresponding entities are removed from InMemoryCache by eviction, or by any other means.
    @​sofianhn and @​benjamn in #​8147

  • Expose missing field errors in results.
    @​brainkim in #​8262

  • Add expected/received variables to No more mocked responses... error messages generated by MockLink.
    @​markneub in #​8340

  • The InMemoryCache version of the cache.gc method now supports additional options for removing non-essential (recomputable) result caching data.
    @​benjamn in #​8421

  • Suppress noisy Missing cache result fields... warnings by default unless setLogVerbosity("debug") called.
    @​benjamn in #​8489

  • Improve interaction between React hooks and React Fast Refresh in development.
    @​andreialecu in #​7952

Potentially disruptive changes
  • To avoid retaining sensitive information from mutation root field arguments, Apollo Client v3.4 automatically clears any ROOT_MUTATION fields from the cache after each mutation finishes. If you need this information to remain in the cache, you can prevent the removal by passing the keepRootFields: true option to client.mutate. ROOT_MUTATION result data are also passed to the mutation update function, so we recommend obtaining the results that way, rather than using keepRootFields: true, if possible.
    @​benjamn in #​8280

  • Internally, Apollo Client now controls the execution of development-only code using the __DEV__ global variable, rather than process.env.NODE_ENV. While this change should not cause any visible differences in behavior, it will increase your minified+gzip bundle size by more than 3.5kB, unless you configure your minifier to replace __DEV__ with a true or false constant, the same way you already replace process.env.NODE_ENV with a string literal like "development" or "production". For an example of configuring a Create React App project without ejecting, see this pull request for our React Apollo reproduction template.
    @​benjamn in #​8347

  • Internally, Apollo Client now uses namespace syntax (e.g. import * as React from "react") for imports whose types are re-exported (and thus may appear in .d.ts files). This change should remove any need to configure esModuleInterop or allowSyntheticDefaultImports in tsconfig.json, but might require updating bundler configurations that specify named exports of the react and prop-types packages, to include exports like createContext and createElement (example).
    @​devrelm in #​7742

  • Respect no-cache fetch policy (by not reading any data from the cache) for loading: true results triggered by notifyOnNetworkStatusChange: true.
    @​jcreighton in #​7761

  • The TypeScript return types of the getLastResult and getLastError methods of ObservableQuery now correctly include the possibility of returning undefined. If you happen to be calling either of these methods directly, you may need to adjust how the calling code handles the methods' possibly-undefined results.
    @​benjamn in #​8394

  • Log non-fatal invariant.error message when fields are missing from result objects written into `InMemory


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 is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • [ ] If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by Mend Renovate. View repository job log here.

renovate[bot] avatar Oct 25 '20 12:10 renovate[bot]