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

Breaking change in apollo-client.cjs.js #8592

Closed
davixyz opened this issue Aug 5, 2021 · 4 comments · Fixed by #8605
Closed

Breaking change in apollo-client.cjs.js #8592

davixyz opened this issue Aug 5, 2021 · 4 comments · Fixed by #8605

Comments

@davixyz
Copy link

davixyz commented Aug 5, 2021

Intended outcome:

Have access to ApolloProvider exported from apollo-client.cjs.js

"version": "3.3.21"

yay provider
Screen Shot 2021-08-05 at 12 03 23 PM

Actual outcome:

ApolloProvider is no longer exported from apollo-client.cjs.js

 "version": "3.4.5",

no provider to be found :(
Screen Shot 2021-08-05 at 12 10 08 PM

How to reproduce the issue:

update to latest version and try to access Provider from apollo-client.cjs

Versions

"version": "3.4.5",

Note
For reasons we have to access Apollo through an entire CJS implementation; I realize that the provider is now in react/react.cjs.js but we were thinking that apollo-client.cjs.js would have the entire apollo client implementation in a single file.

@benjamn
Copy link
Member

benjamn commented Aug 5, 2021

@davixyz Could you import @apollo/client/main.cjs.js instead, or do you really need one big bundle file?

The apollo-client.cjs.js file is a build artifact and not something we intended to be part of the public API, but I do see how changing what it exports could be a breaking change, and I'm open to restoring it in some form, if that's helpful to you.

@davixyz
Copy link
Author

davixyz commented Aug 5, 2021

We can adjust the imports as needed on our end; It's more of an issue in terms of NPM distributions; This might technically be a breaking change for all the clients consuming this file as the export changed and things were removed.

Maybe restoring it as the initial stable version was is the way to go for sake of correctness and calling it out as deprecated so maybe gets removed as distributable in following versions (But please do leave a single big bundle for us using some older CommonJS bundlers)

@benjamn
Copy link
Member

benjamn commented Aug 6, 2021

@davixyz Please take a look at #8605 when you have a chance!

benjamn added a commit that referenced this issue Aug 6, 2021
benjamn added a commit that referenced this issue Aug 6, 2021
@aboveyunhai
Copy link

image

I encounter this problem when I upgrade from 3.4.4 to 3.4.5,
I have to downgrade back to 3.4.4 as well as discard changes from package-lock.json then npm i to reinstall the deps,
but I am not sure if it relates to the OP.

benjamn added a commit that referenced this issue Aug 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants