summaryrefslogtreecommitdiffstats
path: root/devtools/client/shared/vendor/REACT_UPGRADING
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /devtools/client/shared/vendor/REACT_UPGRADING
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/shared/vendor/REACT_UPGRADING')
-rw-r--r--devtools/client/shared/vendor/REACT_UPGRADING54
1 files changed, 54 insertions, 0 deletions
diff --git a/devtools/client/shared/vendor/REACT_UPGRADING b/devtools/client/shared/vendor/REACT_UPGRADING
new file mode 100644
index 000000000..a82b4fa8c
--- /dev/null
+++ b/devtools/client/shared/vendor/REACT_UPGRADING
@@ -0,0 +1,54 @@
+We use a version of React that has a few minor tweaks. We want to use
+an un-minified production version anyway, and because of all of this
+you need to build React yourself to upgrade it for devtools.
+
+First, clone the repo and get ready to build it. Replace `<version>`
+with the version tag you are targetting:
+
+* git clone https://github.com/facebook/react.git
+* cd react
+* git checkout <version>
+* In `src/addons/ReactWithAddons.js`, move the
+ `React.addons.TestUtils = ...` line outside of the `if`
+ block to force it be include in the production build
+
+Next, build React:
+
+* npm install
+* grunt build
+
+Unfortunately, you need to manually patch the generated JS file. We
+need to force React to always create HTML elements, and we do this by
+changing all `document.createElement` calls to `createElementNS`. It's
+much easier to do this on the generated file to make sure you update
+all dependencies as well.
+
+Open `build/react-with-addons.js` and search for all
+`document.createElement` calls and replace them with
+`document.createElementNS('http://www.w3.org/1999/xhtml', ...)`. Note
+that some code is `ownerDocument.createElement` so don't do a blind
+search/replace. There is only about ~12 places to change.
+
+Now move into our repo (note the naming of `react-dev.js`, it's the dev version):
+
+* cp build/react-with-addons.js <gecko-dev>/devtools/client/shared/vendor/react-dev.js
+
+Now we need to generate a production version of React:
+
+* NODE_ENV=production grunt build
+
+Unfortunately, you need to manually replace all the `createElement`
+calls in this version again. We know this is not ideal but WE NEED TO
+MOVE OFF XUL and we don't need to do this anymore once that happens.
+
+After patching `build/react-with-addons.js` again, copy the production
+version over:
+
+* cp build/react-with-addons.js <gecko-dev>/devtools/client/shared/vendor/react.js
+
+You also need to copy the ReactDOM package. It requires React, so
+right now we are just manually changing the path from `react` to
+`devtools/client/shared/vendor/react`.
+
+* cp build/react-dom.js <gecko-dev>/devtools/client/shared/vendor/react-dom.js
+* (change `require('react')` at the top of the file to the right path)