From 135c71c6b5e0dc975fd1bff6059741728f3f5f3c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:22:31 -0700 Subject: [PATCH 01/23] chore(deps): update all dependencies - patch updates (#11405) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 8 ++++---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 549776f8994..2f277c310bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "0.13.2", - "@babel/parser": "7.23.4", + "@babel/parser": "7.23.5", "@changesets/changelog-github": "0.4.8", "@changesets/cli": "2.26.2", "@graphql-tools/schema": "10.0.2", @@ -33,7 +33,7 @@ "@rollup/plugin-node-resolve": "11.2.1", "@size-limit/esbuild-why": "11.0.0", "@size-limit/preset-small-lib": "11.0.0", - "@testing-library/jest-dom": "6.1.4", + "@testing-library/jest-dom": "6.1.5", "@testing-library/react": "14.1.2", "@testing-library/react-12": "npm:@testing-library/react@^12", "@testing-library/user-event": "14.5.1", @@ -44,9 +44,9 @@ "@types/hoist-non-react-statics": "3.3.5", "@types/jest": "29.5.10", "@types/lodash": "4.14.202", - "@types/node": "20.10.0", + "@types/node": "20.10.3", "@types/node-fetch": "2.6.9", - "@types/react": "18.2.38", + "@types/react": "18.2.41", "@types/react-dom": "18.2.17", "@types/use-sync-external-store": "0.0.6", "@typescript-eslint/eslint-plugin": "6.12.0", @@ -540,9 +540,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.4.tgz", - "integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", + "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -2838,9 +2838,9 @@ } }, "node_modules/@testing-library/jest-dom": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.1.4.tgz", - "integrity": "sha512-wpoYrCYwSZ5/AxcrjLxJmCU6I5QAJXslEeSiMQqaWmP2Kzpd1LvF/qxmAIW2qposULGWq2gw30GgVNFLSc2Jnw==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.1.5.tgz", + "integrity": "sha512-3y04JLW+EceVPy2Em3VwNr95dOKqA8DhR0RJHhHKDZNYXcVXnEK7WIrpj4eYU8SVt/qYZ2aRWt/WgQ+grNES8g==", "dev": true, "dependencies": { "@adobe/css-tools": "^4.3.1", @@ -3320,9 +3320,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", - "integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==", + "version": "20.10.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", + "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3351,9 +3351,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.38", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.38.tgz", - "integrity": "sha512-cBBXHzuPtQK6wNthuVMV6IjHAFkdl/FOPFIlkd81/Cd1+IqkHu/A+w4g43kaQQoYHik/ruaQBDL72HyCy1vuMw==", + "version": "18.2.41", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.41.tgz", + "integrity": "sha512-CwOGr/PiLiNBxEBqpJ7fO3kocP/2SSuC9fpH5K7tusrg4xPSRT/193rzolYwQnTN02We/ATXKnb6GqA5w4fRxw==", "dev": true, "dependencies": { "@types/prop-types": "*", diff --git a/package.json b/package.json index b328854a191..731d8529c7b 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "0.13.2", - "@babel/parser": "7.23.4", + "@babel/parser": "7.23.5", "@changesets/changelog-github": "0.4.8", "@changesets/cli": "2.26.2", "@graphql-tools/schema": "10.0.2", @@ -114,7 +114,7 @@ "@rollup/plugin-node-resolve": "11.2.1", "@size-limit/esbuild-why": "11.0.0", "@size-limit/preset-small-lib": "11.0.0", - "@testing-library/jest-dom": "6.1.4", + "@testing-library/jest-dom": "6.1.5", "@testing-library/react": "14.1.2", "@testing-library/react-12": "npm:@testing-library/react@^12", "@testing-library/user-event": "14.5.1", @@ -125,9 +125,9 @@ "@types/hoist-non-react-statics": "3.3.5", "@types/jest": "29.5.10", "@types/lodash": "4.14.202", - "@types/node": "20.10.0", + "@types/node": "20.10.3", "@types/node-fetch": "2.6.9", - "@types/react": "18.2.38", + "@types/react": "18.2.41", "@types/react-dom": "18.2.17", "@types/use-sync-external-store": "0.0.6", "@typescript-eslint/eslint-plugin": "6.12.0", From 838095be8b3346ea9bd18c6e46db3193e6454285 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:18:01 -0700 Subject: [PATCH 02/23] Version Packages (alpha) (#11353) Co-authored-by: github-actions[bot] --- .changeset/pre.json | 13 +++++++++- CHANGELOG.md | 60 +++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 4 +-- package.json | 2 +- 4 files changed, 75 insertions(+), 4 deletions(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 87706b33f54..f51bce71873 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -7,11 +7,22 @@ "changesets": [ "beige-geese-wink", "breezy-spiders-tap", + "clean-items-smash", + "cold-llamas-turn", + "dirty-kids-crash", + "forty-cups-shop", "friendly-clouds-laugh", - "good-experts-repair", + "hot-ducks-burn", + "polite-avocados-warn", + "quick-hats-marry", "shaggy-ears-scream", + "shaggy-sheep-pull", + "sixty-boxes-rest", "sour-sheep-walk", "strong-terms-perform", + "thick-mice-collect", + "thirty-ties-arrive", + "violet-lions-draw", "wild-dolphins-jog", "yellow-flies-repeat" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 43ee4c79a21..c7326ece2c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,64 @@ # @apollo/client +## 3.9.0-alpha.5 + +### Minor Changes + +- [#11345](https://github.com/apollographql/apollo-client/pull/11345) [`1759066a8`](https://github.com/apollographql/apollo-client/commit/1759066a8f9a204e49228568aef9446a64890ff3) Thanks [@phryneas](https://github.com/phryneas)! - `QueryManager.inFlightLinkObservables` now uses a strong `Trie` as an internal data structure. + + #### Warning: requires `@apollo/experimental-nextjs-app-support` update + + If you are using `@apollo/experimental-nextjs-app-support`, you will need to update that to at least 0.5.2, as it accesses this internal data structure. + +- [#11300](https://github.com/apollographql/apollo-client/pull/11300) [`a8158733c`](https://github.com/apollographql/apollo-client/commit/a8158733cfa3e65180ec23518d657ea41894bb2b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Introduces a new `useLoadableQuery` hook. This hook works similarly to `useBackgroundQuery` in that it returns a `queryRef` that can be used to suspend a component via the `useReadQuery` hook. It provides a more ergonomic way to load the query during a user interaction (for example when wanting to preload some data) that would otherwise be clunky with `useBackgroundQuery`. + + ```tsx + function App() { + const [loadQuery, queryRef, { refetch, fetchMore, reset }] = + useLoadableQuery(query, options); + + return ( + <> + + }> + {queryRef && } + + + ); + } + + function Child({ queryRef }) { + const { data } = useReadQuery(queryRef); + + // ... + } + ``` + +### Patch Changes + +- [#11356](https://github.com/apollographql/apollo-client/pull/11356) [`cc4ac7e19`](https://github.com/apollographql/apollo-client/commit/cc4ac7e1917f046bcd177882727864eed40b910e) Thanks [@phryneas](https://github.com/phryneas)! - Fix a potential memory leak in `FragmentRegistry.transform` and `FragmentRegistry.findFragmentSpreads` that would hold on to passed-in `DocumentNodes` for too long. + +- [#11370](https://github.com/apollographql/apollo-client/pull/11370) [`25e2cb431`](https://github.com/apollographql/apollo-client/commit/25e2cb431c76ec5aa88202eaacbd98fad42edc7f) Thanks [@phryneas](https://github.com/phryneas)! - `parse` function: improve memory management + + - use LRU `WeakCache` instead of `Map` to keep a limited number of parsed results + - cache is initiated lazily, only when needed + - expose `parse.resetCache()` method + +- [#11389](https://github.com/apollographql/apollo-client/pull/11389) [`139acd115`](https://github.com/apollographql/apollo-client/commit/139acd1153afa1445b69dcb4e139668ab8c5889a) Thanks [@phryneas](https://github.com/phryneas)! - `documentTransform`: use `optimism` and `WeakCache` instead of directly storing data on the `Trie` + +- [#11358](https://github.com/apollographql/apollo-client/pull/11358) [`7d939f80f`](https://github.com/apollographql/apollo-client/commit/7d939f80fbc2c419c58a6c55b6a35ee7474d0379) Thanks [@phryneas](https://github.com/phryneas)! - Fixes a potential memory leak in `Concast` that might have been triggered when `Concast` was used outside of Apollo Client. + +- [#11344](https://github.com/apollographql/apollo-client/pull/11344) [`bd2667619`](https://github.com/apollographql/apollo-client/commit/bd2667619700139af32a45364794d11f845ab6cf) Thanks [@phryneas](https://github.com/phryneas)! - Add a `resetCache` method to `DocumentTransform` and hook `InMemoryCache.addTypenameTransform` up to `InMemoryCache.gc` + +- [#11367](https://github.com/apollographql/apollo-client/pull/11367) [`30d17bfeb`](https://github.com/apollographql/apollo-client/commit/30d17bfebe44dbfa7b78c8982cfeb49afd37129c) Thanks [@phryneas](https://github.com/phryneas)! - `print`: use `WeakCache` instead of `WeakMap` + +- [#11385](https://github.com/apollographql/apollo-client/pull/11385) [`d9ca4f082`](https://github.com/apollographql/apollo-client/commit/d9ca4f0821c66ae4f03cf35a7ac93fe604cc6de3) Thanks [@phryneas](https://github.com/phryneas)! - ensure `defaultContext` is also used for mutations and subscriptions + +- [#11387](https://github.com/apollographql/apollo-client/pull/11387) [`4dce8673b`](https://github.com/apollographql/apollo-client/commit/4dce8673b1757d8a3a4edd2996d780e86fad14e3) Thanks [@phryneas](https://github.com/phryneas)! - `QueryManager.transformCache`: use `WeakCache` instead of `WeakMap` + +- [#11371](https://github.com/apollographql/apollo-client/pull/11371) [`ebd8fe2c1`](https://github.com/apollographql/apollo-client/commit/ebd8fe2c1b8b50bfeb2da20aeca5671300fb5564) Thanks [@phryneas](https://github.com/phryneas)! - Clarify types of `EntityStore.makeCacheKey`. + +- [#11355](https://github.com/apollographql/apollo-client/pull/11355) [`7d8e18493`](https://github.com/apollographql/apollo-client/commit/7d8e18493cd13134726c6643cbf0fadb08be2d37) Thanks [@phryneas](https://github.com/phryneas)! - InMemoryCache.gc now also triggers FragmentRegistry.resetCaches (if there is a FragmentRegistry) ## 3.8.8 @@ -128,6 +187,7 @@ - [#6701](https://github.com/apollographql/apollo-client/pull/6701) [`8d2b4e107`](https://github.com/apollographql/apollo-client/commit/8d2b4e107d7c21563894ced3a65d631183b58fd9) Thanks [@prowe](https://github.com/prowe)! - Ability to dynamically match mocks Adds support for a new property `MockedResponse.variableMatcher`: a predicate function that accepts a `variables` param. If `true`, the `variables` will be passed into the `ResultFunction` to help dynamically build a response. + ## 3.8.7 ### Patch Changes diff --git a/package-lock.json b/package-lock.json index 1daf4c7fcd1..71a75840fdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@apollo/client", - "version": "3.9.0-alpha.4", + "version": "3.9.0-alpha.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@apollo/client", - "version": "3.9.0-alpha.4", + "version": "3.9.0-alpha.5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 69a308a4805..dc9e6941396 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/client", - "version": "3.9.0-alpha.4", + "version": "3.9.0-alpha.5", "description": "A fully-featured caching GraphQL client.", "private": true, "keywords": [ From aaf990bd2816a155801926517b4d60f26f0b2a95 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 5 Dec 2023 09:08:08 -0700 Subject: [PATCH 03/23] Update ROADMAP.md --- ROADMAP.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 9a9bf125c56..e5ea10915c9 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,6 +1,6 @@ # 🔮 Apollo Client Roadmap -**Last updated: 2023-11-21** +**Last updated: 2023-12-05** For up to date release notes, refer to the project's [Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md). @@ -17,14 +17,14 @@ For up to date release notes, refer to the project's [Changelog](https://github. _Currently in development phase_ -Tentative beta date: Dec 1, 2023 +Tentative beta date: Dec 12, 2023 Features we plan to tackle: - Ability to preload a query outside of a React component that can be used with `useReadQuery` to suspend while loading - Introduce a new `useLoadableQuery` hook - `` improvements -- Optimizing memory usage in SSR scenarios +- Optimizing memory usage > NOTE: These are subject to change and are not guaranteed to be part of 3.9 at the time of this writing. From 3f7eecbfbd4f4444cffcaac7dd9fd225c8c2a401 Mon Sep 17 00:00:00 2001 From: Aditya Kumawat Date: Thu, 7 Dec 2023 00:40:20 +0530 Subject: [PATCH 04/23] Add `skipPollAttempt` option to control polling refetch behavior (#11397) Co-authored-by: Aditya Kumawat --- .api-reports/api-report-core.md | 3 +- .api-reports/api-report-react.md | 3 +- .api-reports/api-report-react_components.md | 3 +- .api-reports/api-report-react_context.md | 3 +- .api-reports/api-report-react_hoc.md | 3 +- .api-reports/api-report-react_hooks.md | 3 +- .api-reports/api-report-react_ssr.md | 3 +- .api-reports/api-report-testing.md | 3 +- .api-reports/api-report-testing_core.md | 3 +- .api-reports/api-report-utilities.md | 3 +- .api-reports/api-report.md | 3 +- .changeset/swift-zoos-collect.md | 19 ++ .size-limits.json | 4 +- src/core/ObservableQuery.ts | 5 +- src/core/watchQueryOptions.ts | 7 + src/react/hooks/__tests__/useQuery.test.tsx | 194 ++++++++++++++++++++ 16 files changed, 248 insertions(+), 14 deletions(-) create mode 100644 .changeset/swift-zoos-collect.md diff --git a/.api-reports/api-report-core.md b/.api-reports/api-report-core.md index 8129823a675..e16b21db97b 100644 --- a/.api-reports/api-report-core.md +++ b/.api-reports/api-report-core.md @@ -2069,6 +2069,7 @@ export interface WatchQueryOptions; refetchWritePolicy?: RefetchWritePolicy; returnPartialData?: boolean; + skipPollAttempt?: () => boolean; variables?: TVariables; } @@ -2115,7 +2116,7 @@ interface WriteContext extends ReadMergeModifyContext { // src/core/QueryManager.ts:120:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:154:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:395:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:253:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:260:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts // src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/.api-reports/api-report-react.md b/.api-reports/api-report-react.md index 268f955f1bf..7acf9ba2c5a 100644 --- a/.api-reports/api-report-react.md +++ b/.api-reports/api-report-react.md @@ -2235,6 +2235,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -2256,7 +2257,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -1685,7 +1686,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -1581,7 +1582,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -1626,7 +1627,7 @@ export function withSubscription boolean; variables?: TVariables; } @@ -2147,7 +2148,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -1567,7 +1568,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -1629,7 +1630,7 @@ export function withWarningSpy(it: (...args: TArgs // src/core/types.ts:156:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts // src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts // src/core/types.ts:201:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:253:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:260:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/.api-reports/api-report-testing_core.md b/.api-reports/api-report-testing_core.md index a306aeb99fb..ad2f42b7825 100644 --- a/.api-reports/api-report-testing_core.md +++ b/.api-reports/api-report-testing_core.md @@ -1556,6 +1556,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -1586,7 +1587,7 @@ export function withWarningSpy(it: (...args: TArgs // src/core/types.ts:156:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts // src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts // src/core/types.ts:201:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:253:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:260:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/.api-reports/api-report-utilities.md b/.api-reports/api-report-utilities.md index 2c4231f2096..9ccfda99640 100644 --- a/.api-reports/api-report-utilities.md +++ b/.api-reports/api-report-utilities.md @@ -2413,6 +2413,7 @@ interface WatchQueryOptions boolean; variables?: TVariables; } @@ -2469,7 +2470,7 @@ interface WriteContext extends ReadMergeModifyContext { // src/core/types.ts:156:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts // src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts // src/core/types.ts:201:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:253:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:260:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts // src/utilities/graphql/storeUtils.ts:226:12 - (ae-forgotten-export) The symbol "storeKeyNameStringify" needs to be exported by the entry point index.d.ts // src/utilities/policies/pagination.ts:76:3 - (ae-forgotten-export) The symbol "TRelayEdge" needs to be exported by the entry point index.d.ts // src/utilities/policies/pagination.ts:77:3 - (ae-forgotten-export) The symbol "TRelayPageInfo" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report.md b/.api-reports/api-report.md index 081d7af9dc9..5a22a0eefdd 100644 --- a/.api-reports/api-report.md +++ b/.api-reports/api-report.md @@ -2853,6 +2853,7 @@ export interface WatchQueryOptions; refetchWritePolicy?: RefetchWritePolicy; returnPartialData?: boolean; + skipPollAttempt?: () => boolean; variables?: TVariables; } @@ -2899,7 +2900,7 @@ interface WriteContext extends ReadMergeModifyContext { // src/core/QueryManager.ts:120:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:154:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts // src/core/QueryManager.ts:395:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts -// src/core/watchQueryOptions.ts:253:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts +// src/core/watchQueryOptions.ts:260:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts // src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts // src/react/hooks/useBackgroundQuery.ts:30:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts // src/react/hooks/useBackgroundQuery.ts:31:3 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts diff --git a/.changeset/swift-zoos-collect.md b/.changeset/swift-zoos-collect.md new file mode 100644 index 00000000000..ee80ede295e --- /dev/null +++ b/.changeset/swift-zoos-collect.md @@ -0,0 +1,19 @@ +--- +@apollo/client: minor +--- + +Adds a new `skipPollAttempt` callback function that's called whenever a refetch attempt occurs while polling. If the function returns `true`, the refetch is skipped and not reattempted until the next poll interval. This will solve the frequent use-case of disabling polling when the window is inactive. + +```ts +useQuery(QUERY, { + pollInterval: 1000, + skipPollAttempt: () => document.hidden // or !document.hasFocus() +}); +// or define it globally +new ApolloClient({ + defaultOptions: { + watchQuery: { + skipPollAttempt: () => document.hidden // or !document.hasFocus() + } + } +}) diff --git a/.size-limits.json b/.size-limits.json index f9e9c6f50a8..e23614a183f 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 38546, - "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32318 + "dist/apollo-client.min.cjs": 38576, + "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32352 } diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index 8516678dfc8..4822807e565 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -776,7 +776,10 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`, const maybeFetch = () => { if (this.pollingInfo) { - if (!isNetworkRequestInFlight(this.queryInfo.networkStatus)) { + if ( + !isNetworkRequestInFlight(this.queryInfo.networkStatus) && + !this.options.skipPollAttempt?.() + ) { this.reobserve( { // Most fetchPolicy options don't make sense to use in a polling context, as diff --git a/src/core/watchQueryOptions.ts b/src/core/watchQueryOptions.ts index b74659b4a99..7c49d861097 100644 --- a/src/core/watchQueryOptions.ts +++ b/src/core/watchQueryOptions.ts @@ -176,6 +176,13 @@ export interface WatchQueryOptions< /** {@inheritDoc @apollo/client!QueryOptions#canonizeResults:member} */ canonizeResults?: boolean; + + /** + * A callback function that's called whenever a refetch attempt occurs + * while polling. If the function returns `true`, the refetch is + * skipped and not reattempted until the next poll interval. + */ + skipPollAttempt?: () => boolean; } export interface NextFetchPolicyContext< diff --git a/src/react/hooks/__tests__/useQuery.test.tsx b/src/react/hooks/__tests__/useQuery.test.tsx index 0c6a56edcdc..2e6f1e3a125 100644 --- a/src/react/hooks/__tests__/useQuery.test.tsx +++ b/src/react/hooks/__tests__/useQuery.test.tsx @@ -2092,6 +2092,200 @@ describe("useQuery Hook", () => { unmount(); result.current.stopPolling(); }); + + describe("should prevent fetches when `skipPollAttempt` returns `false`", () => { + beforeEach(() => { + jest.useFakeTimers(); + }); + + afterEach(() => { + jest.runOnlyPendingTimers(); + jest.useRealTimers(); + }); + + it("when defined as a global default option", async () => { + const skipPollAttempt = jest.fn().mockImplementation(() => false); + + const query = gql` + { + hello + } + `; + const link = mockSingleLink( + { + request: { query }, + result: { data: { hello: "world 1" } }, + }, + { + request: { query }, + result: { data: { hello: "world 2" } }, + }, + { + request: { query }, + result: { data: { hello: "world 3" } }, + } + ); + + const client = new ApolloClient({ + link, + cache: new InMemoryCache(), + defaultOptions: { + watchQuery: { + skipPollAttempt, + }, + }, + }); + + const wrapper = ({ children }: any) => ( + {children} + ); + + const { result } = renderHook( + () => useQuery(query, { pollInterval: 10 }), + { wrapper } + ); + + expect(result.current.loading).toBe(true); + expect(result.current.data).toBe(undefined); + + await waitFor( + () => { + expect(result.current.data).toEqual({ hello: "world 1" }); + }, + { interval: 1 } + ); + + expect(result.current.loading).toBe(false); + + await waitFor( + () => { + expect(result.current.data).toEqual({ hello: "world 2" }); + }, + { interval: 1 } + ); + + skipPollAttempt.mockImplementation(() => true); + expect(result.current.loading).toBe(false); + + await jest.advanceTimersByTime(12); + await waitFor( + () => expect(result.current.data).toEqual({ hello: "world 2" }), + { interval: 1 } + ); + + await jest.advanceTimersByTime(12); + await waitFor( + () => expect(result.current.data).toEqual({ hello: "world 2" }), + { interval: 1 } + ); + + await jest.advanceTimersByTime(12); + await waitFor( + () => expect(result.current.data).toEqual({ hello: "world 2" }), + { interval: 1 } + ); + + skipPollAttempt.mockImplementation(() => false); + expect(result.current.loading).toBe(false); + + await waitFor( + () => { + expect(result.current.data).toEqual({ hello: "world 3" }); + }, + { interval: 1 } + ); + }); + + it("when defined for a single query", async () => { + const skipPollAttempt = jest.fn().mockImplementation(() => false); + + const query = gql` + { + hello + } + `; + const mocks = [ + { + request: { query }, + result: { data: { hello: "world 1" } }, + }, + { + request: { query }, + result: { data: { hello: "world 2" } }, + }, + { + request: { query }, + result: { data: { hello: "world 3" } }, + }, + ]; + + const cache = new InMemoryCache(); + const wrapper = ({ children }: any) => ( + + {children} + + ); + + const { result } = renderHook( + () => + useQuery(query, { + pollInterval: 10, + skipPollAttempt, + }), + { wrapper } + ); + + expect(result.current.loading).toBe(true); + expect(result.current.data).toBe(undefined); + + await waitFor( + () => { + expect(result.current.data).toEqual({ hello: "world 1" }); + }, + { interval: 1 } + ); + + expect(result.current.loading).toBe(false); + + await waitFor( + () => { + expect(result.current.data).toEqual({ hello: "world 2" }); + }, + { interval: 1 } + ); + + skipPollAttempt.mockImplementation(() => true); + expect(result.current.loading).toBe(false); + + await jest.advanceTimersByTime(12); + await waitFor( + () => expect(result.current.data).toEqual({ hello: "world 2" }), + { interval: 1 } + ); + + await jest.advanceTimersByTime(12); + await waitFor( + () => expect(result.current.data).toEqual({ hello: "world 2" }), + { interval: 1 } + ); + + await jest.advanceTimersByTime(12); + await waitFor( + () => expect(result.current.data).toEqual({ hello: "world 2" }), + { interval: 1 } + ); + + skipPollAttempt.mockImplementation(() => false); + expect(result.current.loading).toBe(false); + + await waitFor( + () => { + expect(result.current.data).toEqual({ hello: "world 3" }); + }, + { interval: 1 } + ); + }); + }); }); describe("Error handling", () => { From d05297d9873ffb3ef52445f9f44fe1bc0499a4d7 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Wed, 6 Dec 2023 13:56:22 -0700 Subject: [PATCH 05/23] Fix changeset formatting --- .changeset/swift-zoos-collect.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/swift-zoos-collect.md b/.changeset/swift-zoos-collect.md index ee80ede295e..b3e988b8f0a 100644 --- a/.changeset/swift-zoos-collect.md +++ b/.changeset/swift-zoos-collect.md @@ -1,5 +1,5 @@ --- -@apollo/client: minor +"@apollo/client": minor --- Adds a new `skipPollAttempt` callback function that's called whenever a refetch attempt occurs while polling. If the function returns `true`, the refetch is skipped and not reattempted until the next poll interval. This will solve the frequent use-case of disabling polling when the window is inactive. From 6dc3b9de45033b64e5817c7ec6b3e4c8adcf3192 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 7 Dec 2023 22:15:55 +0100 Subject: [PATCH 06/23] Copy and use ApiDoc components from docs repo (#11416) --- .prettierignore | 5 + docs/shared/ApiDoc/Context.js | 6 + docs/shared/ApiDoc/DocBlock.js | 149 +++++++++++++++++++ docs/shared/ApiDoc/Function.js | 70 +++++++++ docs/shared/ApiDoc/Heading.js | 67 +++++++++ docs/shared/ApiDoc/InterfaceDetails.js | 37 +++++ docs/shared/ApiDoc/ParameterTable.js | 93 ++++++++++++ docs/shared/ApiDoc/PropertySignatureTable.js | 116 +++++++++++++++ docs/shared/ApiDoc/ResponsiveGrid.js | 77 ++++++++++ docs/shared/ApiDoc/index.js | 14 ++ docs/shared/ApiDoc/mdToReact.js | 20 +++ docs/source/api/core/ApolloClient.mdx | 39 ++--- netlify.toml | 2 +- 13 files changed, 676 insertions(+), 19 deletions(-) create mode 100644 docs/shared/ApiDoc/Context.js create mode 100644 docs/shared/ApiDoc/DocBlock.js create mode 100644 docs/shared/ApiDoc/Function.js create mode 100644 docs/shared/ApiDoc/Heading.js create mode 100644 docs/shared/ApiDoc/InterfaceDetails.js create mode 100644 docs/shared/ApiDoc/ParameterTable.js create mode 100644 docs/shared/ApiDoc/PropertySignatureTable.js create mode 100644 docs/shared/ApiDoc/ResponsiveGrid.js create mode 100644 docs/shared/ApiDoc/index.js create mode 100644 docs/shared/ApiDoc/mdToReact.js diff --git a/.prettierignore b/.prettierignore index 5c9398e78de..6e87bed035a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -25,6 +25,11 @@ /docs/source/development-testing/** !/docs/source/development-testing/reducing-bundle-size.mdx +!docs/shared +/docs/shared/** +!/docs/shared/ApiDoc +!/docs/shared/ApiDoc/** + node_modules/ .yalc/ .next/ diff --git a/docs/shared/ApiDoc/Context.js b/docs/shared/ApiDoc/Context.js new file mode 100644 index 00000000000..c6861650c92 --- /dev/null +++ b/docs/shared/ApiDoc/Context.js @@ -0,0 +1,6 @@ +import { useMDXComponents } from "@mdx-js/react"; + +export const useApiDocContext = function () { + const MDX = useMDXComponents(); + return MDX.useApiDocContext(this, arguments); +}; diff --git a/docs/shared/ApiDoc/DocBlock.js b/docs/shared/ApiDoc/DocBlock.js new file mode 100644 index 00000000000..333bda75afd --- /dev/null +++ b/docs/shared/ApiDoc/DocBlock.js @@ -0,0 +1,149 @@ +import PropTypes from "prop-types"; +import React from "react"; +import { Stack } from "@chakra-ui/react"; +import { mdToReact } from "./mdToReact"; +import { useApiDocContext } from "."; + +export function DocBlock({ + canonicalReference, + summary = true, + remarks = false, + example = false, + remarkCollapsible = true, + since = true, + deprecated = true, +}) { + return ( + + {/** TODO: @since, @deprecated etc. */} + {deprecated && } + {since && } + {summary && } + {remarks && ( + + )} + {example && } + + ); +} + +DocBlock.propTypes = { + canonicalReference: PropTypes.string.isRequired, + summary: PropTypes.bool, + remarks: PropTypes.bool, + example: PropTypes.bool, + remarkCollapsible: PropTypes.bool, + since: PropTypes.bool, + deprecated: PropTypes.bool, +}; + +function MaybeCollapsible({ collapsible, children }) { + return ( + collapsible ? + children ? +
+ Read more... + {children} +
+ : null + : children + ); +} +MaybeCollapsible.propTypes = { + collapsible: PropTypes.bool, + children: PropTypes.node, +}; + +/** + * Might still need more work on the Gatsby side to get this to work. + */ +export function Deprecated({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.deprecated; + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Deprecated.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +/** + * Might still need more work on the Gatsby side to get this to work. + */ +export function Since({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.since; + if (!value) return null; + return ( + + Added to Apollo Client in version {value} + + ); +} +Since.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +export function Summary({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.summary; + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Summary.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +export function Remarks({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.remarks?.replace(/^@remarks/g, ""); + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Remarks.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +export function Example({ + canonicalReference, + collapsible = false, + index = 0, +}) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.examples[index]; + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Example.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, + index: PropTypes.number, +}; diff --git a/docs/shared/ApiDoc/Function.js b/docs/shared/ApiDoc/Function.js new file mode 100644 index 00000000000..97cb0934ce8 --- /dev/null +++ b/docs/shared/ApiDoc/Function.js @@ -0,0 +1,70 @@ +import PropTypes from "prop-types"; +import React from "react"; +import { ApiDocHeading, DocBlock, ParameterTable, useApiDocContext } from "."; + +export function FunctionSignature({ + canonicalReference, + parameterTypes = false, + name = true, + arrow = false, +}) { + const getItem = useApiDocContext(); + const { displayName, parameters, returnType } = getItem(canonicalReference); + + return ( + <> + {name ? displayName : ""}( + {parameters + .map((p) => { + let pStr = p.name; + if (p.optional) { + pStr += "?"; + } + if (parameterTypes) { + pStr += ": " + p.type; + } + return pStr; + }) + .join(", ")} + ){arrow ? " =>" : ":"} {returnType} + + ); +} + +FunctionSignature.propTypes = { + canonicalReference: PropTypes.string.isRequired, + parameterTypes: PropTypes.bool, + name: PropTypes.bool, + arrow: PropTypes.bool, +}; + +export function FunctionDetails({ + canonicalReference, + customParameterOrder, + headingLevel, +}) { + return ( + <> + + + + + ); +} + +FunctionDetails.propTypes = { + canonicalReference: PropTypes.string.isRequired, + headingLevel: PropTypes.number.isRequired, + customParameterOrder: PropTypes.arrayOf(PropTypes.string), +}; diff --git a/docs/shared/ApiDoc/Heading.js b/docs/shared/ApiDoc/Heading.js new file mode 100644 index 00000000000..e4a5aa9db69 --- /dev/null +++ b/docs/shared/ApiDoc/Heading.js @@ -0,0 +1,67 @@ +import { useMDXComponents } from "@mdx-js/react"; +import PropTypes from "prop-types"; +import React from "react"; +import { Box, Heading } from "@chakra-ui/react"; +import { FunctionSignature } from "."; +import { useApiDocContext } from "./Context"; + +const levels = { + 2: "xl", + 3: "lg", + 4: "md", + 5: "sm", + 6: "xs", +}; + +export function ApiDocHeading({ + canonicalReference, + headingLevel, + link = true, +}) { + const MDX = useMDXComponents(); + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const heading = + ( + item.kind === "MethodSignature" || + item.kind === "Function" || + item.kind === "Method" + ) ? + + : item.displayName; + return ( + + + {link ? + + {heading} + + : heading} + + {item.file && ( + + + ({item.file}) + + + )} + + ); +} +ApiDocHeading.propTypes = { + canonicalReference: PropTypes.string.isRequired, + headingLevel: PropTypes.number.isRequired, + link: PropTypes.bool, +}; diff --git a/docs/shared/ApiDoc/InterfaceDetails.js b/docs/shared/ApiDoc/InterfaceDetails.js new file mode 100644 index 00000000000..e4b439181c4 --- /dev/null +++ b/docs/shared/ApiDoc/InterfaceDetails.js @@ -0,0 +1,37 @@ +import PropTypes from "prop-types"; +import React from "react"; +import { ApiDocHeading, DocBlock, PropertySignatureTable } from "."; +export function InterfaceDetails({ + canonicalReference, + headingLevel, + link, + customPropertyOrder, +}) { + return ( + <> + + + + + ); +} + +InterfaceDetails.propTypes = { + canonicalReference: PropTypes.string.isRequired, + headingLevel: PropTypes.number.isRequired, + link: PropTypes.bool, + customPropertyOrder: PropTypes.arrayOf(PropTypes.string), +}; diff --git a/docs/shared/ApiDoc/ParameterTable.js b/docs/shared/ApiDoc/ParameterTable.js new file mode 100644 index 00000000000..49f2a7abf9c --- /dev/null +++ b/docs/shared/ApiDoc/ParameterTable.js @@ -0,0 +1,93 @@ +import { useMDXComponents } from "@mdx-js/react"; + +import PropTypes from "prop-types"; +import React from "react"; +import { GridItem, chakra } from "@chakra-ui/react"; +import { PropertySignatureTable, useApiDocContext } from "."; +import { ResponsiveGrid } from "./ResponsiveGrid"; +import { mdToReact } from "./mdToReact"; + +export function ParameterTable({ canonicalReference }) { + const MDX = useMDXComponents(); + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + + if (item.parameters.length === 0) return null; + + return ( + <> + + + Parameters + + + + Name / Type + Description + + {item.parameters.map((parameter) => { + const baseType = parameter.type.split("<")[0]; + const reference = getItem( + item.references?.find((r) => r.text === baseType) + ?.canonicalReference, + false + ); + const interfaceReference = + reference?.kind === "Interface" ? reference : null; + + return ( + + + + {parameter.name} + {parameter.optional ? + (optional) + : null} + + + {parameter.type} + + + + {mdToReact(parameter.comment)} + + {interfaceReference && ( +
+ + Show/hide child attributes + + +
+ )} +
+ ); + })} +
+ + ); +} + +ParameterTable.propTypes = { + canonicalReference: PropTypes.string.isRequired, +}; diff --git a/docs/shared/ApiDoc/PropertySignatureTable.js b/docs/shared/ApiDoc/PropertySignatureTable.js new file mode 100644 index 00000000000..317b2926f0f --- /dev/null +++ b/docs/shared/ApiDoc/PropertySignatureTable.js @@ -0,0 +1,116 @@ +import { useMDXComponents } from "@mdx-js/react"; + +import PropTypes from "prop-types"; +import React, { useMemo } from "react"; +import { DocBlock, FunctionSignature, useApiDocContext } from "."; +import { GridItem, Text, chakra } from "@chakra-ui/react"; +import { ResponsiveGrid } from "./ResponsiveGrid"; + +export function PropertySignatureTable({ + canonicalReference, + prefix = "", + showHeaders = true, + display = "parent", + customOrder = [], +}) { + const MDX = useMDXComponents(); + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const Wrapper = display === "parent" ? ResponsiveGrid : React.Fragment; + + const sortedProperties = useMemo( + () => + item.properties.map(getItem).sort((a, b) => { + const aIndex = customOrder.indexOf(a.displayName); + const bIndex = customOrder.indexOf(b.displayName); + if (aIndex >= 0 && bIndex >= 0) { + return aIndex - bIndex; + } else if (aIndex >= 0) { + return -1; + } else if (bIndex >= 0) { + return 1; + } else { + return a.displayName.localeCompare(b.displayName); + } + }), + [item.properties, getItem, customOrder] + ); + + return ( + <> + {showHeaders ? + + + Properties + + + : null} + {item.childrenIncomplete ? + +
+ (Warning: some properties might be missing from the table due to + complex inheritance!) +
+ : null} + + + {showHeaders ? + <> + Name / Type + Description + + : null} + + {sortedProperties.map((property) => ( + + + + + + {prefix} + + {property.displayName} + + {property.optional ? + (optional) + : null} + + + {property.kind === "MethodSignature" ? + + : property.type} + + + + + + + ))} + + + ); +} + +PropertySignatureTable.propTypes = { + canonicalReference: PropTypes.string.isRequired, + prefix: PropTypes.string, + showHeaders: PropTypes.bool, + display: PropTypes.oneOf(["parent", "child"]), + customOrder: PropTypes.arrayOf(PropTypes.string), +}; diff --git a/docs/shared/ApiDoc/ResponsiveGrid.js b/docs/shared/ApiDoc/ResponsiveGrid.js new file mode 100644 index 00000000000..691a4afebcf --- /dev/null +++ b/docs/shared/ApiDoc/ResponsiveGrid.js @@ -0,0 +1,77 @@ +import React from "react"; +import { Global } from "@emotion/react"; +import { Grid } from "@chakra-ui/react"; + +/** + * This component is actually over in the docs repo, just repeated here so the + * styles are visible. + */ +export function ResponsiveGridStyles() { + return ( + *, .responsive-grid > details > *": { + background: "var(--chakra-colors-bg)", + }, + ".responsive-grid .cell, .responsive-grid .row": { + padding: "var(--chakra-space-4)", + }, + ".responsive-grid details .first.cell + .cell": { + marginTop: -1, + paddingTop: 0, + }, + ".responsive-grid details h6": { + display: "inline", + }, + ".responsive-grid .heading": { + fontFamily: "var(--chakra-fonts-heading)", + fontWeight: "var(--chakra-fontWeights-normal)", + textTransform: "uppercase", + letterSpacing: "var(--chakra-letterSpacings-wider)", + fontSize: "var(--chakra-fontSizes-xs)", + }, + }} + /> + ); +} + +export function ResponsiveGrid({ children }) { + /* + responsiveness not regarding screen width, but actual available space: + if less than 350px, show only one column + show at most two columns (that's where the 45% hack comes - 45% * 3 won't fit) + */ + + return ( + + {children} + + ); +} diff --git a/docs/shared/ApiDoc/index.js b/docs/shared/ApiDoc/index.js new file mode 100644 index 00000000000..66bfa413afa --- /dev/null +++ b/docs/shared/ApiDoc/index.js @@ -0,0 +1,14 @@ +export { useApiDocContext } from "./Context"; +export { + DocBlock, + Deprecated, + Example, + Remarks, + Since, + Summary, +} from "./DocBlock"; +export { PropertySignatureTable } from "./PropertySignatureTable"; +export { ApiDocHeading } from "./Heading"; +export { InterfaceDetails } from "./InterfaceDetails"; +export { FunctionSignature, FunctionDetails } from "./Function"; +export { ParameterTable } from "./ParameterTable"; diff --git a/docs/shared/ApiDoc/mdToReact.js b/docs/shared/ApiDoc/mdToReact.js new file mode 100644 index 00000000000..307ca38c7bf --- /dev/null +++ b/docs/shared/ApiDoc/mdToReact.js @@ -0,0 +1,20 @@ +import PropTypes from "prop-types"; +import React from "react"; +import ReactMarkdown from "react-markdown"; +import { useMDXComponents } from "@mdx-js/react"; + +export function mdToReact(text) { + const sanitized = text + .replace(/\{@link (\w*)\}/g, "[$1](#$1)") + .replace(//g, ""); + return ; +} + +function RenderMd({ markdown }) { + return ( + {markdown} + ); +} +RenderMd.propTypes = { + markdown: PropTypes.string.isRequired, +}; diff --git a/docs/source/api/core/ApolloClient.mdx b/docs/source/api/core/ApolloClient.mdx index 8795e1d3d88..a66e5713d6d 100644 --- a/docs/source/api/core/ApolloClient.mdx +++ b/docs/source/api/core/ApolloClient.mdx @@ -8,6 +8,8 @@ api_doc: - "@apollo/client!DefaultOptions:interface" --- +import { InterfaceDetails, FunctionDetails, DocBlock, Example } from '../../../shared/ApiDoc'; + The `ApolloClient` class encapsulates Apollo's core client-side API. It backs all available view-layer integrations (React, iOS, and so on). ## The `ApolloClient` constructor @@ -20,33 +22,34 @@ Returns an initialized `ApolloClient` object. #### Example - + For more information on the `defaultOptions` object, see the [Default Options](#DefaultOptions) section below. ## Functions - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + ## Types - + ##### Example `defaultOptions` object diff --git a/netlify.toml b/netlify.toml index 67879a8b0ba..0dc401e05ad 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,7 +13,7 @@ npm run docmodel cd ../ rm -rf monodocs - git clone https://github.com/apollographql/docs --branch main --single-branch monodocs + git clone https://github.com/apollographql/docs --branch pr/expose-hook --single-branch monodocs cd monodocs npm i cp -r ../docs local From dff6acf68ecd63878aa095a57b44f945ba4cc233 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 8 Dec 2023 10:37:24 +0100 Subject: [PATCH 07/23] Update netlify.toml Change deploy preview branch back to `main` --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 0dc401e05ad..67879a8b0ba 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,7 +13,7 @@ npm run docmodel cd ../ rm -rf monodocs - git clone https://github.com/apollographql/docs --branch pr/expose-hook --single-branch monodocs + git clone https://github.com/apollographql/docs --branch main --single-branch monodocs cd monodocs npm i cp -r ../docs local From 221dd99ffd1990f8bd0392543af35e9b08d0fed8 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 8 Dec 2023 13:48:42 +0100 Subject: [PATCH 08/23] Allow usage of WeakMap in React Native Hermes (#10804) Co-authored-by: phryneas --- .changeset/unlucky-rats-decide.md | 5 +++++ .size-limits.json | 4 ++-- src/utilities/common/canUse.ts | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/unlucky-rats-decide.md diff --git a/.changeset/unlucky-rats-decide.md b/.changeset/unlucky-rats-decide.md new file mode 100644 index 00000000000..9be1d2d3961 --- /dev/null +++ b/.changeset/unlucky-rats-decide.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +use WeakMap in React Native with Hermes diff --git a/.size-limits.json b/.size-limits.json index e23614a183f..fb873241928 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 38576, - "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32352 + "dist/apollo-client.min.cjs": 38589, + "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32365 } diff --git a/src/utilities/common/canUse.ts b/src/utilities/common/canUse.ts index 72e56c70388..217cc01158b 100644 --- a/src/utilities/common/canUse.ts +++ b/src/utilities/common/canUse.ts @@ -2,7 +2,9 @@ import { maybe } from "../globals/index.js"; export const canUseWeakMap = typeof WeakMap === "function" && - maybe(() => navigator.product) !== "ReactNative"; + !maybe( + () => navigator.product == "ReactNative" && !(global as any).HermesInternal + ); export const canUseWeakSet = typeof WeakSet === "function"; From 54b5d149f19edb9a1dc3eb75247d3288be23a33e Mon Sep 17 00:00:00 2001 From: Mohit <36567063+mohit23x@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:14:09 +0530 Subject: [PATCH 09/23] Update react-native.md - Adds react native devtool supported by flipper (#11364) Co-authored-by: Lenz Weber-Tronic --- .changeset/fuzzy-eyes-lick.md | 5 ++++ docs/source/integrations/react-native.md | 32 ++++++++++++++++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 .changeset/fuzzy-eyes-lick.md diff --git a/.changeset/fuzzy-eyes-lick.md b/.changeset/fuzzy-eyes-lick.md new file mode 100644 index 00000000000..c69c857fd51 --- /dev/null +++ b/.changeset/fuzzy-eyes-lick.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +Update react-native.md - Adds react native devtool in the documentation diff --git a/docs/source/integrations/react-native.md b/docs/source/integrations/react-native.md index 68dfdd23bf6..b98605641d9 100644 --- a/docs/source/integrations/react-native.md +++ b/docs/source/integrations/react-native.md @@ -38,11 +38,33 @@ For more information on setting up Apollo Client, see [Getting started](../get-s ## Apollo Client Devtools -[React Native Debugger](https://github.com/jhen0409/react-native-debugger) supports the [Apollo Client Devtools](../development-testing/developer-tooling/#apollo-client-devtools): - -1. Install React Native Debugger and open it. -2. Enable "Debug JS Remotely" in your app. -3. If you don't see the Developer Tools panel or the Apollo tab is missing from it, toggle the Developer Tools by right-clicking anywhere and selecting **Toggle Developer Tools**. +#### 1. Using [React Native Debugger](https://github.com/jhen0409/react-native-debugger) + +The React Native Debugger supports the [Apollo Client Devtools](../development-testing/developer-tooling/#apollo-client-devtools): + + 1. Install React Native Debugger and open it. + 2. Enable "Debug JS Remotely" in your app. + 3. If you don't see the Developer Tools panel or the Apollo tab is missing from it, toggle the Developer Tools by right-clicking anywhere and selecting **Toggle Developer Tools**. + +#### 2. Using [Flipper](https://fbflipper.com/) + +A community plugin called [React Native Apollo devtools](https://github.com/razorpay/react-native-apollo-devtools) is available for Flipper, which supports viewing cache data. + + 1. Install Flipper and open it. + 2. Go to add plugin and search for `react-native-apollo-devtools` and install it + 3. Add `react-native-flipper` and `react-native-apollo-devtools-client` as dev dependecy to react native app. + 4. Initialize the plugin with flipper on client side + + ``` + import { apolloDevToolsInit } from 'react-native-apollo-devtools-client'; + const client = new ApolloClient({ + // ... + }) + + if(__DEV__){ + apolloDevToolsInit(client); + } + ``` ## Consuming multipart HTTP via text streaming From 8faf35804eb19b18389f1c8a19276dcdd1c2d004 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:27:35 -0500 Subject: [PATCH 10/23] chore(deps): update actions/stale action to v9 (#11423) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-stale-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 5d54d58ea6d..55a67e4ae69 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Close Stale Issues - uses: actions/stale@v8.0.0 + uses: actions/stale@v9.0.0 with: # # Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. # repo-token: # optional, default is ${{ github.token }} From 6216aaf25c8424ad32791cb9a0bd7b4f145b71d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:27:58 -0500 Subject: [PATCH 11/23] chore(deps): update cimg/node docker tag to v21.4.0 (#11422) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dba3e58d143..3a2662c0352 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: Lint: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm version @@ -24,7 +24,7 @@ jobs: Formatting: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm ci @@ -32,7 +32,7 @@ jobs: Tests: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm run ci:precheck @@ -50,7 +50,7 @@ jobs: BuildTarball: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm run ci:precheck @@ -67,7 +67,7 @@ jobs: framework: type: string docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - attach_workspace: From f74069d383866f5516725d233766871af2903ed2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:55:16 -0500 Subject: [PATCH 12/23] chore(deps): update all devdependencies (#11406) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 382 ++++++++++++++++++++++------------------------ package.json | 18 +-- 2 files changed, 189 insertions(+), 211 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f277c310bf..914c70fb679 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,8 +26,8 @@ "devDependencies": { "@arethetypeswrong/cli": "0.13.2", "@babel/parser": "7.23.5", - "@changesets/changelog-github": "0.4.8", - "@changesets/cli": "2.26.2", + "@changesets/changelog-github": "0.5.0", + "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", "@microsoft/api-extractor": "7.38.3", "@rollup/plugin-node-resolve": "11.2.1", @@ -49,16 +49,16 @@ "@types/react": "18.2.41", "@types/react-dom": "18.2.17", "@types/use-sync-external-store": "0.0.6", - "@typescript-eslint/eslint-plugin": "6.12.0", - "@typescript-eslint/parser": "6.12.0", - "@typescript-eslint/rule-tester": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": "6.14.0", + "@typescript-eslint/rule-tester": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "acorn": "8.11.2", "blob-polyfill": "7.0.20220408", "bytes": "3.1.2", "cross-fetch": "4.0.0", - "eslint": "8.54.0", + "eslint": "8.55.0", "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c", "eslint-plugin-local-rules": "2.0.1", @@ -88,7 +88,7 @@ "rxjs": "7.8.1", "size-limit": "11.0.0", "subscriptions-transport-ws": "0.11.0", - "terser": "5.24.0", + "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", @@ -796,16 +796,16 @@ "dev": true }, "node_modules/@changesets/apply-release-plan": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", - "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.0.tgz", + "integrity": "sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/config": "^2.3.1", - "@changesets/get-version-range-type": "^0.3.2", - "@changesets/git": "^2.0.0", - "@changesets/types": "^5.2.1", + "@changesets/config": "^3.0.0", + "@changesets/get-version-range-type": "^0.4.0", + "@changesets/git": "^3.0.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "detect-indent": "^6.0.0", "fs-extra": "^7.0.1", @@ -847,23 +847,23 @@ } }, "node_modules/@changesets/assemble-release-plan": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", - "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.0.tgz", + "integrity": "sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "semver": "^7.5.3" } }, "node_modules/@changesets/assemble-release-plan/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -876,55 +876,54 @@ } }, "node_modules/@changesets/changelog-git": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz", - "integrity": "sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.0.tgz", + "integrity": "sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1" + "@changesets/types": "^6.0.0" } }, "node_modules/@changesets/changelog-github": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.4.8.tgz", - "integrity": "sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.0.tgz", + "integrity": "sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==", "dev": true, "dependencies": { - "@changesets/get-github-info": "^0.5.2", - "@changesets/types": "^5.2.1", + "@changesets/get-github-info": "^0.6.0", + "@changesets/types": "^6.0.0", "dotenv": "^8.1.0" } }, "node_modules/@changesets/cli": { - "version": "2.26.2", - "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", - "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.27.1.tgz", + "integrity": "sha512-iJ91xlvRnnrJnELTp4eJJEOPjgpF3NOh4qeQehM6Ugiz9gJPRZ2t+TsXun6E3AMN4hScZKjqVXl0TX+C7AB3ZQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/apply-release-plan": "^6.1.4", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/changelog-git": "^0.1.14", - "@changesets/config": "^2.3.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/get-release-plan": "^3.0.17", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", - "@changesets/write": "^0.2.3", + "@changesets/apply-release-plan": "^7.0.0", + "@changesets/assemble-release-plan": "^6.0.0", + "@changesets/changelog-git": "^0.2.0", + "@changesets/config": "^3.0.0", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/get-release-plan": "^4.0.0", + "@changesets/git": "^3.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/pre": "^2.0.0", + "@changesets/read": "^0.6.0", + "@changesets/types": "^6.0.0", + "@changesets/write": "^0.3.0", "@manypkg/get-packages": "^1.1.3", - "@types/is-ci": "^3.0.0", "@types/semver": "^7.5.0", "ansi-colors": "^4.1.3", "chalk": "^2.1.0", + "ci-info": "^3.7.0", "enquirer": "^2.3.0", "external-editor": "^3.1.0", "fs-extra": "^7.0.1", "human-id": "^1.0.2", - "is-ci": "^3.0.1", "meow": "^6.0.0", "outdent": "^0.5.0", "p-limit": "^2.2.0", @@ -963,9 +962,9 @@ } }, "node_modules/@changesets/cli/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -990,36 +989,36 @@ } }, "node_modules/@changesets/config": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", - "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-3.0.0.tgz", + "integrity": "sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==", "dev": true, "dependencies": { - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/logger": "^0.0.5", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1", "micromatch": "^4.0.2" } }, "node_modules/@changesets/errors": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", - "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", + "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", "dev": true, "dependencies": { "extendable-error": "^0.1.5" } }, "node_modules/@changesets/get-dependents-graph": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", - "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-2.0.0.tgz", + "integrity": "sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "chalk": "^2.1.0", "fs-extra": "^7.0.1", @@ -1050,9 +1049,9 @@ } }, "node_modules/@changesets/get-dependents-graph/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1077,9 +1076,9 @@ } }, "node_modules/@changesets/get-github-info": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.2.tgz", - "integrity": "sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz", + "integrity": "sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==", "dev": true, "dependencies": { "dataloader": "^1.4.0", @@ -1087,35 +1086,35 @@ } }, "node_modules/@changesets/get-release-plan": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", - "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-4.0.0.tgz", + "integrity": "sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/config": "^2.3.1", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", + "@changesets/assemble-release-plan": "^6.0.0", + "@changesets/config": "^3.0.0", + "@changesets/pre": "^2.0.0", + "@changesets/read": "^0.6.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3" } }, "node_modules/@changesets/get-version-range-type": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", - "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz", + "integrity": "sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==", "dev": true }, "node_modules/@changesets/git": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", - "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-3.0.0.tgz", + "integrity": "sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "is-subdir": "^1.1.1", "micromatch": "^4.0.2", @@ -1123,9 +1122,9 @@ } }, "node_modules/@changesets/logger": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", - "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.1.0.tgz", + "integrity": "sha512-pBrJm4CQm9VqFVwWnSqKEfsS2ESnwqwH+xR7jETxIErZcfd1u2zBSqrHbRHR7xjhSgep9x2PSKFKY//FAshA3g==", "dev": true, "dependencies": { "chalk": "^2.1.0" @@ -1167,39 +1166,39 @@ } }, "node_modules/@changesets/parse": { - "version": "0.3.16", - "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", - "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.4.0.tgz", + "integrity": "sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "js-yaml": "^3.13.1" } }, "node_modules/@changesets/pre": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", - "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.0.tgz", + "integrity": "sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1" } }, "node_modules/@changesets/read": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", - "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.0.tgz", + "integrity": "sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/parse": "^0.3.16", - "@changesets/types": "^5.2.1", + "@changesets/git": "^3.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/parse": "^0.4.0", + "@changesets/types": "^6.0.0", "chalk": "^2.1.0", "fs-extra": "^7.0.1", "p-filter": "^2.1.0" @@ -1241,19 +1240,19 @@ } }, "node_modules/@changesets/types": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", - "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.0.0.tgz", + "integrity": "sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==", "dev": true }, "node_modules/@changesets/write": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz", - "integrity": "sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.3.0.tgz", + "integrity": "sha512-slGLb21fxZVUYbyea+94uFiD6ntQW0M2hIKNznFizDhZPDgn2c/fv1UzzlW43RVzh1BEDuIqW6hzlJ1OflNmcw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "fs-extra": "^7.0.1", "human-id": "^1.0.2", "prettier": "^2.7.1" @@ -1673,9 +1672,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", - "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -1741,9 +1740,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", - "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", + "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3203,15 +3202,6 @@ "hoist-non-react-statics": "^3.3.0" } }, - "node_modules/@types/is-ci": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.0.tgz", - "integrity": "sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.1.0" - } - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -3425,16 +3415,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.12.0.tgz", - "integrity": "sha512-XOpZ3IyJUIV1b15M7HVOpgQxPPF7lGXgsfcEIu3yDxFPaf/xZKt7s9QO/pbk7vpWQyVulpJbu4E5LwpZiQo4kA==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.14.0.tgz", + "integrity": "sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/type-utils": "6.12.0", - "@typescript-eslint/utils": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/type-utils": "6.14.0", + "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -3475,15 +3465,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.12.0.tgz", - "integrity": "sha512-s8/jNFPKPNRmXEnNXfuo1gemBdVmpQsK1pcu+QIvuNJuhFzGrpD7WjOcvDc/+uEdfzSYpNu7U/+MmbScjoQ6vg==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.14.0.tgz", + "integrity": "sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4" }, "engines": { @@ -3503,13 +3493,13 @@ } }, "node_modules/@typescript-eslint/rule-tester": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-6.12.0.tgz", - "integrity": "sha512-O1kFPAuX9H63GNDTyd8GKO5RioxRX96mAVcevbUywVtkrp8eoVLEf2VmKIKCeYAM5oZst52DMVCQXjcQuyxq5w==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-6.14.0.tgz", + "integrity": "sha512-SCxrm68pudpNTUGCqaGxgqNujca+sEjJXA52gH3b0q1DrVBq1VSlxgO9kSmodhbXKVyS7UGlbz3dPDqa65gR2g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "ajv": "^6.10.0", "lodash.merge": "4.6.2", "semver": "^7.5.4" @@ -3542,13 +3532,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.12.0.tgz", - "integrity": "sha512-5gUvjg+XdSj8pcetdL9eXJzQNTl3RD7LgUiYTl8Aabdi8hFkaGSYnaS6BLc0BGNaDH+tVzVwmKtWvu0jLgWVbw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", + "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0" + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3559,13 +3549,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.12.0.tgz", - "integrity": "sha512-WWmRXxhm1X8Wlquj+MhsAG4dU/Blvf1xDgGaYCzfvStP2NwPQh6KBvCDbiOEvaE0filhranjIlK/2fSTVwtBng==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.14.0.tgz", + "integrity": "sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -3586,9 +3576,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.12.0.tgz", - "integrity": "sha512-MA16p/+WxM5JG/F3RTpRIcuOghWO30//VEOvzubM8zuOOBYXsP+IfjoCXXiIfy2Ta8FRh9+IO9QLlaFQUU+10Q==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", + "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3599,13 +3589,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.12.0.tgz", - "integrity": "sha512-vw9E2P9+3UUWzhgjyyVczLWxZ3GuQNT7QpnIY3o5OMeLO/c8oHljGc8ZpryBMIyympiAAaKgw9e5Hl9dCWFOYw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", + "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3641,17 +3631,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.12.0.tgz", - "integrity": "sha512-LywPm8h3tGEbgfyjYnu3dauZ0U7R60m+miXgKcZS8c7QALO9uWJdvNoP+duKTk2XMWc7/Q3d/QiCuLN9X6SWyQ==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz", + "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/typescript-estree": "6.14.0", "semver": "^7.5.4" }, "engines": { @@ -3681,12 +3671,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.12.0.tgz", - "integrity": "sha512-rg3BizTZHF1k3ipn8gfrzDXXSFKyOEB5zxYXInQ6z0hUvmQlhaZQzK+YmHmNViMA9HzW5Q9+bPPt90bU6GQwyw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", + "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", + "@typescript-eslint/types": "6.14.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -5638,15 +5628,15 @@ } }, "node_modules/eslint": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", - "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", + "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.54.0", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.55.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -6050,9 +6040,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -7299,18 +7289,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-core-module": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", @@ -11784,9 +11762,9 @@ } }, "node_modules/terser": { - "version": "5.24.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.24.0.tgz", - "integrity": "sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw==", + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.26.0.tgz", + "integrity": "sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index 731d8529c7b..24b3c4253bf 100644 --- a/package.json +++ b/package.json @@ -107,8 +107,8 @@ "devDependencies": { "@arethetypeswrong/cli": "0.13.2", "@babel/parser": "7.23.5", - "@changesets/changelog-github": "0.4.8", - "@changesets/cli": "2.26.2", + "@changesets/changelog-github": "0.5.0", + "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", "@microsoft/api-extractor": "7.38.3", "@rollup/plugin-node-resolve": "11.2.1", @@ -130,16 +130,16 @@ "@types/react": "18.2.41", "@types/react-dom": "18.2.17", "@types/use-sync-external-store": "0.0.6", - "@typescript-eslint/eslint-plugin": "6.12.0", - "@typescript-eslint/parser": "6.12.0", - "@typescript-eslint/rule-tester": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": "6.14.0", + "@typescript-eslint/rule-tester": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "acorn": "8.11.2", "blob-polyfill": "7.0.20220408", "bytes": "3.1.2", "cross-fetch": "4.0.0", - "eslint": "8.54.0", + "eslint": "8.55.0", "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c", "eslint-plugin-local-rules": "2.0.1", @@ -169,7 +169,7 @@ "rxjs": "7.8.1", "size-limit": "11.0.0", "subscriptions-transport-ws": "0.11.0", - "terser": "5.24.0", + "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", From 065fc34a4b08a3125d328ca775ce465400e85631 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:56:13 -0500 Subject: [PATCH 13/23] Bump @adobe/css-tools from 4.3.1 to 4.3.2 (#11401) Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1 to 4.3.2. - [Changelog](https://github.com/adobe/css-tools/blob/main/History.md) - [Commits](https://github.com/adobe/css-tools/commits) --- updated-dependencies: - dependency-name: "@adobe/css-tools" dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 914c70fb679..9f08709d71d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -135,9 +135,9 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", - "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.2.tgz", + "integrity": "sha512-DA5a1C0gD/pLOvhv33YMrbf2FK3oUzwNl9oOJqE4XVjuEtt6XIakRcsd7eLiOSPkp1kTRQGICTA8cKra/vFbjw==", "dev": true }, "node_modules/@andrewbranch/untar.js": { From f92db4e809e113000b30fc081b7cf1648efe3446 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:47:07 -0500 Subject: [PATCH 14/23] chore(deps): update all dependencies - patch updates (#11421) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .circleci/config.yml | 2 +- package-lock.json | 179 +++++++++++++++++++++++-------------------- package.json | 22 +++--- 3 files changed, 108 insertions(+), 95 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a2662c0352..d1ab64a100e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 jobs: # Filesize: diff --git a/package-lock.json b/package-lock.json index 9f08709d71d..1934beaaf50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,15 +24,15 @@ "zen-observable-ts": "^1.2.5" }, "devDependencies": { - "@arethetypeswrong/cli": "0.13.2", + "@arethetypeswrong/cli": "0.13.3", "@babel/parser": "7.23.5", "@changesets/changelog-github": "0.5.0", "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", - "@microsoft/api-extractor": "7.38.3", + "@microsoft/api-extractor": "7.38.5", "@rollup/plugin-node-resolve": "11.2.1", - "@size-limit/esbuild-why": "11.0.0", - "@size-limit/preset-small-lib": "11.0.0", + "@size-limit/esbuild-why": "11.0.1", + "@size-limit/preset-small-lib": "11.0.1", "@testing-library/jest-dom": "6.1.5", "@testing-library/react": "14.1.2", "@testing-library/react-12": "npm:@testing-library/react@^12", @@ -42,11 +42,11 @@ "@types/fetch-mock": "7.3.8", "@types/glob": "8.1.0", "@types/hoist-non-react-statics": "3.3.5", - "@types/jest": "29.5.10", + "@types/jest": "29.5.11", "@types/lodash": "4.14.202", - "@types/node": "20.10.3", + "@types/node": "20.10.4", "@types/node-fetch": "2.6.9", - "@types/react": "18.2.41", + "@types/react": "18.2.43", "@types/react-dom": "18.2.17", "@types/use-sync-external-store": "0.0.6", "@typescript-eslint/eslint-plugin": "6.14.0", @@ -73,7 +73,7 @@ "jest-junit": "16.0.0", "lodash": "4.17.21", "patch-package": "8.0.0", - "prettier": "3.1.0", + "prettier": "3.1.1", "react": "18.2.0", "react-17": "npm:react@^17", "react-dom": "18.2.0", @@ -86,16 +86,16 @@ "rollup-plugin-cleanup": "3.2.1", "rollup-plugin-terser": "7.0.2", "rxjs": "7.8.1", - "size-limit": "11.0.0", + "size-limit": "11.0.1", "subscriptions-transport-ws": "0.11.0", "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", "ts-morph": "20.0.0", - "ts-node": "10.9.1", + "ts-node": "10.9.2", "typedoc": "0.25.0", - "typescript": "5.3.2", + "typescript": "5.3.3", "wait-for-observables": "1.0.3", "web-streams-polyfill": "3.2.1", "whatwg-fetch": "3.6.19" @@ -147,12 +147,12 @@ "dev": true }, "node_modules/@arethetypeswrong/cli": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.13.2.tgz", - "integrity": "sha512-eqRWeFFiI58xwsiUfZSdZsmNCaqqtxmSPP9554ajiCDrB/aNzq5VktVK7dNiT9PamunNeoej4KbDBnkNwVacvg==", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.13.3.tgz", + "integrity": "sha512-lA29j9fkRGq+hNE3zQGxD/d8WmjhimSaPU2887CBe0Yv3C1UbIWvy51mYerp3/NoevjBLKSWhHmP5oY/eavtjQ==", "dev": true, "dependencies": { - "@arethetypeswrong/core": "0.13.2", + "@arethetypeswrong/core": "0.13.3", "chalk": "^4.1.2", "cli-table3": "^0.6.3", "commander": "^10.0.1", @@ -204,9 +204,9 @@ } }, "node_modules/@arethetypeswrong/core": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.13.2.tgz", - "integrity": "sha512-1l6ygar+6TH4o1JipWWGCEZlOhAwEShm1yKx+CgIByNjCzufbu6k9DNbDmBjdouusNRhBIOYQe1UHnJig+GtAw==", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.13.3.tgz", + "integrity": "sha512-oxa26D3z5DEv9LGzfJWV/6PhQd170dFfDOXl9J3cGRNLo2B68zj6/YOD1RJaYF/kmxechdXT1XyGUPOtkXv8Lg==", "dev": true, "dependencies": { "@andrewbranch/untar.js": "^1.0.3", @@ -234,6 +234,19 @@ "node": ">=10" } }, + "node_modules/@arethetypeswrong/core/node_modules/typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@babel/code-frame": { "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", @@ -2453,15 +2466,15 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.38.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.38.3.tgz", - "integrity": "sha512-xt9iYyC5f39281j77JTA9C3ISJpW1XWkCcnw+2vM78CPnro6KhPfwQdPDfwS5JCPNuq0grm8cMdPUOPvrchDWw==", + "version": "7.38.5", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.38.5.tgz", + "integrity": "sha512-c/w2zfqBcBJxaCzpJNvFoouWewcYrUOfeu5ZkWCCIXTF9a/gXM85RGevEzlMAIEGM/kssAAZSXRJIZ3Q5vLFow==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.28.2", + "@microsoft/api-extractor-model": "7.28.3", "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.61.0", + "@rushstack/node-core-library": "3.62.0", "@rushstack/rig-package": "0.5.1", "@rushstack/ts-command-line": "4.17.1", "colors": "~1.2.1", @@ -2476,14 +2489,14 @@ } }, "node_modules/@microsoft/api-extractor-model": { - "version": "7.28.2", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.2.tgz", - "integrity": "sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.3.tgz", + "integrity": "sha512-wT/kB2oDbdZXITyDh2SQLzaWwTOFbV326fP0pUwNW00WeliARs0qjmXBWmGWardEzp2U3/axkO3Lboqun6vrig==", "dev": true, "dependencies": { "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.61.0" + "@rushstack/node-core-library": "3.62.0" } }, "node_modules/@microsoft/api-extractor/node_modules/semver": { @@ -2634,9 +2647,9 @@ "dev": true }, "node_modules/@rushstack/node-core-library": { - "version": "3.61.0", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.61.0.tgz", - "integrity": "sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==", + "version": "3.62.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.62.0.tgz", + "integrity": "sha512-88aJn2h8UpSvdwuDXBv1/v1heM6GnBf3RjEy6ZPP7UnzHNCqOHA2Ut+ScYUbXcqIdfew9JlTAe3g+cnX9xQ/Aw==", "dev": true, "dependencies": { "colors": "~1.2.1", @@ -2742,25 +2755,25 @@ } }, "node_modules/@size-limit/esbuild": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.0.0.tgz", - "integrity": "sha512-OOmba2ZuMpaUhmBXgCfgrO7L6zkUDwvFFfW8T+dK08968LQ79Q+kNgEXQAd+dhj9TlTkHyyEDczWmx16e9cXoQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.0.1.tgz", + "integrity": "sha512-JXxzmDW7Rch6yxd4u8g6uE21g34oT7fk7Ex2gfDwN4TtciOghI3By4fqxXOwGYkDueEcIw3LXNGjHnTS8Dz5nA==", "dev": true, "dependencies": { - "esbuild": "^0.19.5", - "nanoid": "^5.0.3" + "esbuild": "^0.19.8", + "nanoid": "^5.0.4" }, "engines": { "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@size-limit/esbuild-why": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.0.0.tgz", - "integrity": "sha512-YTEmxCBE5PF6LH9lvNYXJM/h7XqVjpCVFVf2NrsJ75d3HdU8q77WriI7/T1++reBf8GfUhY5RIyASdR1ZJ8S4w==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.0.1.tgz", + "integrity": "sha512-yZm93gskbV+4/XBxQ3Aju+JxkmxaqmzAFm1h+fYk4RXvFb742dcACEXFDy2I8jummF7n7lV/UYNqVOFPLvHW0Q==", "dev": true, "dependencies": { "esbuild-visualizer": "^0.4.1", @@ -2770,7 +2783,7 @@ "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@size-limit/esbuild-why/node_modules/open": { @@ -2792,29 +2805,29 @@ } }, "node_modules/@size-limit/file": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.0.0.tgz", - "integrity": "sha512-tTg6sSiFbiogiof3GV4iIRCPS4+46Hvq4QWXGXp00Be/tOnpglXF62xNpCfFwefx9YCXxCyeYSqqaRBjpRCsmQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.0.1.tgz", + "integrity": "sha512-ioSYJ1WY66kc9+3dgTHi5mT/gcaNNCJ22xU87cjzfKiNxmol+lGsNKbplmrJf+QezvPH9kRIFOWxBjGY+DOt3g==", "dev": true, "engines": { "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@size-limit/preset-small-lib": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.0.0.tgz", - "integrity": "sha512-B4KDPbx5E8Vsn/aXilt2iAeofRBJdT8svQRSylTQPw5RkrumXUBKioM1dmWUXcnuHR2zUveJXlMxGmbdmxbJpQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.0.1.tgz", + "integrity": "sha512-c1N5/wN5FRQ03aOpoCw9ed2TP/1cmjt8vKAeTxO40OSfj6ImkpkMarl7e7pCnBElMULc993aUP5UjFhDN6bU4w==", "dev": true, "dependencies": { - "@size-limit/esbuild": "11.0.0", - "@size-limit/file": "11.0.0", - "size-limit": "11.0.0" + "@size-limit/esbuild": "11.0.1", + "@size-limit/file": "11.0.1", + "size-limit": "11.0.1" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@testing-library/dom": { @@ -3227,9 +3240,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.10", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.10.tgz", - "integrity": "sha512-tE4yxKEphEyxj9s4inideLHktW/x6DwesIwWZ9NN1FKf9zbJYsnhBoA9vrHA/IuIOKwPa5PcFBNV4lpMIOEzyQ==", + "version": "29.5.11", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", + "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -3310,9 +3323,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", - "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", + "version": "20.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", + "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3341,9 +3354,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.41", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.41.tgz", - "integrity": "sha512-CwOGr/PiLiNBxEBqpJ7fO3kocP/2SSuC9fpH5K7tusrg4xPSRT/193rzolYwQnTN02We/ATXKnb6GqA5w4fRxw==", + "version": "18.2.43", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.43.tgz", + "integrity": "sha512-nvOV01ZdBdd/KW6FahSbcNplt2jCJfyWdTos61RYHV+FVv5L/g9AOX1bmbVcWcLFL8+KHQfh1zVIQrud6ihyQA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -9065,12 +9078,12 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/lines-and-columns": { @@ -9521,9 +9534,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.3.tgz", - "integrity": "sha512-I7X2b22cxA4LIHXPSqbBCEQSL+1wv8TuoefejsX4HFWyC6jc5JG7CEaxOltiKjc1M+YCS2YkrZZcj4+dytw9GA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.4.tgz", + "integrity": "sha512-vAjmBf13gsmhXSgBrtIclinISzFFy22WwCYoyilZlsrRXNIHSwgFQ1bEdjRwMT3aoadeIF6HMuDRlOxzfXV8ig==", "dev": true, "funding": [ { @@ -10301,9 +10314,9 @@ } }, "node_modules/prettier": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", - "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -11130,15 +11143,15 @@ "dev": true }, "node_modules/size-limit": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.0.0.tgz", - "integrity": "sha512-6+i4rE1GRzx/vRpuitRYQiZJNTXJjde+4P2NPg8AK7pURrE1+hA3mGstzvT8vQ8DuYFnvp9fh4CHM7Heq3EKXA==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.0.1.tgz", + "integrity": "sha512-6L80ocVspWPrhIRg8kPl41VypqTGH8/lu9e6TJiSJpkNLtOR2h/EEqdAO/wNJOv/sUVtjX+lVEWrzBpItGP+gQ==", "dev": true, "dependencies": { "bytes-iec": "^3.1.1", "chokidar": "^3.5.3", "globby": "^14.0.0", - "lilconfig": "^2.1.0", + "lilconfig": "^3.0.0", "nanospinner": "^1.1.0", "picocolors": "^1.0.0" }, @@ -12013,9 +12026,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -12056,9 +12069,9 @@ } }, "node_modules/ts-node/node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz", + "integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==", "dev": true, "engines": { "node": ">=0.4.0" @@ -12232,9 +12245,9 @@ } }, "node_modules/typescript": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", - "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 24b3c4253bf..49dd9460160 100644 --- a/package.json +++ b/package.json @@ -105,15 +105,15 @@ "zen-observable-ts": "^1.2.5" }, "devDependencies": { - "@arethetypeswrong/cli": "0.13.2", + "@arethetypeswrong/cli": "0.13.3", "@babel/parser": "7.23.5", "@changesets/changelog-github": "0.5.0", "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", - "@microsoft/api-extractor": "7.38.3", + "@microsoft/api-extractor": "7.38.5", "@rollup/plugin-node-resolve": "11.2.1", - "@size-limit/esbuild-why": "11.0.0", - "@size-limit/preset-small-lib": "11.0.0", + "@size-limit/esbuild-why": "11.0.1", + "@size-limit/preset-small-lib": "11.0.1", "@testing-library/jest-dom": "6.1.5", "@testing-library/react": "14.1.2", "@testing-library/react-12": "npm:@testing-library/react@^12", @@ -123,11 +123,11 @@ "@types/fetch-mock": "7.3.8", "@types/glob": "8.1.0", "@types/hoist-non-react-statics": "3.3.5", - "@types/jest": "29.5.10", + "@types/jest": "29.5.11", "@types/lodash": "4.14.202", - "@types/node": "20.10.3", + "@types/node": "20.10.4", "@types/node-fetch": "2.6.9", - "@types/react": "18.2.41", + "@types/react": "18.2.43", "@types/react-dom": "18.2.17", "@types/use-sync-external-store": "0.0.6", "@typescript-eslint/eslint-plugin": "6.14.0", @@ -154,7 +154,7 @@ "jest-junit": "16.0.0", "lodash": "4.17.21", "patch-package": "8.0.0", - "prettier": "3.1.0", + "prettier": "3.1.1", "react": "18.2.0", "react-17": "npm:react@^17", "react-dom": "18.2.0", @@ -167,16 +167,16 @@ "rollup-plugin-cleanup": "3.2.1", "rollup-plugin-terser": "7.0.2", "rxjs": "7.8.1", - "size-limit": "11.0.0", + "size-limit": "11.0.1", "subscriptions-transport-ws": "0.11.0", "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", "ts-morph": "20.0.0", - "ts-node": "10.9.1", + "ts-node": "10.9.2", "typedoc": "0.25.0", - "typescript": "5.3.2", + "typescript": "5.3.3", "wait-for-observables": "1.0.3", "web-streams-polyfill": "3.2.1", "whatwg-fetch": "3.6.19" From 2a471646616e3af1b5c039e961f8d5717fad8f32 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 14 Dec 2023 13:08:11 +0100 Subject: [PATCH 15/23] Persisted Query Link: improve memory management (#11369) --- .../api-report-link_persisted-queries.md | 4 +- .changeset/thick-tips-cry.md | 9 + .size-limits.json | 4 +- .../__tests__/persisted-queries.test.ts | 63 +++- .../__tests__/react.test.tsx | 8 +- src/link/persisted-queries/index.ts | 283 +++++++++--------- 6 files changed, 232 insertions(+), 139 deletions(-) create mode 100644 .changeset/thick-tips-cry.md diff --git a/.api-reports/api-report-link_persisted-queries.md b/.api-reports/api-report-link_persisted-queries.md index dda0d3dd1db..353d48364e6 100644 --- a/.api-reports/api-report-link_persisted-queries.md +++ b/.api-reports/api-report-link_persisted-queries.md @@ -57,7 +57,9 @@ interface BaseOptions { // Warning: (ae-forgotten-export) The symbol "ApolloLink" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export const createPersistedQueryLink: (options: PersistedQueryLink.Options) => ApolloLink; +export const createPersistedQueryLink: (options: PersistedQueryLink.Options) => ApolloLink & { + resetHashCache: () => void; +}; // @public (undocumented) interface DefaultContext extends Record { diff --git a/.changeset/thick-tips-cry.md b/.changeset/thick-tips-cry.md new file mode 100644 index 00000000000..407513ec1c7 --- /dev/null +++ b/.changeset/thick-tips-cry.md @@ -0,0 +1,9 @@ +--- +"@apollo/client": patch +--- + +Persisted Query Link: improve memory management +* use LRU `WeakCache` instead of `WeakMap` to keep a limited number of hash results +* hash cache is initiated lazily, only when needed +* expose `persistedLink.resetHashCache()` method +* reset hash cache if the upstream server reports it doesn't accept persisted queries diff --git a/.size-limits.json b/.size-limits.json index fb873241928..1ac8be3319e 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 38589, - "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32365 + "dist/apollo-client.min.cjs": 38535, + "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32310 } diff --git a/src/link/persisted-queries/__tests__/persisted-queries.test.ts b/src/link/persisted-queries/__tests__/persisted-queries.test.ts index ea8b56e660a..32d75fe5136 100644 --- a/src/link/persisted-queries/__tests__/persisted-queries.test.ts +++ b/src/link/persisted-queries/__tests__/persisted-queries.test.ts @@ -66,7 +66,7 @@ const giveUpResponse = JSON.stringify({ errors: giveUpErrors }); const giveUpResponseWithCode = JSON.stringify({ errors: giveUpErrorsWithCode }); const multiResponse = JSON.stringify({ errors: multipleErrors }); -export function sha256(data: string) { +function sha256(data: string) { const hash = crypto.createHash("sha256"); hash.update(data); return hash.digest("hex"); @@ -151,6 +151,32 @@ describe("happy path", () => { }, reject); }); + it("clears the cache when calling `resetHashCache`", async () => { + fetchMock.post( + "/graphql", + () => new Promise((resolve) => resolve({ body: response })), + { repeat: 1 } + ); + + const hashRefs: WeakRef[] = []; + function hash(query: string) { + const newHash = new String(query); + hashRefs.push(new WeakRef(newHash)); + return newHash as string; + } + const persistedLink = createPersistedQuery({ sha256: hash }); + await new Promise((complete) => + execute(persistedLink.concat(createHttpLink()), { + query, + variables, + }).subscribe({ complete }) + ); + + await expect(hashRefs[0]).not.toBeGarbageCollected(); + persistedLink.resetHashCache(); + await expect(hashRefs[0]).toBeGarbageCollected(); + }); + itAsync("supports loading the hash from other method", (resolve, reject) => { fetchMock.post( "/graphql", @@ -517,6 +543,41 @@ describe("failure path", () => { }) ); + it.each([ + ["error message", giveUpResponse], + ["error code", giveUpResponseWithCode], + ] as const)( + "clears the cache when receiving NotSupported error (%s)", + async (_description, failingResponse) => { + fetchMock.post( + "/graphql", + () => new Promise((resolve) => resolve({ body: failingResponse })), + { repeat: 1 } + ); + fetchMock.post( + "/graphql", + () => new Promise((resolve) => resolve({ body: response })), + { repeat: 1 } + ); + + const hashRefs: WeakRef[] = []; + function hash(query: string) { + const newHash = new String(query); + hashRefs.push(new WeakRef(newHash)); + return newHash as string; + } + const persistedLink = createPersistedQuery({ sha256: hash }); + await new Promise((complete) => + execute(persistedLink.concat(createHttpLink()), { + query, + variables, + }).subscribe({ complete }) + ); + + await expect(hashRefs[0]).toBeGarbageCollected(); + } + ); + itAsync("works with multiple errors", (resolve, reject) => { fetchMock.post( "/graphql", diff --git a/src/link/persisted-queries/__tests__/react.test.tsx b/src/link/persisted-queries/__tests__/react.test.tsx index 07c3fe7375e..b05e7d98f32 100644 --- a/src/link/persisted-queries/__tests__/react.test.tsx +++ b/src/link/persisted-queries/__tests__/react.test.tsx @@ -4,6 +4,7 @@ import * as ReactDOM from "react-dom/server"; import gql from "graphql-tag"; import { print } from "graphql"; import fetchMock from "fetch-mock"; +import crypto from "crypto"; import { ApolloProvider } from "../../../react/context"; import { InMemoryCache as Cache } from "../../../cache/inmemory/inMemoryCache"; @@ -12,7 +13,12 @@ import { createHttpLink } from "../../http/createHttpLink"; import { graphql } from "../../../react/hoc/graphql"; import { getDataFromTree } from "../../../react/ssr/getDataFromTree"; import { createPersistedQueryLink as createPersistedQuery, VERSION } from ".."; -import { sha256 } from "./persisted-queries.test"; + +function sha256(data: string) { + const hash = crypto.createHash("sha256"); + hash.update(data); + return hash.digest("hex"); +} // Necessary configuration in order to mock multiple requests // to a single (/graphql) endpoint diff --git a/src/link/persisted-queries/index.ts b/src/link/persisted-queries/index.ts index fa4c64bac58..95c4129c802 100644 --- a/src/link/persisted-queries/index.ts +++ b/src/link/persisted-queries/index.ts @@ -12,6 +12,7 @@ import type { import { Observable, compact, isNonEmptyArray } from "../../utilities/index.js"; import type { NetworkError } from "../../errors/index.js"; import type { ServerError } from "../utils/index.js"; +import { WeakCache } from "@wry/caches"; export const VERSION = 1; @@ -93,7 +94,10 @@ function operationDefinesMutation(operation: Operation) { export const createPersistedQueryLink = ( options: PersistedQueryLink.Options ) => { - const hashesByQuery = new WeakMap>(); + let hashesByQuery: WeakCache> | undefined; + function resetHashCache() { + hashesByQuery = undefined; + } // Ensure a SHA-256 hash function is provided, if a custom hash // generation function is not provided. We don't supply a SHA-256 hash // function by default, to avoid forcing one as a dependency. Developers @@ -135,149 +139,160 @@ export const createPersistedQueryLink = ( // what to do with the bogus query. return getHashPromise(query); } + if (!hashesByQuery) { + hashesByQuery = + new WeakCache(/** TODO: decide on a maximum size (will do all max sizes in a combined separate PR) */); + } let hash = hashesByQuery.get(query)!; if (!hash) hashesByQuery.set(query, (hash = getHashPromise(query))); return hash; } - return new ApolloLink((operation, forward) => { - invariant( - forward, - "PersistedQueryLink cannot be the last link in the chain." - ); - - const { query } = operation; - - return new Observable((observer: Observer) => { - let subscription: ObservableSubscription; - let retried = false; - let originalFetchOptions: any; - let setFetchOptions = false; - const maybeRetry = ( - { - response, - networkError, - }: { response?: ExecutionResult; networkError?: ServerError }, - cb: () => void - ) => { - if (!retried && ((response && response.errors) || networkError)) { - retried = true; - - const graphQLErrors: GraphQLError[] = []; - - const responseErrors = response && response.errors; - if (isNonEmptyArray(responseErrors)) { - graphQLErrors.push(...responseErrors); - } - - // Network errors can return GraphQL errors on for example a 403 - let networkErrors; - if (typeof networkError?.result !== "string") { - networkErrors = - networkError && - networkError.result && - (networkError.result.errors as GraphQLError[]); - } - if (isNonEmptyArray(networkErrors)) { - graphQLErrors.push(...networkErrors); - } - - const disablePayload: ErrorResponse = { + return Object.assign( + new ApolloLink((operation, forward) => { + invariant( + forward, + "PersistedQueryLink cannot be the last link in the chain." + ); + + const { query } = operation; + + return new Observable((observer: Observer) => { + let subscription: ObservableSubscription; + let retried = false; + let originalFetchOptions: any; + let setFetchOptions = false; + const maybeRetry = ( + { response, networkError, - operation, - graphQLErrors: - isNonEmptyArray(graphQLErrors) ? graphQLErrors : void 0, - meta: processErrors(graphQLErrors), - }; - - // if the server doesn't support persisted queries, don't try anymore - supportsPersistedQueries = !disable(disablePayload); - - // if its not found, we can try it again, otherwise just report the error - if (retry(disablePayload)) { - // need to recall the link chain - if (subscription) subscription.unsubscribe(); - // actually send the query this time - operation.setContext({ - http: { - includeQuery: true, - includeExtensions: supportsPersistedQueries, - }, - fetchOptions: { - // Since we're including the full query, which may be - // large, we should send it in the body of a POST request. - // See issue #7456. - method: "POST", - }, - }); - if (setFetchOptions) { - operation.setContext({ fetchOptions: originalFetchOptions }); + }: { response?: ExecutionResult; networkError?: ServerError }, + cb: () => void + ) => { + if (!retried && ((response && response.errors) || networkError)) { + retried = true; + + const graphQLErrors: GraphQLError[] = []; + + const responseErrors = response && response.errors; + if (isNonEmptyArray(responseErrors)) { + graphQLErrors.push(...responseErrors); } - subscription = forward(operation).subscribe(handler); - return; - } - } - cb(); - }; - const handler = { - next: (response: ExecutionResult) => { - maybeRetry({ response }, () => observer.next!(response)); - }, - error: (networkError: ServerError) => { - maybeRetry({ networkError }, () => observer.error!(networkError)); - }, - complete: observer.complete!.bind(observer), - }; - - // don't send the query the first time - operation.setContext({ - http: { - includeQuery: !supportsPersistedQueries, - includeExtensions: supportsPersistedQueries, - }, - }); + // Network errors can return GraphQL errors on for example a 403 + let networkErrors; + if (typeof networkError?.result !== "string") { + networkErrors = + networkError && + networkError.result && + (networkError.result.errors as GraphQLError[]); + } + if (isNonEmptyArray(networkErrors)) { + graphQLErrors.push(...networkErrors); + } - // If requested, set method to GET if there are no mutations. Remember the - // original fetchOptions so we can restore them if we fall back to a - // non-hashed request. - if ( - useGETForHashedQueries && - supportsPersistedQueries && - !operationDefinesMutation(operation) - ) { - operation.setContext( - ({ fetchOptions = {} }: { fetchOptions: Record }) => { - originalFetchOptions = fetchOptions; - return { - fetchOptions: { - ...fetchOptions, - method: "GET", - }, + const disablePayload: ErrorResponse = { + response, + networkError, + operation, + graphQLErrors: + isNonEmptyArray(graphQLErrors) ? graphQLErrors : void 0, + meta: processErrors(graphQLErrors), }; + + // if the server doesn't support persisted queries, don't try anymore + supportsPersistedQueries = !disable(disablePayload); + if (!supportsPersistedQueries) { + // clear hashes from cache, we don't need them anymore + resetHashCache(); + } + + // if its not found, we can try it again, otherwise just report the error + if (retry(disablePayload)) { + // need to recall the link chain + if (subscription) subscription.unsubscribe(); + // actually send the query this time + operation.setContext({ + http: { + includeQuery: true, + includeExtensions: supportsPersistedQueries, + }, + fetchOptions: { + // Since we're including the full query, which may be + // large, we should send it in the body of a POST request. + // See issue #7456. + method: "POST", + }, + }); + if (setFetchOptions) { + operation.setContext({ fetchOptions: originalFetchOptions }); + } + subscription = forward(operation).subscribe(handler); + + return; + } } - ); - setFetchOptions = true; - } - - if (supportsPersistedQueries) { - getQueryHash(query) - .then((sha256Hash) => { - operation.extensions.persistedQuery = { - version: VERSION, - sha256Hash, - }; - subscription = forward(operation).subscribe(handler); - }) - .catch(observer.error!.bind(observer)); - } else { - subscription = forward(operation).subscribe(handler); - } - - return () => { - if (subscription) subscription.unsubscribe(); - }; - }); - }); + cb(); + }; + const handler = { + next: (response: ExecutionResult) => { + maybeRetry({ response }, () => observer.next!(response)); + }, + error: (networkError: ServerError) => { + maybeRetry({ networkError }, () => observer.error!(networkError)); + }, + complete: observer.complete!.bind(observer), + }; + + // don't send the query the first time + operation.setContext({ + http: { + includeQuery: !supportsPersistedQueries, + includeExtensions: supportsPersistedQueries, + }, + }); + + // If requested, set method to GET if there are no mutations. Remember the + // original fetchOptions so we can restore them if we fall back to a + // non-hashed request. + if ( + useGETForHashedQueries && + supportsPersistedQueries && + !operationDefinesMutation(operation) + ) { + operation.setContext( + ({ fetchOptions = {} }: { fetchOptions: Record }) => { + originalFetchOptions = fetchOptions; + return { + fetchOptions: { + ...fetchOptions, + method: "GET", + }, + }; + } + ); + setFetchOptions = true; + } + + if (supportsPersistedQueries) { + getQueryHash(query) + .then((sha256Hash) => { + operation.extensions.persistedQuery = { + version: VERSION, + sha256Hash, + }; + subscription = forward(operation).subscribe(handler); + }) + .catch(observer.error!.bind(observer)); + } else { + subscription = forward(operation).subscribe(handler); + } + + return () => { + if (subscription) subscription.unsubscribe(); + }; + }); + }), + { resetHashCache } + ); }; From f5420b0edf8bcb7ce08e988ea96e2940ac74150a Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 15 Dec 2023 10:51:58 +0100 Subject: [PATCH 16/23] add central configuration for Apollo Client cache sizes (#11408) * `print`: use `WeakCache` instead of `WeakMap` * format * pull in memory testing tools from PR 11358 * Persisted Query Link: improve memory management * re-add accidentally removed dependency * update api * update size limit * size-limit * fix test failure * better cleanup of interval/timeout * apply formatting * remove unneccessary type * format again after updating prettier * add central confiuguration for Apollo Client cache sizes * resolve import cycle * add exports * reduce cache collection throttle timeout * typo in comment * fix circular import * size-limits * update type to remove `WeakKey` * api-extractor * work around ES5 class compat * update api-report * fix typo in comment * add more caches * add more caches * chores * add type export * update test * chores * formatting * adjust more tests * rename to `AutoCleaned*Cache`, mark @internal * Update src/utilities/caching/sizes.ts Co-authored-by: Jerel Miller * chores * size-limits * unify comment release tags * update exports * naming & lazy bundling approach through inlining * chores * size --------- Co-authored-by: Jerel Miller --- .api-reports/api-report-cache.md | 2 +- .api-reports/api-report-core.md | 8 +- .api-reports/api-report-react.md | 6 +- .api-reports/api-report-react_components.md | 6 +- .api-reports/api-report-react_context.md | 6 +- .api-reports/api-report-react_hoc.md | 6 +- .api-reports/api-report-react_hooks.md | 6 +- .api-reports/api-report-react_ssr.md | 6 +- .api-reports/api-report-testing.md | 6 +- .api-reports/api-report-testing_core.md | 6 +- .api-reports/api-report-utilities.md | 75 ++++- .api-reports/api-report.md | 8 +- .size-limits.json | 4 +- api-extractor.json | 5 + src/__tests__/__snapshots__/exports.ts.snap | 3 + src/cache/core/cache.ts | 14 +- src/cache/inmemory/__tests__/cache.ts | 17 +- src/cache/inmemory/__tests__/readFromStore.ts | 6 +- src/cache/inmemory/fragmentRegistry.ts | 29 +- src/cache/inmemory/inMemoryCache.ts | 7 +- src/cache/inmemory/readFromStore.ts | 12 +- src/cache/inmemory/types.ts | 5 + src/core/QueryManager.ts | 10 +- src/link/persisted-queries/index.ts | 16 +- .../removeTypenameFromVariables.ts | 34 ++- src/react/parser/index.ts | 13 +- src/utilities/caching/__tests__/sizes.test.ts | 11 + src/utilities/caching/caches.ts | 80 ++++++ src/utilities/caching/index.ts | 3 + src/utilities/caching/sizes.ts | 264 ++++++++++++++++++ src/utilities/common/canonicalStringify.ts | 13 +- src/utilities/graphql/DocumentTransform.ts | 3 +- src/utilities/graphql/print.ts | 15 +- src/utilities/index.ts | 8 + 34 files changed, 628 insertions(+), 85 deletions(-) create mode 100644 src/utilities/caching/__tests__/sizes.test.ts create mode 100644 src/utilities/caching/caches.ts create mode 100644 src/utilities/caching/index.ts create mode 100644 src/utilities/caching/sizes.ts diff --git a/.api-reports/api-report-cache.md b/.api-reports/api-report-cache.md index 50588f8f4c0..1f2efd837fc 100644 --- a/.api-reports/api-report-cache.md +++ b/.api-reports/api-report-cache.md @@ -551,7 +551,7 @@ export interface InMemoryCacheConfig extends ApolloReducerConfig { fragments?: FragmentRegistryAPI; // (undocumented) possibleTypes?: PossibleTypesMap; - // (undocumented) + // @deprecated (undocumented) resultCacheMaxSize?: number; // (undocumented) resultCaching?: boolean; diff --git a/.api-reports/api-report-core.md b/.api-reports/api-report-core.md index e16b21db97b..d2ec18f333b 100644 --- a/.api-reports/api-report-core.md +++ b/.api-reports/api-report-core.md @@ -1013,7 +1013,7 @@ export interface InMemoryCacheConfig extends ApolloReducerConfig { fragments?: FragmentRegistryAPI; // (undocumented) possibleTypes?: PossibleTypesMap; - // (undocumented) + // @deprecated (undocumented) resultCacheMaxSize?: number; // (undocumented) resultCaching?: boolean; @@ -2113,9 +2113,9 @@ interface WriteContext extends ReadMergeModifyContext { // src/cache/inmemory/types.ts:132:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:120:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:154:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:395:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:121:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:155:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:396:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/watchQueryOptions.ts:260:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts // src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report-react.md b/.api-reports/api-report-react.md index 7acf9ba2c5a..7a8606ad8fe 100644 --- a/.api-reports/api-report-react.md +++ b/.api-reports/api-report-react.md @@ -2250,9 +2250,9 @@ interface WatchQueryOptions(it: (...args: TArgs // src/core/LocalState.ts:46:5 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:120:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:154:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:395:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:121:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:155:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:396:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/types.ts:154:3 - (ae-forgotten-export) The symbol "ApolloError" needs to be exported by the entry point index.d.ts // src/core/types.ts:156:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts // src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report-testing_core.md b/.api-reports/api-report-testing_core.md index ad2f42b7825..ca6f6c60b4e 100644 --- a/.api-reports/api-report-testing_core.md +++ b/.api-reports/api-report-testing_core.md @@ -1580,9 +1580,9 @@ export function withWarningSpy(it: (...args: TArgs // src/core/LocalState.ts:46:5 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:120:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:154:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:395:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:121:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:155:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:396:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/types.ts:154:3 - (ae-forgotten-export) The symbol "ApolloError" needs to be exported by the entry point index.d.ts // src/core/types.ts:156:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts // src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report-utilities.md b/.api-reports/api-report-utilities.md index 9ccfda99640..65911cc6b02 100644 --- a/.api-reports/api-report-utilities.md +++ b/.api-reports/api-report-utilities.md @@ -22,12 +22,14 @@ import type { Observer } from 'zen-observable-ts'; import type { OperationDefinitionNode } from 'graphql'; import type { SelectionNode } from 'graphql'; import type { SelectionSetNode } from 'graphql'; +import { StrongCache } from '@wry/caches'; import type { Subscriber } from 'zen-observable-ts'; import { Trie } from '@wry/trie'; import { TypedDocumentNode } from '@graphql-typed-document-node/core'; import type { ValueNode } from 'graphql'; import type { VariableDefinitionNode } from 'graphql'; import type { VariableNode } from 'graphql'; +import { WeakCache } from '@wry/caches'; // @public (undocumented) export const addTypenameToDocument: ((doc: TNode) => TNode) & { @@ -324,6 +326,18 @@ export type AsStoreObject(observable: Observable, mapFn: (value: V) => R | PromiseLike, catchFn?: (error: any) => R | PromiseLike): Observable; +// @internal +export const AutoCleanedStrongCache: typeof StrongCache; + +// @internal (undocumented) +export type AutoCleanedStrongCache = StrongCache; + +// @internal +export const AutoCleanedWeakCache: typeof WeakCache; + +// @internal (undocumented) +export type AutoCleanedWeakCache = WeakCache; + // Warning: (ae-forgotten-export) The symbol "InMemoryCache" needs to be exported by the entry point index.d.ts // // @public (undocumented) @@ -444,6 +458,27 @@ class CacheGroup { resetCaching(): void; } +// @public +export interface CacheSizes { + "cache.fragmentQueryDocuments": number; + "documentTransform.cache": number; + "fragmentRegistry.findFragmentSpreads": number; + "fragmentRegistry.lookup": number; + "fragmentRegistry.transform": number; + "inMemoryCache.executeSelectionSet": number; + "inMemoryCache.executeSubSelectedArray": number; + "inMemoryCache.maybeBroadcastWatch": number; + "PersistedQueryLink.persistedQueryHashes": number; + "queryManager.getDocumentInfo": number; + "removeTypenameFromVariables.getVariableDefinitions": number; + canonicalStringify: number; + parser: number; + print: number; +} + +// @public +export const cacheSizes: Partial; + // @public (undocumented) const enum CacheWriteBehavior { // (undocumented) @@ -667,6 +702,38 @@ type DeepPartialReadonlySet = {} & ReadonlySet>; // @public (undocumented) type DeepPartialSet = {} & Set>; +// @public (undocumented) +export const enum defaultCacheSizes { + // (undocumented) + "cache.fragmentQueryDocuments" = 1000, + // (undocumented) + "documentTransform.cache" = 2000, + // (undocumented) + "fragmentRegistry.findFragmentSpreads" = 4000, + // (undocumented) + "fragmentRegistry.lookup" = 1000, + // (undocumented) + "fragmentRegistry.transform" = 2000, + // (undocumented) + "inMemoryCache.executeSelectionSet" = 10000, + // (undocumented) + "inMemoryCache.executeSubSelectedArray" = 5000, + // (undocumented) + "inMemoryCache.maybeBroadcastWatch" = 5000, + // (undocumented) + "PersistedQueryLink.persistedQueryHashes" = 2000, + // (undocumented) + "queryManager.getDocumentInfo" = 2000, + // (undocumented) + "removeTypenameFromVariables.getVariableDefinitions" = 2000, + // (undocumented) + canonicalStringify = 1000, + // (undocumented) + parser = 1000, + // (undocumented) + print = 2000 +} + // @public (undocumented) interface DefaultContext extends Record { } @@ -1198,7 +1265,7 @@ interface InMemoryCacheConfig extends ApolloReducerConfig { // // (undocumented) possibleTypes?: PossibleTypesMap; - // (undocumented) + // @deprecated (undocumented) resultCacheMaxSize?: number; // (undocumented) resultCaching?: boolean; @@ -2463,9 +2530,9 @@ interface WriteContext extends ReadMergeModifyContext { // src/core/LocalState.ts:71:3 - (ae-forgotten-export) The symbol "ApolloClient" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:120:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:154:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:395:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:121:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:155:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:396:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/types.ts:154:3 - (ae-forgotten-export) The symbol "ApolloError" needs to be exported by the entry point index.d.ts // src/core/types.ts:156:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts // src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts diff --git a/.api-reports/api-report.md b/.api-reports/api-report.md index 5a22a0eefdd..d3549849065 100644 --- a/.api-reports/api-report.md +++ b/.api-reports/api-report.md @@ -1199,7 +1199,7 @@ export interface InMemoryCacheConfig extends ApolloReducerConfig { fragments?: FragmentRegistryAPI; // (undocumented) possibleTypes?: PossibleTypesMap; - // (undocumented) + // @deprecated (undocumented) resultCacheMaxSize?: number; // (undocumented) resultCaching?: boolean; @@ -2897,9 +2897,9 @@ interface WriteContext extends ReadMergeModifyContext { // src/cache/inmemory/types.ts:132:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts // src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:120:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:154:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts -// src/core/QueryManager.ts:395:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:121:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:155:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts +// src/core/QueryManager.ts:396:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts // src/core/watchQueryOptions.ts:260:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts // src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts // src/react/hooks/useBackgroundQuery.ts:30:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts diff --git a/.size-limits.json b/.size-limits.json index 1ac8be3319e..f6a846be06c 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 38535, - "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32310 + "dist/apollo-client.min.cjs": 38831, + "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32603 } diff --git a/api-extractor.json b/api-extractor.json index 5a0a74befa3..b257d21f772 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -119,6 +119,11 @@ "logLevel": "none" }, + "ae-internal-missing-underscore": { + "logLevel": "none", + "addToApiReportFile": false + }, + "ae-unresolved-link": { "logLevel": "warning", "addToApiReportFile": true diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap index 70229c88a17..ba76b853b7c 100644 --- a/src/__tests__/__snapshots__/exports.ts.snap +++ b/src/__tests__/__snapshots__/exports.ts.snap @@ -383,6 +383,8 @@ Array [ exports[`exports of public entry points @apollo/client/utilities 1`] = ` Array [ + "AutoCleanedStrongCache", + "AutoCleanedWeakCache", "Concast", "DEV", "DeepMerger", @@ -392,6 +394,7 @@ Array [ "argumentsObjectFromField", "asyncMap", "buildQueryFromSelectionSet", + "cacheSizes", "canUseAsyncIteratorSymbol", "canUseDOM", "canUseLayoutEffect", diff --git a/src/cache/core/cache.ts b/src/cache/core/cache.ts index 44f283a2723..b90871cdd82 100644 --- a/src/cache/core/cache.ts +++ b/src/cache/core/cache.ts @@ -2,9 +2,14 @@ import type { DocumentNode } from "graphql"; import { wrap } from "optimism"; import type { StoreObject, Reference } from "../../utilities/index.js"; -import { getFragmentQueryDocument } from "../../utilities/index.js"; +import { + cacheSizes, + defaultCacheSizes, + getFragmentQueryDocument, +} from "../../utilities/index.js"; import type { DataProxy } from "./types/DataProxy.js"; import type { Cache } from "./types/Cache.js"; +import { WeakCache } from "@wry/caches"; export type Transaction = (c: ApolloCache) => void; @@ -137,7 +142,12 @@ export abstract class ApolloCache implements DataProxy { // Make sure we compute the same (===) fragment query document every // time we receive the same fragment in readFragment. - private getFragmentDoc = wrap(getFragmentQueryDocument); + private getFragmentDoc = wrap(getFragmentQueryDocument, { + max: + cacheSizes["cache.fragmentQueryDocuments"] || + defaultCacheSizes["cache.fragmentQueryDocuments"], + cache: WeakCache, + }); public readFragment( options: Cache.ReadFragmentOptions, diff --git a/src/cache/inmemory/__tests__/cache.ts b/src/cache/inmemory/__tests__/cache.ts index edaa63fb4d4..2d426ed7207 100644 --- a/src/cache/inmemory/__tests__/cache.ts +++ b/src/cache/inmemory/__tests__/cache.ts @@ -19,6 +19,7 @@ import { StoreWriter } from "../writeToStore"; import { ObjectCanon } from "../object-canon"; import { TypePolicies } from "../policies"; import { spyOnConsole } from "../../../testing/internal"; +import { defaultCacheSizes } from "../../../utilities"; disableFragmentWarnings(); @@ -2119,15 +2120,17 @@ describe("Cache", () => { }); describe("resultCacheMaxSize", () => { - const defaultMaxSize = Math.pow(2, 16); - it("uses default max size on caches if resultCacheMaxSize is not configured", () => { const cache = new InMemoryCache(); - expect(cache["maybeBroadcastWatch"].options.max).toBe(defaultMaxSize); + expect(cache["maybeBroadcastWatch"].options.max).toBe( + defaultCacheSizes["inMemoryCache.maybeBroadcastWatch"] + ); expect(cache["storeReader"]["executeSelectionSet"].options.max).toBe( - defaultMaxSize + defaultCacheSizes["inMemoryCache.executeSelectionSet"] + ); + expect(cache["getFragmentDoc"].options.max).toBe( + defaultCacheSizes["cache.fragmentQueryDocuments"] ); - expect(cache["getFragmentDoc"].options.max).toBe(defaultMaxSize); }); it("configures max size on caches when resultCacheMaxSize is set", () => { @@ -2137,7 +2140,9 @@ describe("resultCacheMaxSize", () => { expect(cache["storeReader"]["executeSelectionSet"].options.max).toBe( resultCacheMaxSize ); - expect(cache["getFragmentDoc"].options.max).toBe(defaultMaxSize); + expect(cache["getFragmentDoc"].options.max).toBe( + defaultCacheSizes["cache.fragmentQueryDocuments"] + ); }); }); diff --git a/src/cache/inmemory/__tests__/readFromStore.ts b/src/cache/inmemory/__tests__/readFromStore.ts index 972e252215c..2af1138cef8 100644 --- a/src/cache/inmemory/__tests__/readFromStore.ts +++ b/src/cache/inmemory/__tests__/readFromStore.ts @@ -17,14 +17,16 @@ import { isReference, TypedDocumentNode, } from "../../../core"; +import { defaultCacheSizes } from "../../../utilities"; describe("resultCacheMaxSize", () => { const cache = new InMemoryCache(); - const defaultMaxSize = Math.pow(2, 16); it("uses default max size on caches if resultCacheMaxSize is not configured", () => { const reader = new StoreReader({ cache }); - expect(reader["executeSelectionSet"].options.max).toBe(defaultMaxSize); + expect(reader["executeSelectionSet"].options.max).toBe( + defaultCacheSizes["inMemoryCache.executeSelectionSet"] + ); }); it("configures max size on caches when resultCacheMaxSize is set", () => { diff --git a/src/cache/inmemory/fragmentRegistry.ts b/src/cache/inmemory/fragmentRegistry.ts index 12cade01aea..28463594c9d 100644 --- a/src/cache/inmemory/fragmentRegistry.ts +++ b/src/cache/inmemory/fragmentRegistry.ts @@ -9,7 +9,12 @@ import { visit } from "graphql"; import { wrap } from "optimism"; import type { FragmentMap } from "../../utilities/index.js"; -import { getFragmentDefinitions } from "../../utilities/index.js"; +import { + cacheSizes, + defaultCacheSizes, + getFragmentDefinitions, +} from "../../utilities/index.js"; +import { WeakCache } from "@wry/caches"; export interface FragmentRegistryAPI { register(...fragments: DocumentNode[]): this; @@ -68,11 +73,29 @@ class FragmentRegistry implements FragmentRegistryAPI { const proto = FragmentRegistry.prototype; this.invalidate = (this.lookup = wrap(proto.lookup.bind(this), { makeCacheKey: (arg) => arg, + max: + cacheSizes["fragmentRegistry.lookup"] || + defaultCacheSizes["fragmentRegistry.lookup"], })).dirty; // This dirty function is bound to the wrapped lookup method. - this.transform = wrap(proto.transform.bind(this)); - this.findFragmentSpreads = wrap(proto.findFragmentSpreads.bind(this)); + this.transform = wrap(proto.transform.bind(this), { + cache: WeakCache, + max: + cacheSizes["fragmentRegistry.transform"] || + defaultCacheSizes["fragmentRegistry.transform"], + }); + this.findFragmentSpreads = wrap(proto.findFragmentSpreads.bind(this), { + cache: WeakCache, + max: + cacheSizes["fragmentRegistry.findFragmentSpreads"] || + defaultCacheSizes["fragmentRegistry.findFragmentSpreads"], + }); } + /* + * Note: + * This method is only memoized so it can serve as a dependency to `tranform`, + * so calling `invalidate` will invalidate cache entries for `transform`. + */ public lookup(fragmentName: string): FragmentDefinitionNode | null { return this.registry[fragmentName] || null; } diff --git a/src/cache/inmemory/inMemoryCache.ts b/src/cache/inmemory/inMemoryCache.ts index f00fed8767e..6e001cd9137 100644 --- a/src/cache/inmemory/inMemoryCache.ts +++ b/src/cache/inmemory/inMemoryCache.ts @@ -18,6 +18,8 @@ import { DocumentTransform, canonicalStringify, print, + cacheSizes, + defaultCacheSizes, } from "../../utilities/index.js"; import type { InMemoryCacheConfig, NormalizedCacheObject } from "./types.js"; import { StoreReader } from "./readFromStore.js"; @@ -124,7 +126,10 @@ export class InMemoryCache extends ApolloCache { return this.broadcastWatch(c, options); }, { - max: this.config.resultCacheMaxSize, + max: + this.config.resultCacheMaxSize || + cacheSizes["inMemoryCache.maybeBroadcastWatch"] || + defaultCacheSizes["inMemoryCache.maybeBroadcastWatch"], makeCacheKey: (c: Cache.WatchOptions) => { // Return a cache key (thus enabling result caching) only if we're // currently using a data store that can track cache dependencies. diff --git a/src/cache/inmemory/readFromStore.ts b/src/cache/inmemory/readFromStore.ts index a280948b87e..cc1ec9f0f6b 100644 --- a/src/cache/inmemory/readFromStore.ts +++ b/src/cache/inmemory/readFromStore.ts @@ -29,6 +29,8 @@ import { canUseWeakMap, compact, canonicalStringify, + cacheSizes, + defaultCacheSizes, } from "../../utilities/index.js"; import type { Cache } from "../core/types/Cache.js"; import type { @@ -193,7 +195,10 @@ export class StoreReader { return this.execSelectionSetImpl(options); }, { - max: this.config.resultCacheMaxSize, + max: + this.config.resultCacheMaxSize || + cacheSizes["inMemoryCache.executeSelectionSet"] || + defaultCacheSizes["inMemoryCache.executeSelectionSet"], keyArgs: execSelectionSetKeyArgs, // Note that the parameters of makeCacheKey are determined by the // array returned by keyArgs. @@ -219,7 +224,10 @@ export class StoreReader { return this.execSubSelectedArrayImpl(options); }, { - max: this.config.resultCacheMaxSize, + max: + this.config.resultCacheMaxSize || + cacheSizes["inMemoryCache.executeSubSelectedArray"] || + defaultCacheSizes["inMemoryCache.executeSubSelectedArray"], makeCacheKey({ field, array, context }) { if (supportsResultCaching(context.store)) { return context.store.makeCacheKey(field, array, context.varString); diff --git a/src/cache/inmemory/types.ts b/src/cache/inmemory/types.ts index 5a8d66ec300..207a802feb4 100644 --- a/src/cache/inmemory/types.ts +++ b/src/cache/inmemory/types.ts @@ -137,6 +137,11 @@ export interface InMemoryCacheConfig extends ApolloReducerConfig { resultCaching?: boolean; possibleTypes?: PossibleTypesMap; typePolicies?: TypePolicies; + /** + * @deprecated + * Please use `cacheSizes` instead. + * TODO: write docs page, add link here + */ resultCacheMaxSize?: number; canonizeResults?: boolean; fragments?: FragmentRegistryAPI; diff --git a/src/core/QueryManager.ts b/src/core/QueryManager.ts index 84e01b89023..ba70751e3c8 100644 --- a/src/core/QueryManager.ts +++ b/src/core/QueryManager.ts @@ -4,11 +4,11 @@ import type { DocumentNode } from "graphql"; // TODO(brian): A hack until this issue is resolved (https://github.com/graphql/graphql-js/issues/3356) type OperationTypeNode = any; import { equal } from "@wry/equality"; -import { WeakCache } from "@wry/caches"; import type { ApolloLink, FetchResult } from "../link/core/index.js"; import { execute } from "../link/core/index.js"; import { + defaultCacheSizes, hasDirectives, isExecutionPatchIncrementalResult, isExecutionPatchResult, @@ -100,6 +100,7 @@ interface TransformCacheEntry { import type { DefaultOptions } from "./ApolloClient.js"; import { Trie } from "@wry/trie"; +import { AutoCleanedWeakCache, cacheSizes } from "../utilities/index.js"; export class QueryManager { public cache: ApolloCache; @@ -662,10 +663,13 @@ export class QueryManager { return this.documentTransform.transformDocument(document); } - private transformCache = new WeakCache< + private transformCache = new AutoCleanedWeakCache< DocumentNode, TransformCacheEntry - >(/** TODO: decide on a maximum size (will do all max sizes in a combined separate PR) */); + >( + cacheSizes["queryManager.getDocumentInfo"] || + defaultCacheSizes["queryManager.getDocumentInfo"] + ); public getDocumentInfo(document: DocumentNode) { const { transformCache } = this; diff --git a/src/link/persisted-queries/index.ts b/src/link/persisted-queries/index.ts index 95c4129c802..400af11d6f5 100644 --- a/src/link/persisted-queries/index.ts +++ b/src/link/persisted-queries/index.ts @@ -12,7 +12,11 @@ import type { import { Observable, compact, isNonEmptyArray } from "../../utilities/index.js"; import type { NetworkError } from "../../errors/index.js"; import type { ServerError } from "../utils/index.js"; -import { WeakCache } from "@wry/caches"; +import { + cacheSizes, + AutoCleanedWeakCache, + defaultCacheSizes, +} from "../../utilities/index.js"; export const VERSION = 1; @@ -94,7 +98,9 @@ function operationDefinesMutation(operation: Operation) { export const createPersistedQueryLink = ( options: PersistedQueryLink.Options ) => { - let hashesByQuery: WeakCache> | undefined; + let hashesByQuery: + | AutoCleanedWeakCache> + | undefined; function resetHashCache() { hashesByQuery = undefined; } @@ -140,8 +146,10 @@ export const createPersistedQueryLink = ( return getHashPromise(query); } if (!hashesByQuery) { - hashesByQuery = - new WeakCache(/** TODO: decide on a maximum size (will do all max sizes in a combined separate PR) */); + hashesByQuery = new AutoCleanedWeakCache( + cacheSizes["PersistedQueryLink.persistedQueryHashes"] || + defaultCacheSizes["PersistedQueryLink.persistedQueryHashes"] + ); } let hash = hashesByQuery.get(query)!; if (!hash) hashesByQuery.set(query, (hash = getHashPromise(query))); diff --git a/src/link/remove-typename/removeTypenameFromVariables.ts b/src/link/remove-typename/removeTypenameFromVariables.ts index b8c173b15d2..b713a5b4138 100644 --- a/src/link/remove-typename/removeTypenameFromVariables.ts +++ b/src/link/remove-typename/removeTypenameFromVariables.ts @@ -2,8 +2,14 @@ import { wrap } from "optimism"; import type { DocumentNode, TypeNode } from "graphql"; import { Kind, visit } from "graphql"; import { ApolloLink } from "../core/index.js"; -import { stripTypename, isPlainObject } from "../../utilities/index.js"; +import { + stripTypename, + isPlainObject, + cacheSizes, + defaultCacheSizes, +} from "../../utilities/index.js"; import type { OperationVariables } from "../../core/index.js"; +import { WeakCache } from "@wry/caches"; export const KEEP = "__KEEP"; @@ -95,17 +101,25 @@ function maybeStripTypename( return value; } -const getVariableDefinitions = wrap((document: DocumentNode) => { - const definitions: Record = {}; +const getVariableDefinitions = wrap( + (document: DocumentNode) => { + const definitions: Record = {}; - visit(document, { - VariableDefinition(node) { - definitions[node.variable.name.value] = unwrapType(node.type); - }, - }); + visit(document, { + VariableDefinition(node) { + definitions[node.variable.name.value] = unwrapType(node.type); + }, + }); - return definitions; -}); + return definitions; + }, + { + max: + cacheSizes["removeTypenameFromVariables.getVariableDefinitions"] || + defaultCacheSizes["removeTypenameFromVariables.getVariableDefinitions"], + cache: WeakCache, + } +); function unwrapType(node: TypeNode): string { switch (node.kind) { diff --git a/src/react/parser/index.ts b/src/react/parser/index.ts index 3c5dc3abc8d..5cca2c066f8 100644 --- a/src/react/parser/index.ts +++ b/src/react/parser/index.ts @@ -1,4 +1,3 @@ -import { WeakCache } from "@wry/caches"; import { invariant } from "../../utilities/globals/index.js"; import type { @@ -7,6 +6,11 @@ import type { VariableDefinitionNode, OperationDefinitionNode, } from "graphql"; +import { + AutoCleanedWeakCache, + cacheSizes, + defaultCacheSizes, +} from "../../utilities/index.js"; export enum DocumentType { Query, @@ -22,7 +26,7 @@ export interface IDocumentDefinition { let cache: | undefined - | WeakCache< + | AutoCleanedWeakCache< DocumentNode, { name: string; @@ -50,8 +54,9 @@ export function operationName(type: DocumentType) { // This parser is mostly used to safety check incoming documents. export function parser(document: DocumentNode): IDocumentDefinition { if (!cache) { - cache = - new WeakCache(/** TODO: decide on a maximum size (will do all max sizes in a combined separate PR) */); + cache = new AutoCleanedWeakCache( + cacheSizes.parser || defaultCacheSizes.parser + ); } const cached = cache.get(document); if (cached) return cached; diff --git a/src/utilities/caching/__tests__/sizes.test.ts b/src/utilities/caching/__tests__/sizes.test.ts new file mode 100644 index 00000000000..8339c8950f3 --- /dev/null +++ b/src/utilities/caching/__tests__/sizes.test.ts @@ -0,0 +1,11 @@ +import { expectTypeOf } from "expect-type"; +import type { CacheSizes, defaultCacheSizes } from "../sizes"; + +test.skip("type tests", () => { + expectTypeOf().toMatchTypeOf< + keyof typeof defaultCacheSizes + >(); + expectTypeOf().toMatchTypeOf< + keyof CacheSizes + >(); +}); diff --git a/src/utilities/caching/caches.ts b/src/utilities/caching/caches.ts new file mode 100644 index 00000000000..6acbdb88d34 --- /dev/null +++ b/src/utilities/caching/caches.ts @@ -0,0 +1,80 @@ +import type { CommonCache } from "@wry/caches"; +import { WeakCache, StrongCache } from "@wry/caches"; + +const scheduledCleanup = new WeakSet>(); +function schedule(cache: CommonCache) { + if (!scheduledCleanup.has(cache)) { + scheduledCleanup.add(cache); + setTimeout(() => { + cache.clean(); + scheduledCleanup.delete(cache); + }, 100); + } +} +/** + * @internal + * A version of WeakCache that will auto-schedule a cleanup of the cache when + * a new item is added. + * Throttled to once per 100ms. + * + * @privateRemarks + * Should be used throughout the rest of the codebase instead of WeakCache, + * with the notable exception of usage in `wrap` from `optimism` - that one + * already handles cleanup and should remain a `WeakCache`. + */ +export const AutoCleanedWeakCache = function ( + max?: number | undefined, + dispose?: ((value: any, key: any) => void) | undefined +) { + /* + Some builds of `WeakCache` are function prototypes, some are classes. + This library still builds with an ES5 target, so we can't extend the + real classes. + Instead, we have to use this workaround until we switch to a newer build + target. + */ + const cache = new WeakCache(max, dispose); + cache.set = function (key: any, value: any) { + schedule(this); + return WeakCache.prototype.set.call(this, key, value); + }; + return cache; +} as any as typeof WeakCache; +/** + * @internal + */ +export type AutoCleanedWeakCache = WeakCache; + +/** + * @internal + * A version of StrongCache that will auto-schedule a cleanup of the cache when + * a new item is added. + * Throttled to once per 100ms. + * + * @privateRemarks + * Should be used throughout the rest of the codebase instead of StrongCache, + * with the notable exception of usage in `wrap` from `optimism` - that one + * already handles cleanup and should remain a `StrongCache`. + */ +export const AutoCleanedStrongCache = function ( + max?: number | undefined, + dispose?: ((value: any, key: any) => void) | undefined +) { + /* + Some builds of `StrongCache` are function prototypes, some are classes. + This library still builds with an ES5 target, so we can't extend the + real classes. + Instead, we have to use this workaround until we switch to a newer build + target. + */ + const cache = new StrongCache(max, dispose); + cache.set = function (key: any, value: any) { + schedule(this); + return StrongCache.prototype.set.call(this, key, value); + }; + return cache; +} as any as typeof StrongCache; +/** + * @internal + */ +export type AutoCleanedStrongCache = StrongCache; diff --git a/src/utilities/caching/index.ts b/src/utilities/caching/index.ts new file mode 100644 index 00000000000..159dc27fcfd --- /dev/null +++ b/src/utilities/caching/index.ts @@ -0,0 +1,3 @@ +export { AutoCleanedStrongCache, AutoCleanedWeakCache } from "./caches.js"; +export type { CacheSizes } from "./sizes.js"; +export { cacheSizes, defaultCacheSizes } from "./sizes.js"; diff --git a/src/utilities/caching/sizes.ts b/src/utilities/caching/sizes.ts new file mode 100644 index 00000000000..998537740a3 --- /dev/null +++ b/src/utilities/caching/sizes.ts @@ -0,0 +1,264 @@ +import { global } from "../globals/index.js"; + +declare global { + interface Window { + [cacheSizeSymbol]?: Partial; + } +} + +/** + * The cache sizes used by various Apollo Client caches. + * + * Note that these caches are all derivative and if an item is cache-collected, + * it's not the end of the world - the cached item will just be recalculated. + * + * As a result, these cache sizes should not be chosen to hold every value ever + * encountered, but rather to hold a reasonable number of values that can be + * assumed to be on the screen at any given time. + * + * We assume a "base value" of 1000 here, which is already very generous. + * In most applications, it will be very unlikely that 1000 different queries + * are on screen at the same time. + */ +export interface CacheSizes { + /** + * Cache size for the [`print`](../../utilities/graphql/print.ts) function. + * + * @defaultValue + * Defaults to `2000`. + * + * @remarks + * This method is called from the `QueryManager` and various `Link`s, + * always with the "serverQuery", so the server-facing part of a transformed + * DocumentNode. + */ + print: number; + /** + * Cache size for the [`parser`](../../react/parser/index.ts) function. + * + * @defaultValue + * Defaults to `1000`. + * + * @remarks + * This function is used directly in HOCs, and nowadays mainly accessed by + * calling `verifyDocumentType` from various hooks. + * It is called with a user-provided DocumentNode. + */ + parser: number; + /** + * Cache size for the `performWork` method of each [`DocumentTransform`](../../utilities/graphql/DocumentTransform.ts). + * + * @defaultValue + * Defaults to `2000`. + * + * @remarks + * This method is called from `transformDocument`, which is called from + * `QueryManager` with a user-provided DocumentNode. + * It is also called with already-transformed DocumentNodes, assuming the + * user provided additional transforms. + * + * The cache size here should be chosen with other DocumentTransforms in mind. + * For example, if there was a DocumentTransform that would take `n` DocumentNodes, + * and returned a differently-transformed DocumentNode depending if the app is + * online or offline, then we assume that the cache returns `2*n` documents. + * + * No user-provided DocumentNode will actually be "the last one", as we run the + * `defaultDocumentTransform` before *and* after the user-provided transforms. + * + * So if we assume that the user-provided transforms receive `n` documents and + * return `n` documents, the cache size should be `2*n`. + * + * If we assume that the user-provided transforms receive `n` documents and + * returns `2*n` documents, the cache size should be `3*n`. + * + * This size should also then be used in every other cache that mentions that + * it operates on a "transformed" DocumentNode. + */ + "documentTransform.cache": number; + /** + * Cache size for the `transformCache` used in the `getDocumentInfo` method of + * [`QueryManager`](../../core/QueryManager.ts). + * + * @defaultValue + * Defaults to `2000`. + * + * @remarks + * `getDocumentInfo` is called throughout the `QueryManager` with transformed + * DocumentNodes. + */ + "queryManager.getDocumentInfo": number; + /** + * Cache size for the `hashesByQuery` cache in the [`PersistedQueryLink`](../../link/persisted-queries/index.ts). + * + * @defaultValue + * Defaults to `2000`. + * + * @remarks + * This cache is used to cache the hashes of persisted queries. It is working with + * transformed DocumentNodes. + */ + "PersistedQueryLink.persistedQueryHashes": number; + /** + * Cache for the `sortingMap` used by [`canonicalStringify`](../../utilities/common/canonicalStringify.ts). + * + * @defaultValue + * Defaults to `1000`. + * + * @remarks + * This cache contains the sorted keys of objects that are stringified by + * `canonicalStringify`. + * It uses the stringified unsorted keys of objects as keys. + * The cache will not grow beyond the size of different object **shapes** + * encountered in an application, no matter how much actual data gets stringified. + */ + canonicalStringify: number; + /** + * Cache size for the `transform` method of [`FragmentRegistry`](../../cache/inmemory/fragmentRegistry.ts). + * + * @defaultValue + * Defaults to `2000`. + * + * @remarks + * This function is called as part of the `defaultDocumentTransform` which will be called with + * user-provided and already-transformed DocumentNodes. + * + */ + "fragmentRegistry.transform": number; + /** + * Cache size for the `lookup` method of [`FragmentRegistry`](../../cache/inmemory/fragmentRegistry.ts). + * + * @defaultValue + * Defaults to `1000`. + * + * @remarks + * This function is called with fragment names in the form of a string. + * + * Note: + * This function is a dependency of `transform`, so having a too small cache size here + * might involuntarily invalidate values in the `transform` cache. + */ + "fragmentRegistry.lookup": number; + /** + * Cache size for the `findFragmentSpreads` method of [`FragmentRegistry`](../../cache/inmemory/fragmentRegistry.ts). + * + * @defaultValue + * Defaults to `4000`. + * + * @remarks + * This function is called with transformed DocumentNodes, as well as recursively + * with every fragment spread referenced within that, or a fragment referenced by a + * fragment spread. + * + * Note: + * This function is a dependency of `transform`, so having a too small cache size here + * might involuntarily invalidate values in the `transform` cache. + */ + "fragmentRegistry.findFragmentSpreads": number; + /** + * Cache size for the `getFragmentDoc` method of [`ApolloCache`](../../cache/core/cache.ts). + * + * @defaultValue + * Defaults to `1000`. + * + * @remarks + * This function is called from `readFragment` with user-provided fragment definitions. + */ + "cache.fragmentQueryDocuments": number; + /** + * Cache size for the `getVariableDefinitions` function in [`removeTypenameFromVariables`](../../link/remove-typename/removeTypenameFromVariables.ts). + * + * @defaultValue + * Defaults to `2000`. + * + * @remarks + * This function is called in a link with transformed DocumentNodes. + */ + "removeTypenameFromVariables.getVariableDefinitions": number; + /** + * Cache size for the `maybeBroadcastWatch` method on [`InMemoryCache`](../../cache/inmemory/inMemoryCache.ts). + * + * `maybeBroadcastWatch` will be set to the `resultCacheMaxSize` option and + * will fall back to this configuration value if the option is not set. + * + * @defaultValue + * Defaults to `5000`. + * + * @remarks + * This method is used for dependency tracking in the `InMemoryCache` and + * prevents from unnecessary re-renders. + * It is recommended to keep this value significantly higher than the number of + * possible subscribers you will have active at the same time in your application + * at any time. + */ + "inMemoryCache.maybeBroadcastWatch": number; + /** + * Cache size for the `executeSelectionSet` method on [`StoreReader`](../../cache/inmemory/readFromStore.ts). + * + * `executeSelectionSet` will be set to the `resultCacheMaxSize` option and + * will fall back to this configuration value if the option is not set. + * + * @defaultValue + * Defaults to `10000`. + * + * @remarks + * Every object that is read from the cache will be cached here, so it is + * recommended to set this to a high value. + */ + "inMemoryCache.executeSelectionSet": number; + /** + * Cache size for the `executeSubSelectedArray` method on [`StoreReader`](../../cache/inmemory/readFromStore.ts). + * + * `executeSubSelectedArray` will be set to the `resultCacheMaxSize` option and + * will fall back to this configuration value if the option is not set. + * + * @defaultValue + * Defaults to `5000`. + * + * @remarks + * Every array that is read from the cache will be cached here, so it is + * recommended to set this to a high value. + */ + "inMemoryCache.executeSubSelectedArray": number; +} + +const cacheSizeSymbol = Symbol.for("apollo.cacheSize"); +/** + * + * The global cache size configuration for Apollo Client. + * + * @remarks + * + * You can directly modify this object, but any modification will + * only have an effect on caches that are created after the modification. + * + * So for global caches, such as `parser`, `canonicalStringify` and `print`, + * you might need to call `.reset` on them, which will essentially re-create them. + * + * Alternatively, you can set `globalThis[Symbol.for("apollo.cacheSize")]` before + * you load the Apollo Client package: + * + * @example + * ```ts + * globalThis[Symbol.for("apollo.cacheSize")] = { + * parser: 100 + * } satisfies Partial // the `satisfies` is optional if using TypeScript + * ``` + */ +export const cacheSizes: Partial = { ...global[cacheSizeSymbol] }; + +export const enum defaultCacheSizes { + parser = 1000, + canonicalStringify = 1000, + print = 2000, + "documentTransform.cache" = 2000, + "queryManager.getDocumentInfo" = 2000, + "PersistedQueryLink.persistedQueryHashes" = 2000, + "fragmentRegistry.transform" = 2000, + "fragmentRegistry.lookup" = 1000, + "fragmentRegistry.findFragmentSpreads" = 4000, + "cache.fragmentQueryDocuments" = 1000, + "removeTypenameFromVariables.getVariableDefinitions" = 2000, + "inMemoryCache.maybeBroadcastWatch" = 5000, + "inMemoryCache.executeSelectionSet" = 10000, + "inMemoryCache.executeSubSelectedArray" = 5000, +} diff --git a/src/utilities/common/canonicalStringify.ts b/src/utilities/common/canonicalStringify.ts index 021f23430e2..7c037b0a680 100644 --- a/src/utilities/common/canonicalStringify.ts +++ b/src/utilities/common/canonicalStringify.ts @@ -1,3 +1,9 @@ +import { + AutoCleanedStrongCache, + cacheSizes, + defaultCacheSizes, +} from "../../utilities/caching/index.js"; + /** * Like JSON.stringify, but with object keys always sorted in the same order. * @@ -24,14 +30,17 @@ export const canonicalStringify = Object.assign( // Clearing the sortingMap will reclaim all cached memory, without // affecting the logical results of canonicalStringify, but potentially // sacrificing performance until the cache is refilled. - sortingMap.clear(); + sortingMap = new AutoCleanedStrongCache( + cacheSizes.canonicalStringify || defaultCacheSizes.canonicalStringify + ); }, } ); // Values are JSON-serialized arrays of object keys (in any order), and values // are sorted arrays of the same keys. -const sortingMap = new Map(); +let sortingMap!: AutoCleanedStrongCache; +canonicalStringify.reset(); // The JSON.stringify function takes an optional second argument called a // replacer function. This function is called for each key-value pair in the diff --git a/src/utilities/graphql/DocumentTransform.ts b/src/utilities/graphql/DocumentTransform.ts index 7a5ce40fe4c..bf016aee0da 100644 --- a/src/utilities/graphql/DocumentTransform.ts +++ b/src/utilities/graphql/DocumentTransform.ts @@ -5,6 +5,7 @@ import { invariant } from "../globals/index.js"; import type { DocumentNode } from "graphql"; import { WeakCache } from "@wry/caches"; import { wrap } from "optimism"; +import { cacheSizes } from "../caching/index.js"; export type DocumentTransformCacheKey = ReadonlyArray; @@ -96,7 +97,7 @@ export class DocumentTransform { return stableCacheKeys.lookupArray(cacheKeys); } }, - max: 1000 /** TODO: decide on a maximum size (will do all max sizes in a combined separate PR) */, + max: cacheSizes["documentTransform.cache"], cache: WeakCache, } ); diff --git a/src/utilities/graphql/print.ts b/src/utilities/graphql/print.ts index 3ba1134c968..e32a3f048df 100644 --- a/src/utilities/graphql/print.ts +++ b/src/utilities/graphql/print.ts @@ -1,8 +1,12 @@ import type { ASTNode } from "graphql"; import { print as origPrint } from "graphql"; -import { WeakCache } from "@wry/caches"; +import { + AutoCleanedWeakCache, + cacheSizes, + defaultCacheSizes, +} from "../caching/index.js"; -let printCache!: WeakCache; +let printCache!: AutoCleanedWeakCache; export const print = Object.assign( (ast: ASTNode) => { let result = printCache.get(ast); @@ -15,10 +19,9 @@ export const print = Object.assign( }, { reset() { - printCache = new WeakCache< - ASTNode, - string - >(/** TODO: decide on a maximum size (will do all max sizes in a combined separate PR) */); + printCache = new AutoCleanedWeakCache( + cacheSizes.print || defaultCacheSizes.print + ); }, } ); diff --git a/src/utilities/index.ts b/src/utilities/index.ts index 35c1ec45cad..637ae100af7 100644 --- a/src/utilities/index.ts +++ b/src/utilities/index.ts @@ -131,3 +131,11 @@ export * from "./types/IsStrictlyAny.js"; export type { DeepOmit } from "./types/DeepOmit.js"; export type { DeepPartial } from "./types/DeepPartial.js"; export type { OnlyRequiredProperties } from "./types/OnlyRequiredProperties.js"; + +export { + AutoCleanedStrongCache, + AutoCleanedWeakCache, + cacheSizes, + defaultCacheSizes, +} from "./caching/index.js"; +export type { CacheSizes } from "./caching/index.js"; From fea00231e0e9cd77cdec46a671ea87c5a3f1f510 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Thu, 7 Dec 2023 22:15:55 +0100 Subject: [PATCH 17/23] Copy and use ApiDoc components from docs repo (#11416) --- .prettierignore | 5 + docs/shared/ApiDoc/Context.js | 6 + docs/shared/ApiDoc/DocBlock.js | 149 +++++++++++++++++++ docs/shared/ApiDoc/Function.js | 70 +++++++++ docs/shared/ApiDoc/Heading.js | 67 +++++++++ docs/shared/ApiDoc/InterfaceDetails.js | 37 +++++ docs/shared/ApiDoc/ParameterTable.js | 93 ++++++++++++ docs/shared/ApiDoc/PropertySignatureTable.js | 116 +++++++++++++++ docs/shared/ApiDoc/ResponsiveGrid.js | 77 ++++++++++ docs/shared/ApiDoc/index.js | 14 ++ docs/shared/ApiDoc/mdToReact.js | 20 +++ docs/source/api/core/ApolloClient.mdx | 39 ++--- netlify.toml | 2 +- 13 files changed, 676 insertions(+), 19 deletions(-) create mode 100644 docs/shared/ApiDoc/Context.js create mode 100644 docs/shared/ApiDoc/DocBlock.js create mode 100644 docs/shared/ApiDoc/Function.js create mode 100644 docs/shared/ApiDoc/Heading.js create mode 100644 docs/shared/ApiDoc/InterfaceDetails.js create mode 100644 docs/shared/ApiDoc/ParameterTable.js create mode 100644 docs/shared/ApiDoc/PropertySignatureTable.js create mode 100644 docs/shared/ApiDoc/ResponsiveGrid.js create mode 100644 docs/shared/ApiDoc/index.js create mode 100644 docs/shared/ApiDoc/mdToReact.js diff --git a/.prettierignore b/.prettierignore index 156d707c16e..d1ab5b159ad 100644 --- a/.prettierignore +++ b/.prettierignore @@ -25,6 +25,11 @@ /docs/source/development-testing/** !/docs/source/development-testing/reducing-bundle-size.mdx +!docs/shared +/docs/shared/** +!/docs/shared/ApiDoc +!/docs/shared/ApiDoc/** + node_modules/ .yalc/ .next/ diff --git a/docs/shared/ApiDoc/Context.js b/docs/shared/ApiDoc/Context.js new file mode 100644 index 00000000000..c6861650c92 --- /dev/null +++ b/docs/shared/ApiDoc/Context.js @@ -0,0 +1,6 @@ +import { useMDXComponents } from "@mdx-js/react"; + +export const useApiDocContext = function () { + const MDX = useMDXComponents(); + return MDX.useApiDocContext(this, arguments); +}; diff --git a/docs/shared/ApiDoc/DocBlock.js b/docs/shared/ApiDoc/DocBlock.js new file mode 100644 index 00000000000..333bda75afd --- /dev/null +++ b/docs/shared/ApiDoc/DocBlock.js @@ -0,0 +1,149 @@ +import PropTypes from "prop-types"; +import React from "react"; +import { Stack } from "@chakra-ui/react"; +import { mdToReact } from "./mdToReact"; +import { useApiDocContext } from "."; + +export function DocBlock({ + canonicalReference, + summary = true, + remarks = false, + example = false, + remarkCollapsible = true, + since = true, + deprecated = true, +}) { + return ( + + {/** TODO: @since, @deprecated etc. */} + {deprecated && } + {since && } + {summary && } + {remarks && ( + + )} + {example && } + + ); +} + +DocBlock.propTypes = { + canonicalReference: PropTypes.string.isRequired, + summary: PropTypes.bool, + remarks: PropTypes.bool, + example: PropTypes.bool, + remarkCollapsible: PropTypes.bool, + since: PropTypes.bool, + deprecated: PropTypes.bool, +}; + +function MaybeCollapsible({ collapsible, children }) { + return ( + collapsible ? + children ? +
+ Read more... + {children} +
+ : null + : children + ); +} +MaybeCollapsible.propTypes = { + collapsible: PropTypes.bool, + children: PropTypes.node, +}; + +/** + * Might still need more work on the Gatsby side to get this to work. + */ +export function Deprecated({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.deprecated; + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Deprecated.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +/** + * Might still need more work on the Gatsby side to get this to work. + */ +export function Since({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.since; + if (!value) return null; + return ( + + Added to Apollo Client in version {value} + + ); +} +Since.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +export function Summary({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.summary; + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Summary.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +export function Remarks({ canonicalReference, collapsible = false }) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.remarks?.replace(/^@remarks/g, ""); + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Remarks.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, +}; + +export function Example({ + canonicalReference, + collapsible = false, + index = 0, +}) { + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const value = item.comment?.examples[index]; + if (!value) return null; + return ( + + {mdToReact(value)} + + ); +} +Example.propTypes = { + canonicalReference: PropTypes.string.isRequired, + collapsible: PropTypes.bool, + index: PropTypes.number, +}; diff --git a/docs/shared/ApiDoc/Function.js b/docs/shared/ApiDoc/Function.js new file mode 100644 index 00000000000..97cb0934ce8 --- /dev/null +++ b/docs/shared/ApiDoc/Function.js @@ -0,0 +1,70 @@ +import PropTypes from "prop-types"; +import React from "react"; +import { ApiDocHeading, DocBlock, ParameterTable, useApiDocContext } from "."; + +export function FunctionSignature({ + canonicalReference, + parameterTypes = false, + name = true, + arrow = false, +}) { + const getItem = useApiDocContext(); + const { displayName, parameters, returnType } = getItem(canonicalReference); + + return ( + <> + {name ? displayName : ""}( + {parameters + .map((p) => { + let pStr = p.name; + if (p.optional) { + pStr += "?"; + } + if (parameterTypes) { + pStr += ": " + p.type; + } + return pStr; + }) + .join(", ")} + ){arrow ? " =>" : ":"} {returnType} + + ); +} + +FunctionSignature.propTypes = { + canonicalReference: PropTypes.string.isRequired, + parameterTypes: PropTypes.bool, + name: PropTypes.bool, + arrow: PropTypes.bool, +}; + +export function FunctionDetails({ + canonicalReference, + customParameterOrder, + headingLevel, +}) { + return ( + <> + + + + + ); +} + +FunctionDetails.propTypes = { + canonicalReference: PropTypes.string.isRequired, + headingLevel: PropTypes.number.isRequired, + customParameterOrder: PropTypes.arrayOf(PropTypes.string), +}; diff --git a/docs/shared/ApiDoc/Heading.js b/docs/shared/ApiDoc/Heading.js new file mode 100644 index 00000000000..e4a5aa9db69 --- /dev/null +++ b/docs/shared/ApiDoc/Heading.js @@ -0,0 +1,67 @@ +import { useMDXComponents } from "@mdx-js/react"; +import PropTypes from "prop-types"; +import React from "react"; +import { Box, Heading } from "@chakra-ui/react"; +import { FunctionSignature } from "."; +import { useApiDocContext } from "./Context"; + +const levels = { + 2: "xl", + 3: "lg", + 4: "md", + 5: "sm", + 6: "xs", +}; + +export function ApiDocHeading({ + canonicalReference, + headingLevel, + link = true, +}) { + const MDX = useMDXComponents(); + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const heading = + ( + item.kind === "MethodSignature" || + item.kind === "Function" || + item.kind === "Method" + ) ? + + : item.displayName; + return ( + + + {link ? + + {heading} + + : heading} + + {item.file && ( + + + ({item.file}) + + + )} + + ); +} +ApiDocHeading.propTypes = { + canonicalReference: PropTypes.string.isRequired, + headingLevel: PropTypes.number.isRequired, + link: PropTypes.bool, +}; diff --git a/docs/shared/ApiDoc/InterfaceDetails.js b/docs/shared/ApiDoc/InterfaceDetails.js new file mode 100644 index 00000000000..e4b439181c4 --- /dev/null +++ b/docs/shared/ApiDoc/InterfaceDetails.js @@ -0,0 +1,37 @@ +import PropTypes from "prop-types"; +import React from "react"; +import { ApiDocHeading, DocBlock, PropertySignatureTable } from "."; +export function InterfaceDetails({ + canonicalReference, + headingLevel, + link, + customPropertyOrder, +}) { + return ( + <> + + + + + ); +} + +InterfaceDetails.propTypes = { + canonicalReference: PropTypes.string.isRequired, + headingLevel: PropTypes.number.isRequired, + link: PropTypes.bool, + customPropertyOrder: PropTypes.arrayOf(PropTypes.string), +}; diff --git a/docs/shared/ApiDoc/ParameterTable.js b/docs/shared/ApiDoc/ParameterTable.js new file mode 100644 index 00000000000..49f2a7abf9c --- /dev/null +++ b/docs/shared/ApiDoc/ParameterTable.js @@ -0,0 +1,93 @@ +import { useMDXComponents } from "@mdx-js/react"; + +import PropTypes from "prop-types"; +import React from "react"; +import { GridItem, chakra } from "@chakra-ui/react"; +import { PropertySignatureTable, useApiDocContext } from "."; +import { ResponsiveGrid } from "./ResponsiveGrid"; +import { mdToReact } from "./mdToReact"; + +export function ParameterTable({ canonicalReference }) { + const MDX = useMDXComponents(); + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + + if (item.parameters.length === 0) return null; + + return ( + <> + + + Parameters + + + + Name / Type + Description + + {item.parameters.map((parameter) => { + const baseType = parameter.type.split("<")[0]; + const reference = getItem( + item.references?.find((r) => r.text === baseType) + ?.canonicalReference, + false + ); + const interfaceReference = + reference?.kind === "Interface" ? reference : null; + + return ( + + + + {parameter.name} + {parameter.optional ? + (optional) + : null} + + + {parameter.type} + + + + {mdToReact(parameter.comment)} + + {interfaceReference && ( +
+ + Show/hide child attributes + + +
+ )} +
+ ); + })} +
+ + ); +} + +ParameterTable.propTypes = { + canonicalReference: PropTypes.string.isRequired, +}; diff --git a/docs/shared/ApiDoc/PropertySignatureTable.js b/docs/shared/ApiDoc/PropertySignatureTable.js new file mode 100644 index 00000000000..317b2926f0f --- /dev/null +++ b/docs/shared/ApiDoc/PropertySignatureTable.js @@ -0,0 +1,116 @@ +import { useMDXComponents } from "@mdx-js/react"; + +import PropTypes from "prop-types"; +import React, { useMemo } from "react"; +import { DocBlock, FunctionSignature, useApiDocContext } from "."; +import { GridItem, Text, chakra } from "@chakra-ui/react"; +import { ResponsiveGrid } from "./ResponsiveGrid"; + +export function PropertySignatureTable({ + canonicalReference, + prefix = "", + showHeaders = true, + display = "parent", + customOrder = [], +}) { + const MDX = useMDXComponents(); + const getItem = useApiDocContext(); + const item = getItem(canonicalReference); + const Wrapper = display === "parent" ? ResponsiveGrid : React.Fragment; + + const sortedProperties = useMemo( + () => + item.properties.map(getItem).sort((a, b) => { + const aIndex = customOrder.indexOf(a.displayName); + const bIndex = customOrder.indexOf(b.displayName); + if (aIndex >= 0 && bIndex >= 0) { + return aIndex - bIndex; + } else if (aIndex >= 0) { + return -1; + } else if (bIndex >= 0) { + return 1; + } else { + return a.displayName.localeCompare(b.displayName); + } + }), + [item.properties, getItem, customOrder] + ); + + return ( + <> + {showHeaders ? + + + Properties + + + : null} + {item.childrenIncomplete ? + +
+ (Warning: some properties might be missing from the table due to + complex inheritance!) +
+ : null} + + + {showHeaders ? + <> + Name / Type + Description + + : null} + + {sortedProperties.map((property) => ( + + + + + + {prefix} + + {property.displayName} + + {property.optional ? + (optional) + : null} + + + {property.kind === "MethodSignature" ? + + : property.type} + + + + + + + ))} + + + ); +} + +PropertySignatureTable.propTypes = { + canonicalReference: PropTypes.string.isRequired, + prefix: PropTypes.string, + showHeaders: PropTypes.bool, + display: PropTypes.oneOf(["parent", "child"]), + customOrder: PropTypes.arrayOf(PropTypes.string), +}; diff --git a/docs/shared/ApiDoc/ResponsiveGrid.js b/docs/shared/ApiDoc/ResponsiveGrid.js new file mode 100644 index 00000000000..691a4afebcf --- /dev/null +++ b/docs/shared/ApiDoc/ResponsiveGrid.js @@ -0,0 +1,77 @@ +import React from "react"; +import { Global } from "@emotion/react"; +import { Grid } from "@chakra-ui/react"; + +/** + * This component is actually over in the docs repo, just repeated here so the + * styles are visible. + */ +export function ResponsiveGridStyles() { + return ( + *, .responsive-grid > details > *": { + background: "var(--chakra-colors-bg)", + }, + ".responsive-grid .cell, .responsive-grid .row": { + padding: "var(--chakra-space-4)", + }, + ".responsive-grid details .first.cell + .cell": { + marginTop: -1, + paddingTop: 0, + }, + ".responsive-grid details h6": { + display: "inline", + }, + ".responsive-grid .heading": { + fontFamily: "var(--chakra-fonts-heading)", + fontWeight: "var(--chakra-fontWeights-normal)", + textTransform: "uppercase", + letterSpacing: "var(--chakra-letterSpacings-wider)", + fontSize: "var(--chakra-fontSizes-xs)", + }, + }} + /> + ); +} + +export function ResponsiveGrid({ children }) { + /* + responsiveness not regarding screen width, but actual available space: + if less than 350px, show only one column + show at most two columns (that's where the 45% hack comes - 45% * 3 won't fit) + */ + + return ( + + {children} + + ); +} diff --git a/docs/shared/ApiDoc/index.js b/docs/shared/ApiDoc/index.js new file mode 100644 index 00000000000..66bfa413afa --- /dev/null +++ b/docs/shared/ApiDoc/index.js @@ -0,0 +1,14 @@ +export { useApiDocContext } from "./Context"; +export { + DocBlock, + Deprecated, + Example, + Remarks, + Since, + Summary, +} from "./DocBlock"; +export { PropertySignatureTable } from "./PropertySignatureTable"; +export { ApiDocHeading } from "./Heading"; +export { InterfaceDetails } from "./InterfaceDetails"; +export { FunctionSignature, FunctionDetails } from "./Function"; +export { ParameterTable } from "./ParameterTable"; diff --git a/docs/shared/ApiDoc/mdToReact.js b/docs/shared/ApiDoc/mdToReact.js new file mode 100644 index 00000000000..307ca38c7bf --- /dev/null +++ b/docs/shared/ApiDoc/mdToReact.js @@ -0,0 +1,20 @@ +import PropTypes from "prop-types"; +import React from "react"; +import ReactMarkdown from "react-markdown"; +import { useMDXComponents } from "@mdx-js/react"; + +export function mdToReact(text) { + const sanitized = text + .replace(/\{@link (\w*)\}/g, "[$1](#$1)") + .replace(//g, ""); + return ; +} + +function RenderMd({ markdown }) { + return ( + {markdown} + ); +} +RenderMd.propTypes = { + markdown: PropTypes.string.isRequired, +}; diff --git a/docs/source/api/core/ApolloClient.mdx b/docs/source/api/core/ApolloClient.mdx index 8795e1d3d88..a66e5713d6d 100644 --- a/docs/source/api/core/ApolloClient.mdx +++ b/docs/source/api/core/ApolloClient.mdx @@ -8,6 +8,8 @@ api_doc: - "@apollo/client!DefaultOptions:interface" --- +import { InterfaceDetails, FunctionDetails, DocBlock, Example } from '../../../shared/ApiDoc'; + The `ApolloClient` class encapsulates Apollo's core client-side API. It backs all available view-layer integrations (React, iOS, and so on). ## The `ApolloClient` constructor @@ -20,33 +22,34 @@ Returns an initialized `ApolloClient` object. #### Example - + For more information on the `defaultOptions` object, see the [Default Options](#DefaultOptions) section below. ## Functions - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + ## Types - + ##### Example `defaultOptions` object diff --git a/netlify.toml b/netlify.toml index 67879a8b0ba..0dc401e05ad 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,7 +13,7 @@ npm run docmodel cd ../ rm -rf monodocs - git clone https://github.com/apollographql/docs --branch main --single-branch monodocs + git clone https://github.com/apollographql/docs --branch pr/expose-hook --single-branch monodocs cd monodocs npm i cp -r ../docs local From efeea04a39b206ebcd14995ed096ef8224665c61 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Fri, 8 Dec 2023 10:37:24 +0100 Subject: [PATCH 18/23] Update netlify.toml Change deploy preview branch back to `main` --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 0dc401e05ad..67879a8b0ba 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,7 +13,7 @@ npm run docmodel cd ../ rm -rf monodocs - git clone https://github.com/apollographql/docs --branch pr/expose-hook --single-branch monodocs + git clone https://github.com/apollographql/docs --branch main --single-branch monodocs cd monodocs npm i cp -r ../docs local From 865659b879dc1458812df6718fdeb72f211ad496 Mon Sep 17 00:00:00 2001 From: Mohit <36567063+mohit23x@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:14:09 +0530 Subject: [PATCH 19/23] Update react-native.md - Adds react native devtool supported by flipper (#11364) Co-authored-by: Lenz Weber-Tronic --- .changeset/fuzzy-eyes-lick.md | 5 ++++ docs/source/integrations/react-native.md | 32 ++++++++++++++++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 .changeset/fuzzy-eyes-lick.md diff --git a/.changeset/fuzzy-eyes-lick.md b/.changeset/fuzzy-eyes-lick.md new file mode 100644 index 00000000000..c69c857fd51 --- /dev/null +++ b/.changeset/fuzzy-eyes-lick.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +Update react-native.md - Adds react native devtool in the documentation diff --git a/docs/source/integrations/react-native.md b/docs/source/integrations/react-native.md index 68dfdd23bf6..b98605641d9 100644 --- a/docs/source/integrations/react-native.md +++ b/docs/source/integrations/react-native.md @@ -38,11 +38,33 @@ For more information on setting up Apollo Client, see [Getting started](../get-s ## Apollo Client Devtools -[React Native Debugger](https://github.com/jhen0409/react-native-debugger) supports the [Apollo Client Devtools](../development-testing/developer-tooling/#apollo-client-devtools): - -1. Install React Native Debugger and open it. -2. Enable "Debug JS Remotely" in your app. -3. If you don't see the Developer Tools panel or the Apollo tab is missing from it, toggle the Developer Tools by right-clicking anywhere and selecting **Toggle Developer Tools**. +#### 1. Using [React Native Debugger](https://github.com/jhen0409/react-native-debugger) + +The React Native Debugger supports the [Apollo Client Devtools](../development-testing/developer-tooling/#apollo-client-devtools): + + 1. Install React Native Debugger and open it. + 2. Enable "Debug JS Remotely" in your app. + 3. If you don't see the Developer Tools panel or the Apollo tab is missing from it, toggle the Developer Tools by right-clicking anywhere and selecting **Toggle Developer Tools**. + +#### 2. Using [Flipper](https://fbflipper.com/) + +A community plugin called [React Native Apollo devtools](https://github.com/razorpay/react-native-apollo-devtools) is available for Flipper, which supports viewing cache data. + + 1. Install Flipper and open it. + 2. Go to add plugin and search for `react-native-apollo-devtools` and install it + 3. Add `react-native-flipper` and `react-native-apollo-devtools-client` as dev dependecy to react native app. + 4. Initialize the plugin with flipper on client side + + ``` + import { apolloDevToolsInit } from 'react-native-apollo-devtools-client'; + const client = new ApolloClient({ + // ... + }) + + if(__DEV__){ + apolloDevToolsInit(client); + } + ``` ## Consuming multipart HTTP via text streaming From 98431c1ae25eeda65491618811fbc95b6b432bad Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:27:35 -0500 Subject: [PATCH 20/23] chore(deps): update actions/stale action to v9 (#11423) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/close-stale-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 5d54d58ea6d..55a67e4ae69 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Close Stale Issues - uses: actions/stale@v8.0.0 + uses: actions/stale@v9.0.0 with: # # Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. # repo-token: # optional, default is ${{ github.token }} From 13c27bb1e2f83380a34c031db703335893a4ddcd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:27:58 -0500 Subject: [PATCH 21/23] chore(deps): update cimg/node docker tag to v21.4.0 (#11422) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 23aead0e9ae..609041812f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: Lint: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm version @@ -24,7 +24,7 @@ jobs: Formatting: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm ci @@ -32,7 +32,7 @@ jobs: Tests: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm run ci:precheck @@ -50,7 +50,7 @@ jobs: BuildTarball: docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - run: npm run ci:precheck @@ -67,7 +67,7 @@ jobs: framework: type: string docker: - - image: cimg/node:21.2.0 + - image: cimg/node:21.4.0 steps: - checkout - attach_workspace: From aafcd3efc85da1fffe7e615e2e8c0baad90588b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:55:16 -0500 Subject: [PATCH 22/23] chore(deps): update all devdependencies (#11406) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 382 ++++++++++++++++++++++------------------------ package.json | 18 +-- 2 files changed, 189 insertions(+), 211 deletions(-) diff --git a/package-lock.json b/package-lock.json index 71a75840fdf..c8a1b3868b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,8 +28,8 @@ "devDependencies": { "@arethetypeswrong/cli": "0.13.2", "@babel/parser": "7.23.5", - "@changesets/changelog-github": "0.4.8", - "@changesets/cli": "2.26.2", + "@changesets/changelog-github": "0.5.0", + "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", "@microsoft/api-extractor": "7.38.3", "@rollup/plugin-node-resolve": "11.2.1", @@ -52,16 +52,16 @@ "@types/react-dom": "18.2.17", "@types/relay-runtime": "14.1.14", "@types/use-sync-external-store": "0.0.6", - "@typescript-eslint/eslint-plugin": "6.12.0", - "@typescript-eslint/parser": "6.12.0", - "@typescript-eslint/rule-tester": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": "6.14.0", + "@typescript-eslint/rule-tester": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "acorn": "8.11.2", "blob-polyfill": "7.0.20220408", "bytes": "3.1.2", "cross-fetch": "4.0.0", - "eslint": "8.54.0", + "eslint": "8.55.0", "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c", "eslint-plugin-local-rules": "2.0.1", @@ -91,7 +91,7 @@ "rxjs": "7.8.1", "size-limit": "11.0.0", "subscriptions-transport-ws": "0.11.0", - "terser": "5.24.0", + "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", @@ -799,16 +799,16 @@ "dev": true }, "node_modules/@changesets/apply-release-plan": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", - "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.0.tgz", + "integrity": "sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/config": "^2.3.1", - "@changesets/get-version-range-type": "^0.3.2", - "@changesets/git": "^2.0.0", - "@changesets/types": "^5.2.1", + "@changesets/config": "^3.0.0", + "@changesets/get-version-range-type": "^0.4.0", + "@changesets/git": "^3.0.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "detect-indent": "^6.0.0", "fs-extra": "^7.0.1", @@ -850,23 +850,23 @@ } }, "node_modules/@changesets/assemble-release-plan": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", - "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.0.tgz", + "integrity": "sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "semver": "^7.5.3" } }, "node_modules/@changesets/assemble-release-plan/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -879,55 +879,54 @@ } }, "node_modules/@changesets/changelog-git": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz", - "integrity": "sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.0.tgz", + "integrity": "sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1" + "@changesets/types": "^6.0.0" } }, "node_modules/@changesets/changelog-github": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.4.8.tgz", - "integrity": "sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.0.tgz", + "integrity": "sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==", "dev": true, "dependencies": { - "@changesets/get-github-info": "^0.5.2", - "@changesets/types": "^5.2.1", + "@changesets/get-github-info": "^0.6.0", + "@changesets/types": "^6.0.0", "dotenv": "^8.1.0" } }, "node_modules/@changesets/cli": { - "version": "2.26.2", - "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", - "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.27.1.tgz", + "integrity": "sha512-iJ91xlvRnnrJnELTp4eJJEOPjgpF3NOh4qeQehM6Ugiz9gJPRZ2t+TsXun6E3AMN4hScZKjqVXl0TX+C7AB3ZQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/apply-release-plan": "^6.1.4", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/changelog-git": "^0.1.14", - "@changesets/config": "^2.3.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/get-release-plan": "^3.0.17", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", - "@changesets/write": "^0.2.3", + "@changesets/apply-release-plan": "^7.0.0", + "@changesets/assemble-release-plan": "^6.0.0", + "@changesets/changelog-git": "^0.2.0", + "@changesets/config": "^3.0.0", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/get-release-plan": "^4.0.0", + "@changesets/git": "^3.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/pre": "^2.0.0", + "@changesets/read": "^0.6.0", + "@changesets/types": "^6.0.0", + "@changesets/write": "^0.3.0", "@manypkg/get-packages": "^1.1.3", - "@types/is-ci": "^3.0.0", "@types/semver": "^7.5.0", "ansi-colors": "^4.1.3", "chalk": "^2.1.0", + "ci-info": "^3.7.0", "enquirer": "^2.3.0", "external-editor": "^3.1.0", "fs-extra": "^7.0.1", "human-id": "^1.0.2", - "is-ci": "^3.0.1", "meow": "^6.0.0", "outdent": "^0.5.0", "p-limit": "^2.2.0", @@ -966,9 +965,9 @@ } }, "node_modules/@changesets/cli/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -993,36 +992,36 @@ } }, "node_modules/@changesets/config": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", - "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-3.0.0.tgz", + "integrity": "sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==", "dev": true, "dependencies": { - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/logger": "^0.0.5", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1", "micromatch": "^4.0.2" } }, "node_modules/@changesets/errors": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", - "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", + "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", "dev": true, "dependencies": { "extendable-error": "^0.1.5" } }, "node_modules/@changesets/get-dependents-graph": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", - "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-2.0.0.tgz", + "integrity": "sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "chalk": "^2.1.0", "fs-extra": "^7.0.1", @@ -1053,9 +1052,9 @@ } }, "node_modules/@changesets/get-dependents-graph/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1080,9 +1079,9 @@ } }, "node_modules/@changesets/get-github-info": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.2.tgz", - "integrity": "sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz", + "integrity": "sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==", "dev": true, "dependencies": { "dataloader": "^1.4.0", @@ -1090,35 +1089,35 @@ } }, "node_modules/@changesets/get-release-plan": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", - "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-4.0.0.tgz", + "integrity": "sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/config": "^2.3.1", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", + "@changesets/assemble-release-plan": "^6.0.0", + "@changesets/config": "^3.0.0", + "@changesets/pre": "^2.0.0", + "@changesets/read": "^0.6.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3" } }, "node_modules/@changesets/get-version-range-type": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", - "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz", + "integrity": "sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==", "dev": true }, "node_modules/@changesets/git": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", - "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-3.0.0.tgz", + "integrity": "sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "is-subdir": "^1.1.1", "micromatch": "^4.0.2", @@ -1126,9 +1125,9 @@ } }, "node_modules/@changesets/logger": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", - "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.1.0.tgz", + "integrity": "sha512-pBrJm4CQm9VqFVwWnSqKEfsS2ESnwqwH+xR7jETxIErZcfd1u2zBSqrHbRHR7xjhSgep9x2PSKFKY//FAshA3g==", "dev": true, "dependencies": { "chalk": "^2.1.0" @@ -1170,39 +1169,39 @@ } }, "node_modules/@changesets/parse": { - "version": "0.3.16", - "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", - "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.4.0.tgz", + "integrity": "sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "js-yaml": "^3.13.1" } }, "node_modules/@changesets/pre": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", - "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.0.tgz", + "integrity": "sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1" } }, "node_modules/@changesets/read": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", - "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.0.tgz", + "integrity": "sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/parse": "^0.3.16", - "@changesets/types": "^5.2.1", + "@changesets/git": "^3.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/parse": "^0.4.0", + "@changesets/types": "^6.0.0", "chalk": "^2.1.0", "fs-extra": "^7.0.1", "p-filter": "^2.1.0" @@ -1244,19 +1243,19 @@ } }, "node_modules/@changesets/types": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", - "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.0.0.tgz", + "integrity": "sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==", "dev": true }, "node_modules/@changesets/write": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz", - "integrity": "sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.3.0.tgz", + "integrity": "sha512-slGLb21fxZVUYbyea+94uFiD6ntQW0M2hIKNznFizDhZPDgn2c/fv1UzzlW43RVzh1BEDuIqW6hzlJ1OflNmcw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "fs-extra": "^7.0.1", "human-id": "^1.0.2", "prettier": "^2.7.1" @@ -1676,9 +1675,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", - "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -1744,9 +1743,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", - "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", + "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3206,15 +3205,6 @@ "hoist-non-react-statics": "^3.3.0" } }, - "node_modules/@types/is-ci": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.0.tgz", - "integrity": "sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.1.0" - } - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", @@ -3434,16 +3424,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.12.0.tgz", - "integrity": "sha512-XOpZ3IyJUIV1b15M7HVOpgQxPPF7lGXgsfcEIu3yDxFPaf/xZKt7s9QO/pbk7vpWQyVulpJbu4E5LwpZiQo4kA==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.14.0.tgz", + "integrity": "sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/type-utils": "6.12.0", - "@typescript-eslint/utils": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/type-utils": "6.14.0", + "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -3484,15 +3474,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.12.0.tgz", - "integrity": "sha512-s8/jNFPKPNRmXEnNXfuo1gemBdVmpQsK1pcu+QIvuNJuhFzGrpD7WjOcvDc/+uEdfzSYpNu7U/+MmbScjoQ6vg==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.14.0.tgz", + "integrity": "sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4" }, "engines": { @@ -3512,13 +3502,13 @@ } }, "node_modules/@typescript-eslint/rule-tester": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-6.12.0.tgz", - "integrity": "sha512-O1kFPAuX9H63GNDTyd8GKO5RioxRX96mAVcevbUywVtkrp8eoVLEf2VmKIKCeYAM5oZst52DMVCQXjcQuyxq5w==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-6.14.0.tgz", + "integrity": "sha512-SCxrm68pudpNTUGCqaGxgqNujca+sEjJXA52gH3b0q1DrVBq1VSlxgO9kSmodhbXKVyS7UGlbz3dPDqa65gR2g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "ajv": "^6.10.0", "lodash.merge": "4.6.2", "semver": "^7.5.4" @@ -3551,13 +3541,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.12.0.tgz", - "integrity": "sha512-5gUvjg+XdSj8pcetdL9eXJzQNTl3RD7LgUiYTl8Aabdi8hFkaGSYnaS6BLc0BGNaDH+tVzVwmKtWvu0jLgWVbw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", + "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0" + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3568,13 +3558,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.12.0.tgz", - "integrity": "sha512-WWmRXxhm1X8Wlquj+MhsAG4dU/Blvf1xDgGaYCzfvStP2NwPQh6KBvCDbiOEvaE0filhranjIlK/2fSTVwtBng==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.14.0.tgz", + "integrity": "sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -3595,9 +3585,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.12.0.tgz", - "integrity": "sha512-MA16p/+WxM5JG/F3RTpRIcuOghWO30//VEOvzubM8zuOOBYXsP+IfjoCXXiIfy2Ta8FRh9+IO9QLlaFQUU+10Q==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", + "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3608,13 +3598,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.12.0.tgz", - "integrity": "sha512-vw9E2P9+3UUWzhgjyyVczLWxZ3GuQNT7QpnIY3o5OMeLO/c8oHljGc8ZpryBMIyympiAAaKgw9e5Hl9dCWFOYw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", + "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3650,17 +3640,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.12.0.tgz", - "integrity": "sha512-LywPm8h3tGEbgfyjYnu3dauZ0U7R60m+miXgKcZS8c7QALO9uWJdvNoP+duKTk2XMWc7/Q3d/QiCuLN9X6SWyQ==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz", + "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/typescript-estree": "6.14.0", "semver": "^7.5.4" }, "engines": { @@ -3690,12 +3680,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.12.0.tgz", - "integrity": "sha512-rg3BizTZHF1k3ipn8gfrzDXXSFKyOEB5zxYXInQ6z0hUvmQlhaZQzK+YmHmNViMA9HzW5Q9+bPPt90bU6GQwyw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", + "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", + "@typescript-eslint/types": "6.14.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -5581,15 +5571,15 @@ } }, "node_modules/eslint": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", - "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", + "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.54.0", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.55.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -5993,9 +5983,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -7228,18 +7218,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-core-module": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", @@ -11664,9 +11642,9 @@ } }, "node_modules/terser": { - "version": "5.24.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.24.0.tgz", - "integrity": "sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw==", + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.26.0.tgz", + "integrity": "sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index dc9e6941396..b98d0729d27 100644 --- a/package.json +++ b/package.json @@ -109,8 +109,8 @@ "devDependencies": { "@arethetypeswrong/cli": "0.13.2", "@babel/parser": "7.23.5", - "@changesets/changelog-github": "0.4.8", - "@changesets/cli": "2.26.2", + "@changesets/changelog-github": "0.5.0", + "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", "@microsoft/api-extractor": "7.38.3", "@rollup/plugin-node-resolve": "11.2.1", @@ -133,16 +133,16 @@ "@types/react-dom": "18.2.17", "@types/relay-runtime": "14.1.14", "@types/use-sync-external-store": "0.0.6", - "@typescript-eslint/eslint-plugin": "6.12.0", - "@typescript-eslint/parser": "6.12.0", - "@typescript-eslint/rule-tester": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": "6.14.0", + "@typescript-eslint/rule-tester": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/utils": "6.14.0", "acorn": "8.11.2", "blob-polyfill": "7.0.20220408", "bytes": "3.1.2", "cross-fetch": "4.0.0", - "eslint": "8.54.0", + "eslint": "8.55.0", "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c", "eslint-plugin-local-rules": "2.0.1", @@ -172,7 +172,7 @@ "rxjs": "7.8.1", "size-limit": "11.0.0", "subscriptions-transport-ws": "0.11.0", - "terser": "5.24.0", + "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", From dabb1f88cfa9cd25ca55e1918a1c23202b0e108c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:47:07 -0500 Subject: [PATCH 23/23] chore(deps): update all dependencies - patch updates (#11421) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .circleci/config.yml | 2 +- package-lock.json | 179 +++++++++++++++++++++++-------------------- package.json | 22 +++--- 3 files changed, 108 insertions(+), 95 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 609041812f5..78dfff62626 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - secops: apollo/circleci-secops-orb@2.0.3 + secops: apollo/circleci-secops-orb@2.0.4 jobs: # Filesize: diff --git a/package-lock.json b/package-lock.json index c8a1b3868b5..a2a88bf002e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,15 +26,15 @@ "zen-observable-ts": "^1.2.5" }, "devDependencies": { - "@arethetypeswrong/cli": "0.13.2", + "@arethetypeswrong/cli": "0.13.3", "@babel/parser": "7.23.5", "@changesets/changelog-github": "0.5.0", "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", - "@microsoft/api-extractor": "7.38.3", + "@microsoft/api-extractor": "7.38.5", "@rollup/plugin-node-resolve": "11.2.1", - "@size-limit/esbuild-why": "11.0.0", - "@size-limit/preset-small-lib": "11.0.0", + "@size-limit/esbuild-why": "11.0.1", + "@size-limit/preset-small-lib": "11.0.1", "@testing-library/jest-dom": "6.1.5", "@testing-library/react": "14.1.2", "@testing-library/react-12": "npm:@testing-library/react@^12", @@ -44,11 +44,11 @@ "@types/fetch-mock": "7.3.8", "@types/glob": "8.1.0", "@types/hoist-non-react-statics": "3.3.5", - "@types/jest": "29.5.10", + "@types/jest": "29.5.11", "@types/lodash": "4.14.202", - "@types/node": "20.10.3", + "@types/node": "20.10.4", "@types/node-fetch": "2.6.9", - "@types/react": "18.2.41", + "@types/react": "18.2.43", "@types/react-dom": "18.2.17", "@types/relay-runtime": "14.1.14", "@types/use-sync-external-store": "0.0.6", @@ -76,7 +76,7 @@ "jest-junit": "16.0.0", "lodash": "4.17.21", "patch-package": "8.0.0", - "prettier": "3.1.0", + "prettier": "3.1.1", "react": "18.2.0", "react-17": "npm:react@^17", "react-dom": "18.2.0", @@ -89,16 +89,16 @@ "rollup-plugin-cleanup": "3.2.1", "rollup-plugin-terser": "7.0.2", "rxjs": "7.8.1", - "size-limit": "11.0.0", + "size-limit": "11.0.1", "subscriptions-transport-ws": "0.11.0", "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", "ts-morph": "20.0.0", - "ts-node": "10.9.1", + "ts-node": "10.9.2", "typedoc": "0.25.0", - "typescript": "5.3.2", + "typescript": "5.3.3", "wait-for-observables": "1.0.3", "web-streams-polyfill": "3.2.1", "whatwg-fetch": "3.6.19" @@ -150,12 +150,12 @@ "dev": true }, "node_modules/@arethetypeswrong/cli": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.13.2.tgz", - "integrity": "sha512-eqRWeFFiI58xwsiUfZSdZsmNCaqqtxmSPP9554ajiCDrB/aNzq5VktVK7dNiT9PamunNeoej4KbDBnkNwVacvg==", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.13.3.tgz", + "integrity": "sha512-lA29j9fkRGq+hNE3zQGxD/d8WmjhimSaPU2887CBe0Yv3C1UbIWvy51mYerp3/NoevjBLKSWhHmP5oY/eavtjQ==", "dev": true, "dependencies": { - "@arethetypeswrong/core": "0.13.2", + "@arethetypeswrong/core": "0.13.3", "chalk": "^4.1.2", "cli-table3": "^0.6.3", "commander": "^10.0.1", @@ -207,9 +207,9 @@ } }, "node_modules/@arethetypeswrong/core": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.13.2.tgz", - "integrity": "sha512-1l6ygar+6TH4o1JipWWGCEZlOhAwEShm1yKx+CgIByNjCzufbu6k9DNbDmBjdouusNRhBIOYQe1UHnJig+GtAw==", + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.13.3.tgz", + "integrity": "sha512-oxa26D3z5DEv9LGzfJWV/6PhQd170dFfDOXl9J3cGRNLo2B68zj6/YOD1RJaYF/kmxechdXT1XyGUPOtkXv8Lg==", "dev": true, "dependencies": { "@andrewbranch/untar.js": "^1.0.3", @@ -237,6 +237,19 @@ "node": ">=10" } }, + "node_modules/@arethetypeswrong/core/node_modules/typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@babel/code-frame": { "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", @@ -2456,15 +2469,15 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.38.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.38.3.tgz", - "integrity": "sha512-xt9iYyC5f39281j77JTA9C3ISJpW1XWkCcnw+2vM78CPnro6KhPfwQdPDfwS5JCPNuq0grm8cMdPUOPvrchDWw==", + "version": "7.38.5", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.38.5.tgz", + "integrity": "sha512-c/w2zfqBcBJxaCzpJNvFoouWewcYrUOfeu5ZkWCCIXTF9a/gXM85RGevEzlMAIEGM/kssAAZSXRJIZ3Q5vLFow==", "dev": true, "dependencies": { - "@microsoft/api-extractor-model": "7.28.2", + "@microsoft/api-extractor-model": "7.28.3", "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.61.0", + "@rushstack/node-core-library": "3.62.0", "@rushstack/rig-package": "0.5.1", "@rushstack/ts-command-line": "4.17.1", "colors": "~1.2.1", @@ -2479,14 +2492,14 @@ } }, "node_modules/@microsoft/api-extractor-model": { - "version": "7.28.2", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.2.tgz", - "integrity": "sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.3.tgz", + "integrity": "sha512-wT/kB2oDbdZXITyDh2SQLzaWwTOFbV326fP0pUwNW00WeliARs0qjmXBWmGWardEzp2U3/axkO3Lboqun6vrig==", "dev": true, "dependencies": { "@microsoft/tsdoc": "0.14.2", "@microsoft/tsdoc-config": "~0.16.1", - "@rushstack/node-core-library": "3.61.0" + "@rushstack/node-core-library": "3.62.0" } }, "node_modules/@microsoft/api-extractor/node_modules/semver": { @@ -2637,9 +2650,9 @@ "dev": true }, "node_modules/@rushstack/node-core-library": { - "version": "3.61.0", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.61.0.tgz", - "integrity": "sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==", + "version": "3.62.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.62.0.tgz", + "integrity": "sha512-88aJn2h8UpSvdwuDXBv1/v1heM6GnBf3RjEy6ZPP7UnzHNCqOHA2Ut+ScYUbXcqIdfew9JlTAe3g+cnX9xQ/Aw==", "dev": true, "dependencies": { "colors": "~1.2.1", @@ -2745,25 +2758,25 @@ } }, "node_modules/@size-limit/esbuild": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.0.0.tgz", - "integrity": "sha512-OOmba2ZuMpaUhmBXgCfgrO7L6zkUDwvFFfW8T+dK08968LQ79Q+kNgEXQAd+dhj9TlTkHyyEDczWmx16e9cXoQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.0.1.tgz", + "integrity": "sha512-JXxzmDW7Rch6yxd4u8g6uE21g34oT7fk7Ex2gfDwN4TtciOghI3By4fqxXOwGYkDueEcIw3LXNGjHnTS8Dz5nA==", "dev": true, "dependencies": { - "esbuild": "^0.19.5", - "nanoid": "^5.0.3" + "esbuild": "^0.19.8", + "nanoid": "^5.0.4" }, "engines": { "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@size-limit/esbuild-why": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.0.0.tgz", - "integrity": "sha512-YTEmxCBE5PF6LH9lvNYXJM/h7XqVjpCVFVf2NrsJ75d3HdU8q77WriI7/T1++reBf8GfUhY5RIyASdR1ZJ8S4w==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.0.1.tgz", + "integrity": "sha512-yZm93gskbV+4/XBxQ3Aju+JxkmxaqmzAFm1h+fYk4RXvFb742dcACEXFDy2I8jummF7n7lV/UYNqVOFPLvHW0Q==", "dev": true, "dependencies": { "esbuild-visualizer": "^0.4.1", @@ -2773,7 +2786,7 @@ "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@size-limit/esbuild-why/node_modules/open": { @@ -2795,29 +2808,29 @@ } }, "node_modules/@size-limit/file": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.0.0.tgz", - "integrity": "sha512-tTg6sSiFbiogiof3GV4iIRCPS4+46Hvq4QWXGXp00Be/tOnpglXF62xNpCfFwefx9YCXxCyeYSqqaRBjpRCsmQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.0.1.tgz", + "integrity": "sha512-ioSYJ1WY66kc9+3dgTHi5mT/gcaNNCJ22xU87cjzfKiNxmol+lGsNKbplmrJf+QezvPH9kRIFOWxBjGY+DOt3g==", "dev": true, "engines": { "node": "^18.0.0 || >=20.0.0" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@size-limit/preset-small-lib": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.0.0.tgz", - "integrity": "sha512-B4KDPbx5E8Vsn/aXilt2iAeofRBJdT8svQRSylTQPw5RkrumXUBKioM1dmWUXcnuHR2zUveJXlMxGmbdmxbJpQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.0.1.tgz", + "integrity": "sha512-c1N5/wN5FRQ03aOpoCw9ed2TP/1cmjt8vKAeTxO40OSfj6ImkpkMarl7e7pCnBElMULc993aUP5UjFhDN6bU4w==", "dev": true, "dependencies": { - "@size-limit/esbuild": "11.0.0", - "@size-limit/file": "11.0.0", - "size-limit": "11.0.0" + "@size-limit/esbuild": "11.0.1", + "@size-limit/file": "11.0.1", + "size-limit": "11.0.1" }, "peerDependencies": { - "size-limit": "11.0.0" + "size-limit": "11.0.1" } }, "node_modules/@testing-library/dom": { @@ -3230,9 +3243,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.10", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.10.tgz", - "integrity": "sha512-tE4yxKEphEyxj9s4inideLHktW/x6DwesIwWZ9NN1FKf9zbJYsnhBoA9vrHA/IuIOKwPa5PcFBNV4lpMIOEzyQ==", + "version": "29.5.11", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", + "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -3313,9 +3326,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", - "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", + "version": "20.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", + "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3344,9 +3357,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.41", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.41.tgz", - "integrity": "sha512-CwOGr/PiLiNBxEBqpJ7fO3kocP/2SSuC9fpH5K7tusrg4xPSRT/193rzolYwQnTN02We/ATXKnb6GqA5w4fRxw==", + "version": "18.2.43", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.43.tgz", + "integrity": "sha512-nvOV01ZdBdd/KW6FahSbcNplt2jCJfyWdTos61RYHV+FVv5L/g9AOX1bmbVcWcLFL8+KHQfh1zVIQrud6ihyQA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -8954,12 +8967,12 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/lines-and-columns": { @@ -9410,9 +9423,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.3.tgz", - "integrity": "sha512-I7X2b22cxA4LIHXPSqbBCEQSL+1wv8TuoefejsX4HFWyC6jc5JG7CEaxOltiKjc1M+YCS2YkrZZcj4+dytw9GA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.4.tgz", + "integrity": "sha512-vAjmBf13gsmhXSgBrtIclinISzFFy22WwCYoyilZlsrRXNIHSwgFQ1bEdjRwMT3aoadeIF6HMuDRlOxzfXV8ig==", "dev": true, "funding": [ { @@ -10190,9 +10203,9 @@ } }, "node_modules/prettier": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", - "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -11022,15 +11035,15 @@ "dev": true }, "node_modules/size-limit": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.0.0.tgz", - "integrity": "sha512-6+i4rE1GRzx/vRpuitRYQiZJNTXJjde+4P2NPg8AK7pURrE1+hA3mGstzvT8vQ8DuYFnvp9fh4CHM7Heq3EKXA==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.0.1.tgz", + "integrity": "sha512-6L80ocVspWPrhIRg8kPl41VypqTGH8/lu9e6TJiSJpkNLtOR2h/EEqdAO/wNJOv/sUVtjX+lVEWrzBpItGP+gQ==", "dev": true, "dependencies": { "bytes-iec": "^3.1.1", "chokidar": "^3.5.3", "globby": "^14.0.0", - "lilconfig": "^2.1.0", + "lilconfig": "^3.0.0", "nanospinner": "^1.1.0", "picocolors": "^1.0.0" }, @@ -11893,9 +11906,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -11936,9 +11949,9 @@ } }, "node_modules/ts-node/node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz", + "integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==", "dev": true, "engines": { "node": ">=0.4.0" @@ -12112,9 +12125,9 @@ } }, "node_modules/typescript": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", - "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index b98d0729d27..f99c1a6cdd9 100644 --- a/package.json +++ b/package.json @@ -107,15 +107,15 @@ "zen-observable-ts": "^1.2.5" }, "devDependencies": { - "@arethetypeswrong/cli": "0.13.2", + "@arethetypeswrong/cli": "0.13.3", "@babel/parser": "7.23.5", "@changesets/changelog-github": "0.5.0", "@changesets/cli": "2.27.1", "@graphql-tools/schema": "10.0.2", - "@microsoft/api-extractor": "7.38.3", + "@microsoft/api-extractor": "7.38.5", "@rollup/plugin-node-resolve": "11.2.1", - "@size-limit/esbuild-why": "11.0.0", - "@size-limit/preset-small-lib": "11.0.0", + "@size-limit/esbuild-why": "11.0.1", + "@size-limit/preset-small-lib": "11.0.1", "@testing-library/jest-dom": "6.1.5", "@testing-library/react": "14.1.2", "@testing-library/react-12": "npm:@testing-library/react@^12", @@ -125,11 +125,11 @@ "@types/fetch-mock": "7.3.8", "@types/glob": "8.1.0", "@types/hoist-non-react-statics": "3.3.5", - "@types/jest": "29.5.10", + "@types/jest": "29.5.11", "@types/lodash": "4.14.202", - "@types/node": "20.10.3", + "@types/node": "20.10.4", "@types/node-fetch": "2.6.9", - "@types/react": "18.2.41", + "@types/react": "18.2.43", "@types/react-dom": "18.2.17", "@types/relay-runtime": "14.1.14", "@types/use-sync-external-store": "0.0.6", @@ -157,7 +157,7 @@ "jest-junit": "16.0.0", "lodash": "4.17.21", "patch-package": "8.0.0", - "prettier": "3.1.0", + "prettier": "3.1.1", "react": "18.2.0", "react-17": "npm:react@^17", "react-dom": "18.2.0", @@ -170,16 +170,16 @@ "rollup-plugin-cleanup": "3.2.1", "rollup-plugin-terser": "7.0.2", "rxjs": "7.8.1", - "size-limit": "11.0.0", + "size-limit": "11.0.1", "subscriptions-transport-ws": "0.11.0", "terser": "5.26.0", "ts-api-utils": "1.0.3", "ts-jest": "29.1.1", "ts-jest-resolver": "2.0.1", "ts-morph": "20.0.0", - "ts-node": "10.9.1", + "ts-node": "10.9.2", "typedoc": "0.25.0", - "typescript": "5.3.2", + "typescript": "5.3.3", "wait-for-observables": "1.0.3", "web-streams-polyfill": "3.2.1", "whatwg-fetch": "3.6.19"