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

Allow React 17 as a peerDependency #122

Merged
merged 1 commit into from
Oct 22, 2020
Merged

Conversation

jamesplease
Copy link
Collaborator

@jamesplease jamesplease commented Oct 20, 2020

React 17 was released today. I haven't yet tested constate with this new release, but there's a good chance that it'll work just fine.

Copy link
Owner

@diegohaz diegohaz left a comment

Choose a reason for hiding this comment

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

Thanks @jamesplease!

@diegohaz diegohaz merged commit 0f69b83 into diegohaz:master Oct 22, 2020
@jamesplease jamesplease deleted the patch-1 branch October 22, 2020 20:12
@favna
Copy link

favna commented Oct 25, 2020

Came here because I'm updating my package.json right now but why not just specify it as "react": ">=16.8"?

@jamesplease
Copy link
Collaborator Author

jamesplease commented Oct 25, 2020

It’s just a matter of preference. Let’s say we specify what you suggested, ”react”: “>=16.8”. Should React 18 come out with changes that break constate, then the dependency list is not accurate, and a new release would need to be published that puts an upper limit on the dependency. Issues may be opened up by users who are confused and who expect the library to work with the new release.

Of course, if constate continues to work just fine in 18, then specifying the dependencies that way is quite convenient.

With the approach in this PR, the maintainers must manually update the dependency for each major release. The downside, as we have seen, is that backwards compatible major releases require a version bump. But the plus side is that breaking changes in major releases will be prevented (well, a warning during the install phase will be shown at least).

I have a slight preference for being “honest” with the dependencies array. Will constate work with React 18? Who knows. Maybe, maybe not. But we do know that it works with 16.8+ and 17, and the dependency array reflects what we do know.

With that said, I don’t have a strong preference either way, so if @diegohaz prefers to make it >=16.8 then that’s A-OK by me.

@favna
Copy link

favna commented Oct 25, 2020

Your reasoning is perfectly sound. The version bump is pretty okay to do anyway.

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.

3 participants