Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Latest commit

 

History

History
646 lines (358 loc) · 25 KB

CHANGELOG.md

File metadata and controls

646 lines (358 loc) · 25 KB

Changelog

10.3.3

Patch Changes

10.3.2

Patch Changes

10.3.1

Patch Changes

10.3.0

Minor Changes

Patch Changes

10.2.1

Patch Changes

10.2.0

Minor Changes

Patch Changes

10.1.3

Patch Changes

10.1.2

Patch Changes

10.1.1

Patch Changes

10.1.0

Minor Changes

  • #2708 a224c11d7 Thanks @markbann! - - upgrade @apollo/client to the latest (3.8.10)
    • set connectToDevTools to false by default
    • allow consumers to pass defaultOptions into the options of

10.0.3

Patch Changes

10.0.2

Patch Changes

10.0.1

Patch Changes

10.0.0

Major Changes

  • #2302 96a5023e7 Thanks @vsumner! - Update Apollo from v2 to v3. Replace dependencies on apollo-client, apollo-cache-inmemory, apollo-link, @apollo/react-common and @apollo/react-hooks with @apollo/client. When updating to Apollo v3, @shopify/graphql-persisted, @shopify/graphql-testing, @shopify/react-graphql and @shopify/react-graphql-universal-provider should all be updated at the same time, and you should follow the Apollo3 migration guide, and note any breaking changes in the Apollo3 changelog, paying particular attention to changes around import paths and cache behavior.

    Update the return type of useMutation to FetchResult to align it with what the Apollo client returns. The data key that gets returned from calling the function returned by useMutation may now be undefined in addition to possibly being null.

    We have tested SSR behaviour in the Shopify Admin (aka web) which uses a single render pass. We expect everything to work in SSR environments that use multiple passes of @shopify/react-html too, however be aware that multi-pass has not been exhaustively proven in production.

    Apollo Change: ApolloClient.{query,mutate,etc} now have built-in type inference. We suggest enabling graphql-typescript-definitions's --export-format=documentWithTypedDocumentNode option to generate .graphql.d.ts files that produce types that Apollo's own client and hooks can take advantage of.

    Apollo Change: useQuery().errors, useMutation().errors and other error arrays are now readonly arrays (i.e. readonly GraphQLError[]). Previously they returned mutable arrays (i.e. GraphQLError[]).

    Apollo Change: The message of ApolloError Error instances are no longer prefixed with GraphQL Error: or Network Error:.

    Apollo Change: The value of a complete but empty data payload is now undefined, in Apollo 2 it was an empty object (i.e. {}). Complete but empty data can occur if you have a query that uses the @include directive that results in you requesting an empty query, for instance query PetQuery($includePets: Boolean! = false) { pets @include(if: $includePets) { name } }.

    Apollo Change: In Apollo 2 making a query with the fetchPolicy: 'cache-and-network' option also seemed to imply setting notifyOnNetworkStatusChange: true, and thus if you called fetchMore on that query then the loading state would be updated. In Apollo 3 this side-effect is no longer present. If you want a query to update its loading state after calling fetchMore then you must explicitly set the notifyOnNetworkStatusChange: true option.

Patch Changes

9.3.2

Patch Changes

9.3.1

Patch Changes

9.3.0

Minor Changes

  • #2409 0bff6fad7 Thanks @BPScott! - Update types to account changes in TypeScript 4.8 and 4.9. Propogate contstraints on generic types and update type usage relating to Window and Navigator. Technically this makes some types stricter, as attempting to pass null|undefined into certain functions is now disallowed by TypeScript, but these were never expected runtime values in the first place.

  • #2409 0bff6fad7 Thanks @BPScott! - extends {} has been added to the Data / Variables / DeepPartial generic types on the useQuery and useGraphQLDocument hooks, the createAsyncQuery,createAsyncQueryComponent functions and the Query component. If you use typescript's strictNullChecks option and define functions that contain generics that are then passed into any of these functions you may need add an extends {} to your code as well, per the typescript 4.8 changelog. For example, replace <Data> with <Data extends {}>.

Patch Changes

9.2.3

Patch Changes

9.2.2

Patch Changes

9.2.1

Patch Changes

9.2.0

Minor Changes

Patch Changes

9.1.0

Minor Changes

Patch Changes

9.0.0

Major Changes

  • #2363 6c4a181ca Thanks @ryanwilsonperkin! - Use loading=true from server-side-rendered queries when ssr is set to false

    This is for consistency with the way that Apollo does things and to ensure that we avoid hydration mismatch errors when the client will initially render with true while the server rendered with false.

    Functionally, this means that if you previously relied on loading=false in your component code as an indication of server side rendering with an ssr false value, you should instead make use of the "called" value to determine whether or not it was called (this will still be false).

8.0.4

Patch Changes

8.0.3

Patch Changes

8.0.2

Patch Changes

  • #2320 f70a02825 Thanks @vsumner! - Update useQuery refetch so that it can recover from a network error. Add more tests.

8.0.1 - 2022-06-08

  • No updates. Transitive dependency bump.

8.0.0 - 2022-05-19

Breaking Change

  • Drop support for node 12 and Safari 10, 11 and 12. Remove wildcard export in exports field. [#2277]

7.2.0 - 2022-04-25

Changed

  • Fix NetworkStatus type export. [#2216]

7.1.25 - 2022-03-15

  • No updates. Transitive dependency bump.

7.1.24 - 2022-03-09

Changed

  • Correct wildcard export to ./* [#2209]

Added

  • Add NetworkStatus type export. [#2196]

7.1.23 - 2022-03-07

  • No updates. Transitive dependency bump.

7.1.22 - 2022-02-28

  • No updates. Transitive dependency bump.

7.1.21 - 2022-02-25

Changed

  • Use ./* instead of ./ in package.json exports to fix deprecation warning. [#2184]

7.1.20 - 2022-02-14

Changed

  • Reduce usage of @shopify/useful-types by using built-in types. [#2163]

7.1.19 - 2022-02-09

  • No updates. Transitive dependency bump.

7.1.18 - 2022-02-01

Changed

  • Rerelease after failed publish. No code changes.

7.1.17 - 2022-02-01

Changed

  • Reorder exports map to prioritize the esnext condition. [#2148]
  • Update Loom build config. [#2150]

7.1.16 - 2022-01-19

  • No updates. Transitive dependency bump.

7.1.15 - 2021-12-07

  • No updates. Transitive dependency bump.

7.1.14 - 2021-12-01

  • No updates. Transitive dependency bump.

7.1.13 - 2021-11-23

  • No updates. Transitive dependency bump.

7.1.12 - 2021-11-22

Changed

  • Fixed babel helpers file being generated with incorrect filename in esm build. [#2082]

7.1.11 - 2021-11-01

  • No updates. Transitive dependency bump.

7.1.10 - 2021-10-08

Changed

  • Use the named import of ApolloClient [#2052]

7.1.9 - 2021-09-24

Changed

  • Migrate from sewing-kit-next to loom for building - package build output remains identical. [#2039]

7.1.8 - 2021-09-14

  • No updates. Transitive dependency bump.

7.1.7 - 2021-09-14

Changed

  • Enable type checking in tests and fix type errors. [#2034]
  • Fixed an issue with the SSR link when an error is thrown. [#2036]

7.1.6 - 2021-08-30

  • No updates. Transitive dependency bump.

7.1.5 - 2021-08-26

  • No updates. Transitive dependency bump.

7.1.4 - 2021-08-24

Changed

  • Added file exclusion for tests to package.json. [#2005]

7.1.3 - 2021-08-13

Changed

  • Updated build tooling, types are now compiled with TypeScript 4.3. [#1997]

7.1.2 - 2021-08-04

Changed

  • Ensure tsconfig.tsbuildinfo file is not uploaded to the npm registry. [#1982]

7.1.1 - 2021-08-03

Changed

  • Update to latest sewing-kit-next for build. Update types/typesVersions fields to point directly into the build folder [#1980]

7.1.0 - 2021-07-13

Added

  • Officially supports React 17.x 1969

Fixed

  • Changes to tests for React-17 compatibility in dev. #1957

7.0.2 - 2021-06-29

  • No updates. Transitive dependency bump.

7.0.0 - 2021-05-21

Breaking Change

  • Update minimum supported node version to 12.14.0. Add engines field to help enforce usage of this version. #1906

6.3.6 - 2021-04-13

Changed

  • Removed dependency on tslib, as we no-longer compile with tsc. #1829

6.3.1 - 2021-03-03

Fixed

  • Updated multi-build outputs to include mandatory extensions to fix "Module not found" issues reported by ESM supported bundlers #1759

6.2.0 - 2020-12-18

Added

  • Add new build outputs (CommonJS, ESM, esnext, Node) for greater tree-shakability #1698

6.1.18 - 2020-10-20

  • Added tslib@^1.14.1 in the list of dependencies. #1657

6.1.13 - 2020-06-24

Changed

  • Replace Apollo declarative Query component with useQuery hook (#1519)

6.1.9 - 2020-05-14

Changed

  • Improve typings for usePrefetch to accept a fetchPolicy in options (#1437)

6.1.0 - 2020-03-13

  • Update dependencies from react-apollo to @apollo/react-common, @apollo/react-components, and @apollo/react-hooks (#1321)

6.0.9 - 2020-02-27

Changed

  • Improve typings for useBackgroundQuery by allowing the fetchPolicy option. (#1293).

6.0.7 - 2020-01-24

Fixed

  • Fixed when using no-cache fetch policy and data is undefined (#1244).

6.0.0 - 2019-10-30

Added

  • Added a createAsyncQuery function that can create queries that are only loaded when executed (#1153).

Changed

  • Improved typings to avoid cases where TypeScript allowed variables to be omitted incorrectly. These typings now require [email protected] (#1153).

5.2.0 - 2019-10-07

Changed

  • Changed some type imports to fix type errors when using [email protected]. Projects that use 2.x may have some typing issues as changes were made to react-apollo that make it impossible to support the types for both versions. (#1087)

5.1.0 - 2019-09-05

Added

  • Adds support for ssr=false in useQuery (951)

5.0.9 - 2019-08-29

Fixed

  • Fix SSR when using cache-and-network fetch policy with useQuery (#928)

5.0.0 - 2019-08-20

Changed

  • Removed the createGraphQLClient/ ApolloClient exports, and instead export the tools to build an operation-tracking link (createSsrExtractableLink/ SsrExtractableLink). Projects using the createGraphQLClient utility to create a client with a resolve method can instead use the link and SsrExtractableLink#resolveAll() directly. (#878)

4.0.4 - 2019-08-13

Fixed

  • Add missing dependencies (832)

4.0.3 - 2019-07-07

Added

  • Adds SSR extractable link to support GraphQL Self-serialization (810)

4.0.2 - 2019-07-05

Fixed

  • Using useQuery with fetchPolicy set to no-cache no longer runs during server renders (previously, using such a query would cause extract to loop indefinitely) (#770)

4.0.1 - 2019-07-04

Fixed

  • Fixed an issue where useBackgroundQuery would not unsubscribe when options change

4.0.0 - 2019-07-03

Changed

  • Updated to depend on the 3.x version of @shopify/react-async (#762)

3.4.1 - 2019-06-12

Fixed

  • useQuery now returns undefined instead of an empty object {} when there's no data (#751)
  • Fix re-wrapping query result under current key when using no-cache fetch policy (as a result of leaking implementation details, exposing ref object intead of what it is representing)

3.4.0 - 2019-05-31

3.3.6 - 2019-05-31

Fixed

  • Queries are no longer waited on during server render when skip is true (#726)
  • The result of calling useQuery is now referentially stable when variables stay deep-equal between calls (previously, using a different object with the same values would change the result) (#726).

3.3.5 - 2019-05-29

Fixed

  • Fixed an issue where useQuery was watching a query even when skip was true (#721)

3.3.4 - 2019-05-23

Fixed

  • Fixed an issue where useQuery with an async query component would not cause the query’s bundle to be included in the initial HTML.

3.3.3 - 2019-05-22

Fixed

  • Components created with createAsyncQueryComponent now call their children prop with a loading state while the query is still being fetched (#707)

3.3.1 - 2019-05-15

  • Fixed an issue where useQuery would not be performed during server renders (#702)

3.2.0 - 2019-04-25

  • Added useQuery and useApolloClient hooks (#663)

3.1.0 - 2019-04-17

Added

  • Added useMutation hook (#653)

3.0.0 - 2019-04-08

This library now requires React 16.8 because of changes to @shopify/react-effect.

1.3.0 - 2019-02-25

Added

  • You can now import GraphQLData and GraphQLVariables to extract the data or variable types from the component returned by createAsyncQueryComponent (#529)

Changed

  • AsyncQueryComponentType now conforms to graphql-typed’s GraphQLOperation interface (#529)

1.2.0 - 2019-02-15

Added

  • createAsyncQueryComponent now accepts a defer property that dictates whether that component should wait until mount or idle to start loading the query (#517)
  • The component returned from createAsyncQueryComponent and its static Preload, Prefetch, and KeepFresh components all accept an async prop that is an object with an optional defer property, which controls the way loading is done for just that element (#517)

1.1.0 - 2019-02-10

Added

  • Added some additional generic types for extracting default from queries.

1.0.1 - 2019-02-10

  • Fixed some broken API choices

1.0.0 - 2019-02-07

  • Initial release