Skip to content

Commit

Permalink
Merge branch 'main' into pr/fix-11234
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas authored Sep 22, 2023
2 parents 5ae0a2e + 770cb72 commit fd08de1
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 123 deletions.
25 changes: 0 additions & 25 deletions .api-reports/api-report-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,6 @@ export interface BackgroundQueryHookOptions<TData = unknown, TVariables extends
queryKey?: string | number | any[];
// (undocumented)
skip?: boolean;
// (undocumented)
suspenseCache?: SuspenseCache;
}

// @public (undocumented)
Expand Down Expand Up @@ -1917,27 +1915,6 @@ export interface SubscriptionResult<TData = any, TVariables = any> {
variables?: TVariables;
}

// Warning: (ae-forgotten-export) The symbol "SuspenseCache_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export class SuspenseCache extends SuspenseCache_2 {
constructor();
}

// @public (undocumented)
class SuspenseCache_2 {
// Warning: (ae-forgotten-export) The symbol "SuspenseCacheOptions" needs to be exported by the entry point index.d.ts
constructor(options?: SuspenseCacheOptions);
// (undocumented)
getQueryRef<TData = any>(cacheKey: CacheKey, createObservable: () => ObservableQuery<TData>): InternalQueryReference<TData>;
}

// @public (undocumented)
interface SuspenseCacheOptions {
// (undocumented)
autoDisposeTimeoutMs?: number;
}

// @public (undocumented)
export type SuspenseQueryHookFetchPolicy = Extract<WatchQueryFetchPolicy, "cache-first" | "network-only" | "no-cache" | "cache-and-network">;

Expand All @@ -1949,8 +1926,6 @@ export interface SuspenseQueryHookOptions<TData = unknown, TVariables extends Op
queryKey?: string | number | any[];
// (undocumented)
skip?: boolean;
// (undocumented)
suspenseCache?: SuspenseCache;
}

// @public (undocumented)
Expand Down
27 changes: 0 additions & 27 deletions .api-reports/api-report-react_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ interface BackgroundQueryHookOptions<TData = unknown, TVariables extends Operati
queryKey?: string | number | any[];
// (undocumented)
skip?: boolean;
// Warning: (ae-forgotten-export) The symbol "SuspenseCache" needs to be exported by the entry point index.d.ts
//
// (undocumented)
suspenseCache?: SuspenseCache;
}

// Warning: (ae-forgotten-export) The symbol "BackgroundQueryHookOptions" needs to be exported by the entry point index.d.ts
Expand Down Expand Up @@ -1798,27 +1794,6 @@ interface SubscriptionResult<TData = any, TVariables = any> {
variables?: TVariables;
}

// Warning: (ae-forgotten-export) The symbol "SuspenseCache_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
class SuspenseCache extends SuspenseCache_2 {
constructor();
}

// @public (undocumented)
class SuspenseCache_2 {
// Warning: (ae-forgotten-export) The symbol "SuspenseCacheOptions" needs to be exported by the entry point index.d.ts
constructor(options?: SuspenseCacheOptions);
// (undocumented)
getQueryRef<TData = any>(cacheKey: CacheKey, createObservable: () => ObservableQuery<TData>): InternalQueryReference<TData>;
}

// @public (undocumented)
interface SuspenseCacheOptions {
// (undocumented)
autoDisposeTimeoutMs?: number;
}

// @public (undocumented)
type SuspenseQueryHookFetchPolicy = Extract<WatchQueryFetchPolicy, "cache-first" | "network-only" | "no-cache" | "cache-and-network">;

Expand All @@ -1832,8 +1807,6 @@ interface SuspenseQueryHookOptions<TData = unknown, TVariables extends Operation
queryKey?: string | number | any[];
// (undocumented)
skip?: boolean;
// (undocumented)
suspenseCache?: SuspenseCache;
}

// @public (undocumented)
Expand Down
25 changes: 0 additions & 25 deletions .api-reports/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ export interface BackgroundQueryHookOptions<TData = unknown, TVariables extends
queryKey?: string | number | any[];
// (undocumented)
skip?: boolean;
// (undocumented)
suspenseCache?: SuspenseCache;
}

// @public (undocumented)
Expand Down Expand Up @@ -2529,27 +2527,6 @@ export interface SubscriptionResult<TData = any, TVariables = any> {
variables?: TVariables;
}

// Warning: (ae-forgotten-export) The symbol "SuspenseCache_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export class SuspenseCache extends SuspenseCache_2 {
constructor();
}

// @public (undocumented)
class SuspenseCache_2 {
// Warning: (ae-forgotten-export) The symbol "SuspenseCacheOptions" needs to be exported by the entry point index.d.ts
constructor(options?: SuspenseCacheOptions);
// (undocumented)
getQueryRef<TData = any>(cacheKey: CacheKey, createObservable: () => ObservableQuery<TData>): InternalQueryReference<TData>;
}

// @public (undocumented)
interface SuspenseCacheOptions {
// (undocumented)
autoDisposeTimeoutMs?: number;
}

// @public (undocumented)
export type SuspenseQueryHookFetchPolicy = Extract<WatchQueryFetchPolicy, "cache-first" | "network-only" | "no-cache" | "cache-and-network">;

Expand All @@ -2561,8 +2538,6 @@ export interface SuspenseQueryHookOptions<TData = unknown, TVariables extends Op
queryKey?: string | number | any[];
// (undocumented)
skip?: boolean;
// (undocumented)
suspenseCache?: SuspenseCache;
}

// @public (undocumented)
Expand Down
5 changes: 5 additions & 0 deletions .changeset/pretty-readers-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Remove (already throwing) SuspenseCache export that should have been removed in 3.8.
4 changes: 2 additions & 2 deletions .size-limit.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const checks = [
{
path: "dist/apollo-client.min.cjs",
limit: "38190",
limit: "37986",
},
{
path: "dist/main.cjs",
Expand All @@ -10,7 +10,7 @@ const checks = [
{
path: "dist/index.js",
import: "{ ApolloClient, InMemoryCache, HttpLink }",
limit: "32044",
limit: "32019",
},
...[
"ApolloProvider",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/networking/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ VueJS example:
```js
import ApolloClient from "apollo-client";
import { HttpLink } from "apollo-link-http";
import { ApolloLink, concat, split } from "apollo-link";
import { ApolloLink, concat } from "apollo-link";
import { InMemoryCache } from "apollo-cache-inmemory";
import { getMainDefinition } from "apollo-utilities";

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cra4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@apollo/client": "^3.7.16",
"graphql": "^16.7.1",
"graphql": "^16.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cra5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"react-scripts": "5.0.1",
"typescript": "^4.9.5",
"@apollo/client": "^3.7.16",
"graphql": "^16.7.1"
"graphql": "^16.8.1"
},
"scripts": {
"start": "PORT=3000 react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/react": "18.2.14",
"@types/react-dom": "18.2.6",
"deepmerge": "^4.3.1",
"graphql": "^16.7.1",
"graphql": "^16.8.1",
"lodash": "^4.17.21",
"next": "13.4.7",
"react": "18.2.0",
Expand Down
14 changes: 7 additions & 7 deletions integration-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integration-tests/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@apollo/client": "^3.7.16",
"graphql": "^16.7.1",
"graphql": "^16.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/__snapshots__/exports.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Array [
"NetworkStatus",
"Observable",
"ObservableQuery",
"SuspenseCache",
"checkFetcher",
"concat",
"createHttpLink",
Expand Down Expand Up @@ -265,7 +264,6 @@ Array [
"ApolloConsumer",
"ApolloProvider",
"DocumentType",
"SuspenseCache",
"getApolloContext",
"operationName",
"parser",
Expand Down
25 changes: 0 additions & 25 deletions src/react/cache/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,2 @@
export type { SuspenseCacheOptions } from "./SuspenseCache.js";
export { getSuspenseCache } from "./getSuspenseCache.js";

import { SuspenseCache as RealSuspenseCache } from "./SuspenseCache.js";

// TODO: remove export with release 3.8
// replace with
// export type { SuspenseCache } from './SuspenseCache.js';
/**
* @deprecated
* It is no longer necessary to create a `SuspenseCache` instance and pass it into the `ApolloProvider`.
* Please remove this code from your application.
*
* This export will be removed with the final 3.8 release.
*/
export class SuspenseCache extends RealSuspenseCache {
constructor() {
super();
// throwing an error here instead of using invariant - we do not want this error
// message to be link-ified, but to directly show up as bold as possible
throw new Error(
"It is no longer necessary to create a `SuspenseCache` instance and pass it into the `ApolloProvider`.\n" +
"Please remove this code from your application. \n\n" +
"This export will be removed with the final 3.8 release."
);
}
}
2 changes: 0 additions & 2 deletions src/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export {
} from "./context/index.js";

export * from "./hooks/index.js";
// TODO: remove export with release 3.8
export { SuspenseCache } from "./cache/index.js";

export type { IDocumentDefinition } from "./parser/index.js";
export { DocumentType, operationName, parser } from "./parser/index.js";
Expand Down
3 changes: 0 additions & 3 deletions src/react/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import type {
WatchQueryOptions,
WatchQueryFetchPolicy,
} from "../../core/index.js";
import type { SuspenseCache } from "../cache/index.js";

/* QueryReference type */

Expand Down Expand Up @@ -134,7 +133,6 @@ export interface SuspenseQueryHookOptions<
| "refetchWritePolicy"
> {
fetchPolicy?: SuspenseQueryHookFetchPolicy;
suspenseCache?: SuspenseCache;
queryKey?: string | number | any[];

/**
Expand Down Expand Up @@ -172,7 +170,6 @@ export interface BackgroundQueryHookOptions<
| "refetchWritePolicy"
> {
fetchPolicy?: BackgroundQueryHookFetchPolicy;
suspenseCache?: SuspenseCache;
queryKey?: string | number | any[];

/**
Expand Down

0 comments on commit fd08de1

Please sign in to comment.