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

fix: using apollo core to avoid loading react #613

Closed
wants to merge 1 commit into from

Conversation

clemkoa
Copy link

@clemkoa clemkoa commented Jan 8, 2021

Issue:
#611

Description of changes:
As described in the issue, the apollo client loads react by default which is not optimal. Instead of using @apollo/client I import @apollo/client/core which is just the apollo functions needed!

The apollo team described the migration process on this page: https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/ . They use the package @apollo/client because they are in a react project. As described here https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/#using-apollo-client-without-react, "Apollo Client 3.0 includes built-in support for React hooks, but it absolutely still supports non-React view layers. To use Apollo Client 3.0 with Vue, Angular, or another view layer of your choosing, import ApolloClient from the @apollo/client/core entry point". Importing @apollo/client/core works with all js frameworks and doesn't force react to be loaded.

Happy to modify if you have feedback

@clemkoa
Copy link
Author

clemkoa commented Jan 22, 2021

Hi, is there anything holding back this PR? Do you need more information?

@fsproru
Copy link

fsproru commented Jan 30, 2021

Having the same issue too, here is another PR fixing the same issue: #599

@manueliglesias @elorzafe @dabit3 is there a way to get this fix in?

@aradalvand
Copy link

Will this PR be merged? It's been 2 months.

@clemkoa
Copy link
Author

clemkoa commented Mar 2, 2021

@elorzafe can you please check out this PR? The wrong imports break a lot of non-react ts projects

@pmuller
Copy link

pmuller commented Mar 17, 2021

Same issue here. I'd be happy to see this PR get merged. :)

@DregondRahl
Copy link

Looking forward to this merge. Would help alot with use Vue for AppSync

@viktormuller
Copy link

Looking forward to this merge. It would reduce significantly the dependencies of our AWS Lambda and hence its cold start time.

@revmischa
Copy link

Unfortunately AWS employees get raises and promotions for shipping new features and services but not for maintaining anything. We see the limitations of this approach to incentivizing employees here.

@sammartinez
Copy link
Contributor

Apologizes folks for missing this! I do have some people looking into this now. Thanks for raising this up @revmischa

Copy link
Contributor

@david-mcafee david-mcafee left a comment

Choose a reason for hiding this comment

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

Thanks for your PR, @clemkoa! Unfortunately, it looks like we've already updated all the imports, so this PR is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants