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

Created apolloClient utility to retrieve the apollo state in redux. #223

Closed
wants to merge 4 commits into from
Closed

Created apolloClient utility to retrieve the apollo state in redux. #223

wants to merge 4 commits into from

Conversation

rewop
Copy link

@rewop rewop commented Sep 21, 2016

This PR resolves #221.

It checks if the deprecated reduxRootKey property is set in the client and uses it. Otherwise it uses the new reduxRootSelector property of the client.

Also it adds the deprecation warning when reduxRootKey is used in the client.

@apollo-cla
Copy link

@rewop: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@rewop
Copy link
Author

rewop commented Sep 21, 2016

@rricard this is the first attempt :)

I had to run typings command to make the types be recognised, but I also see it added a lot of files. Let me know if I have to revert for those files.

@rewop
Copy link
Author

rewop commented Sep 21, 2016

Another note, I had to fix apollo-client to 0.14.6 to get the version with the problem.

Copy link
Contributor

@rricard rricard 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 the PR, it seems good to me except for the typings update that seems to lose the CI. Maybe some simple tests on this feature as well... Moreover, I'd like to have @jbaxleyiii feedback on this, he'll be merging you ultimately!

@rewop
Copy link
Author

rewop commented Sep 21, 2016

Thanks for the review.

About the tests, I am considering the testing the new function should be enough.
Suggestions where I can implement the test for the function?

About the CI, I will look into it, but think I may need help to understand what is wrong.

@rricard
Copy link
Contributor

rricard commented Sep 21, 2016

First for the typings, let's try to see if you revert your changes in typings/ what it does. The, re-npm install. It my still fail for you but may pass in the CI, in this case we should investigate your env!

Second, for the tests, yes just test the new function but try to cover the edge cases as much as possible. Since you created a new file for the function, try creating a new file, we'll move it around if that makes more sense!

Good luck!

@rewop
Copy link
Author

rewop commented Sep 23, 2016

@rricard Tested and fixed the CI. However I see #226 could be a cleaner alternative than this one.

Copy link
Contributor

@rricard rricard left a comment

Choose a reason for hiding this comment

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

@rewop seems like it is indeed an another patch for the same thing, I still see two issues with your PR:

  • Way too much additions, I don't know what happened with the typings but it's definitely not the way to go ... TypeScript 2.0 is even moving away from typings in order to move that on NPM
  • you need to rebase your branch on top of master

@rricard
Copy link
Contributor

rricard commented Sep 23, 2016

However, what I like here is we add some tests. If you can get rid of the typings/ files and rebase it, I think we'll have something good.

@jbaxleyiii or @stubailo do you have a preference on this ?

Simone Potenza added 3 commits September 23, 2016 14:36
It checks if the deprecated reduxRootKey is set in the client, and used in the
client and uses it. Otherwise it uses the new reduxRootSelector property of
the client

Also it adds the deprecation warning when reduxRootKey is used in the client
@rewop
Copy link
Author

rewop commented Sep 23, 2016

@rricard done what you asked. I hope this is helpful.

@@ -52,7 +52,7 @@
"apollo-client": "^0.4.12"
},
"devDependencies": {
"apollo-client": "0.4.13",
"apollo-client": "0.4.16",
Copy link
Author

Choose a reason for hiding this comment

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

I fixed the version here to test it with the faulty version of apollo-client, but I think we should change it to the latest version. These changes should back compatible, because reduxRootKey has precedence over reduxRootSelector.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes you should indeed!

Copy link
Contributor

@rricard rricard left a comment

Choose a reason for hiding this comment

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

This seems good to me. Now we'll wait for one of the main maintainers...

Copy link
Contributor

@rricard rricard left a comment

Choose a reason for hiding this comment

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

CI is still failing, I'm not good enough with TypeScript to understand why this is happening.

@rewop
Copy link
Author

rewop commented Sep 23, 2016

I am not familiar with typescript either. The problem is that I could not find steps to set up the module for development. So I just run npm install ./node_modules/.bin/typing install (that is why the typings files added) to get started with the project.

About the CI I have the same error on my local machine when running npm run compile.

I tried also to run ./node_modules/.bin/typing install --production to update the definitions only for production modules, but the compilation still fails.

Here I am stuck. I have been trying to look for info to contribute with typescript, but nothing that helped to fix the CI problem.

Help wanted! :)

@rricard
Copy link
Contributor

rricard commented Sep 23, 2016

@rewop don't worry, they plan to migrate from typings to npm-based typing soon. I think we should wait for the opinion of someone else here!

@jbaxleyiii
Copy link
Contributor

closed for #226 but thank you for this PR!

@jbaxleyiii jbaxleyiii closed this Sep 27, 2016
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.

TypeError: Cannot read property 'queries' of undefined
4 participants