-
Notifications
You must be signed in to change notification settings - Fork 36
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
add shared @apollo/experimental-nextjs-app-support
entry point
#300
Conversation
#198 Bundle Size — 1.07MiB (+6.53%).Warning Bundle contains 1 duplicate package – View duplicate packages Bundle metrics
|
Current #198 |
Baseline #189 |
|
---|---|---|
Initial JS | 938.93KiB (+5.31% ) |
891.55KiB |
Initial CSS | 70B (+100% ) |
0B |
Cache Invalidation | 85.99% |
0.04% |
Chunks | 32 (+33.33% ) |
24 |
Assets | 56 (+24.44% ) |
45 |
Modules | 591 (+15.43% ) |
512 |
Duplicate Modules | 110 (+266.67% ) |
30 |
Duplicate Code | 7.61% (+489.92% ) |
1.29% |
Packages | 26 (-10.34% ) |
29 |
Duplicate Packages | 1 |
1 |
Bundle size by type 3 changes
3 regressions
Current #198 |
Baseline #189 |
|
---|---|---|
JS | 1.06MiB (+6.3% ) |
1MiB |
Other | 8.67KiB (+44.68% ) |
5.99KiB |
CSS | 70B (+100% ) |
0B |
Bundle analysis report Branch pr-unify-entrypoints Project dashboard
@apollo/experimental-nextjs-app-support
entry point
typeof window === "undefined" | ||
? ApolloLink.from([ | ||
// in a SSR environment, if you use multipart features like | ||
// @defer, you need to decide how to handle these. | ||
// This strips all interfaces with a `@defer` directive from your queries. | ||
new SSRMultipartLink({ | ||
stripDefer: true, | ||
}), | ||
httpLink, | ||
]) | ||
: httpLink, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is something that's copied blindly without any real need, so I'll omit the complexity here for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! I absolutely love the simplification here.
export { | ||
InMemoryCache as NextSSRInMemoryCache, | ||
ApolloClient as NextSSRApolloClient, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a way to mark these as deprecated? Or is there another way we can hint that these exports will be removed in a future version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about that, too.... I think I'll merge this as-is and add another PR for that.
Co-authored-by: Jerel Miller <[email protected]>
This unifies
@apollo/experimental-nextjs-app-support/rsc
and@apollo/experimental-nextjs-app-support/ssr
into@apollo/experimental-nextjs-app-support
.Once we rename the package to remove the
experimental
label, this will be the only entry point.Also, some imports are changed:
useQuery
/useSuspenseQuery
etc. hooks have been dropped. They should be imported from@apollo/client
instead.NextSSRApolloClient
has been renamed toApolloClient
and is available in different variations from all environments, including RSC.NextSSRInMemoryCache
has been renamed toInMemoryCache
and is available in different variations from all environments, including RSC.resetNextSSRApolloSingletons
has been renamed toresetApolloClientSingletons