* Added UNSAFE_ methods to create-class HAS_MANY list
* Added warning for UNSAFE_componentWillRecieveProps misspelling
* Bumping create-react-class package version
* Added support for static getDerivedStateFromProps mixins
**what is the change?:**
Added an `eslintrc` which disables the 'comma-dangle' rule just for
addons.
**why make this change?:**
To get CI passing again on the 15* branches.
We don't have dangling commas in the addons because it breaks GCC under
certain conditions. This doesn't affect React because we use Babel with
React, but it's not worth setting up Babel for the addons at this time.
**test plan:**
`yarn lint`
**issue:**
None - hopefully will fix this before it's a problem
* [#9627] Fix create-react-class isMounted ordering issue
Split the IsMountedMixin in two so that the __isMounted flag is set to false after componentWillUnmount is executed in mixins and the component.
* Revert changes to integration test
* Test 'create-react-class' with fixtures
NOTE: Never going to merge this commit, but I may cherry-pick it onto
branches in order to test fixes for issue #9765
**what is the change?:**
Require and use the UMD bundles of 'create-react-class' in three
fixtures to test the three supported uses;
- test Global JS with globals.html
- test AMD with requirejs.html
- test CommonJS with webpack-alias
**why make this change?:**
To test https://github.com/facebook/react/pull/9761 and other PRs fixing https://github.com/facebook/react/issues/9765
**test plan:**
Manual testing;
- cd into the directory in fixtures
- run the build step if needed
- open the file
**issue:**
https://github.com/facebook/react/issues/9765
* Rename fixtures testing create-react-class
**what is the change?:**
Renamed some fixtures.
**why make this change?:**
This is part of setting up manual tests of the add-ons we are fixing.
**test plan:**
`cd fixtures && node ./build-all.js` and manually open the renamed
fixtures.
**issue:**
https://github.com/facebook/react/issues/9765
* Prettify the unminified UMD build of `react-linked-input`
**what is the change?:**
`prettier addons/react-linked-input/react-linked-input.js | pbcopy` and
replaced the contents of the file.
**why make this change?:**
I am manually tweaking this file and want it to be more readable.
**test plan:**
about to set up manual testing of this with fixtures. I expect that
right now only the use of it as a global will work, and subsequent
commits will fix the AMD and CommonJS use cases.
**issue:**
https://github.com/facebook/react/issues/9765
* Test state of `react-linked-input` and `create-fragment` before fix
**what is the change?:**
Setting up the fixtures to enable manual testing of the
`react-linked-input` and `create-fragment` UMD builds.
This was a painstaking and frustrating process and we need something
better before making any more fixes to addons. Here is roughly what I
did;
- add 'console.log' statements to the add-on to confirm that you've loaded the right build case
- copy the add-on into 'build/packages' so that the 'webpack-alias' can find it.
- make copies of each of the following three fixtures for each add-on you want to test, renaming them to specify what you are testing:
- globals.js
- requirejs.js
- webpack-alias/*
- modify those fixtures to use the add-on you intend to text
**why make this change?:**
We need to verify the current state of the bug before fixing it, to
confirm that the change actually is fixing the bug.
**test plan:**
`open fixtures/globals-with-create-react-fragment.html`
`open fixtures/globals-with-react-linked-input.html`
`open fixtures/requirejswith-create-react-fragment.html`
`open fixtures/requirejswith-react-linked-input.html`
`cd fixtures/webpack-aliaswith-create-react-fragment/ && yarn build && open index.html`
`cd fixtures/webpack-aliaswith-react-linked-input/ && yarn build && open index.html`
**issue:**
https://github.com/facebook/react/issues/9765
* Fix missing `React` in `react-linked-input` and `create-fragment`
**what is the change?:**
Manually tweaking the UMD builds for both add-ons to include a
dependency on React.
**why make this change?:**
They were broken before for AMD and CommonJS.
For reasons I have not debugged, the CommonJS builds are still broken,
but the AMD is now fixed and globals still work:
```
do 'react-linked-input' and
'create-react-fragment' work?
before after
+ my + my +
en^ironment | fix | fix |
+----------------------------------------
| | |
Global JS | :) yes | :) yes |
+----------------------------------------
| | |
AMD | X no | :) yes |
+----------------------------------------
| | |
CommonJS | X no | X no |
+-------------+-----------+-----------+--
```
**test plan:**
In the previous commit we set up fixtures to manually test these.
**issue:**
https://github.com/facebook/react/issues/9765
* More adjustments to enable testing with fixtures
Not worth explaining - just committing as a 'save point' while I fiddle
with the fixtures.
* Remove all cruft from manually testing addons in fixtures
**what is the change?:**
We forked three of the fixtures into two variations to test two of the
react addons. We also added `console.log` statements to the addons to
verify that we were loading the right build.
This commit cleans it up by
- deleting forked fixtures
- re-adding the original fixtures
- removing `console.log` statements
**why make this change?:**
To get this branch ready for review.
**test plan:**
`cd fixtures && node ./build-all.js` and then check the updated fixtures
manually
**issue:**
https://github.com/facebook/react/issues/9765
* Double to single quotes in 'react-linked-input'
**what is the change?:**
`:%s /"/'/gc`
I left double quotes wrapping cases where we have single quotes in the
string.
**why make this change?:**
I ran the code for the unminified 'react-linked-input' through
'prettier' so it would be easier for me to manually fix the UMD wrapper.
And 'prettier' changed many single quotes into double quotes. @spicyj
pointed out this will be treated differently by the google closure
compiler, and may have semantic differences.
**test plan:**
It's not worth testing imo.
**issue:**
https://github.com/facebook/react/issues/9765
* remove random newline
* Fix missing react in create-react-class
refs #9689
* Modify the 'create-react-class' package to make 'globals' work again
**what is the change?:**
Pass the global 'react' into the global conditional in the UMD build of
'create-react-class'.
**why make this change?:**
Here is the deal:
- @mondwan's original fix does fix the AMD build, but breaks the
'global JS' build.
- My modification makes it work with both AMD and the 'global JS'
build.
- @mondwan's fix seems to have fixed the CommonJS build too, and I
maintained that fix with my modification.
```
Does the 'create-react-class' UMD build work?
Before After After
+ @mondwan's + @mondwan's + @flarnie's
Build System | fix | fix | modification
+---------------------------------------------------------+
| | |
Global JS | :D Success | X Fail | :D Success
| | |
+---------------------------------------------------------+
| | |
AMD | X Fail | :D Success | :D Success
| | |
+---------------------------------------------------------+
| | |
Common JS | X Fail | :D Success | :D Success
| | |
+ + +
```
**test plan:**
The testing for this was really tricky and involves a fragile multi-step
process:
1) Make sure the fixtures are working on your branch
2) Modify some of the fixtures to use 'create-react-class', like in this
commit (you can just cherry-pick it if you are on a branch based on
the 15.* branches) -
https://github.com/flarnie/react/commit/51dcbd5ef164b86bc509ae070a6273758a60e13c
3) Make sure React is set up, and then
`cd fixures && node ./build-all.js`
4) The following fixtures could be used to test the various builds:
- test GlobalJS with `globals.html`
- test AMD with `requirejs.html`
- test CommonJS with `webpack-alias/index.html`
**issue:**
https://github.com/facebook/react/issues/9689
and
https://github.com/facebook/react/issues/9765
* Add missing object-assign dep to create-react-class
* Remove unnecessary inlines and irrelevant tests in createFragment
* Uninline shallowEqual in shallowCompare
* Uninline invariant in update
* Uninline invariant/warning and remove unreachable code in react-linked-input
* Envify and collapse createClass UMD
* Envify and collapse createFragment
* ReactLink doesn't really need PropTypes dep
It is unnecessary because it is not explicitly exposed and was never public API.
* Rebuild, envify and collapse LinkedStateMixin UMD
* Collapse PureRenderMixin UMD
* Rebuild shallowCompare
* Envify and collapse update UMD
* Remove unused prop-types dep from linked-input
* Fix change handling in LinkedInput
* Compile LinkedInput to ES5
* Rebuild, collapse, and fix LinkedInput UMD
* Add full README for react-addons-create-fragment
* Mention compat version of transition-group so we can delete those docs
* README for react-addons-linked-state-mixin
* More docs
* Fix devDeps for createClass
* docs
1. Moved react-addons-test-utils to react-dom/test-utils and added deprecation message.
2. Moved shallow renderer (previous accessible via TestUtils.createRenderer) to react-test-renderer/shallow and added deprecation message.
3. Updated READMEs for react-addons-test-utils and react-test-renderer