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

Update doc regarding webpack and React 15 #340

Merged
merged 1 commit into from
Apr 21, 2016

Conversation

tylercollier
Copy link
Contributor

I've updated doc regarding webpack and React 15, which came from the advice here.

What I had to do to get things working with webpack and React 0.14 was different than in the guide, and I wrote about it here. I did not include it in this PR due to not really understanding what's going on and if my solution is a universal one, but I think a better guide will make sure people don't abandon using enzyme because they feel it's too hard to set up.

@lelandrichardson
Copy link
Collaborator

LGTM. We added react 15 support, but didn't really update the documentation. Thanks for the help!

@lelandrichardson lelandrichardson merged commit d31aeeb into enzymejs:master Apr 21, 2016
@tylercollier
Copy link
Contributor Author

Can you update the doc for React 0.14 too?

The current guide says:

If you are using React 0.14, the instructions above will be the same but with a different list of externals:

In its list that follows, it isn't as helpful as what's shown for using with React 0.13 (which is actual javascript). I recommend writing actual javascript because with just a list, it's unclear what the values should be ('window' or true).

So something like this:

/* webpack.config.js */
// ...
externals: {
  'cheerio': 'window',
  'react-dom': ???
  'react/lib/ExecutionEnvironment': true,
  'react/lib/ReactContext': true
}
// ...

Note the ???. For me, to get things working, I actually removed that line and replaced it with 'react-deom/server': 'window'. I'm not sure how 'correct' that is vs just my environment.

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.

2 participants