mirror of
https://github.com/facebook/react.git
synced 2026-02-26 05:45:14 +00:00
* Add manual build fixtures * Inject ReactDOM into ReactWithAddons from ReactWithAddons We used to read ReactDOM as a global inside ReactAddonsDOMDependenciesUMDShim. This didn't work in AMD environments such as RequireJS and SystemJS. Instead, I changed it so that ReactDOM gets injected into ReactWithAddons by ReactDOM itself. This way we don't have to try to require it (which wouldn't work because AMD doesn't handle circular dependencies well). This means you have to load ReactDOM first before using ReactDOM-dependent addons, but this was already the case before. This commit makes all build fixtures pass. * Memoize ReactDOM to avoid going into require on every access * Add Brunch fixture * Inline requires to work around Brunch bug See #8556 and https://github.com/brunch/brunch/issues/1591#issuecomment-270742503 for context. This appears to be a Brunch bug but we can keep a temporary fix until the next major.
Manual Testing Fixtures
This folder exists for React contributors only.
If you use React you don't need to worry about it.
These fixtures verify that the built React distributions are usable in different environments.
They are not running automatically. (At least not yet, feel free to contribute to automate them.)
Run them when you make changes to how we package React, ReactDOM, and addons.
How to Run
First, build React and the fixtures:
cd react
npm run build
cd fixtures
node build-all.js
Then run a local server at the root of the repo, e.g.
npm i -g pushstate-server
cd ..
pushstate-server .
(Too complicated? Send a PR to simplify this :-).
Then open the corresponding URLs, for example:
open http://localhost:9000/fixtures/globals.html
open http://localhost:9000/fixtures/requirejs.html
open http://localhost:9000/fixtures/systemjs.html
open http://localhost:9000/fixtures/browserify/index.html
open http://localhost:9000/fixtures/brunch/index.html
open http://localhost:9000/fixtures/rjs/index.html
open http://localhost:9000/fixtures/systemjs-builder/index.html
open http://localhost:9000/fixtures/webpack/index.html
open http://localhost:9000/fixtures/webpack-alias/index.html
You should see two things:
- "Hello World" fading in with an animation.
- No errors in the console.