Skip to content

Commit e7d1a5c

Browse files
Merge pull request #470 from apollographql/main
Create a new pull request by comparing changes across two branches
2 parents 5615e2f + e88b641 commit e7d1a5c

Some content is hidden

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

41 files changed

+1916
-788
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export namespace ApolloCache {
5959
export abstract class ApolloCache {
6060
// (undocumented)
6161
readonly assumeImmutableResults: boolean;
62-
// (undocumented)
6362
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
6463
abstract diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
6564
// (undocumented)
@@ -124,13 +123,9 @@ type BroadcastOptions = Pick<Cache_2.BatchOptions<InMemoryCache>, "optimistic" |
124123
namespace Cache_2 {
125124
// (undocumented)
126125
interface BatchOptions<TCache extends ApolloCache, TUpdateResult = void> {
127-
// (undocumented)
128126
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff?: Cache_2.DiffResult<any> | undefined) => any;
129-
// (undocumented)
130127
optimistic?: string | boolean;
131-
// (undocumented)
132128
removeOptimistic?: string;
133-
// (undocumented)
134129
update(cache: TCache): TUpdateResult;
135130
}
136131
// (undocumented)
@@ -497,7 +492,6 @@ export class InMemoryCache extends ApolloCache {
497492
constructor(config?: InMemoryCacheConfig);
498493
// (undocumented)
499494
readonly assumeImmutableResults = true;
500-
// (undocumented)
501495
batch<TUpdateResult>(options: Cache_2.BatchOptions<InMemoryCache, TUpdateResult>): TUpdateResult;
502496
// Warning: (ae-forgotten-export) The symbol "BroadcastOptions" needs to be exported by the entry point index.d.ts
503497
//

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import { TypePolicy } from '@apollo/client/cache';
101101
import { UnconventionalError } from '@apollo/client/errors';
102102
import { Unmasked } from '@apollo/client/masking';
103103
import type { VariablesOption } from '@apollo/client/utilities/internal';
104+
import type { variablesUnknownSymbol } from '@apollo/client/utilities/internal';
104105
import { WatchFragmentOptions } from '@apollo/client/cache';
105106
import { WatchFragmentResult } from '@apollo/client/cache';
106107

@@ -300,6 +301,7 @@ export namespace ApolloClient {
300301
returnPartialData?: boolean;
301302
skipPollAttempt?: () => boolean;
302303
query: DocumentNode_2 | TypedDocumentNode<TData, TVariables>;
304+
[variablesUnknownSymbol]?: boolean;
303305
} & VariablesOption<NoInfer<TVariables>>;
304306
// (undocumented)
305307
export type WriteFragmentOptions<TData, TVariables extends OperationVariables> = Base.WriteFragmentOptions<TData, TVariables> & VariablesOption<TVariables>;
@@ -1132,8 +1134,8 @@ export type WatchQueryOptions<TVariables extends OperationVariables = OperationV
11321134

11331135
// Warnings were encountered during analysis:
11341136
//
1135-
// src/core/ApolloClient.ts:353:5 - (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
1136-
// src/core/ObservableQuery.ts:361:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
1137+
// src/core/ApolloClient.ts:356:5 - (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
1138+
// src/core/ObservableQuery.ts:363:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
11371139
// src/core/QueryManager.ts:180:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
11381140

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

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ export type VariablesOption<TVariables extends OperationVariables> = {} extends
447447
variables: TVariables;
448448
};
449449

450+
// @internal @deprecated
451+
export const variablesUnknownSymbol: unique symbol;
452+
450453
// Warnings were encountered during analysis:
451454
//
452455
// src/utilities/internal/getStoreKeyName.ts:88:1 - (ae-forgotten-export) The symbol "storeKeyNameStringify" needs to be exported by the entry point index.d.ts

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export namespace ApolloCache {
5858
export abstract class ApolloCache {
5959
// (undocumented)
6060
readonly assumeImmutableResults: boolean;
61-
// (undocumented)
6261
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
6362
abstract diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
6463
// (undocumented)
@@ -314,6 +313,7 @@ export namespace ApolloClient {
314313
returnPartialData?: boolean;
315314
skipPollAttempt?: () => boolean;
316315
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
316+
[variablesUnknownSymbol]?: boolean;
317317
} & VariablesOption<NoInfer<TVariables>>;
318318
// (undocumented)
319319
export type WriteFragmentOptions<TData, TVariables extends OperationVariables> = Base.WriteFragmentOptions<TData, TVariables> & VariablesOption<TVariables>;
@@ -550,13 +550,9 @@ export const build: "source" | "esm" | "cjs";
550550
namespace Cache_2 {
551551
// (undocumented)
552552
interface BatchOptions<TCache extends ApolloCache, TUpdateResult = void> {
553-
// (undocumented)
554553
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff?: Cache_2.DiffResult<any> | undefined) => any;
555-
// (undocumented)
556554
optimistic?: string | boolean;
557-
// (undocumented)
558555
removeOptimistic?: string;
559-
// (undocumented)
560556
update(cache: TCache): TUpdateResult;
561557
}
562558
// (undocumented)
@@ -1324,7 +1320,6 @@ export class InMemoryCache extends ApolloCache {
13241320
constructor(config?: InMemoryCacheConfig);
13251321
// (undocumented)
13261322
readonly assumeImmutableResults = true;
1327-
// (undocumented)
13281323
batch<TUpdateResult>(options: Cache_2.BatchOptions<InMemoryCache, TUpdateResult>): TUpdateResult;
13291324
// Warning: (ae-forgotten-export) The symbol "BroadcastOptions" needs to be exported by the entry point index.d.ts
13301325
//
@@ -2649,6 +2644,9 @@ type VariablesOption<TVariables extends OperationVariables> = {} extends TVariab
26492644
variables: TVariables;
26502645
};
26512646

2647+
// @internal @deprecated
2648+
const variablesUnknownSymbol: unique symbol;
2649+
26522650
// Warning: (ae-forgotten-export) The symbol "verbosityLevels" needs to be exported by the entry point index.d.ts
26532651
//
26542652
// @public (undocumented)
@@ -2711,9 +2709,9 @@ interface WriteContext extends ReadMergeModifyContext {
27112709
// src/cache/inmemory/policies.ts:167:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts
27122710
// src/cache/inmemory/policies.ts:167:3 - (ae-forgotten-export) The symbol "KeyArgsFunction" needs to be exported by the entry point index.d.ts
27132711
// src/cache/inmemory/types.ts:134:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
2714-
// src/core/ApolloClient.ts:159:5 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2715-
// src/core/ApolloClient.ts:353:5 - (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
2716-
// src/core/ObservableQuery.ts:361:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
2712+
// src/core/ApolloClient.ts:162:5 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2713+
// src/core/ApolloClient.ts:356:5 - (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
2714+
// src/core/ObservableQuery.ts:363:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
27172715
// src/core/QueryManager.ts:180:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
27182716
// src/local-state/LocalState.ts:147:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
27192717
// src/local-state/LocalState.ts:200:7 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts

.github/workflows/prerelease.yml

Lines changed: 7 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
contents: write
2222
pull-requests: write
2323
id-token: write
24-
outputs:
25-
packages: ${{ steps.changesets.outputs.publishedPackages }}
2624
steps:
2725
- uses: actions/create-github-app-token@v1
2826
id: github-actions-bot-app-token
@@ -40,29 +38,20 @@ jobs:
4038
# with the correct commits
4139
fetch-depth: 0
4240

43-
- name: Append NPM token to .npmrc
44-
run: |
45-
cat << EOF > "$HOME/.npmrc"
46-
provenance=true
47-
//registry.npmjs.org/:_authToken=$NPM_TOKEN
48-
EOF
49-
env:
50-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
- name: Check for pre.json file existence
42+
id: check_files
43+
uses: andstor/[email protected]
44+
with:
45+
files: ".changeset/pre.json"
5146

5247
- name: Setup Node.js
5348
uses: actions/setup-node@v6
5449
with:
55-
node-version: ">=23.6.0"
50+
node-version: "24.x"
5651

5752
- name: Install dependencies with cache
5853
uses: bahmutov/npm-install@v1
5954

60-
- name: Check for pre.json file existence
61-
id: check_files
62-
uses: andstor/[email protected]
63-
with:
64-
files: ".changeset/pre.json"
65-
6655
- name: Enter prerelease mode (alpha by default)
6756
# If .changeset/pre.json does not exist and we did not recently exit
6857
# prerelease mode, enter prerelease mode with tag alpha
@@ -82,85 +71,6 @@ jobs:
8271
uses: changesets/action@v1
8372
with:
8473
version: npm run changeset-version
74+
publish: echo "This step should never publish"
8575
env:
8676
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
88-
- name: Publish to npm + GitHub
89-
id: changesets
90-
# Only run publish if we're still in pre mode and the last commit was
91-
# via an automatically created Version Packages PR
92-
if: steps.check_files.outputs.files_exists == 'true' && startsWith(github.event.head_commit.message, 'Version Packages')
93-
uses: changesets/action@v1
94-
with:
95-
version: echo "This step should never version"
96-
publish: npm run changeset-publish
97-
env:
98-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
100-
101-
postrelease:
102-
name: Postrelease
103-
runs-on: ubuntu-latest
104-
needs: prerelease
105-
if: needs.prerelease.result == 'success' && fromJSON(needs.prerelease.outputs.packages)[0] != null
106-
strategy:
107-
matrix:
108-
package: ${{ fromJSON(needs.prerelease.outputs.packages) }}
109-
steps:
110-
- uses: actions/create-github-app-token@v1
111-
id: github-actions-bot-app-token
112-
with:
113-
app-id: 819772
114-
private-key: ${{ secrets.APOLLO_GITHUB_ACTIONS_BOT_PRIVATE_KEY }}
115-
116-
- name: Checkout repo
117-
uses: actions/checkout@v5
118-
with:
119-
token: ${{ steps.github-actions-bot-app-token.outputs.token }}
120-
121-
- name: Append NPM token to .npmrc
122-
run: |
123-
cat << EOF > "$HOME/.npmrc"
124-
provenance=true
125-
//registry.npmjs.org/:_authToken=$NPM_TOKEN
126-
EOF
127-
env:
128-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
129-
130-
- name: Setup Node.js
131-
uses: actions/setup-node@v6
132-
with:
133-
node-version: ">=23.6.0"
134-
135-
- name: Install dependencies with cache
136-
uses: bahmutov/npm-install@v1
137-
138-
- name: Tag release with next on npm
139-
run: |
140-
if NEXT=$(npm show ${{ matrix.package.name }}@next version) node -e 'process.exit(require("semver").gt("${{ matrix.package.version }}",process.env.NEXT)?0:1)'; then
141-
npm dist-tag add ${{ matrix.package.name }}@${{ matrix.package.version }} next;
142-
fi
143-
144-
- name: Send a Slack notification on publish
145-
id: slack
146-
uses: slackapi/[email protected]
147-
with:
148-
# Slack channel id, channel name, or user id to post message
149-
# See also: https://api.slack.com/methods/chat.postMessage#channels
150-
# You can pass in multiple channels to post to by providing
151-
# a comma-delimited list of channel IDs
152-
channel-id: "C01PS0CB41G"
153-
payload: |
154-
{
155-
"blocks": [
156-
{
157-
"type": "section",
158-
"text": {
159-
"type": "mrkdwn",
160-
"text": "A new version of `${{ matrix.package.name }}` was released: <https://github.com/apollographql/apollo-client/releases/tag/${{ matrix.package.name }}@${{ matrix.package.version }}|v${{ matrix.package.version }}> :rocket:"
161-
}
162-
}
163-
]
164-
}
165-
env:
166-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/release.yml

Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- "release-*"
78

89
concurrency: ${{ github.workflow }}-${{ github.ref }}
910

@@ -21,8 +22,8 @@ jobs:
2122
pull-requests: write
2223
id-token: write
2324
outputs:
24-
published: ${{ steps.changesets.outputs.published }}
25-
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
25+
published: ${{ steps.changesets.outputs.published || steps.changesets-prerelease.outputs.published }}
26+
publishedPackages: ${{ steps.changesets.outputs.publishedPackages || steps.changesets-prerelease.outputs.publishedPackages }}
2627
steps:
2728
- name: Checkout repo
2829
uses: actions/checkout@v5
@@ -37,36 +38,41 @@ jobs:
3738
with:
3839
files: ".changeset/pre.json"
3940

40-
- name: Append NPM token to .npmrc
41-
run: |
42-
cat << EOF > "$HOME/.npmrc"
43-
provenance=true
44-
//registry.npmjs.org/:_authToken=$NPM_TOKEN
45-
EOF
46-
env:
47-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
48-
4941
- name: Setup Node.js
5042
uses: actions/setup-node@v6
5143
with:
52-
node-version: ">=23.6.0"
44+
node-version: "24.x"
45+
registry-url: "https://registry.npmjs.org"
5346

5447
- name: Install dependencies (with cache)
5548
uses: bahmutov/npm-install@v1
5649

57-
- name: Create release PR or publish to npm + GitHub
50+
- name: "[main] Create release PR or publish to npm + GitHub"
5851
id: changesets
59-
if: steps.check_files.outputs.files_exists == 'false'
52+
if: github.ref_name == 'main' && steps.check_files.outputs.files_exists == 'false'
6053
uses: changesets/action@v1
6154
with:
6255
version: npm run changeset-version
6356
publish: npm run changeset-publish
6457
env:
6558
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
59+
NPM_TOKEN: ""
60+
61+
- name: "[prerelease] Publish to npm + GitHub"
62+
id: changesets-prerelease
63+
# Only run publish if we're still in pre mode and the last commit was
64+
# via an automatically created Version Packages PR
65+
if: github.ref_name != 'main' && steps.check_files.outputs.files_exists == 'true' && startsWith(github.event.head_commit.message, 'Version Packages')
66+
uses: changesets/action@v1
67+
with:
68+
version: echo "This step should never version"
69+
publish: npm run changeset-publish
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
NPM_TOKEN: ""
6773

68-
postrelease:
69-
name: Postrelease
74+
slack-notification:
75+
name: Postrelease Slack Notification
7076
runs-on: ubuntu-latest
7177
needs: release
7278
if: needs.release.result == 'success' && needs.release.outputs.published == 'true'
@@ -102,7 +108,7 @@ jobs:
102108
},
103109
{
104110
"type": "mrkdwn",
105-
"text": "*Tag:*\n`latest`"
111+
"text": "*Tag:*\n`${{ github.ref_name == 'main' && 'latest' || 'next' }}`"
106112
},
107113
{
108114
"type": "mrkdwn",
@@ -118,3 +124,32 @@ jobs:
118124
}
119125
env:
120126
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
127+
128+
tag-next:
129+
name: Postrelease Tag Next Release
130+
runs-on: ubuntu-latest
131+
needs: release
132+
if: github.ref_name != 'main' && needs.release.result == 'success' && needs.release.outputs.published == 'true'
133+
permissions:
134+
id-token: write
135+
strategy:
136+
matrix:
137+
package: ${{ fromJSON(needs.release.outputs.publishedPackages) }}
138+
steps:
139+
- name: Checkout repo
140+
uses: actions/checkout@v5
141+
142+
- name: Setup Node.js
143+
uses: actions/setup-node@v6
144+
with:
145+
node-version: "24.x"
146+
registry-url: "https://registry.npmjs.org"
147+
148+
- name: Install dependencies with cache
149+
uses: bahmutov/npm-install@v1
150+
151+
- name: Tag release with next on npm
152+
run: |
153+
if NEXT=$(npm show ${{ matrix.package.name }}@next version) node -e 'process.exit(require("semver").gt("${{ matrix.package.version }}",process.env.NEXT)?0:1)'; then
154+
npm dist-tag add ${{ matrix.package.name }}@${{ matrix.package.version }} next;
155+
fi

.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)": 43931,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38761,
4-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33451,
5-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27513
2+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 44088,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38925,
4+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33546,
5+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27621
66
}

0 commit comments

Comments
 (0)