Summary:This imports `react-transform-hmr/lib/index.js` with a relative path from every module, to make sure we don’t rely on the current (broken) behaviour.
It works now, because:
- the dependency is added by a transform
- we extract dependencies before transforming
- we include `react-transform-hmr/lib/index.js` manually
- packager incorrectly names modules by the name of their package (i.e. packages with multiple versions overwrite each other)
This blocks transforming before extracting dependencies, switching to numeric module IDs, and unbundling/random access bundles.
Reviewed By: bestander
Differential Revision: D2994024
fb-gh-sync-id: 23c56397b768775ff56e3d6924f50a9e39e8ce8c
shipit-source-id: 23c56397b768775ff56e3d6924f50a9e39e8ce8c
Summary:
Turns out, even after discussion that was had in https://github.com/facebook/react-native/pull/5294#issuecomment-174397103, we really do need this transform.
I've just included it in the preset...let me know if you all would rather publish to npm.
The actual reason why this is necessary is because in the latest sync from FB, fbjs was updated to use the `Symbol.iterator` express in it's isEmpty function: 064a484e18
We use this in RN in the ListView...and this change (once #5084 is merged) will cause ListView to break on older JSC context's.
This resolves that, and is probably something we should have had all along.
Closes https://github.com/facebook/react-native/pull/5824
Reviewed By: svcscm
Differential Revision: D2913315
Pulled By: vjeux
fb-gh-sync-id: abaf484a9431b3111e8118d01db8d2c0d2dd73ca
shipit-source-id: abaf484a9431b3111e8118d01db8d2c0d2dd73ca
Summary:
Rather than specifying Babel plugins in the `.babelrc` packaged with react-native, leverage a Babel preset to define the plugins (https://github.com/exponentjs/babel-preset-react-native).
This allows for a much better user experience for those who want (or need) to override options in their project's `.babelrc`.
Prior to this PR, if a user wanted to use a custom babel-plugin (or a custom set of babel plugins), they'd have either 1) manually override the `.babelrc` in the react-packager directory (or fork RN), or 2) specify a custom transformer to use when running the packager that loaded their own `.babelrc`. Note - the custom transformer was necessary because without it, RN's `.babelrc` options would supersede the options defined in the project's `.babelrc`...potentially causing issues with plugin ordering.
This PR makes the transformer check for the existence of a project-level `.babelrc`, and if it it's there, it _doesn't_ use the react-native `.babelrc`. This prevents any oddities with Babel plug
Closes https://github.com/facebook/react-native/pull/5214
Reviewed By: davidaurelio
Differential Revision: D2881814
Pulled By: martinbigio
fb-gh-sync-id: 4168144b7a365fae62bbeed094d8a03a48b4798c