Skip to content

Commit e93fbf6

Browse files
authored
Add section on TSerialized generic removal (#12949)
1 parent 37555ce commit e93fbf6

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.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)": 38692,
4-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33440,
5-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27529
2+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 43936,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38686,
4+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33476,
5+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27519
66
}

docs/source/migrating/apollo-client-4-migration.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,17 @@ new ApolloClient({ // [!code ++]
15671567
});
15681568
```
15691569
1570+
### Removal of `<TSerialized>` generic argument
1571+
1572+
The `TSerialized` generic argument has been removed from the `ApolloCache` abstract class. Most users set this type to `any` which provided little benefit for type safety. APIs that previously relied on `TSerialized` are now set to `unknown`.
1573+
1574+
To migrate, remove the `TSerialized` generic argument when referencing `ApolloCache`.
1575+
1576+
```ts
1577+
const cache: ApolloCache<any> = ... // [!code --]
1578+
const cache: ApolloCache = ... // [!code ++]
1579+
```
1580+
15701581
## Apollo Link changes
15711582

15721583
### New class-based links

0 commit comments

Comments
 (0)