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

Ship 15.4.0 #7770

Closed
zpao opened this issue Sep 19, 2016 · 19 comments
Closed

Ship 15.4.0 #7770

zpao opened this issue Sep 19, 2016 · 19 comments

Comments

@zpao
Copy link
Member

zpao commented Sep 19, 2016

This might be a little ways out, but going to start the process. We definitely want to run an RC here and push it through React Native. We'll want other people to play with it too. There's a big packaging change and it has potential to have issues.

@gaearon
Copy link
Collaborator

gaearon commented Oct 14, 2016

I just published 15.4.0-rc.3.

Installation

npm i --save react@15.4.0-rc.3 react-dom@15.4.0-rc.3

If you use snapshot testing:

npm i --save-dev react-test-renderer@15.4.0-rc.3

Please report issues!

There is a big change in how internals are organized. We are continuing to split React from ReactDOM internally, and in this release a bunch of internal modules has moved from react/lib/* to react-dom/lib/*. They were never a part of the public API so it's valid as a minor version, but we published this RC so that you have a chance to assess whether you or any libraries you depend on use private APIs, and raise issues with their maintainers before 15.4.0 is stable.

If your package depends on React internal APIs, consider copying the relevant code in your project. React makes no guarantees that any imports from /lib/ folders will ever be supported. They may technically break in any patch version even though we are taking extra steps to make it smooth. As a quick fix, you can replace react/lib/ with react-dom/lib/ and it will likely work, but many of those modules might get removed or further renamed in React 16. Please don't use internal modules of React.

If you found an issue in a popular React-related library that breaks in 15.4.0, please post here so that we keep track of them.

@faalsh
Copy link

faalsh commented Oct 15, 2016

I'm getting:

Module not found: Error: Cannot resolve module 'react/lib/ReactMount'

@gaearon
Copy link
Collaborator

gaearon commented Oct 15, 2016

@faalsh

If you didn't mean to install the RC please run:

npm i --save react@latest react-dom@latest

We published RC4 as latest by mistake but it wasn't meant to be installed automatically.

If you are trying out RC on purpose, please look at which library tries to import react/lib/ReactMount. It's likely not your code, is it? Then file an issue with that library.

@faalsh
Copy link

faalsh commented Oct 15, 2016

@gaearon I'm trying out RC on purpose. Thanks for the tip, the error is caused by react-hot-loader.

@gaearon
Copy link
Collaborator

gaearon commented Oct 15, 2016

RHL 1.x (which is the one relying on this internal module) has been unsupported for more than a year. Please migrate to 3.x if you'd like to keep using it. There are instructions linked from the first paragraph in its README.

@thisbejim
Copy link

thisbejim commented Oct 21, 2016

Hi @gaearon, I am currently on react@15.4.0-rc.3 react-dom@15.4.0-rc.3 react-test-renderer@15.4.0-rc.3 and jest@16.0.2 and when snapshot testing material-ui components with react-test-renderer I get the following error:

Invariant Violation: getNodeFromInstance: Invalid argument.

at invariant (node_modules/fbjs/lib/invariant.js:38:15)
      at Object.getNodeFromInstance (node_modules/react-dom/lib/ReactDOMComponentTree.js:155:77)
      at Object.findDOMNode (node_modules/react-dom/lib/findDOMNode.js:49:41)
      at ListItem.applyFocusState (node_modules/material-ui/List/ListItem.js:300:43)
      at MenuItem.applyFocusState (node_modules/material-ui/MenuItem/MenuItem.js:198:26)
      at MenuItem.componentDidMount (node_modules/material-ui/MenuItem/MenuItem.js:167:12)
      at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:265:25
      at measureLifeCyclePerf (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:75:12)
      at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:264:11
      at CallbackQueue.notifyAll (node_modules/react-test-renderer/lib/CallbackQueue.js:76:22)
      at ReactTestReconcileTransaction.ON_DOM_READY_QUEUEING.close (node_modules/react-test-renderer/lib/ReactTestReconcileTransaction.js:36:26)
      at ReactTestReconcileTransaction.TransactionImpl.closeAll (node_modules/react-test-renderer/lib/Transaction.js:206:25)
      at ReactTestReconcileTransaction.TransactionImpl.perform (node_modules/react-test-renderer/lib/Transaction.js:153:16)
      at batchedMountComponentIntoNode (node_modules/react-test-renderer/lib/ReactTestMount.js:69:27)
      at ReactDefaultBatchingStrategyTransaction.TransactionImpl.perform (node_modules/react-test-renderer/lib/Transaction.js:140:20)
      at Object.ReactDefaultBatchingStrategy.batchedUpdates (node_modules/react-test-renderer/lib/ReactDefaultBatchingStrategy.js:62:26)
      at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactUpdates.js:97:27)
      at Object.ReactTestMount.render [as create] (node_modules/react-test-renderer/lib/ReactTestMount.js:125:18)
      at Object.<anonymous> (src/components/app/__tests__/app.js:60:68)
      at process._tickCallback (internal/process/next_tick.js:103:7)

Repro if needed.

Any insights? Thanks.

@gaearon
Copy link
Collaborator

gaearon commented Oct 21, 2016

@thisbejim It's not a regression though, is it? Did it ever work before?

@aweary Can you look at #7770 (comment) please? My intuition is that we support mock "DOM" refs but not findDOMNode() at the moment.

@aweary
Copy link
Contributor

aweary commented Oct 21, 2016

@gaearon yupp, findDOMNodesupport was never implemented. This error is technically new since in 15.3.2 you would get the injectEnvironment() error before your tests had a chance to even call findDOMNode, but it's not technically a regression since it never worked.

I can look into what it would take for implementing findDOMNode support 👍

@thisbejim
Copy link

thisbejim commented Oct 24, 2016

@gaearon Yeah my bad, I had been looking through other issues and wrongly assumed this was something that was planned to be fixed for this release.

Thank you for taking a look, @aweary, I appreciate your time and effort.

In the meantime are there any workarounds? Cheers.

@gaearon
Copy link
Collaborator

gaearon commented Oct 31, 2016

@thisbejim Would you be interested in fixing this?

@aweary
Copy link
Contributor

aweary commented Oct 31, 2016

@gaearon I do have some work done towards this, just didn't have a chance to finish it last week.

That said, if you want to work on this @thisbejim feel free to! 😄

@thisbejim
Copy link

@gaearon @aweary As much as I'd love to help out I think it is very likely that this issue is way over my head. Will take a look at what Aweary is doing though to try and gain a better understanding of the problem.

@aweary
Copy link
Contributor

aweary commented Nov 5, 2016

@thisbejim just in case you missed it, we ended up concluding that supporting findDOMNode with the test renderer wasn't a good idea, see here

@thisbejim
Copy link

thisbejim commented Nov 7, 2016

Thanks for the update @aweary, much appreciated.

Update: For anyone else who has the findDOMNode error, the solution is to use Enzyme and enzyme-to-json to be compatible with snapshot testing.

@aaron-axisa
Copy link

aaron-axisa commented Nov 7, 2016

I am encountering some issues with my react project using 15.4.0-rc.4 when trying to setup jest and enzyme. (More details here: stackOverflow Question )

Edit: fixed. Mostly merely dependency issues

@aaron-axisa
Copy link

aaron-axisa commented Nov 8, 2016

I have however found an issue with the library chai-enzyme

It requires react/lib/ReactTestUtils (which now moved)


+-- chai-enzyme@0.6.0
| +-- html@1.0.0
| | `-- concat-stream@1.5.2
| |   +-- readable-stream@2.0.6
| |   `-- typedarray@0.0.6
| +-- react@^0.14.8 || ^15.0.1
| `-- react-element-to-jsx-string@5.0.0
|   +-- collapse-white-space@1.0.2
|   +-- is-plain-object@2.0.1
|   | `-- isobject@1.0.2
|   +-- react@^15.3.2
|   +-- react-addons-test-utils@15.3.2
|   +-- sortobject@1.1.1
|   | `-- editions@1.3.3
|   +-- stringify-object@2.4.0
|   | +-- is-plain-obj@1.1.0
|   | `-- is-regexp@1.0.0
|   `-- traverse@0.6.6

@gaearon
Copy link
Collaborator

gaearon commented Nov 8, 2016

I have however found an issue with the library chai-enzyme

Please file it with that library.

@gaearon
Copy link
Collaborator

gaearon commented Nov 8, 2016

Reminder to whoever releases this: error code process.

@sophiebits
Copy link
Collaborator

cc @aweary, @bgnorlov, @chenglou, @gaearon, @goatslacker, @hkal, @jedwards1211, @jessebeach, @keyanzhang, @mnpenner, @nhunzaker, @sebmarkbage – your changes are now shipped in React 15.4!

https://facebook.github.io/react/blog/2016/11/16/react-v15.4.0.html

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

No branches or pull requests

7 participants