apollographql / apollographql/apollo-client-integrations

New package (0.11.0+) brings Apollo Client into Browser bundle when not used in Client Components

Open
#341 12 comments 1 reaction 0 assignees View on GitHub
nextjs-bug
Dominant language
TypeScript
Stars
556
Forks
53
PR merge metrics
No merged PRs in 30d

Description

My project uses CommonJS (no "type": "module").
I found an issue.The new version of `@apollo/experimental-nextjs-app-support` have been added to a bundle, on pages where there is no ApolloProvider, only RSC calls of apollo client.

Steps to reproduce:
- install `"@apollo/experimental-nextjs-app-support": "0.11.2"`
- use `const {data} = await(await getClient()).query({query: MyQuery});` on any nextjs page.tsx
- check the result bundle. There is an `@apollo/experimental-nextjs-app-support` in browser bundle, and all it deps (like Apollo Client)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the report with @apollo/experimental-nextjs-app-support 0.11.2 in a CommonJS Next.js project, using the RSC query in page.tsx. Inspect the resulting browser bundle and compare the dependency graph with and without ApolloProvider; done means unused Apollo support and its dependencies no longer enter that bundle.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, next.js, typescript
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.