Major Changes
-
#12727
b845906
Thanks @jerelmiller! - Add a codemod that renames old import locations from 3.x entrypoint to their 4.x entrypoint.Run the codemod using the following command:
npx @apollo/client-codemod-migrate-3-to-4 --parser tsx ./src/**/*.{ts,tsx}
The codemod supports
.js
,.jsx
,.ts
, and.tsx
files. -
#12851
32bc830
Thanks @phryneas! - Add a newclientSetup
codemod step which applies the following steps from the migration guide to your Apollo Client setup code:- Moves
uri
,headers
andcredentials
to thelink
option and creates a newHttpLink
instance - Moves
name
andversion
into aclientAwareness
option - Adds a
localState
option with a newLocalState
instance, movesresolvers
, and removestypeDefs
andfragmentMatcher
options - Changes the
connectToDevTools
option todevtools.enabled
- Renames
disableNetworkFetches
toprioritizeCacheValues
- If
dataMasking
is enabled, adds a template for global type augmentation to re-enable data masking types - Adds the
incrementalHandler
option and adds a template for global type augmentation to accordingly type network responses in custom links
- Moves
Minor Changes
- #12818
d1e9503
Thanks @phryneas! - Extendimports
codemod, add newlinks
andremovals
(via #12838) codemods.
Patch Changes
-
#12846
71ccfb5
Thanks @phryneas! - Add a newlegacyEntryPoints
transformation step that moves imports from old legacy entry points like@apollo/client/main.cjs
or@apollo/client/react/react.cjs
to the new entry points like@apollo/client
or@apollo/client/react
. -
#12775
454ec78
Thanks @jerelmiller! - Don't exportgql
from@apollo/client/react
entrypoint. Import from@apollo/client
instead. -
#12858
6440e8b
Thanks @phryneas! - adjust theclientSetup
codemod so that it removes theTCacheShape
type argument from allApolloClient
usages (types and constructor calls).