-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[V3] Create @apollo/client/core bundle #5541
Conversation
a8d8b65
to
49a2ffb
Compare
A really important change that is going to fix the main issue for many community packages that will want to migrate to 3.0! |
Thanks for kickstarting this @kamilkisiela. We'll be working on a variation of this over the next little while, and will merge our commits into this PR to keep everything in the same place. We'd love to get your feedback when ready, so we'll definitely keep you posted. |
49a2ffb
to
b4b1db4
Compare
@hwillson I see you're pushing it forward. Is there a way we could prevent people from using I'm talking about not exposing some types and classes in |
I think it would be much clearer to have something like:
What do you think? |
@abdonrd we considered that in our original design, but decided we want the @kamilkisiela I'll put some thought into this - thanks! |
c83e9d4
to
5fdea43
Compare
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.
Now let's do the same for other entry points (in subsequent PRs)!
This ensures `dist` is fully ready after each build, which helps when linking the `dist` dir into test projects during development.
We'll use `core` as the non-React bundle, instead of `common`.
These changes help avoid creating a CJS specific bundle for `@apollo/client/core` by comparing `dist/apollo-client.cjs.js` and `dist/react/index.js` exports, then re-exporting all non-React exports from the main CJS bundle.
7418a20
to
e4b3990
Compare
Similar to the changes made in #5541, this commit adds a direct entry point for the Apollo Client cache code. Importing from `@apollo/client/cache` gives access to the cache code directly, without pulling in other parts of the Apollo Client codebase.
Similar to the changes made in #5541, this commit adds a direct entry point for the Apollo Client cache code. Importing from `@apollo/client/cache` gives access to the cache code directly, without pulling in other parts of the Apollo Client codebase.
This PR creates
package.json
under/core
directory so people are able to use@apollo/client/core
module, just like regular node module, with support of bundlers and everything.Thanks to
@apollo/client/core
non-react people doesn't have to installreact
(and@types/react
on TypeScript).It still doesn't fix the issue in codesandbox.io and stackblitz.io and related because in all non-react projects the
react
module has to be installed... But at least non-react folks are able to use new Apollo Client v3 :)Related #5532