From 324e4c918fc2563d7a411e1595f3dc792def3437 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 4 Dec 2023 17:21:21 +0100 Subject: [PATCH 1/4] fix circular import --- src/utilities/graphql/DocumentTransform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/graphql/DocumentTransform.ts b/src/utilities/graphql/DocumentTransform.ts index c32df389ddc..c6b4d6f1db8 100644 --- a/src/utilities/graphql/DocumentTransform.ts +++ b/src/utilities/graphql/DocumentTransform.ts @@ -5,7 +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 "../../utilities/index.js"; +import { cacheSizes } from "../caching/index.js"; export type DocumentTransformCacheKey = ReadonlyArray; From 2e65620841e23fffb747cb74b1d894ea44d8eaf3 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 4 Dec 2023 17:21:53 +0100 Subject: [PATCH 2/4] size-limits --- .size-limits.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.size-limits.json b/.size-limits.json index f9e9c6f50a8..5081d8f0202 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": 38804, + "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32573 } From 717dc2dc835eb0ec684cbe9cddafb58a3966cf13 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 4 Dec 2023 17:25:22 +0100 Subject: [PATCH 3/4] update type to remove `WeakKey` --- src/utilities/caching/caches.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/caching/caches.ts b/src/utilities/caching/caches.ts index bbdd7a5baea..7c06c4ea60a 100644 --- a/src/utilities/caching/caches.ts +++ b/src/utilities/caching/caches.ts @@ -22,7 +22,7 @@ function schedule(cache: CommonCache) { * already handles cleanup and should remain a `WeakCache`. */ -export class CleanWeakCache extends WeakCache { +export class CleanWeakCache extends WeakCache { constructor(max: number, dispose?: (value: V) => void) { super(max, dispose); } From b2d33d09319f44054205fc605973c5673c646549 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 4 Dec 2023 17:25:29 +0100 Subject: [PATCH 4/4] api-extractor --- .api-reports/api-report-utilities.md | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.api-reports/api-report-utilities.md b/.api-reports/api-report-utilities.md index 2c4231f2096..841f022cfac 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) & { @@ -444,6 +446,24 @@ class CacheGroup { resetCaching(): void; } +// @public +interface CacheSizes { + canonicalStringify: number; + documentTransform: number; + fragmentRegistryFindFragmentSpreads: number; + fragmentRegistryLookup: number; + fragmentRegistryTransform: number; + parser: number; + persistedQueryHashes: number; + print: number; + queryManagerTransforms: number; +} + +// Warning: (ae-forgotten-export) The symbol "CacheSizes" needs to be exported by the entry point index.d.ts +// +// @public +export const cacheSizes: CacheSizes; + // @public (undocumented) const enum CacheWriteBehavior { // (undocumented) @@ -483,6 +503,20 @@ export const canUseWeakSet: boolean; // @public (undocumented) export function checkDocument(doc: DocumentNode): DocumentNode; +// @public +export class CleanStrongCache extends StrongCache { + constructor(max: number, dispose?: (value: V) => void); + // (undocumented) + set(key: K, value: V): V; +} + +// @public +export class CleanWeakCache extends WeakCache { + constructor(max: number, dispose?: (value: V) => void); + // (undocumented) + set(key: K, value: V): V; +} + // @public export function cloneDeep(value: T): T;