Skip to content

Commit 0e686a1

Browse files
Version Packages (rc) (#12741)
1 parent e1ca85e commit 0e686a1

File tree

7 files changed

+95
-9
lines changed

7 files changed

+95
-9
lines changed

.changeset/pre.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"beige-kings-grow",
1616
"beige-mirrors-talk",
1717
"beige-spiders-hope",
18+
"big-paws-invent",
1819
"brave-moons-juggle",
1920
"brave-radios-wait",
2021
"bright-ads-share",
@@ -53,6 +54,7 @@
5354
"four-ghosts-watch",
5455
"four-tables-cheat",
5556
"fresh-moose-hope",
57+
"fresh-swans-remain",
5658
"friendly-olives-refuse",
5759
"friendly-walls-think",
5860
"funny-boats-wink",
@@ -85,6 +87,7 @@
8587
"itchy-drinks-refuse",
8688
"itchy-roses-accept",
8789
"khaki-bears-destroy",
90+
"khaki-coats-prove",
8891
"khaki-keys-deliver",
8992
"khaki-spies-work",
9093
"kind-crews-warn",
@@ -123,6 +126,7 @@
123126
"odd-chicken-hide",
124127
"odd-lemons-relax",
125128
"old-avocados-cover",
129+
"old-mangos-grin",
126130
"old-melons-double",
127131
"olive-cougars-ring",
128132
"orange-suits-laugh",
@@ -134,6 +138,7 @@
134138
"poor-eels-punch",
135139
"poor-spiders-hunt",
136140
"popular-games-sleep",
141+
"proud-walls-shave",
137142
"purple-balloons-accept",
138143
"purple-bears-flash",
139144
"purple-lions-cough",
@@ -147,6 +152,7 @@
147152
"rich-eagles-cross",
148153
"rich-kids-carry",
149154
"rich-turtles-clap",
155+
"rude-crabs-eat",
150156
"rude-fans-study",
151157
"rude-parrots-suffer",
152158
"selfish-spoons-approve",

.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)": 43723,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38671,
4-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33349,
5-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27607
2+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 43672,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38739,
4+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33372,
5+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27611
66
}

CHANGELOG.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
11
# @apollo/client
22

3+
## 4.0.0-rc.2
4+
5+
### Major Changes
6+
7+
- [#12742](https://github.com/apollographql/apollo-client/pull/12742) [`575bf3e`](https://github.com/apollographql/apollo-client/commit/575bf3ed5885efb09c1eec497af4d2690c6b87d4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The new `SetContextLink` flips the `prevContext` and `operation` arguments in the callback. The `setContext` function has remained unchanged.
8+
9+
```diff
10+
- new SetContextLink((operation, prevContext) => {
11+
+ new SetContextLink((prevContext, operation) => {
12+
// ...
13+
})
14+
```
15+
16+
- [#12742](https://github.com/apollographql/apollo-client/pull/12742) [`575bf3e`](https://github.com/apollographql/apollo-client/commit/575bf3ed5885efb09c1eec497af4d2690c6b87d4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The `operation` argument to the callback passed to `SetContextLink` is now of type `SetContextLink.SetContextOperation` which is an `Operation` without the `getContext` or `setContext` functions. Previously the type of `operation` was `GraphQLRequest` which had access to a `context` property. The `context` property was always `undefined` and could result in bugs when using it instead of the `prevContext` argument.
17+
18+
This change means the `operation` argument now contains an accessible `client` property.
19+
20+
### Minor Changes
21+
22+
- [#12740](https://github.com/apollographql/apollo-client/pull/12740) [`1c6e03c`](https://github.com/apollographql/apollo-client/commit/1c6e03c9c74a9fad2a1c2e1c3ae61a9560038238) Thanks [@phryneas](https://github.com/phryneas)! - Overridable types for `dataState: "complete"`, `dataState: "streaming"` and
23+
`dataState: "partial"` responses.
24+
25+
This adds the `DataValue` namespace exported from Apollo Client with the three
26+
types `DataValue.Complete`, `DataValue.Streaming` and `DataValue.Partial`.
27+
28+
These types will be used to mark `TData` in the respective states.
29+
30+
- `Complete` defaults to `TData`
31+
- `Streaming` defaults to `TData`
32+
- `Partial` defaults to `DeepPartial<TData>`
33+
34+
All three can be overwritten, e.g. to be `DeepReadonly` using higher kinded types
35+
by following this pattern:
36+
37+
```ts
38+
import { HKT, DeepPartial } from "@apollo/client/utilities";
39+
import { DeepReadonly } from "some-type-helper-library";
40+
41+
interface CompleteOverride extends HKT {
42+
return: DeepReadonly<this["arg1"]>;
43+
}
44+
45+
interface StreamingOverride extends HKT {
46+
return: DeepReadonly<this["arg1"]>;
47+
}
48+
49+
interface PartialOverride extends HKT {
50+
return: DeepReadonly<DeepPartial<this["arg1"]>>;
51+
}
52+
53+
declare module "@apollo/client" {
54+
export interface TypeOverrides {
55+
Complete: CompleteOverride;
56+
Streaming: StreamingOverride;
57+
Partial: PartialOverride;
58+
}
59+
}
60+
```
61+
62+
### Patch Changes
63+
64+
- [#12748](https://github.com/apollographql/apollo-client/pull/12748) [`e1ca85e`](https://github.com/apollographql/apollo-client/commit/e1ca85eab181d8e16d945e849dfb13352902f197) Thanks [@phryneas](https://github.com/phryneas)! - Fix a bug where the new `operationType` property wasn't passed into `operation`.
65+
66+
- [#12739](https://github.com/apollographql/apollo-client/pull/12739) [`b184754`](https://github.com/apollographql/apollo-client/commit/b184754d08810df9a7838615990e90a960966037) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix type of `error` argument on the `onError` option for `subscribeToMore` to `ErrorLike`.
67+
368
## 4.0.0-rc.1
469

570
### Major Changes

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apollo/client",
3-
"version": "4.0.0-rc.1",
3+
"version": "4.0.0-rc.2",
44
"description": "A fully-featured caching GraphQL client.",
55
"private": true,
66
"keywords": [
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# @apollo/client-codemod-migrate-3-to-4
2+
3+
## 1.0.0-rc.0
4+
5+
### Major Changes
6+
7+
- [#12727](https://github.com/apollographql/apollo-client/pull/12727) [`b845906`](https://github.com/apollographql/apollo-client/commit/b8459062caae96447b4867be75a853aa1943ec31) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add a codemod that renames old import locations from 3.x entrypoint to their 4.x entrypoint.
8+
9+
Run the codemod using the following command:
10+
11+
```sh
12+
npx @apollo/client-codemod-migrate-3-to-4 --parser tsx ./src/**/*.{ts,tsx}
13+
```
14+
15+
The codemod supports `.js`, `.jsx`, `.ts`, and `.tsx` files.

scripts/codemods/ac3-to-ac4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apollo/client-codemod-migrate-3-to-4",
3-
"version": "0.0.0",
3+
"version": "1.0.0-rc.0",
44
"description": "Apollo Client Codemod to migrate from version 3 to version 4",
55
"keywords": [
66
"apollo",

0 commit comments

Comments
 (0)