-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Version Packages (alpha) #12221
Open
github-actions
wants to merge
1
commit into
release-4.0
Choose a base branch
from
changeset-release/release-4.0
base: release-4.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Version Packages (alpha) #12221
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
a43e71a
to
0fa9848
Compare
commit: |
size-limit report 📦
|
163864b
to
913da8a
Compare
1f0c587
to
07fa847
Compare
e6906d2
to
5302881
Compare
3e1b8a9
to
f0bd4c5
Compare
b921ab5
to
f8cadb2
Compare
f8cadb2
to
7cff903
Compare
4ff69dd
to
e28c272
Compare
e28c272
to
47616c0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to release-4.0, this PR will be updated.
release-4.0
is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exit
onrelease-4.0
.Releases
@apollo/client@4.0.0-alpha.0
Major Changes
#12379
ef892b4
Thanks @jerelmiller! - Removes theaddTypename
option fromInMemoryCache
andMockedProvider
.__typename
is now always added to the outgoing query document when usingInMemoryCache
and cannot be disabled.If you are using
<MockedProvider />
withaddTypename={false}
, ensure that your mocked responses include a__typename
field. This will ensure cache normalization kicks in and behaves more like production.#12222
d1a9054
Thanks @jerelmiller! - Drop support for React 16.#12376
a0c996a
Thanks @jerelmiller! - Remove deprecatedignoreResults
option fromuseMutation
. If you don't want to synchronize component state with the mutation, useuseApolloClient
to access your client instance and useclient.mutate
directly.#12224
51e6c0f
Thanks @jerelmiller! - Remove deprecatedpartialRefetch
option.#12211
c2736db
Thanks @jerelmiller! - Remove the deprecatedgraphql
,withQuery
,withMutation
,withSubscription
, andwithApollo
hoc components. Use the provided React hooks instead.#12262
10ef733
Thanks @jerelmiller! - RemoveitAsync
test utility.#12304
86469a2
Thanks @jerelmiller! - TheCache.DiffResult<T>
type is now a union type with better type safety for both complete and partial results. Checkingdiff.complete
will now narrow the type ofresult
depending on whether the value istrue
orfalse
.When
true
,diff.result
will be a non-null value equal to theT
generic type. Whenfalse
,diff.result
now reportsresult
asDeepPartial<T> | null
indicating that fields in the result may be missing (DeepPartial<T>
) or empty entirely (null
).#12254
0028ac0
Thanks @jerelmiller! - Changes the defaultAccept
header toapplication/graphql-response+json
.#12333
3e4beaa
Thanks @jerelmiller! - Fix type ofdata
property onApolloQueryResult
. Previously this field was non-optional, non-nullTData
, however at runtime this value could be set toundefined
. This field is now reported asTData | undefined
.This will affect you in a handful of places:
data
property emitted from the result passed to thenext
callback fromclient.watchQuery
ApolloQueryResult
type such asobservableQuery.refetch
,observableQuery.fetchMore
, etc.#12223
69c1cb6
Thanks @jerelmiller! - RemovesubscribeAndCount
testing utility from@apollo/client/testing
.#12300
4d581e4
Thanks @jerelmiller! - Moves all React-related exports to the@apollo/client/react
entrypoint and out of the main@apollo/client
entrypoint. This prevents the need to install React in order to use the core client.The following is a list of exports available in
@apollo/client
that should now import from@apollo/client/react
.ApolloConsumer
ApolloProvider
createQueryPreloader
getApolloContext
skipToken
useApolloClient
useBackgroundQuery
useFragment
useLazyQuery
useLoadableQuery
useMutation
useQuery
useQueryRefHandlers
useReactiveVar
useReadQuery
useSubscription
useSuspenseQuery
The following is a list of exports available in
@apollo/client/testing
that should now import from@apollo/client/testing/react
:MockedProvider
#12329
61febe4
Thanks @phryneas! - Rework package publish format (Rework build process 1/? #12329, Rework build process 2/?: add babel transform #12382)We have reworked the way Apollo Client is packaged.
"since 2023, node >= 20, not dead"
)#12304
86469a2
Thanks @jerelmiller! - ### Changes for users ofInMemoryCache
cache.diff
now returnsnull
instead of an empty object ({}
) whenreturnPartialData
istrue
and the result is empty.If you use
cache.diff
directly withreturnPartialData: true
, you will need to check fornull
before accessing any other fields on theresult
property. A non-null value indicates that at least one field was present in the cache for the given query document.Changes for third-party cache implementations
The client now expects
cache.diff
to returnnull
instead of an empty object when there is no data that can be fulfilled from the cache andreturnPartialData
istrue
. If your cache implementation returns an empty object, please update this to returnnull
.#12359
ebb4d96
Thanks @jerelmiller! - Remove theonCompleted
andonError
callbacks fromuseQuery
anduseLazyQuery
.See #12352 for more context on this change.
#12304
86469a2
Thanks @jerelmiller! - ### Changes for users ofInMemoryCache
cache.diff
no longer throws whenreturnPartialData
is set tofalse
without a complete result. Instead,cache.diff
will returnnull
when it is unable to read a full cache result.If you use
cache.diff
directly withreturnPartialData: false
, remove thetry
/catch
block and replace with a check fornull
.Changes for third-party cache implementations
The client now expects
cache.diff
to returnnull
instead of throwing when the cache returns an incomplete result andreturnPartialData
isfalse
. The internaltry
/catch
blocks have been removed aroundcache.diff
. If your cache implementation throws for incomplete results, please update this to returnnull
.#12211
c2736db
Thanks @jerelmiller! - Remove the deprecatedQuery
,Mutation
, andSubscription
components. Use the provided React hooks instead.Minor Changes
3e4beaa
Thanks @jerelmiller! - Deprecate thepartial
flag onApolloQueryResult
and make it a non-optional property. Previouslypartial
was only set conditionally if the result emitted was partial. This value is now available with all results that return anApolloQueryResult
.Patch Changes
#12291
ae5d06a
Thanks @phryneas! - Remove deprecatedresetApolloContext
export#12369
bdfc5b2
Thanks @phryneas! -ObervableQuery.refetch
: don't refetch withcache-and-network
, swich tonetwork-only
instead#12375
d3f8f13
Thanks @jerelmiller! - Export theUseSuspenseFragmentOptions
type.