Skip to content
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

Warn if ssrMode or ssrForceFetchDelay are used. #358

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Sep 4, 2024

I've seen this a few times too often now.

@phryneas phryneas requested a review from a team as a code owner September 4, 2024 12:01
Copy link

netlify bot commented Sep 4, 2024

Deploy Preview for apollo-client-nextjs-docmodel ready!

Name Link
🔨 Latest commit 197ba3e
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-nextjs-docmodel/deploys/6716073220d61c000845567e
😎 Deploy Preview https://deploy-preview-358--apollo-client-nextjs-docmodel.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 your Netlify site configuration.

Comment on lines +98 to +100
for (const warning of warnings) {
console.warn(warning, info.pkg, "ApolloClient");
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is down here because we need access to info, which relies on this, which is only available after the super call - but we want to remove these options before that call.

Copy link
Contributor

github-actions bot commented Sep 4, 2024

size-limit report 📦

Path Size
{ ApolloNextAppProvider, ApolloClient, InMemoryCache } from '@apollo/experimental-nextjs-app-support' (Browser ESM) 4.93 KB (+2.19% 🔺)
{ WrapApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client-react-streaming' (Browser ESM) 1.8 KB (+6.46% 🔺)
{ buildManualDataTransport } from '@apollo/client-react-streaming/manual-transport' (Browser ESM) 3 KB (+3.55% 🔺)
@apollo/client-react-streaming (Browser ESM) 2.51 KB (+4.43% 🔺)
@apollo/client-react-streaming (SSR ESM) 7.34 KB (+1.35% 🔺)
@apollo/client-react-streaming (RSC ESM) 7.18 KB (+1.52% 🔺)
@apollo/client-react-streaming/manual-transport (Browser ESM) 3.21 KB (+3.4% 🔺)
@apollo/client-react-streaming/manual-transport (SSR ESM) 8.3 KB (+1.18% 🔺)
@apollo/experimental-nextjs-app-support (Browser ESM) 5.52 KB (+1.99% 🔺)
@apollo/experimental-nextjs-app-support (SSR ESM) 10.68 KB (+0.97% 🔺)
@apollo/experimental-nextjs-app-support (RSC ESM) 7.23 KB (+1.42% 🔺)
@apollo/experimental-nextjs-app-support/rsc (RSC ESM) 6.38 KB (0%)

Copy link

relativeci bot commented Sep 4, 2024

#264 Bundle Size — 1.1MiB (+0.03%).

197ba3e(current) vs e6bfd3a main#263(baseline)

Warning

Bundle contains 1 duplicate package – View duplicate packages

Bundle metrics  Change 1 change Regression 1 regression
                 Current
#264
     Baseline
#263
Regression  Initial JS 924.27KiB(+0.04%) 923.9KiB
No change  Initial CSS 70B 70B
No change  Cache Invalidation 22.66% 22.66%
No change  Chunks 33 33
No change  Assets 57 57
No change  Modules 588 588
No change  Duplicate Modules 99 99
No change  Duplicate Code 6.23% 6.23%
No change  Packages 26 26
No change  Duplicate Packages 1 1
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#264
     Baseline
#263
Regression  JS 1.09MiB (+0.03%) 1.09MiB
No change  Other 8.78KiB 8.78KiB
No change  CSS 70B 70B

Bundle analysis reportBranch pr/warn-on-useless-optionsProject dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

Good call on this one!

Copy link

pkg-pr-new bot commented Oct 21, 2024

yarn@berry undefined https://pkg.pr.new/apollographql/apollo-client-nextjs/@apollo/client-react-streaming@358
yarn@berry undefined https://pkg.pr.new/apollographql/apollo-client-nextjs/@apollo/experimental-nextjs-app-support@358

commit: 197ba3e

@phryneas phryneas merged commit 4834f55 into main Oct 21, 2024
23 of 24 checks passed
@phryneas phryneas deleted the pr/warn-on-useless-options branch October 21, 2024 07:53
@t-tiger
Copy link

t-tiger commented Dec 25, 2024

@phryneas
May I ask a question about this implementation?

Actually, this change is causing an issue with the application we are using. Specifically, with PreloadQuery, a query is first executed on the RSC, and then the same query is executed again on the client side. This is causing duplicate requests in all places where we are using useSuspenseQuery.

Until the PR is shipped, I had been able to prevent the client-side query execution after the RSC query by setting ssrMode and ssrForceFetchDelay. However, since these options have been removed, duplicate requests are now occurring.

I think there may be others facing the same issue. Do you know of any way to prevent duplicate requests between RSC and the client side? Or is there any point I might be overlooking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants