Commit Graph

520 Commits

Author SHA1 Message Date
Eli Perkins 1b0d8ac43b Use appropriate capitalization of Xcode
Summary:
[Xcode](https://developer.apple.com/xcode/) is spelled with a lowercase `c`. 😄

**Test plan (required)**

ctrl-f project for `XCode`, case sensitive, find-and-replace with `Xcode`.

Make sure tests pass on both Travis and Circle CI.
Closes https://github.com/facebook/react-native/pull/12572

Differential Revision: D4622075

Pulled By: hramos

fbshipit-source-id: d64f0b10254cd624a71844ebaefa6fc29bc1ea57
2017-02-27 22:47:14 -08:00
Bhuwan Khattar 234f4f538d Introduce HasteImpl
Summary:
Similar to https://github.com/facebook/jest/pull/2877, this introduces an optional config `HasteImpl` of type `{getHasteName(filePath: string): (string|void)}` that returns the haste name for a module at filePath if it is a haste module or undefined otherwise.

This allows us to inject a custom implementation of haste's module id resolution rather than only relying on `providesModule` annotations

Reviewed By: davidaurelio

Differential Revision: D4589372

fbshipit-source-id: 4d1983dfbf09c9d67faf725e86ae86ab42433b7d
2017-02-27 14:04:58 -08:00
Martin Konicek 17c175a149 CLI: Add support for templates fetched from npm
Summary:
This PR allows anyone to publish templates for React Native.

It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:
https://github.com/mkonicek/AppTemplateFeedback/issues/1

I published a sample template [react-native-template-demo](https://www.npmjs.com/package/react-native-template-demo).

(GitHub: https://github.com/mkonicek/react-native-template-demo)

With this PR anyone can then use that template:

`react-native init MyApp --template demo`

The convention is: if someone publishes an npm package called `react-native-template-foo`, people can use it by running `react-native init MyApp --template foo`.

Use a template called `react-native-template-demo` from npm:

`react-native init MyApp --template demo`

Use a local template:

`react-native init MyApp --template file:///path_to/react-native-template-dem
Closes https://github.com/facebook/react-native/pull/12548

Differential Revision: D4620567

Pulled By: mkonicek

fbshipit-source-id: bb40d457a7fec28edb577f08137e73241072de3a
2017-02-27 14:04:57 -08:00
Michael Bolin 48cb932c6e Apply auto-formatter for BUCK files in fbandroid.
fbshipit-source-id: 278ce6f67f5df830b2218e3aca69be103d3c56a6
2017-02-27 14:04:56 -08:00
Gabe Levi 4a60be62bc Deploy v0.40.0
Reviewed By: yungsters

Differential Revision: D4612331

fbshipit-source-id: 3eaa2f99d3181227166064cbee29b9245401a775
2017-02-24 12:45:56 -08:00
Adam Miskiewicz b0bdbeb5c3 Fix flowconfig in starter project
Summary:
In the .flowconfig in the starter project, we're missing the correct suppression comments.

This should fix the flow issues in the e2e tests.
Closes https://github.com/facebook/react-native/pull/12533

Differential Revision: D4603657

Pulled By: ericvicenti

fbshipit-source-id: a07ec947d3ba746279c58e2d95c2293f54e06933
2017-02-22 19:52:08 -08:00
Martin Konicek df008a31e4 CLI template: Bump version of react-navigation dependency
Summary: Beta 1 is old, bump to the latest version.

Reviewed By: mkonicek

Differential Revision:
D4601561
Ninja: OSS only

fbshipit-source-id: f0aa7aa861dc2a2cb40ac171259c69b7d47d0dc4
2017-02-22 15:31:07 -08:00
Lukas Piatkowski a2addbd932 BREAKING: Change the js1 - packager - RN App protocol to version 2
Reviewed By: cwdick

Differential Revision: D4551991

fbshipit-source-id: 395c38ee5c71ddc24d8743e7ec90cc89de087503
2017-02-16 04:30:00 -08:00
Michael Bolin f9df89ac95 Fix copy/paste bug in open source BUCK file for React Native.
Reviewed By: bestander, lacker

Differential Revision: D4562337

fbshipit-source-id: 2ca24344435b650a9c740eba9b196e70015b5cdb
2017-02-15 09:46:24 -08:00
Moses Gunesch c6c1c02b75 Don't add duplicate font entries to plist during link (iOS)
Summary:
**Test plan**

1. Add fonts using `react-native link` and a `"rnpm"` config in package.json
2. Manually delete one or more fonts from Xcode's Resources folder using Remove References option
3. Run `react-native link` again

With the patch in this PR, the plist will not accidentally get populated with duplicate entries.
Closes https://github.com/facebook/react-native/pull/12048

Differential Revision: D4560432

fbshipit-source-id: aba3733acfd5373f8d654406b06b8338b137bc07
2017-02-14 17:16:54 -08:00
Dan Abramov 934cd82941 Move DevTools integration into its own repo
Summary:
The way React DevTools integration was set up in RN was not entirely supported by the React team, and we had to disable it in c3b25c9059 so that we can move forward with enabling Fiber support in React Native.

Here, I am moving the DevTools client setup from RN repo to [React DevTools repo](https://github.com/facebook/react-devtools/blob/master/packages/react-devtools-core/README.md#requirereact-devtools-coreconnecttodevtoolsoptions) so that we can keep it in sync with the rest of React DevTools. This is also a part of a larger effort to consolidate DevTools code (https://github.com/facebook/react-devtools/issues/489). It allows us to remove the double injection of the hook, an lets us replace the `eval` hack with a regular dependency. The implementation [lives here now](https://github.com/facebook/react-devtools/blob/master/packages/react-devtools-core/src/backend.js).

This change re-enables Nuclide Inspector with React Native Stack reconciler and prepares it for compatibi
Closes https://github.com/facebook/react-native/pull/12316

Reviewed By: zertosh

Differential Revision: D4545322

Pulled By: gaearon

fbshipit-source-id: ab949916c1a92c6b41cd41e7e1edf9697a71de2e
2017-02-14 14:03:46 -08:00
Lukas Piatkowski d8f48d1b51 Refactor the packager server for further protocol changes
Reviewed By: cwdick

Differential Revision: D4543321

fbshipit-source-id: f7d5823b0d340f8ca17b3dd6caf4e158fa918bcf
2017-02-14 09:45:57 -08:00
Michael Bolin 6a4f7c0993 Eliminate the need for `import re` in a BUCK file.
Reviewed By: mzlee

Differential Revision: D4550304

fbshipit-source-id: 59a101a35ea33aa8043046f64b675fab0f6f889a
2017-02-13 22:32:37 -08:00
Jeff Morrison 64f3688473 fbobjc deploy
Reviewed By: gabelevi

Differential Revision: D4544571

fbshipit-source-id: 0b0776d91dea647b0b84a9ca400019aef49963f4
2017-02-13 10:30:39 -08:00
Max Sherman a97f665629 Guard against small window where sending a message can crash the packager
Reviewed By: davidaurelio

Differential Revision: D4541015

fbshipit-source-id: 025039c593f7f0f6e40f5fd38ccc07e50f7d04b0
2017-02-10 09:30:08 -08:00
Alex Kotliarskyi a6e4977662 Don't include assets that are not used on the platform
Reviewed By: fkgozali

Differential Revision: D4534622

fbshipit-source-id: 7c6024177cca4c69cb5631f4a7b0f00315f7fca7
2017-02-09 11:15:25 -08:00
Martin Konicek ab81db65c5 CLI: Add README to app template, lint
Reviewed By: mkonicek

Differential Revision:
D4522116
Ninja: oss only

fbshipit-source-id: d17e0e8badcfe97eaea092e5d5274e02904a534d
2017-02-07 10:32:29 -08:00
Martin Konicek 4551e9347a CLI: Update Navigation app template
Summary:
Update the template that will be used by `react-native init --template navigation`. The goal is to make it easier for people to get started by demonstrating a few very basic concepts such as navigation, lists and text input.

**Test plan (required)**

<img src="https://cloud.githubusercontent.com/assets/346214/22697898/ced66f52-ed4a-11e6-9b90-df6daef43199.gif" alt="Android Example" height="800" style="float: left"/>

<img src="https://cloud.githubusercontent.com/assets/346214/22697901/cfeab3e4-ed4a-11e6-8552-d76585317ac2.gif" alt="iOS Example" height="800"/>
Closes https://github.com/facebook/react-native/pull/12260

Differential Revision: D4521758

Pulled By: mkonicek

fbshipit-source-id: d7d9e481dd3373917ac68ec9169b9ac3267547a9
2017-02-07 09:16:08 -08:00
Martin Konicek a54d449e94 CLI: Add support for project templates
Summary:
Currently it is not trivial for people to get started with React Native. `react-native init MyApp` just creates a simple app with a single screen. People have to spend time figuring out how to add more screens, or how to accomplish very basic tasks such as rendering a list of data or handling text input.

Let's add an option: `react-native init --template navigation` - this creates a "starter" app which can be easily tweaked into the actual app the person wants to build.

**Test plan (required)**

- Checked that 'react-native init MyApp' still works as before:

<img width="487" alt="screenshot 2017-02-02 16 56 28" src="https://cloud.githubusercontent.com/assets/346214/22559344/b2348ebe-e968-11e6-9032-d1c33216f490.png">

<img width="603" alt="screenshot 2017-02-02 16 58 04" src="https://cloud.githubusercontent.com/assets/346214/22559370/c96a2ca6-e968-11e6-91f7-7afb967920fc.png">

- Ran 'react-native init MyNavApp --template'. This prints the available templates:

```
$ react-native init MyNavApp
Closes https://github.com/facebook/react-native/pull/12170

Differential Revision: D4516241

Pulled By: mkonicek

fbshipit-source-id: 8ac081157919872e92947ed64ea64fb48078614d
2017-02-06 12:31:25 -08:00
Eric Vicenti bc74dd1e14 Eject CLI command to re-create native folders
Summary:
The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app.

Now it will be possible to:

1. Remove the native iOS or Android folders
2. Create an `app.json` for your app, with at least a `name` and `displayName`
3. Run `react-native eject`, and the native code for your app will be generated

Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app

For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control.

Eject step tested in RN app by deleting native folders.

mkonicek, what is the best way to test `react-native init`?

As follow-up items, we can enable the following:

- Configuring app icon and launch screen from the `app.json`
- Automatically run `react-native link` for native libraries
- A
Closes https://github.com/facebook/react-native/pull/12162

Differential Revision: D4509138

Pulled By: ericvicenti

fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
2017-02-03 12:58:46 -08:00
Mike Grabowski 2f5556df39 Remove build artifacts
Summary:
Ignores `bundle.js` that is a webpack bundle and got most likely accidentally released. Already cherry-picked to 0.42

Fixes #12183
Closes https://github.com/facebook/react-native/pull/12185

Differential Revision: D4507535

Pulled By: mkonicek

fbshipit-source-id: 2ab404534b345cf531f408b654c34a30abd01458
2017-02-03 06:58:35 -08:00
Christoph Pojer a2c84d14ce Remove `react-packager` indirection.
Summary:
This moves the `src` directory one level up and removes the `react-packager` folder. Personally, I always disliked this indirection. I'm reorganizing some things in RNP, so this seems to make sense.

Not sure if I forgot to update any paths. Can anyone advice if there are more places that need change?

Reviewed By: jeanlauliac

Differential Revision: D4487867

fbshipit-source-id: d63f9c79d6238300df9632d2e6a4e6a4196d5ccb
2017-02-02 05:44:15 -08:00
Jirat K 1c249e4804 Use Yarn for Install/Uninstall CLI if available
Summary:
Make `react-native install` and `uninstall` cli to use yarn if available (fixes #11122)

**Test plan Yarn**

1. Publish to Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
2. react-native init AwesomeApp
3. react-native install react-native-fit-image
4. react-native uninstall react-native-fit-image

**Test plan NPM**
1. Publish to Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
2. react-native init AwesomeAppNPM --npm
3. react-native install react-native-fit-image
4. react-native uninstall react-native-fit-image

**output (yarn.lock)**

```
> react-native install react-native-fit-image
yarn add v0.16.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency
└─ react-native-fit-image@1.4.6
  Done in 4.11s.
rnpm-install info Module react-native-fit-image has been successfully
Closes https://github.com/facebook/react-native/pull/11174

Differential Revision: D4441872

fbshipit-source-id: 05bd30e1ad14bdbe861259c88e1f18df77cfa54f
2017-02-02 05:13:33 -08:00
Pavlos Vinieratos 5e6f39aace allow for dark background in the debugger view
Summary:
I prefer a darker environment when coding, and having the Chrome window be dark except the part that I cannot hide, is making my eyes hurt. This is for the people that prefer the darker color scheme when developing.
Closes https://github.com/facebook/react-native/pull/11878

Differential Revision: D4494415

Pulled By: mkonicek

fbshipit-source-id: 423473ec073e6ddd0d14322c22ee37abed1c55bc
2017-02-02 04:43:51 -08:00
Peggy Rayzis a45246e354 Fix .gitignore of HelloWorld template to commit third party JARs
Summary:
Hi RN team! Thanks for all that you do. 🎉

**Motivation:**
I noticed in the [Buck docs](https://buckbuild.com/article/exopackage.html) (scroll down to Step 2) that it expects third party JARs to live in version control. Currently, the HelloWorld template ignores these dependencies from version control, which is a bit confusing.
Closes https://github.com/facebook/react-native/pull/11738

Differential Revision: D4494423

Pulled By: mkonicek

fbshipit-source-id: 37b946ad9c30af2b47b409bae6830bba5917491a
2017-02-02 04:13:59 -08:00
Martin Konicek 3ee3d2b4b2 CLI: Add basic Navigation template (Chat)
Summary:
Basic template using 'react-navigation' to make it easy to get started.

Not duplicating all the files in `android` and `ios` folders. These will be taken from the `HelloWorld` template. Let's not duplicate all of these files (it's a lot and they are large, especially the Xcode projects).

**Test plan (required)**

The app works locally. This PR is just a preparation for a next PR that will add support for 'react-native init --template Navigation'. Will have a proper test plan there.
Closes https://github.com/facebook/react-native/pull/12153

Differential Revision: D4494776

Pulled By: mkonicek

fbshipit-source-id: b43eafd7a1424477f9493a3eb4083ba4dd3d3846
2017-02-02 03:28:35 -08:00
Martin Konicek e3d4ace3ae BREAKING: [CLI] New app template: Resize UI when keyboard is shown on Android
Summary:
When building the Chat example for react-navigation, I realized the default Android behavior doesn't actually work:

<img width="868" alt="screenshot 2017-02-01 15 15 25" src="https://cloud.githubusercontent.com/assets/346214/22512559/518e3bf0-e891-11e6-9a86-2dafac5b250f.png">

(From https://developer.android.com/guide/topics/manifest/activity-element.html)

In my app there's a `<ListView>` and a `<TextInput>` below it. Without this PR the UI pans which is a very bad user experience.

Keyboard is hidden:

<img width="437" alt="screenshot 2017-02-01 15 21 15" src="https://cloud.githubusercontent.com/assets/346214/22512814/23fc93d4-e892-11e6-9e45-94041dbe8eba.png">

Keyboard is shown:

<img width="439" alt="screenshot 2017-02-01 15 26 56" src="https://cloud.githubusercontent.com/assets/346214/22513062/e4e1835c-e892-11e6-93b7-fe5616135b91.png">

 ---

Let's use "adjustResize", it seems to be a reasonable default in most cases and people can always change the constant in their AndroidManifest.xml
Closes https://github.com/facebook/react-native/pull/12154

Differential Revision: D4496428

fbshipit-source-id: c300ebe55bd93f8b243e0d7d0d6a132bc3a5a1c1
2017-02-01 12:58:28 -08:00
Charles Dick 76e3d45c34 Add cell size to JSC heap capture visualization
Reviewed By: bnham

Differential Revision: D4469000

fbshipit-source-id: 3e572bb7bdd83f79009d2059d543e03e6a57bba0
2017-02-01 10:58:30 -08:00
John Shelley b5421410ba Android - Update Gradle to 2.2.3
Summary:
Currently React Native's local cli is a bit behind in its android gradle plugin version. This PR is an attempt to update the local cli, to allow for better support moving forward.
* Updates the gradle plugin version to 2.2.3
* Updates the gradle wrapper to 2.14.1
* Uses the `all` for the project wrapper to include sources for API completion

**Test plan (required)**

* Perform all required steps here: https://github.com/facebook/react-native/tree/master/react-native-cli
   * Run the local npm tests and e2e tests (no longer available)
   * Test the local cli by using Sinopia

Make sure tests pass on both Travis and Circle CI.

TO NOTE: In a previous issue (https://github.com/facebook/react-native/issues/11500) I was able to update to 2.2.3 comfortably, however there may be other issue I am not aware of. This PR is intended to start discussion on what it will take to update.
Closes https://github.com/facebook/react-native/pull/11930

Differential Revision: D4489926

Pulled By: mkonicek

fbshipit-source-id: 35ff5ac6b1b8893854538d6b9fe2c2e042ecca9f
2017-01-31 13:13:32 -08:00
rh389 7a4166c31d Deal with 0.38 'FlowFixMe's
Summary:
Largely typing fixes to deal with the glut of new `FlowFixMe` suppressions introduced with flow 0.38 in a4bfac907e

Tested with flow itself. CC gabelevi
Closes https://github.com/facebook/react-native/pull/11985

Differential Revision: D4452045

Pulled By: ericvicenti

fbshipit-source-id: acc46c4c406ae706a679e396be1d40ae2f4ce5a1
2017-01-31 13:13:32 -08:00
Harshil Shah bce6ece5f6 Add symlinks under node_modules as part of projectRoots
Summary:
Support symlinks under `node_modules` for all local-cli commands. PR https://github.com/facebook/react-native/pull/9009 only adds symlink support to the packager.

But other cli commands like `react-native bundle` creates its own instance of packager that doesn't have symlinks as part of its project roots, which results in the bundler breaking since it cannot find modules that you have symlinked.

This change ensures all `local-cli` commands add symlinks to its project roots.

Test plan (required)

1.  Create a symlink in node_modules (for instance use npm/yarn link)
2. Run `react-native bundle`.
Closes https://github.com/facebook/react-native/pull/11810

Differential Revision: D4487741

fbshipit-source-id: 87fe44194134d086dca4eaca99ee5742d6eadb69
2017-01-31 03:43:39 -08:00
Ciprian Pãtru f9c6d47b94 Prevent "/inspector/json" to be repeatedly output to the console
Differential Revision: D4474847

fbshipit-source-id: d14fe55041b7c5c04b4c8e8fce282fd62d694492
2017-01-30 11:13:41 -08:00
Andrew Imm a1cd5e0d05 Use a project's custom platforms when creating a production bundle
Reviewed By: davidaurelio

Differential Revision: D4463579

fbshipit-source-id: 0f1514b25239b2fe62fca6fd02a475db98cff3a8
2017-01-26 16:13:49 -08:00
Christoffer Bo Petersen 4368719476 Remove unused imports
Summary:
When installing template by `react-native init AwesomeProject` and adding checkstyle to the Gradle setup, it will complain about unused imports
Closes https://github.com/facebook/react-native/pull/12076

Differential Revision: D4470930

fbshipit-source-id: 50a105886607fd1d3a458453fa1a844e9746dafa
2017-01-26 14:13:30 -08:00
Alex Kotliarskyi 8b4272b2fd Change favicon depending on the Chrome debugger state
Reviewed By: yungsters

Differential Revision: D4465694

fbshipit-source-id: fc740f176d6e1fe25dfc79c9ccd8a1ea2be35bb3
2017-01-26 11:58:32 -08:00
Jean Lauliac be490d2f0c Backed out changeset 35b573bece59
Reviewed By: davidaurelio

Differential Revision: D4461681

fbshipit-source-id: f5c45f713f2fe68443986a2822aa325b01dd5075
2017-01-26 03:43:33 -08:00
Charles Dick 936c62a265 JSC Heap Capture add other roots to visualization
Reviewed By: amnn

Differential Revision: D4422659

fbshipit-source-id: a32e87d2d39b6ff571f02d613b32db630e5e6de1
2017-01-26 03:28:31 -08:00
Lukas Piatkowski c5f862b913 The jscProfileMiddleware require some FB only modules, so moving to internal
Reviewed By: cwdick

Differential Revision: D4441898

fbshipit-source-id: 0ab5aa4158fccf190e76d3582a8a12d9b1d23fa8
2017-01-25 10:43:54 -08:00
Jing Chen 7cb5b6e523 Revert stacked revisions on packager that causes packager to instacrash
Reviewed By: fkgozali, bestander

Differential Revision: D4456911

fbshipit-source-id: 35b573bece59c59c0700ef2d8ab26c0b7150d3cf
2017-01-24 11:43:36 -08:00
Jean Lauliac ccf94aa65a packager: GlobalTransformCache: remove global variable
Reviewed By: davidaurelio

Differential Revision: D4449333

fbshipit-source-id: b9546b90d2fd5ddca9c1ee2719c6c454b60bdfa4
2017-01-24 03:43:36 -08:00
Janic Duplessis 10a29aa954 Support copy to clipboard on Windows
Summary:
Also fix lint errors about Buffer being undefined by adding env: node to the eslint config for local-cli.

Tested on windows 10.
Closes https://github.com/facebook/react-native/pull/11959

Differential Revision: D4438903

Pulled By: hramos

fbshipit-source-id: 28d5edd662dd1e63dedf1274ff0a21af4df84f5e
2017-01-19 16:28:39 -08:00
Gabe Levi e2ce98b7c6 Fix the suppress comment regex for react_native
Reviewed By: davidaurelio

Differential Revision: D4435640

fbshipit-source-id: c680aee6931979859f04c0dca47037ba6f6cba73
2017-01-19 10:28:28 -08:00
Andres Suarez d4e8b19e71 Enable emoji in flow
Reviewed By: gabelevi

Differential Revision: D4428957

fbshipit-source-id: 487dbbb2512ff9dbd42e37fb81e14dfb8bea301b
2017-01-19 07:43:31 -08:00
Gabe Levi a4bfac907e Deploy v0.38.0
Reviewed By: jeffmo

Differential Revision: D4428858

fbshipit-source-id: 10dc69349a2b563e1fa444a8b0612e3b2d4ccd1c
2017-01-18 11:13:30 -08:00
Lukas Piatkowski bbd5750bb4 Sampling Profiler to return urls that open file in nuclide
Reviewed By: cwdick

Differential Revision: D4422768

fbshipit-source-id: 2e8c4af6e6fae4256fe886b79f5ea6c87986d581
2017-01-18 04:28:38 -08:00
rh389 e0c3d56d3a Fix template release build: Add -ObjC and -lc++ to tests target
Summary:
Fixes https://github.com/facebook/react-native/issues/11861 - the release config is currently broken for projects created by `react-native init` in `master`, 0.40 and 0.39.

I'm still investigating when and how this got broken but this seems to be a clean fix. I've added `-ObjC` as well to match the main target but I'm not sure yet whether that's necessary.

To test:
```
react-native init fooproject --version react-native@rh389/react-native#missinglinkerflags
```
Open in XCode, Edit scheme (⌘<), Change `Build Configuration` to `Release`, build.

Update: The `-lc++` flag became necessary when 33deaad196 landed because of the libstdc++ dependencies of `RCTLog`. Still not sure about `-ObjC`. javache ?
Closes https://github.com/facebook/react-native/pull/11889

Differential Revision: D4421685

Pulled By: javache

fbshipit-source-id: 954edaef773f8cef7b7ad671fa4d1f2bfc2f20f2
2017-01-16 13:13:31 -08:00
Andrew Imm 09a83f976e Allow project-specific config for RN CLI using providesModuleNodeModules
Reviewed By: davidaurelio

Differential Revision: D4409046

fbshipit-source-id: 5af0d08542935a784f4737653ccac49fd7517aff
2017-01-12 21:13:36 -08:00
Mike Grabowski 545072b02d Fully support new import system on iOS
Summary:
A bit late to the party, but upgraded, tests replaced, all green.

Also updated `pbxproj` so that we are testing against React 0.40 init result, not against something old.

To cherry-pick and land once ships.
Closes https://github.com/facebook/react-native/pull/11868

Differential Revision: D4411362

fbshipit-source-id: c485fd76114979d34a7e288bb70e1ecb9b3baf76
2017-01-12 14:58:28 -08:00
David Aurelio 0849f84df2 create better debuggable source maps
Summary:
Introduces a new mechanism to build source maps that allows us to use real mapping segments instead of just mapping line-by-line.

This mechanism is only used when building development bundles to improve the debugging experience in Chrome.

The new mechanism takes advantage of a new feature in babel-generator that exposes raw mapping objects. These raw mapping objects are converted to arrays with 2, 4, or 5 for the most compact representation possible.
We no longer generate a source map for the bundle that maps each line to itself in conjunction with configuring babel generator to retain lines.

Instead, we create a source map with a large mappings object produced from the mappings of each individual file in conjunction with a “carry over” – the number of preceding lines in the bundle.

The implementation makes a couple of assumptions that hold true for babel transform results, e.g. mappings being in the order of the generated code, and that a block of mappings always belongs to the same source file. In addition, the implementation avoids allocation of objects and strings at all costs. All calculations are purely numeric, and base64 vlq produces numeric ascii character codes. These are written to a preallocated buffer objects, which is turned to a string only at the end of the building process. This implementation is ~5x faster than using the source-map library.

In addition to providing development source maps that work better, we can now also produce individual high-quality source maps for production builds and combine them to an “index source map”. This approach is unfeasable for development source maps, because index source map consistently crash Chrome.

Better production source maps are useful to get precise information about source location and symbol names when symbolicating stack traces from crashes in production.

Reviewed By: jeanlauliac

Differential Revision: D4382290

fbshipit-source-id: 365a176fa142729d0a4cef43edeb81084361e54d
2017-01-12 14:28:41 -08:00
Mike Grabowski 4969f26252 Improve `unlink` on rnpm
Summary:
We don't need to look for `thisDependency` as we already have it. Small improvement as I am working on other fixes.
Closes https://github.com/facebook/react-native/pull/11867

Differential Revision: D4411177

fbshipit-source-id: 1413eb5457cb4d7916ead90f438ffe158f644cad
2017-01-12 13:58:34 -08:00