From 45289186bcaaa33dfe904913eb6df31e2541c219 Mon Sep 17 00:00:00 2001 From: Alessia Bellisario Date: Wed, 10 Jul 2024 15:51:39 -0400 Subject: [PATCH] remove deprecated `watchFragment` option, `canonizeResults` (#11949) * fix: remove deprecated watchFragment option canonizeResults * chore: add changeset * chore: update api-reports --- .api-reports/api-report-cache.api.md | 2 -- .api-reports/api-report-core.api.md | 2 -- .api-reports/api-report-react.api.md | 2 -- .api-reports/api-report-react_components.api.md | 2 -- .api-reports/api-report-react_context.api.md | 2 -- .api-reports/api-report-react_hoc.api.md | 2 -- .api-reports/api-report-react_hooks.api.md | 2 -- .api-reports/api-report-react_internal.api.md | 2 -- .api-reports/api-report-react_ssr.api.md | 2 -- .api-reports/api-report-testing.api.md | 2 -- .api-reports/api-report-testing_core.api.md | 2 -- .api-reports/api-report-utilities.api.md | 2 -- .api-reports/api-report.api.md | 2 -- .changeset/curly-vans-draw.md | 5 +++++ src/cache/core/cache.ts | 11 ----------- 15 files changed, 5 insertions(+), 37 deletions(-) create mode 100644 .changeset/curly-vans-draw.md diff --git a/.api-reports/api-report-cache.api.md b/.api-reports/api-report-cache.api.md index 30ec666b30..3434c4bbb0 100644 --- a/.api-reports/api-report-cache.api.md +++ b/.api-reports/api-report-cache.api.md @@ -976,8 +976,6 @@ export type TypePolicy = { // @public export interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-core.api.md b/.api-reports/api-report-core.api.md index 5382952aee..237eac1a46 100644 --- a/.api-reports/api-report-core.api.md +++ b/.api-reports/api-report-core.api.md @@ -2231,8 +2231,6 @@ export interface UriFunction { // @public export interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-react.api.md b/.api-reports/api-report-react.api.md index 0e32289572..5b8b33b8ae 100644 --- a/.api-reports/api-report-react.api.md +++ b/.api-reports/api-report-react.api.md @@ -2285,8 +2285,6 @@ TVariables // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-react_components.api.md b/.api-reports/api-report-react_components.api.md index e8ed84f1de..24881bcaf5 100644 --- a/.api-reports/api-report-react_components.api.md +++ b/.api-reports/api-report-react_components.api.md @@ -1764,8 +1764,6 @@ interface UriFunction { // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-react_context.api.md b/.api-reports/api-report-react_context.api.md index 6f255e1efa..fa3fd404a7 100644 --- a/.api-reports/api-report-react_context.api.md +++ b/.api-reports/api-report-react_context.api.md @@ -1684,8 +1684,6 @@ interface UriFunction { // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-react_hoc.api.md b/.api-reports/api-report-react_hoc.api.md index 7b8cdd3f2f..6be8fbce07 100644 --- a/.api-reports/api-report-react_hoc.api.md +++ b/.api-reports/api-report-react_hoc.api.md @@ -1696,8 +1696,6 @@ interface UriFunction { // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-react_hooks.api.md b/.api-reports/api-report-react_hooks.api.md index 6c8829f614..0691c35d9b 100644 --- a/.api-reports/api-report-react_hooks.api.md +++ b/.api-reports/api-report-react_hooks.api.md @@ -2109,8 +2109,6 @@ export interface UseSuspenseQueryResult { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-react_internal.api.md b/.api-reports/api-report-react_internal.api.md index 934334ea9b..98443e3b6b 100644 --- a/.api-reports/api-report-react_internal.api.md +++ b/.api-reports/api-report-react_internal.api.md @@ -2127,8 +2127,6 @@ TVariables // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-react_ssr.api.md b/.api-reports/api-report-react_ssr.api.md index c547e86923..eb50183646 100644 --- a/.api-reports/api-report-react_ssr.api.md +++ b/.api-reports/api-report-react_ssr.api.md @@ -1669,8 +1669,6 @@ interface UriFunction { // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-testing.api.md b/.api-reports/api-report-testing.api.md index 2d72d09c0a..ebd148cf04 100644 --- a/.api-reports/api-report-testing.api.md +++ b/.api-reports/api-report-testing.api.md @@ -1728,8 +1728,6 @@ export function wait(ms: number): Promise; // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-testing_core.api.md b/.api-reports/api-report-testing_core.api.md index ddf2c0aa6c..ef631e90da 100644 --- a/.api-reports/api-report-testing_core.api.md +++ b/.api-reports/api-report-testing_core.api.md @@ -1685,8 +1685,6 @@ export function wait(ms: number): Promise; // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report-utilities.api.md b/.api-reports/api-report-utilities.api.md index ea225f4f7e..ab3858c6f0 100644 --- a/.api-reports/api-report-utilities.api.md +++ b/.api-reports/api-report-utilities.api.md @@ -2590,8 +2590,6 @@ export type VariableValue = (node: VariableNode) => any; // @public interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.api-reports/api-report.api.md b/.api-reports/api-report.api.md index 58d5f5cbdd..ef88362554 100644 --- a/.api-reports/api-report.api.md +++ b/.api-reports/api-report.api.md @@ -2946,8 +2946,6 @@ TVariables // @public export interface WatchFragmentOptions { - // @deprecated (undocumented) - canonizeResults?: boolean; fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; from: StoreObject | Reference | string; diff --git a/.changeset/curly-vans-draw.md b/.changeset/curly-vans-draw.md new file mode 100644 index 0000000000..e9096914b9 --- /dev/null +++ b/.changeset/curly-vans-draw.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +Remove deprecated `watchFragment` option, `canonizeResults` diff --git a/src/cache/core/cache.ts b/src/cache/core/cache.ts index f4b7dd9b59..cb953152c4 100644 --- a/src/cache/core/cache.ts +++ b/src/cache/core/cache.ts @@ -69,17 +69,6 @@ export interface WatchFragmentOptions { * @docGroup 2. Cache options */ optimistic?: boolean; - /** - * @deprecated - * Using `canonizeResults` can result in memory leaks so we generally do not - * recommend using this option anymore. - * A future version of Apollo Client will contain a similar feature. - * - * Whether to canonize cache results before returning them. Canonization - * takes some extra time, but it speeds up future deep equality comparisons. - * Defaults to false. - */ - canonizeResults?: boolean; } /**