apollo-client-nextjs
apollo-client-nextjs copied to clipboard
RSC preloading mechanism
Resolves #212 and also prepares for #248 a bit.
Previews:
https://apollo-git-32cae2-apollo-client-next-package-integration-tests.vercel.app//rsc/dynamic/PreloadQuery/useSuspenseQuery https://apollo-git-32cae2-apollo-client-next-package-integration-tests.vercel.app//rsc/dynamic/PreloadQuery/queryRef-useReadQuery https://apollo-git-32cae2-apollo-client-next-package-integration-tests.vercel.app//rsc/dynamic/PreloadQuery/queryRef-refTest
On each you can call __APOLLO_CLIENT__[Symbol.for("apollo.suspenseCache")].queryRefs
to investigate the queryRefs (if there are any)
size-limit report 📦
Path | Size |
---|---|
{ ApolloNextAppProvider, NextSSRApolloClient, NextSSRInMemoryCache } from '@apollo/experimental-nextjs-app-support/ssr' (Browser ESM) | 7.88 KB (+1.2% 🔺) |
{ WrapApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client-react-streaming' (Browser ESM) | 1.5 KB (+7.48% 🔺) |
{ buildManualDataTransport } from '@apollo/client-react-streaming/manual-transport' (Browser ESM) | 6.36 KB (+1.5% 🔺) |
@apollo/client-react-streaming (Browser ESM) | 2.23 KB (+4.91% 🔺) |
@apollo/client-react-streaming (SSR ESM) | 2.58 KB (+47.44% 🔺) |
@apollo/client-react-streaming (RSC ESM) | 1.65 KB (+20.62% 🔺) |
@apollo/client-react-streaming/manual-transport (Browser ESM) | 6.55 KB (+1.5% 🔺) |
@apollo/client-react-streaming/manual-transport (SSR ESM) | 7.14 KB (+12.55% 🔺) |
@apollo/experimental-nextjs-app-support/ssr (Browser ESM) | 8.49 KB (+1% 🔺) |
@apollo/experimental-nextjs-app-support/ssr (SSR ESM) | 9.12 KB (+9.49% 🔺) |
@apollo/experimental-nextjs-app-support/ssr (RSC ESM) | 867 B (0%) |
@apollo/experimental-nextjs-app-support/rsc (RSC ESM) | 626 B (0%) |
#194 Bundle Size — 1.03MiB (+2.47%).
74c2fd2(current) vs afa5bcc main#189(baseline)
[!WARNING] Bundle contains 1 duplicate package – View duplicate packages
Bundle metrics Â
9 changes
3 regressions
1 improvement
           |       Current #194 |
     Baseline #189 |
---|---|---|
898.87KiB (+0.82% ) |
891.55KiB |
|
70B (+100% ) |
0B |
|
88.27% |
0.04% |
|
29 (+20.83% ) |
24 |
|
53 (+17.78% ) |
45 |
|
528 (+3.13% ) |
512 |
|
47 (+56.67% ) |
30 |
|
2.57% (+99.22% ) |
1.29% |
|
26 (-10.34% ) |
29 |
|
1 |
1 |
Bundle size by type Â
3 changes
3 regressions
           |       Current #194 |
     Baseline #189 |
---|---|---|
1.02MiB (+2.28% ) |
1MiB |
|
8.06KiB (+34.41% ) |
5.99KiB |
|
70B (+100% ) |
0B |
Bundle analysis report Branch pr/rsc-preload Project dashboard
Quick thought: we need some warning if people add cookies
or headers
to context
here as that could result in secrets to be dumped into the stream on accident.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
apollo-client-nextjs-experimental-nextjs-app-support | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 18, 2024 9:24am |
So here we have some previews:
https://apollo-git-32cae2-apollo-client-next-package-integration-tests.vercel.app//rsc/dynamic/PreloadQuery/useSuspenseQuery https://apollo-git-32cae2-apollo-client-next-package-integration-tests.vercel.app//rsc/dynamic/PreloadQuery/queryRef-useReadQuery https://apollo-git-32cae2-apollo-client-next-package-integration-tests.vercel.app//rsc/dynamic/PreloadQuery/queryRef-refTest
On each you can call __APOLLO_CLIENT__[Symbol.for("apollo.suspenseCache")].queryRefs
to investigate the queryRefs (if there are any)
Okay, tests in Vercel run fine now, and the error in latest
is expected, since that AC release is still missing functionality we require.
I'll do another pass on everything here and then we should be ready for review 🎉