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

react-element-to-jsx-string requires react 15 :-( #98

Open
ljharb opened this issue Aug 16, 2016 · 5 comments
Open

react-element-to-jsx-string requires react 15 :-( #98

ljharb opened this issue Aug 16, 2016 · 5 comments
Labels

Comments

@ljharb
Copy link
Member

ljharb commented Aug 16, 2016

I'm using React 0.14, and react-element-to-jsx-string has a direct dependency (not a peer dep) on react-addons-test-utils - https://npmcdn.com/[email protected]/package.json.

This means that a normal npm install will install a 15.x version of react-addons-test-utils, which will then complain that my React 0.14 doesn't work.

react-element-to-jsx-string needs to have a peer dep on react-addons-test-utils, not a direct dep.

I'm filing this here, since this is manifesting as a bug in chai-enzyme in that npm ls doesn't work when i install it.

@ayrton
Copy link
Contributor

ayrton commented Aug 16, 2016

As a workaround I believe we can loosen up the dependency to do ^2.1.0 | ^3.0.0. See this diff.

We only have one use case with react-element-to-jsx library so far.

@ayrton
Copy link
Contributor

ayrton commented Aug 16, 2016

@ljharb how do you see the most ideal solution?

@ljharb
Copy link
Member Author

ljharb commented Aug 16, 2016

That won't solve it, since npm will still try to install the latest.

The ideal solution is that nothing is a singleton and nothing needs peer deps :-) but React is a singleton, so all react things must only specify React things as peer deps. In other words, if I want to use chai-enzyme (with react-element-to-jsx-string as a dependency), i must install react-addons-test-utils as a top-level dep.

Another alternative is to simply remove that feature, and drop the dependency.

@ayrton ayrton added the bug label Aug 29, 2016
@ayrton
Copy link
Contributor

ayrton commented Nov 4, 2016

I think it's best to pin chai-enzyme to 0.4.2, which is the latest release that doesn't pull in react-element-to-jsx-string.

As an aside react-element-to-jsx-string supports react 0.14.8 and above while we support 0.14 and above, maybe we should bump this too? thoughts? cc @vesln

@ljharb
Copy link
Member Author

ljharb commented Nov 4, 2016

bumping to the latest 0.14 seems just fine

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

No branches or pull requests

2 participants