Commit Graph

8795 Commits

Author SHA1 Message Date
Lukas Piatkowski 81b1a2c6a5 Propagate bytecode offset in SamplingProfiler and use it to name unnamed functions
Reviewed By: cwdick

Differential Revision: D4251568

fbshipit-source-id: 2343d8f6a5b2f247a7af1bbd0112bed8edadcbfe
2016-12-01 09:43:37 -08:00
Lukas Piatkowski 48b95f08fb Refactory of SamplingProfiler, CpuProfileGenerator and jscProfilerMiddleware
Reviewed By: cwdick

Differential Revision: D4251541

fbshipit-source-id: ccd221beadd87f6a8cf27a1d68ae06599cf54333
2016-12-01 09:43:37 -08:00
Don Yu 946913e9fa Add in UI Explorer example for showing annotation callouts by default in <MapView>
Reviewed By: martinbigio

Differential Revision: D4253281

fbshipit-source-id: b4bd9fedf7042d3d43d2a50bdb7474caa875781f
2016-12-01 08:58:34 -08:00
Emil Sjolander 8117a029cb Fix error from refactor of setMeasuredDimensionsIfEmptyOrFixedSize
Reviewed By: gkassabli

Differential Revision: D4258254

fbshipit-source-id: e22e36e67260114081e483527fc7ce378f7f0df9
2016-12-01 07:28:30 -08:00
Pieter De Baets 81c8a3f2ea Fix headers for UIExplorerUnitTests
Reviewed By: davidaurelio

Differential Revision: D4258382

fbshipit-source-id: 0538deb409e9dc000a5a339d6d0c76302b52c8d5
2016-12-01 07:13:33 -08:00
Pieter De Baets 0e6895f270 Fix typo
Reviewed By: amnn

Differential Revision: D4258150

fbshipit-source-id: d41c5426b801d32db6099cf8b29596689f369ba6
2016-12-01 06:58:31 -08:00
Nicolas Cuillery a0f3a93f0b Upgrade React and React Native at the same time
Summary:
**Motivation**
As NoelBroda pointed out in https://github.com/facebook/react-native/pull/11104 and https://github.com/facebook/react-native/pull/11123, NPM often produces an unmet peerDependency when upgrading React Native. It causes a failure when running "npm install" with NPM2.

During the git-upgrade, we have to take care of the `react` peerDep: this PR checks if the installed `react` package matches the `react` peerDep of the new `react-native` version. If so, R & RN are upgraded at the same time (in the same `npm install`).

**Test plan**
- Publish `react-native-git-upgrade` to Sinopia,
- Run `react-native-git-upgrade` inside a RN project with version < 0.37,
- Verify that no "unmet peer dependency" warning is displayed
- Open the `package.json` and verify that both R & RN have been updated
Closes https://github.com/facebook/react-native/pull/11226

Differential Revision: D4258007

Pulled By: mkonicek

fbshipit-source-id: cff466d4710807d97fc6161f47bb974097b75261
2016-12-01 03:43:28 -08:00
Héctor Ramos c5da1068f8 Update JDK download link for Mac OS Android set up
Summary:
*First PR to React Native.*

After performing a clean install of macOS Sierra on my machine I tried to get RN set up again and noticed that the link provided for installing Java (required by Android Studio) pointed to the [wrong location](https://www.java.com/en/download/mac_download.jsp). After some time researching I found the right package required by Android Studio [here](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).

I tried looking for a more general link (as this points to the JDK version 8 and has a weird path: _jdk8-downloads-2133151.html_ - Sadly this was the best I could find.

I also looked through listed issues to try and find a previous attempt to fix this error but couldn't find any references, sorry if I missed anything.

**TL;DR:** JDK download link is incorrect, PR updates it to the correct one.
Closes https://github.com/facebook/react-native/pull/11201

Differential Revision: D4253304

Pulled By: hramos

fbshipit-source-id: be8ffe059bf60f5d7aa1876e5581b270187864c2
2016-11-30 17:58:34 -08:00
Joel Sánchez 921921237f Add alternative lsof command for killing a process running on port 8081.
Summary:
I was running RN 0.31 on ArchLinux (kernel 4.7), and "react-native start"
was refusing to run on the default (and sometimes required, as I have
noticed) port. I tried executing the suggested lsof command, but that did not
work. Somewhere I found the lsof command I include in this commit, and that
worked (it was a node.js process). So I'm including it, since I found it
helpful.
Closes https://github.com/facebook/react-native/pull/9402

Reviewed By: lacker

Differential Revision: D4144400

Pulled By: hramos

fbshipit-source-id: 6203549455555efc59b7bab0a3ec23957d80b956
2016-11-30 17:13:30 -08:00
Charles Dick 48d3cd7d26 Pull aggrow from facebookincubator/tracery-prerelease
Reviewed By: bnham

Differential Revision: D4250937

fbshipit-source-id: b5f2cfdeb06c04399670e463b8b2498e2fe0074b
2016-11-30 12:58:35 -08:00
Charles Dick 3094c36c81 remove old heap capture in preparation for pull from tracery-prerelease
Reviewed By: bnham

Differential Revision: D4250926

fbshipit-source-id: 7cfbb8d8aae5ef150f0260c92e946d569e41f7fb
2016-11-30 12:58:35 -08:00
Emil Sjolander bed9087191 Revert D4248487: [yoga] Remove force_static
Differential Revision: D4248487

fbshipit-source-id: c826eb6543ff6b8d512bf688fbd395e9766df2fb
2016-11-30 12:28:32 -08:00
Yann Pringault fb230000a8 Call handleUpdateLayout even if the content didn't change
Summary:
This PR fixes #11096.

I don't know enough the ReactAndroid's source code so I don't know if this is correct but I hope it is.

In a recent commit (d4b8ae7a8a), the `dispatchUpdates` method now returns a boolean to dispatch or not the `onLayout` event. This works well but if the content is unchanged, the line `nativeViewHierarchyOptimizer.handleUpdateLayout(this);` is never called. I don't know if it was intended but it was this which introduces my issue. I called this again even if the content didn't change. This was the behaviour before 0.38 so I guess I didn't break anything.

**Test plan (required)**

I tested my pretty big app with this fix and every screen is ok.
Closes https://github.com/facebook/react-native/pull/11222

Differential Revision: D4252101

Pulled By: astreet

fbshipit-source-id: 551559234631ac37245a854d81ba568f0ddb02dd
2016-11-30 11:43:34 -08:00
Christoph Pojer b1fd7bd641 kill `shouldThrowOnUnresolvedErrors` option
Summary: Removes the `shouldThrowOnUnresolvedErrors` option, as now it is only ever `() => true`

Reviewed By: davidaurelio

Differential Revision: D4237711

fbshipit-source-id: 9460f0f0c50dc0d08d17cb7bdeb995825f7051f3
2016-11-30 10:13:36 -08:00
Emil Sjolander 4902a03380 Fix usage of weak references to check for null
Reviewed By: lexs

Differential Revision: D4251133

fbshipit-source-id: 2d8949252b31447ce54bc16a35cb25fabe72230b
2016-11-30 10:13:36 -08:00
Martin Konicek be559d9760 Small wording and naming changes
Summary:
Just some small changes that made the core easier for me to understand as I went through it.

**Test plan (required)**

    $ cd react-native
    # "Install globally" without using Sinopia :)
    $ cp -r react-native-git-upgrade /usr/local/lib/node_modules/

    $ cd ~
    $ react-native init Zero29App --version=0.29.2
    $ cd Zero29App

Made a small change in `MainApplication.java` to introduce a conflict with the new template.

    $ git init && git add . && git commit -m "Initial commit"
    $ react-native-git-upgrade

Worked, printed the conflicting file. Output: http://pastie.org/10972793

    $ git reset --hard
    $ react-native-git-upgrade --verbose

Worked, printed the conflicting file. Output: http://pastie.org/10972796

In both cases (with and without --verbose) the output of `git st` was http://pastie.org/10972795
Closes https://github.com/facebook/react-native/pull/11197

Differential Revision: D4251008

Pulled By: mkonicek

fbshipit-source-id: c5bbbeaf996cb5cb46cccc12fd1da7634cc23520
2016-11-30 08:28:33 -08:00
Emil Sjolander 89a380abc8 Remove force_static
Reviewed By: gkassabli

Differential Revision: D4248487

fbshipit-source-id: e5127a02561b145745cf5393a0188661469ec79b
2016-11-30 08:28:33 -08:00
Jean Lauliac 59873d7a2b packager: Module: gives global cache more retries
Reviewed By: cpojer

Differential Revision: D4250880

fbshipit-source-id: c2d215d4dad10705bc24bec758aed85ef13607ba
2016-11-30 07:43:42 -08:00
Jean Lauliac cb254d1e35 packager: GlobalTransformCache: globalized keyOf
Reviewed By: davidaurelio

Differential Revision: D4243863

fbshipit-source-id: 917a8a116baf67c838c062b7b713dd4660d9f673
2016-11-30 07:43:42 -08:00
Jean Lauliac 9b9fd2f2f0 packager: GlobalTransformCache: better aggregation
Reviewed By: davidaurelio

Differential Revision: D4238279

fbshipit-source-id: 3b79a3e87d0eb975efce6adc11b13862c7138e1b
2016-11-30 07:43:42 -08:00
Jean Lauliac 6740207b9f packager: Bundler: hash all the cache key components
Reviewed By: davidaurelio

Differential Revision: D4238061

fbshipit-source-id: 2ad79a85a5da3026afd508557b3b29457f472bb2
2016-11-30 07:43:42 -08:00
Christoph Pojer 6554ad5983 Kill fastfs
Summary:
This kills fastfs in favor of Jest's hasteFS. It gets rid of a ton of code, including the mocking code in ResolutionRequest which we don't need any more. Next step after this is to rewrite HasteMap, ModuleCache, Module/Package. We are getting closer to a nicer and faster world! :)

Here is what I did:
* Use Jest's HasteFS instead of fastfs. A fresh instance is received every time something changes on the FS.
* HasteFS is not shared with everything any more. Only one reference is kept in DependencyGraph and there are a few smaller functions that are passed around (getClosestPackage and dirExists). Note: `dirExists` now does fs access instead of an offline check. This sucks but stat calls aren't slow and aren't going to be a bottleneck in ResolutionRequest, I promise! When it is time to tackle a ResolutionRequest rewrite with jest-resolve, this will go away. "It gets worse before it gets better" :) The ModuleGraph equivalent does *not* do fs access and retains the previous way of doing things because we shouldn't do online fs access there.
* Add flow annotations to ResolutionRequest. This required a few tiny hacks for now because of ModuleGraph's duck typing. I'll get rid of this soon.
* Updated ModuleGraph to work with the new code, also created a mock HasteFS instance there.
* I fixed a few tiny mock issues for `fs` to make the tests work; I had to add one tiny little internal update to `dgraph._hasteFS._files` because the file watching in the tests isn't real. It is instrumented through some function calls, therefore the hasteFS instance doesn't get automatically updated. One way to solve this is to add `JestHasteMap.emit('change', …)` for testing but I didn't want to cut a Jest release just for that. #movefast

(Note: I will likely land this in 1.5 weeks from now after my vacation and I have yet to fully test all the product flows. Please give me feedback so I can make sure this is solid!)

Reviewed By: davidaurelio

Differential Revision: D4204082

fbshipit-source-id: d6dc9fcb77ac224df4554a59f0fce241c01b0512
2016-11-30 04:28:32 -08:00
Adam Comella 911c05a89b Android: Decrease cost of reflection
Summary:
This change suppresses access checking during reflection which makes reflection faster by decreasing its overhead.

**Test plan (required)**

My team uses this change in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/11204

Differential Revision: D4250790

Pulled By: astreet

fbshipit-source-id: 0ee2f40dcadccc695980fcae14fafe1050acb52f
2016-11-30 03:58:29 -08:00
Adam Comella 528a3c776a Android: Keep ScrollView content visible after edits
Summary:
Suppose that the user is scrolled to the bottom of a ScrollView. Next, the ScrollView's content is edited such that the height of the content changes and the current scroll position is larger than the new height of the content. Consequently, the user sees a blank ScrollView. As soon as the user interacts with the ScrollView, the ScrollView will jump to its max scroll position.

This change improves this scenario by ensuring that the user is never staring at a blank ScrollView when the ScrollView has content in it. It does this by moving the ScrollView to its max scroll position when the scroll position after an edit is larger than the max scroll position of the ScrollView.

Here are some pictures to illustrate how this PR improves the scenario described above:

![image](https://cloud.githubusercontent.com/assets/199935/20408839/0e731774-accc-11e6-9f0a-3d77198645e9.png)

![image](https://cloud.githubusercontent.com/assets/199935/20408844/12877bb6-accc-11e6-8fe2-1c1bb26569cc.png)

**Test plan (require
Closes https://github.com/facebook/react-native/pull/11000

Differential Revision: D4250792

Pulled By: astreet

fbshipit-source-id: 940fff6282ad29c796726f68b4519cbdabbfe554
2016-11-30 03:58:29 -08:00
David Aurelio eda09f89c9 Add utilities for bundle creation
Summary: Adds utilities needed for bundle creation: `completeModuleWrapper` appends numeric IDs for the module itself and its dependencies to a module wrapped. `createGetModuleId` returns a function that returns sequential numeric IDs for strings, and is idempotent.

Reviewed By: cpojer

Differential Revision: D4240334

fbshipit-source-id: c165482ebcf0e81ebb83ba6ff634de095ffb6bf0
2016-11-30 03:13:40 -08:00
David Aurelio da079f7433 change `isPolyfill` to `type = 'module' | 'script'`
Summary: When building, we will process modules in a special way, *not* polyfillys. We will also add more types of (virtual) files that are not modules. That’s why a “type” property makes more sense.

Reviewed By: cpojer

Differential Revision: D4244583

fbshipit-source-id: 92a0b4a0a2026d0b97ba88034483a6ce4e0c1ebb
2016-11-30 03:13:40 -08:00
David Aurelio 021b313d88 Fix double callback invocation in `ModuleGraph/Graph`
Summary:
The logic in `ModuleGraph/Graph` allowed the callback to be invoked twice, if two invocations of `resolve` call back with errors asynchronously.

This fixes that problem by always calling `queue.kill()` on the asynchronous queue, and only invoke the main callback from the `drain` and `error` queue callbacks.

Reviewed By: jeanlauliac

Differential Revision: D4236797

fbshipit-source-id: c30da7bf7707e13b11270bb2c6117997fd35b029
2016-11-30 03:13:40 -08:00
Tim Yung c76f5e1ae5 RN: Move `core` to Shared
Reviewed By: cpojer

Differential Revision: D4250233

fbshipit-source-id: 8c42bed47559c477be039d47e3f4fd1fac503152
2016-11-29 23:13:50 -08:00
mlanter 39554ab32c Fix missing mock for StatusBarManager
Summary:
Fix an issue when running Jest unit tests due to a missing mock for StatusBarManger.

**More info:**
In one of my files I have:
```
export const STATUS_BAR_HEIGHT = (StatusBar.currentHeight || 0);
```
When I run the tests it gives this error, which seems to be because StatusBarManager is undefined (https://github.com/facebook/react-native/blob/master/Libraries/Components/StatusBar/StatusBar.js#L20)

```
TypeError: Cannot read property 'HEIGHT' of undefined
  at Object.<anonymous> (node_modules/react-native/Libraries/Components/StatusBar/StatusBar.js:395:1823)
  at Object.StatusBar (node_modules/react-native/Libraries/react-native/react-native.js:55:24)
```

**Test plan (required)**
Verify that with this change tests that use StatusBar pass.
Closes https://github.com/facebook/react-native/pull/11198

Differential Revision: D4246367

Pulled By: cpojer

fbshipit-source-id: ee9406d2566688d235a11cab8f24b0583698e93a
2016-11-29 22:13:44 -08:00
Brent Vatne 346858a552 Add StyleSheet.setStyleAttributePreprocessor
Summary:
**Motivation**

On Exponent we load fonts dynamically and assign their native names by appending a session id, so that fonts from one Exponent "experience" do not clash with each other. So, before sending the `fontFamily` to native, we want to change it to the Exponent-scoped `fontFamily`.

Example:

```js
// Before rendering your app
StyleSheet.setStyleAttributePreprocessor('fontFamily', _processFontFamily);

function _processFontFamily(name) {
  // Pass system fonts through
  if (!name || Constants.systemFonts.indexOf(name) >= 0) {
    return name;
  }

  if (!Font.isLoaded(name)) {
    if (__DEV__) {
      console.error(`${name} is not a system font and has not been loaded through Exponent.Font.loadAsync. If you intended to use a system font, make sure you typed the name correctly and that it is supported by the current operating system. If this is a custom font, be sure to load it with Exponent.Font.loadAsync`);
    } else {
      return 'system';
    }
  }

  return `ExponentFont-
Closes https://github.com/facebook/react-native/pull/11138

Differential Revision: D4245518

Pulled By: mkonicek

fbshipit-source-id: bd2452b1129d6675aa7b88e41351f8bb61fa20a3
2016-11-29 15:28:32 -08:00
Kevin Cooper 00f888a318 Add missing mock for AppState
Summary:
**Description**

In the same vein as https://github.com/facebook/react-native/pull/11198, this adds a mock for the native module `AppState`.

**Test plan**

Create a component that uses `AppState`, e.g.

```jsx
import React, { Component } from 'react';
import { AppState } from 'react-native';

class TestComponent extends Component {
  componentDidMount() {
    AppState.addEventListener('change', this.stateChangeListener);
  }
}
```
Closes https://github.com/facebook/react-native/pull/11199

Differential Revision: D4246668

Pulled By: cpojer

fbshipit-source-id: e3a73a98963a0e152a70aba78ef3461b86da0f6c
2016-11-29 14:43:38 -08:00
Gaëtan Renaudeau 20e99f5b93 Fix invariant in scrollResponderZoomTo
Summary:
This fixes a cryptic bug to appear when you try to use scrollResponderZoomTo in Android.
before this PR it would break with a `Error: TaskQueue: Error with task : invariant requires an error message argument` because the invariant() was not properly used..

Also, instead of detecting the platform, I think it's better practice to duck type.
Closes https://github.com/facebook/react-native/pull/11186

Differential Revision: D4246674

fbshipit-source-id: 47002a85d8252e5abbd1cd9ecef3d7676fa8615a
2016-11-29 14:43:38 -08:00
Adam Comella aac8daf378 Android: Enable ad-hoc dependencies to be pre-downloaded
Summary:
ReactAndroid/build.gradle downloads a number of ad-hoc dependencies from the internet such as boost, JSC headers, and folly. Having the build depend on the internet is problematic. For example, if the site hosting the JSC headers was to go down, then CI builds would start failing.

This change introduces the environment variable REACT_NATIVE_DEPENDENCIES which refers to a path. Developers can pre-download all of the ad-hoc dependencies into that path and then the build process will grab the dependencies from that local path rather than trying to download them from the internet. This solution is in the spirit of the existing REACT_NATIVE_BOOST_PATH hook.

**Test plan (required)**

This change is used by my team's app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/11195

Differential Revision: D4247080

Pulled By: mkonicek

fbshipit-source-id: 7c4350339c8d509a829e258d8f1bf320ff8eef64
2016-11-29 14:28:34 -08:00
Vojta Bartos abf1438f54 fixing shake to open Dev Menu only work once
Summary:
Fixing issues https://github.com/facebook/react-native/issues/10588

This bug has been introduced during refactoring UIActionSheet to UIAlertController d368ebfab2 (diff-f78a84ff95f2bcee5a70d3accb504528)

**Test plan**

- shake to open DevMenu, choose random menu item, it should close DevMenu and after another shaking it should open again
Closes https://github.com/facebook/react-native/pull/10676

Differential Revision: D4168254

Pulled By: javache

fbshipit-source-id: 6e2935b765053a2b55809af357d2b6ea03e04e8b
2016-11-29 13:43:31 -08:00
Emil Sjolander b58c8ad916 Remove deprecated java code
Reviewed By: AaaChiuuu

Differential Revision: D4233198

fbshipit-source-id: 736d79be266e1b9f2d62e5fe6d901de47123cdc1
2016-11-29 12:28:55 -08:00
Sokovikov 837814240b unselectedItemTintColor property available since iOS10
Summary:
**motivation:**

make possible to use new tab bar property.

![1475603157804](https://cloud.githubusercontent.com/assets/1488195/19085757/8b7cc8a4-8a7c-11e6-82c7-7c76313fb545.jpg)

It is not working for previous versions but not failing.
https://developer.apple.com/reference/uikit/uitabbar/1648949-unselecteditemtintcolor
Closes https://github.com/facebook/react-native/pull/10241

Differential Revision: D4168046

Pulled By: mmmulani

fbshipit-source-id: aa0c9b36cbdbc50a9a60bbbc658355c3066ba1a5
2016-11-29 12:28:55 -08:00
Jean Lauliac 188093ae29 packager: Bundler: use stable paths for cache key
Summary: For having a global cache, we need cache keys that are the same from different machines, so we cannot include user/machine-specific information. In that regard, I suggest we consider the paths relatively to the install directory of the React Native instead of being absolute, so that they are more chances they stay stables between different installations, users, machines.

Reviewed By: davidaurelio

Differential Revision: D4237840

fbshipit-source-id: d864b9739550ac2c95d5693db12bd1592411f80a
2016-11-29 11:58:35 -08:00
Jean Lauliac e485f6997d packager: Bundler: use transform module hash instead of mtime
Summary: mtime is a problem for the global cache, because everyone has different times at which they rebased/cloned the repo. Use the actual content instead. Of course, the file could depend on other files we don't take into account... but the mtime solution was already problematic in that regard, so I assume this is a safe change.

Reviewed By: davidaurelio

Differential Revision: D4237826

fbshipit-source-id: 9dc18eb422cddd4d5ed097d1ebeef4b8c361ff39
2016-11-29 11:58:35 -08:00
Sokovikov a50bafa678 badgeColor property
Summary:
**motivation:**

make possible to use new tab bar item property

![1476033023249](https://cloud.githubusercontent.com/assets/1488195/19222245/f4c1292c-8e64-11e6-8a29-7b95b45e153c.jpg)
Closes https://github.com/facebook/react-native/pull/10315

Differential Revision: D4000011

Pulled By: mmmulani

fbshipit-source-id: 5c00b0b5f56c551cc4151fcc030da6c8bc1a3649
2016-11-29 11:43:31 -08:00
Emil Sjolander 065af66deb Remove Style prefix in java and cs apis
Reviewed By: splhack

Differential Revision: D4232920

fbshipit-source-id: 6e2ff21bbb7e0e441892023c14df579d1bc7aa49
2016-11-29 09:13:28 -08:00
Martin Konicek b20b20656a More accurate check for latest version
Summary:
When testing `react-native-git-upgrade` locally I noticed a warning:

    A more recent version of "react-native-git-upgrade" has been found:
    Current: 0.1.0
    Latest: 0.0.1

See https://www.npmjs.com/package/react-native-git-upgrade

This won't happen to a lot of people but better fix the warning. Also, if the check for updates fails, don't crash - the check for updates is not critical to the tool working.

Also, slightly updated one error message.

**Test plan (required)**

Installed `react-native-git-upgrade` locally, ran it inside an app folder (RN 0.29).

Didn't see the wrong "more recent version" warning anymore.

Tried making `checkForUpdates` fail by adding some dummy code: `semver.foo()`. Saw a warning but the process continued:

    git-upgrade WARN Check for latest version failed semver.foo is not a function

Saw a more descriptive error message:

    git-upgrade ERR! Error: react-native version in "package.json" (0.29.0) doesn't match the installed version in "node_mod
Closes https://github.com/facebook/react-native/pull/11188

Differential Revision: D4244002

Pulled By: bestander

fbshipit-source-id: 772044750a933663cb516201d09e2873462cca4a
2016-11-29 06:13:28 -08:00
Emil Sjolander f1a5233fd2 Always use soloader. Catching exception and re-trying hides errors
Reviewed By: lexs

Differential Revision: D4243906

fbshipit-source-id: e4d691c9c49f3b9316f67e39b9f277657d78fb3c
2016-11-29 04:43:30 -08:00
Jean Lauliac c284e0cd7a packager: Module: better type for transformOptions
Reviewed By: davidaurelio

Differential Revision: D4237808

fbshipit-source-id: 8ca40bc9f8e7ec7cea2aaa8a8562dc63d423cea4
2016-11-29 04:28:36 -08:00
Venryx c4046d62a7 * Reduce emit overhead to ~50% of prior, by caching class-name of java-script module/interface.
Summary:
Made modification to react-native code that reduces the communication channel overhead to ~50% of prior, in some cases, by caching the class-name of the java-script module/interface.

For me it reduced the run-time of the RCTDeviceEventEmitter.emit function from 1438ms to 715ms, over a period of 8 seconds in my Android app. My project requires many emit calls, as I'm transferring real-time EEG data from a Muse headband to my react-native UI to be graphed, so this optimization was very helpful in my case.
Closes https://github.com/facebook/react-native/pull/11118

Reviewed By: astreet

Differential Revision: D4232794

Pulled By: javache

fbshipit-source-id: 25ca1cfc170a343e71ff8915c3fa7e38884a402b
2016-11-29 02:58:34 -08:00
Loic CHOLLIER 30152ff5b4 Adds native to the list of jest-react-native platforms to fix testing with react-relay.
Summary:
See https://github.com/facebook/jest/pull/2170. Per cpojer's request, bringing this PR to react-native as well.

**Summary**

When using jest with React Native and Relay and recommended default settings, jest throws :
```
    Cannot find module 'react-dom' from 'relayUnstableBatchedUpdates.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:151:17)
      at Object.<anonymous> (node_modules/react-relay/lib/relayUnstableBatchedUpdates.js:15:18)
      at new RelayEnvironment (node_modules/react-relay/lib/RelayEnvironment.js:39:63)
```

Investigating this, I found out that https://github.com/facebook/jest/blob/master/packages/jest-react-native/jest-preset.json didn't have "native" in the list of platforms, hence jest can't pick up `relayUnstableBatchedUpdates.native.js` in react-relay.

**Test plan**

I copied and paste the content of https://github.com/facebook/jest/blob/master/packages/jest-react-native/jest-preset.json in my `package.json` `jest` section, as well a
Closes https://github.com/facebook/react-native/pull/11179

Differential Revision: D4243073

Pulled By: cpojer

fbshipit-source-id: bcfeb2235df4d466ba19d0a3fe94fc98835a20ea
2016-11-28 21:28:28 -08:00
Max Sherman 65fe3eaa03 Get inspector compiling
Reviewed By: lexs

Differential Revision: D4189469

fbshipit-source-id: 2b4278105fe6d632a79c030fcb789ec50918a278
2016-11-28 17:13:31 -08:00
Alex Kotliarskyi 1fe0f4d8ec Add `deprecated` flag for nativeImageSource
Summary:
Looks like the native Image implementation used to treat old `image!` images slightly differently. This diff restores that behavior for `nativeImageSource`.

{F65080365}

Reviewed By: mmmulani

Differential Revision: D4240506

fbshipit-source-id: d8d39216f86df32e0614d7cdc95df2148c85077a
2016-11-28 15:58:36 -08:00
Ryan Gomba 97887c2a52 Remove unused var in NativeAnimatedNodesManager
Summary:
Should have been removed in 6f5433febe (commitcomment-19793695).

Simple enough fix.

cc/ janicduplessis
Closes https://github.com/facebook/react-native/pull/11178

Differential Revision: D4239876

fbshipit-source-id: f96e220ffdab042bded27ff16d2395741c70b61f
2016-11-28 14:13:33 -08:00
Martin Konicek eb45367956 Update Flowconfig in CLI template to Flow v0.36.0
Summary: Flow was updated in bf901d926e, need to update the config file for the template too.

Reviewed By: mkonicek

Differential Revision:
D4240152
Ninja: OSS tests only

fbshipit-source-id: c20704c43a5d603105125a0316b7926cdc7cd7fd
2016-11-28 14:13:33 -08:00
Tim Yung 53741ad020 Packager: Shorter + Consistent-Width Timestamps
Summary: Sets some options on `toLocaleString()` so that the server debug output's timestamps are shorter and have a consistent width (zero-padded).

Reviewed By: cpojer

Differential Revision: D4235074

fbshipit-source-id: 72dcf35ffd182eb70afc20d2b266314787433c4a
2016-11-28 13:13:35 -08:00