-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Support Apollo Client v3 #175
Conversation
Should we also offer ES6 module version for tree-shaking? We can have |
9292c8f
to
61d4007
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.
Thanks for taking a look at this! Hopefully the issue of rewriteURIForGET
not being exported as CJS can be rectified on Apollo's end, then we can look at merging once Apollo Client v3 is out of pre-release.
This package used to have a https://github.com/jaydenseric/apollo-upload-client/releases/tag/v9.0.0 I only intend to add it back if we can get it working properly with For a modern example of a package with a https://unpkg.com/browse/[email protected]/lib/
The |
Co-Authored-By: Jayden Seric <[email protected]>
d115ea1
to
675cbde
Compare
# Conflicts: # package.json
What concerns me is the way they initialize the client using a From https://www.apollographql.com/docs/react/api/link/introduction/:
|
Co-authored-by: Michaël De Boey <[email protected]>
Co-authored-by: Michaël De Boey <[email protected]>
What about having
|
This reverts commit 683cc96. See jaydenseric#201 (comment) .
It should be a regular dependency as this package uses require to import from
An example of a plugin would be a Babel plugin that doesn't actually import anything from Babel, but depends on Babel injecting certain helpers, context, etc. into the plugin function. Regarding the |
Thanks for your explanation. It makes sense. I'm not sure why some packages like |
That's because Both approaches will work, with pros and cons. Here is my decision process when installing:
If you are deciding to create a community convention, my thought process would be: Could multiple versions of this package coexist in |
Angular is now spitting warning when using this lib because it uses CommonJS module. So from my point of view it would be extra nice to support ESM at the same time as Apollo 3.
|
@PowerKiKi I'm going to work on ESM outside of this PR, but it will be hard to have a good outcome because There is a lot to explain. I have been moving all my packages to support all of this at the same time:
The only way to tick all those boxes is like this: You can see documented all the different ways parts of the public API can be consumed: https://github.com/jaydenseric/graphql-upload#class-graphqlupload Now, |
Thanks for the detailed answer and your work on those lib. I was not aware that |
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 think what you have done in the PR is right, I'll report it to you if yarn2 yells at me |
Will there be a release with this soon? |
Thanks for the detailed answers above to our questions! It's really helpful. |
This has been published in v14.0.0 🚀 I still feel pretty unhappy about a few things:
I've updated the example app, but please note point 2 above. Next up is to add tests in a patch release (see #204), then we can add support for GET requests (with tests) in a minor release (see #151). |
Is there anything people can help with around supporting GET requests? It looks like apollographql/apollo-client#6593 might have unblocked that, but from my reading of the discussion around apollo's bundling it sounds like it might be more complicated that I'm assuming. 😅 |
@nelsonpecora I've been working full time the past few days on adding tests (#204), but got a little stuck on aspects of the abort controller signals. If I can't figure it out today, I will push up all the other tests anyway. If I have time remaining today I will add tests and support for GET (#151). The actual GET related helpers are available to us now from If I run out of time (I already took 3 days off paid work this week for this; I have to return to my contract work for Thursday and Friday), hopefully the community can raise a PR. From here on out only PRs with appropriate test coverage will be reviewed. Having tests will make it much easier to review and accept contributions! |
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.
Looks good
This PR use the new
@apollo/client
.Also sincerewriteURIForGET
is exported in@apollo/client/link/http/rewriteURIForGET
, we can support GET requestsFixes #174 .