Commit Graph

3 Commits

Author SHA1 Message Date
Mond WAN fc542d7f78 Fix missing react in create-react-class (#9761)
* Fix missing react in create-react-class

refs #9689

* 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

In this case I will clean it up afterwards.

**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

* Remove fiber specific fixures

This already was merged (https://github.com/facebook/react/pull/9902)
but I wanted to do manual testing and needed the change locally.

**what is the change?:**
Remove 'fiber-debugger', 'fiber-triangle', and 'packaging' from
'fixtures' directory.

**why make this change?:**
These were not meant to be included on this branch and cause the
'build-all.js' script to throw.

**test plan:**
`cd ./fixtures && node ./build-all.js`

* 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

* Undo modifications that add 'create-react-class' to fixtures

**what is the change?:**
In the previous commit we modified the fixtures to test
'create-react-class' manually, and this puts them all back.

**why make this change?:**
This will be useful for cherry-picking onto branches where we used the
previous commit for testing purposes

**test plan:**
`cd fixtures && node ./build-all.js` and open the fixtures

* remove stray console.log
2017-06-10 10:32:49 -07:00
Dan Abramov 80b862395d Fixes for 15.5 addons (#9385)
* 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
2017-04-09 04:01:35 +01:00
Brian Vaughn f42f38e1ba Renamed react-create-class to create-react-class and fixed up tests to run in addons folder 2017-03-31 14:50:24 -07:00