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

Move React-related exports to @apollo/client/react and out of the main bundle #12300

Merged
merged 23 commits into from
Jan 23, 2025

Conversation

jerelmiller
Copy link
Member

Fixes #8190
Fixes #8958

Moves all React-related exports to the @apollo/client/react entrypoint and out of the main @apollo/client bundle. This makes it easier for other frameworks or users of the core API to use the client without the need to install React in order to import from the top-level module.

Copy link

changeset-bot bot commented Jan 22, 2025

🦋 Changeset detected

Latest commit: 78b5ced

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

This PR includes changesets to release 1 package
Name Type
@apollo/client Major

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 commented Jan 22, 2025

⚠️ Docs preview not attached to branch

The preview was not built because the PR's base branch release-4.0 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: 5c9c6976629554dd43b01d90

Copy link

netlify bot commented Jan 22, 2025

Deploy Preview for apollo-client-docs ready!

Name Link
🔨 Latest commit 78b5ced
🔍 Latest deploy log https://app.netlify.com/sites/apollo-client-docs/deploys/679168fd36fafd000805c795
😎 Deploy Preview https://deploy-preview-12300--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 your Netlify site configuration.

@jerelmiller jerelmiller force-pushed the jerel/move-react-imports branch from 2cb976e to 8fab8c3 Compare January 22, 2025 21:49
Copy link

pkg-pr-new bot commented Jan 22, 2025

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

commit: 78b5ced

Copy link
Contributor

github-actions bot commented Jan 22, 2025

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 33.47 KB (-17.55% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" 41.43 KB (-17.14% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/main.cjs" (production) 38.78 KB (-17.72% 🔽)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" 36.18 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "dist/index.js" (production) 33.58 KB (0%)
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.12 KB (0%)
import { useQuery } from "dist/react/index.js" (production) 4.21 KB (0%)
import { useLazyQuery } from "dist/react/index.js" 5.61 KB (0%)
import { useLazyQuery } from "dist/react/index.js" (production) 4.68 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.43 KB (0%)
import { useSubscription } from "dist/react/index.js" (production) 3.48 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" 5.51 KB (0%)
import { useSuspenseQuery } from "dist/react/index.js" (production) 4.17 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" 5.01 KB (0%)
import { useBackgroundQuery } from "dist/react/index.js" (production) 3.66 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" 5.09 KB (0%)
import { useLoadableQuery } from "dist/react/index.js" (production) 3.74 KB (0%)
import { useReadQuery } from "dist/react/index.js" 3.41 KB (0%)
import { useReadQuery } from "dist/react/index.js" (production) 3.35 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%)

Copy link
Member

@phryneas phryneas left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@github-actions github-actions bot added the auto-cleanup 🤖 label Jan 23, 2025
@jerelmiller jerelmiller merged commit 4d581e4 into release-4.0 Jan 23, 2025
47 checks passed
@jerelmiller jerelmiller deleted the jerel/move-react-imports branch January 23, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants