Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.0 #12201

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6676ac4
Enter prerelease mode
github-actions[bot] Dec 9, 2024
c2736db
Remove the deprecated hoc and query components (#12211)
jerelmiller Dec 13, 2024
d1a9054
Drop support for React 16 (#12222)
jerelmiller Dec 16, 2024
69c1cb6
Remove `subscribeAndCount` testing utility (#12223)
jerelmiller Dec 16, 2024
51e6c0f
Remove deprecated `partialRefetch` option (#12224)
jerelmiller Dec 16, 2024
0028ac0
Change default `Accept` header (#12254)
jerelmiller Jan 8, 2025
9b5e47e
Merge remote-tracking branch 'origin/main' into release-4.0
jerelmiller Jan 11, 2025
10ef733
Remove `itAsync` test function from `@apollo/client/testing` (#12262)
jerelmiller Jan 13, 2025
d1ba516
Merge branch 'main' into release-4.0
jerelmiller Jan 17, 2025
400e4e9
Merge branch 'main' into release-4.0
phryneas Jan 22, 2025
af3a90a
Merge branch 'main' into release-4.0
jerelmiller Jan 22, 2025
4d581e4
Move React-related exports to `@apollo/client/react` and out of the m…
jerelmiller Jan 23, 2025
4ea1622
Merge branch 'main' into release-4.0
jerelmiller Jan 24, 2025
3a60a6f
Merge branch 'main' into release-4.0
jerelmiller Jan 24, 2025
ae5d06a
Run Knip on 4.0 branch (#12291)
phryneas Jan 27, 2025
86469a2
Don't throw on missing results with `cache.diff` and other changes (#…
jerelmiller Jan 28, 2025
3623e28
Merge branch 'main' into release-4.0
jerelmiller Jan 28, 2025
b69d07b
some more knip reportings (#12314)
phryneas Jan 29, 2025
2a62324
remove dependency on `mocha` from memory tests (#12320)
phryneas Jan 29, 2025
6585f99
Clean up build scripts (#12305)
phryneas Jan 31, 2025
f88e807
Merge remote-tracking branch 'origin/main' into release-4.0
jerelmiller Jan 31, 2025
0429fb9
Fix tests affected by change to cache (#12330)
jerelmiller Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .api-reports/api-report-cache.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export abstract class ApolloCache<TSerialized> implements DataProxy {
readonly assumeImmutableResults: boolean;
// (undocumented)
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
// (undocumented)
abstract diff<T>(query: Cache_2.DiffOptions): Cache_2.DiffResult<T>;
// (undocumented)
abstract evict(options: Cache_2.EvictOptions): boolean;
Expand Down Expand Up @@ -254,9 +253,14 @@ interface DataMasking {
export namespace DataProxy {
// (undocumented)
export type DiffResult<T> = {
result?: T;
complete?: boolean;
missing?: MissingFieldError[];
result: T;
complete: true;
missing?: never;
fromOptimisticTransaction?: boolean;
} | {
result: DeepPartial<T> | null;
complete: false;
missing?: MissingFieldError;
fromOptimisticTransaction?: boolean;
};
// (undocumented)
Expand Down Expand Up @@ -324,8 +328,6 @@ export interface DataProxy {
// @public (undocumented)
type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends (ReadonlyArray<infer TItem>) ? TItem[] extends (T) ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;

// Warning: (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;

Expand Down Expand Up @@ -661,6 +663,10 @@ export class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
// (undocumented)
readonly policies: Policies;
// (undocumented)
read<T>(options: Cache_2.ReadOptions & {
returnPartialData: true;
}): T | DeepPartial<T> | null;
// (undocumented)
read<T>(options: Cache_2.ReadOptions): T | null;
// (undocumented)
release(rootId: string, optimistic?: boolean): number;
Expand Down Expand Up @@ -1182,7 +1188,8 @@ interface WriteContext extends ReadMergeModifyContext {

// Warnings were encountered during analysis:
//
// src/cache/core/cache.ts:92:7 - (ae-forgotten-export) The symbol "MaybeMasked" needs to be exported by the entry point index.d.ts
// src/cache/core/cache.ts:91:7 - (ae-forgotten-export) The symbol "MaybeMasked" needs to be exported by the entry point index.d.ts
// src/cache/core/types/DataProxy.ts:152:9 - (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:93:3 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeyArgsFunction" needs to be exported by the entry point index.d.ts
Expand Down
25 changes: 14 additions & 11 deletions .api-reports/api-report-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export abstract class ApolloCache<TSerialized> implements DataProxy {
readonly assumeImmutableResults: boolean;
// (undocumented)
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
// (undocumented)
abstract diff<T>(query: Cache_2.DiffOptions): Cache_2.DiffResult<T>;
// (undocumented)
abstract evict(options: Cache_2.EvictOptions): boolean;
Expand Down Expand Up @@ -500,9 +499,14 @@ export interface DataMasking {
export namespace DataProxy {
// (undocumented)
export type DiffResult<T> = {
result?: T;
complete?: boolean;
missing?: MissingFieldError[];
result: T;
complete: true;
missing?: never;
fromOptimisticTransaction?: boolean;
} | {
result: DeepPartial<T> | null;
complete: false;
missing?: MissingFieldError;
fromOptimisticTransaction?: boolean;
};
// (undocumented)
Expand Down Expand Up @@ -570,8 +574,6 @@ export interface DataProxy {
// @public (undocumented)
type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends (ReadonlyArray<infer TItem>) ? TItem[] extends (T) ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;

// Warning: (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;

Expand Down Expand Up @@ -1181,6 +1183,10 @@ export class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
// (undocumented)
readonly policies: Policies;
// (undocumented)
read<T>(options: Cache_2.ReadOptions & {
returnPartialData: true;
}): T | DeepPartial<T> | null;
// (undocumented)
read<T>(options: Cache_2.ReadOptions): T | null;
// (undocumented)
release(rootId: string, optimistic?: boolean): number;
Expand Down Expand Up @@ -2060,8 +2066,6 @@ interface QueryOptions<TVariables = OperationVariables, TData = any> {
errorPolicy?: ErrorPolicy;
fetchPolicy?: FetchPolicy;
notifyOnNetworkStatusChange?: boolean;
// @deprecated
partialRefetch?: boolean;
pollInterval?: number;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
returnPartialData?: boolean;
Expand Down Expand Up @@ -2259,8 +2263,6 @@ interface SharedWatchQueryOptions<TVariables extends OperationVariables, TData>
// Warning: (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TVariables, TData>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
notifyOnNetworkStatusChange?: boolean;
// @deprecated
partialRefetch?: boolean;
pollInterval?: number;
refetchWritePolicy?: RefetchWritePolicy;
returnPartialData?: boolean;
Expand Down Expand Up @@ -2504,6 +2506,7 @@ interface WriteContext extends ReadMergeModifyContext {

// Warnings were encountered during analysis:
//
// src/cache/core/types/DataProxy.ts:152:9 - (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:93:3 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:162:3 - (ae-forgotten-export) The symbol "KeyArgsFunction" needs to be exported by the entry point index.d.ts
Expand All @@ -2512,7 +2515,7 @@ interface WriteContext extends ReadMergeModifyContext {
// src/core/ObservableQuery.ts:121:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:159:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:414:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:277:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:271: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)
Expand Down
17 changes: 10 additions & 7 deletions .api-reports/api-report-masking.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ abstract class ApolloCache<TSerialized> implements DataProxy {
readonly assumeImmutableResults: boolean;
// (undocumented)
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
// (undocumented)
abstract diff<T>(query: Cache_2.DiffOptions): Cache_2.DiffResult<T>;
// (undocumented)
abstract evict(options: Cache_2.EvictOptions): boolean;
Expand Down Expand Up @@ -235,9 +234,14 @@ export interface DataMasking {
namespace DataProxy {
// (undocumented)
type DiffResult<T> = {
result?: T;
complete?: boolean;
missing?: MissingFieldError[];
result: T;
complete: true;
missing?: never;
fromOptimisticTransaction?: boolean;
} | {
result: DeepPartial<T> | null;
complete: false;
missing?: MissingFieldError;
fromOptimisticTransaction?: boolean;
};
// (undocumented)
Expand Down Expand Up @@ -317,8 +321,6 @@ interface DataProxy {
// @public (undocumented)
type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends (ReadonlyArray<infer TItem>) ? TItem[] extends (T) ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;

// Warning: (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;

Expand Down Expand Up @@ -648,7 +650,8 @@ type WatchFragmentResult<TData> = {

// Warnings were encountered during analysis:
//
// src/cache/core/types/DataProxy.ts:147:7 - (ae-forgotten-export) The symbol "MissingFieldError" needs to be exported by the entry point index.d.ts
// src/cache/core/types/DataProxy.ts:152:9 - (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
// src/cache/core/types/DataProxy.ts:154:7 - (ae-forgotten-export) The symbol "MissingFieldError" needs to be exported by the entry point index.d.ts
// src/cache/core/types/common.ts:101:3 - (ae-forgotten-export) The symbol "ReadFieldFunction" needs to be exported by the entry point index.d.ts
// src/cache/core/types/common.ts:102:3 - (ae-forgotten-export) The symbol "CanReadFunction" needs to be exported by the entry point index.d.ts
// src/cache/core/types/common.ts:103:3 - (ae-forgotten-export) The symbol "isReference" needs to be exported by the entry point index.d.ts
Expand Down
26 changes: 11 additions & 15 deletions .api-reports/api-report-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ abstract class ApolloCache<TSerialized> implements DataProxy {
readonly assumeImmutableResults: boolean;
// (undocumented)
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
// (undocumented)
abstract diff<T>(query: Cache_2.DiffOptions): Cache_2.DiffResult<T>;
// (undocumented)
abstract evict(options: Cache_2.EvictOptions): boolean;
Expand Down Expand Up @@ -593,9 +592,14 @@ interface DataMasking {
namespace DataProxy {
// (undocumented)
type DiffResult<T> = {
result?: T;
complete?: boolean;
missing?: MissingFieldError[];
result: T;
complete: true;
missing?: never;
fromOptimisticTransaction?: boolean;
} | {
result: DeepPartial<T> | null;
complete: false;
missing?: MissingFieldError;
fromOptimisticTransaction?: boolean;
};
// (undocumented)
Expand Down Expand Up @@ -675,8 +679,6 @@ interface DataProxy {
// @public (undocumented)
type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends (ReadonlyArray<infer TItem>) ? TItem[] extends (T) ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;

// Warning: (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;

Expand Down Expand Up @@ -1826,8 +1828,6 @@ interface QueryOptions<TVariables = OperationVariables, TData = any> {
errorPolicy?: ErrorPolicy;
fetchPolicy?: FetchPolicy;
notifyOnNetworkStatusChange?: boolean;
// @deprecated
partialRefetch?: boolean;
pollInterval?: number;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
returnPartialData?: boolean;
Expand Down Expand Up @@ -1987,9 +1987,6 @@ class RenderPromises {
// @public (undocumented)
type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;

// @public @deprecated (undocumented)
export const resetApolloContext: typeof getApolloContext;

// @public (undocumented)
type ResetFunction = () => void;

Expand Down Expand Up @@ -2035,8 +2032,6 @@ interface SharedWatchQueryOptions<TVariables extends OperationVariables, TData>
// Warning: (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TVariables, TData>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
notifyOnNetworkStatusChange?: boolean;
// @deprecated
partialRefetch?: boolean;
pollInterval?: number;
refetchWritePolicy?: RefetchWritePolicy;
returnPartialData?: boolean;
Expand Down Expand Up @@ -2512,7 +2507,8 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar

// Warnings were encountered during analysis:
//
// src/cache/core/types/DataProxy.ts:147:7 - (ae-forgotten-export) The symbol "MissingFieldError" needs to be exported by the entry point index.d.ts
// src/cache/core/types/DataProxy.ts:152:9 - (ae-forgotten-export) The symbol "DeepPartial" needs to be exported by the entry point index.d.ts
// src/cache/core/types/DataProxy.ts:154:7 - (ae-forgotten-export) The symbol "MissingFieldError" needs to be exported by the entry point index.d.ts
// src/cache/core/types/common.ts:101:3 - (ae-forgotten-export) The symbol "ReadFieldFunction" needs to be exported by the entry point index.d.ts
// src/cache/core/types/common.ts:102:3 - (ae-forgotten-export) The symbol "CanReadFunction" needs to be exported by the entry point index.d.ts
// src/cache/core/types/common.ts:103:3 - (ae-forgotten-export) The symbol "isReference" needs to be exported by the entry point index.d.ts
Expand All @@ -2525,7 +2521,7 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
// src/core/QueryManager.ts:414:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:175:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
// src/core/types.ts:204:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:277:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:271:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:38:3 - (ae-forgotten-export) The symbol "SubscribeToMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:54:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:78:4 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts
Expand Down
Loading