Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

keep deferred inFlightLinkObservables until the response is finished#12338

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

phryneas
Copy link
Member

An experiment. This might be required for query streaming with@defer anduseSuspenseQuery.

@changeset-botchangeset-bot
Copy link

changeset-botbot commentedFeb 4, 2025
edited
Loading

🦋 Changeset detected

Latest commit:b201bc0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@apollo/clientPatch

Not sure what this means?Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svc-apollo-docs
Copy link

svc-apollo-docs commentedFeb 4, 2025
edited
Loading

⚠️ Docs preview not attached to branch

The preview was not built because the PR's base branchrelease-3.13 is not in the list of sources.

An Apollo team member can comment one of the following commands to dictate which branch to attach the preview to:

  • !docs set-base-branch version-2.6
  • !docs set-base-branch main

Build ID: cc19e4a82fbc673e4b124e13

@pkg-pr-newpkg.pr.new
Copy link

pkg-pr-newbot commentedFeb 4, 2025
edited
Loading

npm i https://pkg.pr.new/@apollo/client@12338

commit:b201bc0

@netlifyNetlify
Copy link

netlifybot commentedFeb 4, 2025
edited
Loading

Deploy Preview forapollo-client-docs ready!

NameLink
🔨 Latest commitb201bc0
🔍 Latest deploy loghttps://app.netlify.com/sites/apollo-client-docs/deploys/67a4a3f11cee2c0008cefa23
😎 Deploy Previewhttps://deploy-preview-12338--apollo-client-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site configuration.

@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedFeb 4, 2025
edited
Loading

size-limit report 📦

PathSize
dist/apollo-client.min.cjs41.24 KB (+0.07% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs"50.68 KB (+0.06% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production)47.75 KB (+0.06% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js"36.24 KB (+0.09% 🔺)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production)33.63 KB (+0.08% 🔺)
import { ApolloProvider } from "dist/react/index.js"1.26 KB (0%)
import { ApolloProvider } from "dist/react/index.js" (production)1.24 KB (0%)
import { useQuery } from "dist/react/index.js"5.21 KB (0%)
import { useQuery } from "dist/react/index.js" (production)4.29 KB (0%)
import { useLazyQuery } from "dist/react/index.js"5.7 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production)4.78 KB (0%)
import { useMutation } from "dist/react/index.js"3.62 KB (0%)
import { useMutation } from "dist/react/index.js" (production)2.84 KB (0%)
import { useSubscription } from "dist/react/index.js"4.42 KB (0%)
import { useSubscription } from "dist/react/index.js" (production)3.48 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js"5.88 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production)4.54 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js"5.37 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production)4.03 KB (0%)
import { useLoadableQuery } from "dist/react/index.js"5.45 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production)4.11 KB (0%)
import { useReadQuery } from "dist/react/index.js"3.42 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production)3.36 KB (0%)
import { useFragment } from "dist/react/index.js"2.36 KB (0%)
import { useFragment } from "dist/react/index.js" (production)2.31 KB (0%)

@phryneasphryneas changed the base branch frommain torelease-3.13February 6, 2025 09:58
@phryneas
Copy link
MemberAuthor

I have verified over inapollographql/apollo-client-integrations#424 that this is exactly what this needs.

Gonna polish this PR, add a few tests and then we should get this into 3.13.

@phryneasphryneasforce-pushed thepr/keep-deferred-inFlightLinkObservables branch fromb0183ec tob201bc0CompareFebruary 6, 2025 11:58
@phryneas
Copy link
MemberAuthor

Added a test, this should be ready for review.

@phryneasphryneas marked this pull request as ready for reviewFebruary 6, 2025 12:05
Comment on lines +1185 to +1190
concast.beforeNext(function cb(method, arg: FetchResult) {
if (method === "next" && "hasNext" in arg && arg.hasNext) {
concast.beforeNext(cb);
} else {
inFlightLinkObservables.remove(printedServerQuery, varJson);
}
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note that this change right now applies to@defer etc., but not to subscriptions.
Changing that for subscriptions would be nice, but feels a bit more breaking, so I think we should probably do that in 4.0 - WDYT@jerelmiller ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That makes sense to me. I see no reason why two subscriptions kicked off with the same document/variables shouldn't be deduped, especially since it can be disabled per-subscription if need be. Mind making a tracking issue and putting it in the milestone so that we don't forget to update?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

#12348 👍

Copy link
Member

@jerelmillerjerelmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fantastic test addition that demonstrates all the things I was hoping to see. Thanks for getting this done!

@jerelmillerjerelmiller merged commit67c16c9 intorelease-3.13Feb 6, 2025
54 checks passed
@jerelmillerjerelmiller deleted the pr/keep-deferred-inFlightLinkObservables branchFebruary 6, 2025 16:45
@github-actionsgithub-actionsbot mentioned this pull requestFeb 6, 2025
@phryneas
Copy link
MemberAuthor

Fantastic test addition that demonstrates all the things I was hoping to see. Thanks for getting this done!

We're getting to a point where we have all the tools in place that writing these tests is actually fun :)

jerelmiller reacted with hooray emoji

@github-actionsgithub-actionsbot mentioned this pull requestFeb 13, 2025
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 9, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@jerelmillerjerelmillerjerelmiller approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@phryneas@svc-apollo-docs@jerelmiller

[8]ページ先頭

©2009-2025 Movatter.jp