-
Notifications
You must be signed in to change notification settings - Fork 786
Created apolloClient utility to retrieve the apollo state in redux. #223
Conversation
@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/ |
@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. |
Another note, I had to fix apollo-client to 0.14.6 to get the version with the problem. |
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 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!
Thanks for the review. About the tests, I am considering the testing the new function should be enough. About the CI, I will look into it, but think I may need help to understand what is wrong. |
First for the typings, let's try to see if you revert your changes in 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! |
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.
@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
However, what I like here is we add some tests. If you can get rid of the @jbaxleyiii or @stubailo do you have a preference on this ? |
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
@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", |
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 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
.
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.
yes you should indeed!
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.
This seems good to me. Now we'll wait for one of the main maintainers...
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.
CI is still failing, I'm not good enough with TypeScript to understand why this is happening.
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 About the CI I have the same error on my local machine when running I tried also to run 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! :) |
@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! |
closed for #226 but thank you for this PR! |
This PR resolves #221.
It checks if the deprecated
reduxRootKey
property is set in the client and uses it. Otherwise it uses the newreduxRootSelector
property of the client.Also it adds the deprecation warning when
reduxRootKey
is used in the client.