Skip to content

Commit

Permalink
Merge branch 'main' into pr/tests-using
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Sep 7, 2023
2 parents dd24ff7 + 7c90f9a commit 4a49723
Show file tree
Hide file tree
Showing 241 changed files with 34,025 additions and 29,781 deletions.
5 changes: 0 additions & 5 deletions .changeset/fast-candles-trade.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fifty-suits-drum.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/orange-balloons-prove.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/tall-otters-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

For `invariant.log` etc., error arguments are now serialized correctly in the link to the error page.
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
- run: npm ci
- run: npm run lint

Formatting:
docker:
- image: cimg/node:20.5.1
steps:
- checkout
- run: npm ci
- run: npm run check:format

Tests:
docker:
- image: cimg/node:20.5.1
Expand Down Expand Up @@ -83,6 +91,7 @@ workflows:
jobs:
# - Filesize
- Tests
- Formatting
- Lint
- BuildTarball
- IntegrationTests:
Expand Down
5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@
"message": "Please only use the namespace import syntax (`import * as React from 'react'`) for React imports!"
}
],
"import/consistent-type-specifier-style": [
"error",
"prefer-top-level"
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import/extensions": [
"error",
"always",
Expand Down
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ f7890ae96a3ba900d3de9bf8b23254bcfba18a25
0cb68364f2c3828badde8c74de44e9c1864fb6d4
# Format `react` folder, upgrade to prettier 3.0 (#11111)
ba3e7d9fa7d46e4c636148bbf01552833db0ceda
# Format all non-docs files with prettier (#11170)
352c4a9ad4d140d58850688bd1b2d5513f62c6cb
# Format remaining files from #11170 (#11185)
994ae91f16ea4c8ee28818bd7eaac47e4765c660
212 changes: 0 additions & 212 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
# ONLY ADD NEWLY CREATED FILES/PATHS TO THE LIST BELOW. DO NOT ADD EXISTING
# PROJECT FILES.


# Do not format anything automatically except files listed below
/*

# ignores all files in /docs directory
!/docs
/docs/**
Expand All @@ -32,211 +28,3 @@
node_modules/
.yalc/
.next/

# Ignore all files in /scripts directory
/scripts

!/src
/src/__tests__/ApolloClient.ts
/src/__tests__/client.ts
/src/__tests__/exports.ts
/src/__tests__/fetchMore.ts
/src/__tests__/graphqlSubscriptions.ts
/src/__tests__/local-state/export.ts
/src/__tests__/local-state/general.ts
/src/__tests__/local-state/resolvers.ts
/src/__tests__/local-state/subscriptions.ts
/src/__tests__/mutationResults.ts
/src/__tests__/optimistic.ts
/src/__tests__/refetchQueries.ts
/src/__tests__/resultCacheCleaning.ts
/src/__tests__/subscribeToMore.ts
/src/cache/core/__tests__/cache.ts
/src/cache/core/cache.ts
/src/cache/core/types/Cache.ts
/src/cache/core/types/DataProxy.ts
/src/cache/core/types/common.ts
/src/cache/index.ts
/src/cache/inmemory/__tests__/cache.ts
/src/cache/inmemory/__tests__/diffAgainstStore.ts
/src/cache/inmemory/__tests__/entityStore.ts
/src/cache/inmemory/__tests__/fragmentMatcher.ts
/src/cache/inmemory/__tests__/fragmentRegistry.ts
/src/cache/inmemory/__tests__/helpers.ts
/src/cache/inmemory/__tests__/key-extractor.ts
/src/cache/inmemory/__tests__/object-canon.ts
/src/cache/inmemory/__tests__/optimistic.ts
/src/cache/inmemory/__tests__/policies.ts
/src/cache/inmemory/__tests__/readFromStore.ts
/src/cache/inmemory/__tests__/recordingCache.ts
/src/cache/inmemory/__tests__/roundtrip.ts
/src/cache/inmemory/__tests__/writeToStore.ts
/src/cache/inmemory/entityStore.ts
/src/cache/inmemory/fixPolyfills.native.ts
/src/cache/inmemory/fixPolyfills.ts
/src/cache/inmemory/fragmentRegistry.ts
/src/cache/inmemory/helpers.ts
/src/cache/inmemory/inMemoryCache.ts
/src/cache/inmemory/key-extractor.ts
/src/cache/inmemory/object-canon.ts
/src/cache/inmemory/policies.ts
/src/cache/inmemory/reactiveVars.ts
/src/cache/inmemory/readFromStore.ts
/src/cache/inmemory/types.ts
/src/cache/inmemory/writeToStore.ts
/src/config/jest/setup.ts
/src/core/ApolloClient.ts
/src/core/LocalState.ts
/src/core/ObservableQuery.ts
/src/core/QueryInfo.ts
/src/core/QueryManager.ts
/src/core/__tests__/LocalState.ts
/src/core/__tests__/ObservableQuery.ts
/src/core/__tests__/QueryManager/index.ts
/src/core/__tests__/QueryManager/links.ts
/src/core/__tests__/QueryManager/multiple-results.ts
/src/core/__tests__/QueryManager/recycler.ts
/src/core/__tests__/fetchPolicies.ts
/src/core/networkStatus.ts
/src/core/types.ts
/src/core/watchQueryOptions.ts
/src/errors/__tests__/ApolloError.ts
/src/errors/index.ts
/src/index.ts
/src/invariantErrorCodes.ts
/src/link/batch-http/__tests__/batchHttpLink.ts
/src/link/batch-http/batchHttpLink.ts
/src/link/batch-http/index.ts
/src/link/batch/__tests__/batchLink.ts
/src/link/batch/batchLink.ts
/src/link/batch/batching.ts
/src/link/batch/index.ts
/src/link/context/__tests__/index.ts
/src/link/context/index.ts
/src/link/core/ApolloLink.ts
/src/link/core/__tests__/ApolloLink.ts
/src/link/core/concat.ts
/src/link/core/empty.ts
/src/link/core/execute.ts
/src/link/core/from.ts
/src/link/core/index.ts
/src/link/core/split.ts
/src/link/core/types.ts
/src/link/error/__tests__/index.ts
/src/link/error/index.ts
/src/link/http/HttpLink.ts
/src/link/http/__tests__/HttpLink.ts
/src/link/http/__tests__/checkFetcher.ts
/src/link/http/__tests__/headerNormalization.ts
/src/link/http/__tests__/helpers.ts
/src/link/http/__tests__/parseAndCheckHttpResponse.ts
/src/link/http/__tests__/responseIterator.ts
/src/link/http/__tests__/responseIteratorNoAsyncIterator.ts
/src/link/http/__tests__/selectHttpOptionsAndBody.ts
/src/link/http/__tests__/selectURI.ts
/src/link/http/__tests__/serializeFetchParameter.ts
/src/link/http/checkFetcher.ts
/src/link/http/createHttpLink.ts
/src/link/http/createSignalIfSupported.ts
/src/link/http/index.ts
/src/link/http/iterators/async.ts
/src/link/http/iterators/nodeStream.ts
/src/link/http/iterators/promise.ts
/src/link/http/iterators/reader.ts
/src/link/http/parseAndCheckHttpResponse.ts
/src/link/http/responseIterator.ts
/src/link/http/rewriteURIForGET.ts
/src/link/http/selectHttpOptionsAndBody.ts
/src/link/http/selectURI.ts
/src/link/http/serializeFetchParameter.ts
/src/link/persisted-queries/__tests__/persisted-queries.test.ts
/src/link/persisted-queries/__tests__/react.test.tsx
/src/link/persisted-queries/index.ts
/src/link/retry/__tests__/delayFunction.ts
/src/link/retry/__tests__/retryFunction.ts
/src/link/retry/__tests__/retryLink.ts
/src/link/retry/delayFunction.ts
/src/link/retry/index.ts
/src/link/retry/retryFunction.ts
/src/link/retry/retryLink.ts
/src/link/schema/__tests__/schemaLink.ts
/src/link/schema/index.ts
/src/link/subscriptions/__tests__/graphqlWsLink.ts
/src/link/subscriptions/index.ts
/src/link/utils/__tests__/filterOperationVariables.ts
/src/link/utils/__tests__/fromError.ts
/src/link/utils/__tests__/fromPromise.ts
/src/link/utils/__tests__/toPromise.ts
/src/link/utils/__tests__/validateOperation.ts
/src/link/utils/createOperation.ts
/src/link/utils/filterOperationVariables.ts
/src/link/utils/fromError.ts
/src/link/utils/fromPromise.ts
/src/link/utils/index.ts
/src/link/utils/throwServerError.ts
/src/link/utils/toPromise.ts
/src/link/utils/transformOperation.ts
/src/link/utils/validateOperation.ts
/src/link/ws/__tests__/webSocketLink.ts
/src/link/ws/index.ts
/src/testing/core/itAsync.ts
/src/testing/core/mocking/mockClient.ts
/src/testing/core/mocking/mockFetch.ts
/src/testing/core/mocking/mockLink.ts
/src/testing/core/mocking/mockQueryManager.ts
/src/testing/core/mocking/mockSubscriptionLink.ts
/src/testing/core/mocking/mockWatchQuery.ts
/src/testing/core/observableToPromise.ts
/src/testing/core/subscribeAndCount.ts
/src/testing/core/wait.ts
/src/testing/core/withConsoleSpy.ts
/src/testing/core/wrap.ts
/src/testing/index.ts
/src/testing/react/MockedProvider.tsx
/src/testing/react/__tests__/MockedProvider.test.tsx
/src/testing/react/__tests__/mockSubscriptionLink.test.tsx
/src/utilities/common/__tests__/canUse.ts
/src/utilities/common/__tests__/cloneDeep.ts
/src/utilities/common/__tests__/compact.ts
/src/utilities/common/__tests__/maybeDeepFeeze.ts
/src/utilities/common/__tests__/mergeDeep.ts
/src/utilities/common/arrays.ts
/src/utilities/common/canUse.ts
/src/utilities/common/cloneDeep.ts
/src/utilities/common/compact.ts
/src/utilities/common/errorHandling.ts
/src/utilities/common/filterInPlace.ts
/src/utilities/common/incrementalResult.ts
/src/utilities/common/makeUniqueId.ts
/src/utilities/common/maybeDeepFreeze.ts
/src/utilities/common/mergeDeep.ts
/src/utilities/common/mergeOptions.ts
/src/utilities/common/objects.ts
/src/utilities/common/responseIterator.ts
/src/utilities/common/stringifyForDisplay.ts
/src/utilities/globals/global.ts
/src/utilities/globals/index.ts
/src/utilities/globals/maybe.ts
/src/utilities/graphql/__tests__/directives.ts
/src/utilities/graphql/__tests__/fragments.ts
/src/utilities/graphql/__tests__/getFromAST.ts
/src/utilities/graphql/__tests__/storeUtils.ts
/src/utilities/graphql/__tests__/transform.ts
/src/utilities/graphql/directives.ts
/src/utilities/graphql/fragments.ts
/src/utilities/graphql/getFromAST.ts
/src/utilities/graphql/storeUtils.ts
/src/utilities/graphql/transform.ts
/src/utilities/observables/Concast.ts
/src/utilities/observables/Observable.ts
/src/utilities/observables/__tests__/Concast.ts
/src/utilities/observables/__tests__/Observable.ts
/src/utilities/observables/__tests__/asyncMap.ts
/src/utilities/observables/__tests__/subclassing.ts
/src/utilities/observables/asyncMap.ts
/src/utilities/observables/iteration.ts
/src/utilities/observables/subclassing.ts
/src/utilities/policies/__tests__/relayStylePagination.test.ts
/src/utilities/policies/pagination.ts
/src/utilities/types/IsStrictlyAny.ts
/src/version.ts
4 changes: 2 additions & 2 deletions .size-limit.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const checks = [
{
path: "dist/apollo-client.min.cjs",
limit: "38074",
limit: "38190",
},
{
path: "dist/main.cjs",
Expand All @@ -10,7 +10,7 @@ const checks = [
{
path: "dist/index.js",
import: "{ ApolloClient, InMemoryCache, HttpLink }",
limit: "31980",
limit: "32044",
},
...[
"ApolloProvider",
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @apollo/client

## 3.8.3

### Patch Changes

- [#11193](https://github.com/apollographql/apollo-client/pull/11193) [`fd2a4cf0c`](https://github.com/apollographql/apollo-client/commit/fd2a4cf0c3ada968df3f9814d87dedaaa8eddb5e) Thanks [@phryneas](https://github.com/phryneas)! - Call devtools registration after ApolloClient is fully set up.

## 3.8.2

### Patch Changes

- [#10072](https://github.com/apollographql/apollo-client/pull/10072) [`51045c336`](https://github.com/apollographql/apollo-client/commit/51045c336ff86befbdd598af6e7104ffe0d419d0) Thanks [@Huulivoide](https://github.com/Huulivoide)! - Fixes race conditions in useReactiveVar that may prevent updates to the reactive variable from propagating through the hook.

- [#11162](https://github.com/apollographql/apollo-client/pull/11162) [`d9685f53c`](https://github.com/apollographql/apollo-client/commit/d9685f53c34483245e6ea21e91b669ef1180ae97) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensures GraphQL errors returned in subscription payloads adhere to the `errorPolicy` set in `client.subscribe(...)` calls.

- [#11134](https://github.com/apollographql/apollo-client/pull/11134) [`96492e142`](https://github.com/apollographql/apollo-client/commit/96492e14279d78e2613c1381d31f88cdf5816f45) Thanks [@alessbell](https://github.com/alessbell)! - Use separate type imports in useSuspenseQuery and useBackgroundQuery to workaround SWC compiler issue.

- [#11117](https://github.com/apollographql/apollo-client/pull/11117) [`6b8198109`](https://github.com/apollographql/apollo-client/commit/6b8198109bd9fe5eedf352421a0a773ac0acfb18) Thanks [@phryneas](https://github.com/phryneas)! - Adds a new devtools registration mechanism and tweaks the mechanism behind the
"devtools not found" mechanic.

- [#11186](https://github.com/apollographql/apollo-client/pull/11186) [`f1d429f32`](https://github.com/apollographql/apollo-client/commit/f1d429f32ae8e896155b50f1fc7c51dfeb06c3ba) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue where race conditions when rapidly switching between variables would sometimes result in the wrong `data` returned from the query. Specifically this occurs when a query is triggered with an initial set of variables (`VariablesA`), then triggers the same query with another set of variables (`VariablesB`) but switches back to the `VariablesA` before the response for `VariablesB` is returned. Previously this would result in the data for `VariablesB` to be displayed while `VariablesA` was active. The data is for `VariablesA` is now properly returned.

- [#11163](https://github.com/apollographql/apollo-client/pull/11163) [`a8a9e11e9`](https://github.com/apollographql/apollo-client/commit/a8a9e11e917716538206eb7d5de21dbfd09630bd) Thanks [@bignimbus](https://github.com/bignimbus)! - Fix typo in error message: "occured" -> "occurred"

- [#11180](https://github.com/apollographql/apollo-client/pull/11180) [`7d9c481e5`](https://github.com/apollographql/apollo-client/commit/7d9c481e53f3c9577ec6ed6231c9e3db8c8b374b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fixes an issue where refetching from `useBackgroundQuery` via `refetch` with an error after an error was already fetched would get stuck in a loading state.

## 3.8.1

### Patch Changes
Expand Down
5 changes: 2 additions & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🔮 Apollo Client Roadmap

**Last updated: 2023-08-09**
**Last updated: 2023-08-29**

For up to date release notes, refer to the project's [Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md).

Expand All @@ -21,8 +21,7 @@ Features we plan to tackle:

- Introduce a suspenseful `useFragment` that will suspend when the data is not yet loaded
- Ability to preload a query outside of a React component that can be used with `useReadQuery` to suspend while loading
- Introduce a new `useInteractiveQuery`/`useLazyBackgroundQuery` hook (name TBD)
- Add metrics integration throughout the library for powerful insights
- Introduce a new `useInteractiveQuery`/`useLazyBackgroundQuery` hook (name TBD)
- Improved testing utilities

> NOTE: These are subject to change and are not guaranteed to be part of 3.9 at the time of this writing.
Expand Down
8 changes: 5 additions & 3 deletions docs/shared/DisplayClientError.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@ function ErrorDetails({ version, messageId, args }) {
{(loading || errorMessage) && (
<>
<MDX.h2>Error message</MDX.h2>
<MDX.blockquote>{loading ? 'Loading' : errorMessage}</MDX.blockquote>
<MDX.blockquote style={{ lineHeight: "normal", whiteSpace: "pre-wrap" }}>{loading ? 'Loading' : errorMessage}</MDX.blockquote>
</>
)}

<MDX.h3>File</MDX.h3>
<MDX.inlineCode>{loading ? 'Loading' : data.file}</MDX.inlineCode>

<MDX.h3>Condition</MDX.h3>
<MDX.inlineCode>{loading ? 'Loading' : data.condition}</MDX.inlineCode>
<div style={{visibility: data?.condition ? 'visible' : 'hidden'}}>
<MDX.h3>Condition</MDX.h3>
<MDX.inlineCode>{data?.condition || ''}</MDX.inlineCode>
</div>
</div>
);
}
Expand Down
Loading

0 comments on commit 4a49723

Please sign in to comment.