Summary:
Putting this up as request for comments.
The PR adds [transform-react-jsx-source](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source) to the list of plugins that come by default with the `react-native` preset. It will enable the use of a bunch of really cool tooling around JSX, however those are generally useful only in development mode. Is changing `react-native` preset the right thing to do in this case? Is there a way to enable this transform only in DEV? Should I add this somewhere else?
Closes https://github.com/facebook/react-native/pull/6351
Differential Revision: D3302906
Pulled By: frantic
fbshipit-source-id: 012d3a4142168f9f90d30d1686115d4dc3996eb9
Summary:
The babel plugin transform-es2015-constants was replaced by check-es2015-constants.
References:
T2970
rBW0a3b3b03dbcfc8d1e809a0eaf6270eec8de80763
T3053
This patch updates the babel preset to use check-es2015-constants which should be more future-proof and will receive bug fixes.
Closes https://github.com/facebook/react-native/pull/6943
Reviewed By: davidaurelio
Differential Revision: D3189222
Pulled By: bestander
fb-gh-sync-id: a5ec23e297e1d3591d51641dd567049f4310b107
fbshipit-source-id: a5ec23e297e1d3591d51641dd567049f4310b107
Summary:
This separates the babel config of the local-cli and the packager from the one used by the transforms of the packager since it doesn't run in the same environment and the local-cli/packager doesn't require react specific transforms and runs in node 4 so we can also avoid some es2015 transforms that node already supports.
I had to move the code in cli.js so it can still run in node 0.12 that doesn't support `const` since it is no longer transformed.
**Test plan**
Run the local-cli on node 0.12 and there should be a message saying that it requires at least node 4.
Run the local-cli on node 4 and 5 and everything should work the same as before.
I was also hoping for some perf gains but there was nothing noticeable. I did benchmark the babel-register call and it stayed pretty much the same. As for runtime performance it can help if there are optimisations for es2015 features in node.
Closes https://github.com/facebook/react-native/pull/6155
Differential Revision: D3242754
Pulled By: eczarny
fb-gh-sync-id: 6cd349e284b7d92a1b2cc8b5c0e26adbfb0d9a2f
fbshipit-source-id: 6cd349e284b7d92a1b2cc8b5c0e26adbfb0d9a2f
Summary:
This separates the babel config of the local-cli and the packager from the one used by the transforms of the packager since it doesn't run in the same environment and the local-cli/packager doesn't require react specific transforms and runs in node 4 so we can also avoid some es2015 transforms that node already supports.
I had to move the code in cli.js so it can still run in node 0.12 that doesn't support `const` since it is no longer transformed.
**Test plan**
Run the local-cli on node 0.12 and there should be a message saying that it requires at least node 4.
Run the local-cli on node 4 and 5 and everything should work the same as before.
I was also hoping for some perf gains but there was nothing noticeable. I did benchmark the babel-register call and it stayed pretty much the same. As for runtime performance it can help if there are optimisations for es2015 features in node.
Closes https://github.com/facebook/react-native/pull/6155
Differential Revision: D3242754
Pulled By: davidaurelio
fb-gh-sync-id: 02880c841c10562d5f107e1c975d668e55cc619f
fbshipit-source-id: 02880c841c10562d5f107e1c975d668e55cc619f
Summary:
react-native is about to do a branch cut for the next stable release. We want
this version to use a stable release of react so we released one.
This should be the same as the previous alpha. The is mostly changes to DOM / testing and not RN:
https://github.com/facebook/react/commits/15.0.2-dev
AFAIK there are no behavior changes to RN.
I had to add ReactPropTransferer from downstream since this moved out of React Core and into www.
Reviewed By: zpao
Differential Revision: D3245046
fb-gh-sync-id: 7e460315699fd5bff36d89751ce94edb75dd4733
fbshipit-source-id: 7e460315699fd5bff36d89751ce94edb75dd4733
Summary: This upgrades to node-haste@2.10.0 and allows to expose folders as additional node modules from rn-cli.config.js
Reviewed By: bestander
Differential Revision: D3232595
fb-gh-sync-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59
fbshipit-source-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59
Summary:HMR e2e test red-screened because of the wrong path to react.
**Test plan (required)**
Make sure e2e tests pass
Closes https://github.com/facebook/react-native/pull/7209
Reviewed By: mkonicek
Differential Revision: D3218896
Pulled By: bestander
fb-gh-sync-id: 8c5c4ceda34bd2d273e9de16ed670592d1fde3b9
fbshipit-source-id: 8c5c4ceda34bd2d273e9de16ed670592d1fde3b9
Summary:Adding the react native renderer dependency and various fixes to support React 15.
Don't use dispatchID for touchableHandleResponderGrant
This callback argument was removed because "IDs" no longer exist. Instead, we'll
use the tag from the event target.
The corresponding PR on React Core is: https://github.com/facebook/react/pull/6338
Reviewed By: spicyj
Differential Revision: D3159788
fb-gh-sync-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9
fbshipit-source-id: 60e5cd2aa0af69d83fcdac3dfde0a85a748cb7b9
Summary:Fixes an issue where if you implement `renderScrollComponent` and have a `ref` callback on the returned element, the ref used to be clobbered by the ref that ListView adds to the element.
This is accomplished by converting the ref from a legacy string-based ref to a callback-based ref, and then using `cloneReferencedElement`, which is a simple utility to compose callback refs.
Closes https://github.com/facebook/react-native/pull/6441
Differential Revision: D3064250
Pulled By: mkonicek
fb-gh-sync-id: 2d55d04e2144a1cc08900a57a1fc0dab07c87eea
fbshipit-source-id: 2d55d04e2144a1cc08900a57a1fc0dab07c87eea
Summary:In https://github.com/facebook/react-native/pull/5241 ide updated the version number to be a fake one so that people wouldn't send in PRs just bumping the version.
Unfortunately, this leads to compatibility issues when developing against `master` with 3rd-party components that declare React Native as a `peerDependency`. For example, I'm using [react-native-orientation](https://github.com/yamill/react-native-orientation) which has a peerDependency of `"react-native": ">=0.5"`.
I see a few ways to deal with this:
1. Only develop against the releases on npm, not git snapshots.
2. Ask ecosystem projects to not include a minimum version of `react-native` in their peerDependencies.
3. Track the RN release numbers in the git repository (eg it would be 0.19 right now).
4. Make the release number on master huge (1000 in this PR) so it's obviously a fake number but will still comply with >= checks.
I don't think option 2 is good because it's reasonable for a package author to want to specify a minimum R
Closes https://github.com/facebook/react-native/pull/5556
Differential Revision: D3110274
fb-gh-sync-id: 8638157d44ee99945337fbf585936b50699f0341
fbshipit-source-id: 8638157d44ee99945337fbf585936b50699f0341
Summary:The goal is to minimize the number of files we need to bootstrap. This allows us to make the upgrade process smoother for everyone.
If someone needs to customize the file, we already provide some config options. The ability to copy the file and modify it is always there for those few who need it.
**Test plan**
Generate a new project with the updated template. The app should build and run fine both in debug and production mode.
Related #6292
Closes https://github.com/facebook/react-native/pull/6610
Differential Revision: D3109099
Pulled By: foghina
fb-gh-sync-id: 13fc89e60daed30bf6349e532a140c1b6f8f053a
fbshipit-source-id: 13fc89e60daed30bf6349e532a140c1b6f8f053a
Summary:Tests seem to be broken on CI due to failing dependency of `babel-eslint` on `eslint` < `2.0.0`.
cc bestander
Closes https://github.com/facebook/react-native/pull/6669
Differential Revision: D3102085
fb-gh-sync-id: a9fe36725aac293fbe60f282342297f776d715b2
fbshipit-source-id: a9fe36725aac293fbe60f282342297f776d715b2
Summary:This change adds the `flow/` folder to the generated `.flowconfig` in new/upgraded projects. The absence of this folder was causing flow bugs to appear in projects consuming react-native that weren't visible in react-native itself. By including the same definition in consuming projects these errors disappear. Fixes https://github.com/facebook/react-native/issues/6428.
**Test plan (required)**
Tested `react-native upgrade` with this change and ensured that the generated `.flowconfig` works and didn't throw flow errors.
Closes https://github.com/facebook/react-native/pull/6430
Differential Revision: D3071701
fb-gh-sync-id: f28f4d8f7e63669386766b6f226144adeda32c85
shipit-source-id: f28f4d8f7e63669386766b6f226144adeda32c85
Summary:- lint bot is now managed by Circle CI
- checked that flow and lint errors are caught both by bot and CI
- flow fix for npm 3
- Travis is now using npm 2 and Circle CI npm 3
- Refactored Travis script to be able to be able to fail on multiple lines
Closes https://github.com/facebook/react-native/pull/6508
Differential Revision: D3069500
Pulled By: davidaurelio
fb-gh-sync-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
shipit-source-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
Summary:Changing the order of transformation and extraction of dependencies made the order of modules dependent on the time when the worker pool returns a result.
node-haste v2.9.1 addresses this issue and makes the order of dependencies deterministic.
This also bumps the packager versions to enforce cache invalidation.
Reviewed By: martinbigio
Differential Revision: D3065063
fb-gh-sync-id: 1d45b066e45c3f64092f779c3fce3becf6739409
shipit-source-id: 1d45b066e45c3f64092f779c3fce3becf6739409
Summary:This work allows automated release deployment.
Previous semi-automation lived in release.sh and I split it into two pieces:
- test-manual-e2e.sh - that just tests that current commit is buildable and makes a quick e2e installation for manual testing
- publish-npm.js - that makes publish based on what current branch and tags are on commit that is tested/deployed by CI
This simplified `Releases.md` guide and requires you to just run
```
git checkout -b 0.22-stable
git tag v0.22.0-rc
git push origin 0.22-stable --tags
```
to have a successful npm release.
Closes https://github.com/facebook/react-native/pull/6453
Reviewed By: mkonicek
Differential Revision: D3047938
Pulled By: bestander
fb-gh-sync-id: dbebf4c3a0bc2c2a0ef75c54595ab5654f91b8ea
shipit-source-id: dbebf4c3a0bc2c2a0ef75c54595ab5654f91b8ea
Summary:This is the last bits needed to fix Windows compatibility on master, most of the work was done in node-haste.
**Test plan**
Run npm test
Run the packager using Windows and Mac
cc cpojer davidaurelio
Closes https://github.com/facebook/react-native/pull/6260
Reviewed By: dmmiller, bestander
Differential Revision: D3005397
Pulled By: davidaurelio
fb-gh-sync-id: e16847808ebfa8b234315b2093dba204c9c1e869
shipit-source-id: e16847808ebfa8b234315b2093dba204c9c1e869
Summary:If website has node_modules installed `npm tests`
**Test plan (required)**
```
cd website && npm install
cd .. && npm test
```
Before this fix we see this error:
Error: Failed to build DependencyGraph: providesModule naming collision:
Duplicate module name: ViewportMetrics
Paths: react-native/node_modules/react/lib/ViewportMetrics.js collides with react-native/website/node_modules/react/lib/ViewportMetrics.js
Closes https://github.com/facebook/react-native/pull/6170
Differential Revision: D3001147
Pulled By: bestander
fb-gh-sync-id: a040edf097183e6899c0ff49785ff36bd465eb61
shipit-source-id: a040edf097183e6899c0ff49785ff36bd465eb61