Skip to content

Commit

Permalink
Temporarily revert useSyncExternalStore changes (#8785).
Browse files Browse the repository at this point in the history
This reverts commit 7f0d459 and
follow-up commit 5328dae (move
onCompleted and onError to the snapshot function).

Because there have been several merges on release-3.6 since those
commits, and some of those merges involve useSyncExternalStore-related
code, I was not able to obtain a good state simply by reverting the
commits and manually resolving the conflicts.

Instead, I removed the commits during an interactive Git rebase, using
--rebase-merges to replay/recreate merge commits (rather than dropping
them, as rebase usually does). Once I verified tests were passing after
this rebase, I constructed the current commit from the difference
between the branches, which should allow us to keep the current history
from before the rebase, with this commit achieving the same final state
as after the rebase.

We will cherry-pick the inverse of this commit onto a new release-3.7
branch soon, so we can continue releasing v3.6 betas without the
risk/complexity introduced by useSyncExternalStore. We are still
committed to implementing that API and fully supporting React 18, with
prerelease availability continuing in the v3.7 betas.
  • Loading branch information
benjamn committed Feb 3, 2022
1 parent cefd24c commit 00ac40f
Show file tree
Hide file tree
Showing 31 changed files with 910 additions and 444 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
- Add `GraphQLWsLink` in `@apollo/client/ws/subscriptions`. This link is similar to the existing `WebSocketLink` in `@apollo/client/link/ws`, but uses the newer [`graphql-ws`](https://www.npmjs.com/package/graphql-ws) package and protocol instead of the older `subscriptions-transport-ws` implementation.
[@glasser](https://github.com/glasser) in [#9369](https://github.com/apollographql/apollo-client/pull/9369)

## Apollo Client 3.5.8 (2022-01-24)

### Bug Fixes

- Fix the type of the `called` property returned by `useQuery()` and `useLazyQuery()`. <br/>
[@sztadii](https://github.com/sztadii) in [#9304](https://github.com/apollographql/apollo-client/pull/9304)

### Bug Fixes (by [@brainkim](https://github.com/brainkim) in [#9328](https://github.com/apollographql/apollo-client/pull/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.

## Apollo Client 3.5.7 (2022-01-10)

### Bug Fixes
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"types": "cd .. && typedoc --json ./docs/src/gatsby-theme-apollo-docs/docs.json ./src/index.ts"
},
"dependencies": {
"gatsby": "3.0.0",
"gatsby-theme-apollo-docs": "5.3.12",
"gatsby": "3.14.6",
"gatsby-theme-apollo-docs": "6.0.0",
"react": "16.14.0",
"react-dom": "16.14.0"
},
"devDependencies": {
"typedoc": "0.22.10",
"typedoc": "0.22.11",
"typescript": "4.4.4"
}
}
2 changes: 1 addition & 1 deletion docs/source/caching/cache-field-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ query BookWithAuthorLanguages {
}
```

In this case, the `favoriteBook.authors` field is no longer just a single object, but an array of authors, so it's even more imporant to define a custom `merge` function to prevent loss of data by replacement:
In this case, the `favoriteBook.authors` field is no longer just a single object, but an array of authors, so it's even more important to define a custom `merge` function to prevent loss of data by replacement:

```ts
const cache = new InMemoryCache({
Expand Down
Loading

0 comments on commit 00ac40f

Please sign in to comment.