Commit Graph

5 Commits

Author SHA1 Message Date
Martin Bigio 4133de04d7 Use full path for react-native on HMR config
Summary:Fixes https://github.com/facebook/react-native/issues/6731
Closes https://github.com/facebook/react-native/pull/6748

Differential Revision: D3126410

Pulled By: martinbigio

fb-gh-sync-id: fc462ec82e72914d13341a4543212c017bd3838c
fbshipit-source-id: fc462ec82e72914d13341a4543212c017bd3838c
2016-04-01 08:08:27 -07:00
Martin Bigio 51b5423fd5 Use `react-native` instead of `React` on hmr config
Summary:Check https://github.com/facebook/react-native/issues/6640 for details
Closes https://github.com/facebook/react-native/pull/6696

Differential Revision: D3109128

fb-gh-sync-id: b80ff44f0dbc063870dc1dc7de9bf3c814ac9a12
fbshipit-source-id: b80ff44f0dbc063870dc1dc7de9bf3c814ac9a12
2016-03-29 06:35:21 -07:00
Martín Bigio 3a1634ec7b Fix HMR preset config path
Reviewed By: davidaurelio

Differential Revision: D3077935

fb-gh-sync-id: b1e89f9e34a505f0611cf8991afe4224d5a6f05d
shipit-source-id: b1e89f9e34a505f0611cf8991afe4224d5a6f05d
2016-03-21 15:45:27 -07:00
David Aurelio a72c2950d6 babel-preset-react-native: Make sure that `react-transform-hmr/lib/index.js` is included correctly for every module in the bundle
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
2016-03-01 03:22:32 -08:00
Adam Miskiewicz e6cb02d61a Use "babel-preset-react-native"
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
2016-02-03 08:15:32 -08:00