Skip to content

Commit 9c3207c

Browse files
authored
remove react/context|hooks|parser entry points, remove parser utils completely (#12513)
* remove `react/context|hooks|parser` entry points, move `verifyDocumentType` to `utilities` * `verifyDocumentType`: remove `parser` cache * call `verifyDocumentType` from `QueryManager`, not in the hooks * dead code * cleanup * fix build * linter fixup * format * update snapshot * use `checkDocument` instead of `verifyDocumentType` * remove import * api-extractor * update size-limits * move props into namespace * api-extractor * changesets
1 parent fa4348a commit 9c3207c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1605
-702
lines changed

.api-reports/api-report-core.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ interface WriteContext extends ReadMergeModifyContext {
20222022
// src/cache/inmemory/types.ts:133:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
20232023
// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
20242024
// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
2025-
// src/core/QueryManager.ts:187:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
2025+
// src/core/QueryManager.ts:185:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
20262026
// src/core/QueryManager.ts:455:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
20272027

20282028
// (No @packageDocumentation comment for this package)

.api-reports/api-report-react.api.md

Lines changed: 1453 additions & 64 deletions
Large diffs are not rendered by default.

.api-reports/api-report-react_internal.api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import type { OperationVariables } from '@apollo/client/core';
1818
import type { PromiseWithState } from '@apollo/client/utilities';
1919
import type { QueryResult } from '@apollo/client/core';
2020
import type { Unmasked } from '@apollo/client/core';
21-
import type { useBackgroundQuery } from '@apollo/client/react/hooks';
22-
import type { useFragment } from '@apollo/client/react/hooks';
23-
import type { useQuery } from '@apollo/client/react/hooks';
24-
import type { useQueryRefHandlers } from '@apollo/client/react/hooks';
25-
import type { useReadQuery } from '@apollo/client/react/hooks';
26-
import type { useSuspenseFragment } from '@apollo/client/react/hooks';
27-
import type { useSuspenseQuery } from '@apollo/client/react/hooks';
21+
import type { useBackgroundQuery } from '@apollo/client/react';
22+
import type { useFragment } from '@apollo/client/react';
23+
import type { useQuery } from '@apollo/client/react';
24+
import type { useQueryRefHandlers } from '@apollo/client/react';
25+
import type { useReadQuery } from '@apollo/client/react';
26+
import type { useSuspenseFragment } from '@apollo/client/react';
27+
import type { useSuspenseQuery } from '@apollo/client/react';
2828
import type { WatchFragmentOptions } from '@apollo/client/core';
2929
import type { WatchFragmentOptions as WatchFragmentOptions_2 } from '@apollo/client/cache';
3030
import type { WatchFragmentResult } from '@apollo/client/cache';

.api-reports/api-report-utilities.api.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import type { MutationOptions } from '@apollo/client/core';
2525
import type { NameNode } from 'graphql';
2626
import { Observable } from 'rxjs';
2727
import type { OperationDefinitionNode } from 'graphql';
28+
import type { OperationTypeNode } from 'graphql';
2829
import type { OperationVariables } from '@apollo/client/core';
2930
import type { QueryOptions } from '@apollo/client/core';
3031
import type { Reference as Reference_2 } from '@apollo/client/cache';
@@ -84,7 +85,6 @@ export interface CacheSizes {
8485
"queryManager.getDocumentInfo": number;
8586
"removeTypenameFromVariables.getVariableDefinitions": number;
8687
canonicalStringify: number;
87-
parser: number;
8888
print: number;
8989
}
9090

@@ -103,7 +103,7 @@ export const canUseDOM: boolean;
103103
export const canUseLayoutEffect: boolean;
104104

105105
// @public (undocumented)
106-
export function checkDocument(doc: DocumentNode): DocumentNode;
106+
export function checkDocument(doc: DocumentNode, expectedType?: OperationTypeNode): DocumentNode;
107107

108108
// @public
109109
export function cloneDeep<T>(value: T): T;
@@ -213,8 +213,6 @@ export const enum defaultCacheSizes {
213213
// (undocumented)
214214
canonicalStringify = 1000,
215215
// (undocumented)
216-
parser = 1000,
217-
// (undocumented)
218216
print = 2000
219217
}
220218

.api-reports/api-report-utilities_internal.api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const getApolloClientMemoryInternals: (() => {
3838
transform: number | undefined;
3939
} | undefined;
4040
print: number | undefined;
41-
parser: number | undefined;
4241
canonicalStringify: number | undefined;
4342
links: unknown[];
4443
queryManager: {

.api-reports/api-report.api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,6 @@ const getApolloClientMemoryInternals: (() => {
962962
transform: number | undefined;
963963
} | undefined;
964964
print: number | undefined;
965-
parser: number | undefined;
966965
canonicalStringify: number | undefined;
967966
links: unknown[];
968967
queryManager: {
@@ -2482,7 +2481,7 @@ interface WriteContext extends ReadMergeModifyContext {
24822481
// src/cache/inmemory/types.ts:133:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
24832482
// src/core/ObservableQuery.ts:130:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
24842483
// src/core/ObservableQuery.ts:131:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
2485-
// src/core/QueryManager.ts:187:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
2484+
// src/core/QueryManager.ts:185:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
24862485
// src/core/QueryManager.ts:455:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
24872486
// src/link/http/selectHttpOptionsAndBody.ts:128:1 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts
24882487

.changeset/dirty-eagles-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": major
3+
---
4+
5+
Removed the `@apollo/client/react/context` and `@apollo/client/react/hooks` entry points. Please use `@apollo/client/react` instead.

.changeset/nice-dots-matter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": patch
3+
---
4+
5+
Removed the `parser` cache. The functionality has been replaced in a way that doesn't need caching.

.changeset/purple-bears-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": major
3+
---
4+
5+
Removed the `@apollo/client/react/parser` entry point. There is no replacement.

.size-limits.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 42953,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38324,
4-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 32954,
5-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27724
2+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 42819,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38357,
4+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 32736,
5+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27747
66
}

0 commit comments

Comments
 (0)