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

change react-dom from devDependency to dependency #1366

Closed
wants to merge 1 commit into from

Conversation

legnaleurc
Copy link

Since #1209, we import react-dom explicitly, so maybe it should be put into dependencies instead of devDependencies.
Put it in devDependencies will confuse some plugins of build systems (e.g. Webpack), makes them think react-dom is not needed for react-redux.

@netlify
Copy link

netlify bot commented Jul 30, 2019

Deploy preview for react-redux-docs ready!

Built with commit 5301358

https://deploy-preview-1366--react-redux-docs.netlify.com

@markerikson
Copy link
Contributor

markerikson commented Jul 30, 2019

Appreciate the PR, but no, this is not correct.

Because of how the renderers export unstable_batchedUpdates, we're in a weird situation where we have to import from react-dom, but allow the RN loader to fall back to the RN package instead when used with RN.

Adding react-dom as an explicit dependency would break that, and also force an extra download for all RN users.

In addition, we do need react-dom as a dependency for developing React-Redux.

@legnaleurc
Copy link
Author

We need react-dom for deploying react-redux, at least it appears when we run npm run build:umd.
Would it be acceptable to be peerDependencies or optionalDependencies?

@markerikson
Copy link
Contributor

Also no. We don't want to be RN users to be getting warned when they install React-Redux but not ReactDOM. And, since we build the UMDs ourselves as part of the dev process, that's already handled under devDependencies.

I know it's quirky, but what we have now works.

@zkochan
Copy link

zkochan commented Aug 6, 2019

It can be an optional peer dependency. In that case, users will not be warned about it. Optional peer dependencies are supported by yarn, pnpm and will be supported in npm in the next minor version (thanks to @arcanis)

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