Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

React Apollo 2.0 (and Roadmap) #1164

Merged
merged 0 commits into from
Oct 31, 2017
Merged

React Apollo 2.0 (and Roadmap) #1164

merged 0 commits into from
Oct 31, 2017

Conversation

jbaxleyiii
Copy link
Contributor

@jbaxleyiii jbaxleyiii commented Sep 28, 2017

tldr;

The 2.0 upgrade is 100% backwards compat with the 1.0! The only change is upgrading apollo-client which does have some minor breaking changes. Oh its also 2/3 the size of the 1.0 🎉

npm i --save react-apollo@beta

Roadmap

Included in this PR is a roadmap for what is next for react-apollo. PLEASE comment on this PR (it will stay open until the 2.0 for apollo-client is live) with feedback!

This PR is to upgrade to apollo-client 2.0 which is a breaking change for this library since it directly exported the client. Going forward, react-apollo will no longer directly export gql or apollo-client to prevent this semver lock in.

@apollo-cla
Copy link

apollo-cla commented Sep 28, 2017

Warnings
⚠️

❗ Big PR

Generated by 🚫 dangerJS

@stevewillard
Copy link

@jbaxleyiii I just wanted to say that it took me about 15 minutes to upgrade apollo-client and react-apollo to version 2. Super easy! The only gotcha I had was I had to re-add a react-redux wrapper, whereas in 1.x I guess I didn't have to do that.

Thank you so much for all your work! 💯

@jbaxleyiii
Copy link
Contributor Author

@stevewillard that is SO great to hear! Please let me know if you run into anything odd!

@tomitrescak
Copy link

Does it still depend on redux store? Is there any love for mobx? And how do I check if queries have finished running? I need it for my testing tools. Thanks! Great job!

@jaydenseric
Copy link
Contributor

It seems redux is an unnecessary peer dependency, can it be removed?

@maktouch
Copy link

maktouch commented Oct 5, 2017

Is ErrorPolicy planned for this release?

#1112

@stantoncbradley
Copy link

#890 is still an issue

@j
Copy link

j commented Oct 13, 2017

@jbaxleyiii When will this be pushed to NPM for testing?

@jbaxleyiii
Copy link
Contributor Author

@j the first @beta in on npm! @maktouch yep ErrorPolicy should just work as an option to be passed.

@wmertens wmertens mentioned this pull request Oct 14, 2017
@elie222
Copy link

elie222 commented Oct 25, 2017

We're still having major performance issues with Apollo 2.0 and React Native when adding 100s of items to the store. Just trying to star a player takes ages. We sat days working on it optimising as much as possible, but the only solution on Apollo 1.0 was to not load these items into the store. Apollo 2.0 is just as bad performance wise for us.

@paramaggarwal
Copy link

paramaggarwal commented Oct 26, 2017

I am unable to figure out an upgrade process here. Just got the 2.0 via an yarn upgrade react-apollo --latest and getting errors.

  1. I did yarn add apollo-client to my project but it seems to have its own major list of changes.
  2. I sharing my application redux state with Apollo and now I am not sure what changes are needed.
  3. I believe gql now needs to be imported separately, but can't find any example in docs.
  4. There are some changes related to apollo-link and apollo-cache-inmemory which I don't understand exactly how to go about.

The claim in this PR that this change is not a breaking change is incorrect based on these observations.

@Vanuan
Copy link
Contributor

Vanuan commented Oct 27, 2017

Should README.md be changed too?

From this:

const client = new ApolloClient({
  networkInterface: createNetworkInterface({ uri: "/graphql" }),
});

to this:

const client = new ApolloClient({
  link: new HttpLink({ uri: "/graphql" }),
  cache: new InMemoryCache(),
});

Do we really need to import the client from react-apollo or this would be fine:

import ApolloClient from "apollo-client";
import { ApolloProvider } from 'react-apollo';

@bogdansoare
Copy link

what is the status of react-apollo 2 ?
I don't see any reduction in file-size by upgrading? is that normal?

@jbaxleyiii jbaxleyiii merged commit 66f30a6 into master Oct 31, 2017
@paramaggarwal
Copy link

@jbaxleyiii v2.0 was published to npm since 7 days - even though the PR is merged right now - I think this happened in error - hence letting you know! (https://www.npmjs.com/package/react-apollo)

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

Successfully merging this pull request may close these issues.