Summary: In accordance with the unwritten rule that any API that takes a callback should also return a promise, I've changed `InteractionManager.runAfterInteractions()` to do just that.
```js
InteractionManager.runAfterInteractions(() => {
...
});
```
can become
```js
InteractionManager.runAfterInteractions().then(() => {
...
});
```
(but doesn't have to). Most importantly, though, this change enables code like
```js
doSomeUIStuff();
await InteractionManager.runAfterInteractions();
doSomeNonUIStuff();
```
which is nice.
Note: Because returning a `Promise` means the callback argument is now optional, the behaviour of the API is slightly changed, though not in a backwards-incompatible way (unless a consumer is in some way relying on the exception, but that would be insane).
Closes https://github.com/facebook/react-native/pull/3788
Reviewed By: vjeux
Differential Revision: D2634693
Pulled By: josephsavona
fb-gh-sync-id: 7315120963be23cf69d777e940b2750d32ae47a8
Summary: The previous version of `performanceNow` used to reassign to a `require(...)` alias, which our inline requires transform guarded against. Before the update to React 0.14, we were pulling `performanceNow` from a hardcoded `react-tools` version (b4e74e38e4/src/shared/vendor/performance/performanceNow.js), so we couldn't just fix the file and had to special case it. Now that we've updated to React 0.14, `performanceNow` is pulled from fbjs and no longer needs to be special cased.
public
Reviewed By: cpojer
Differential Revision: D2634940
fb-gh-sync-id: 7085cde3179c04f9ecfd87bdd472b19e370ee73c
Summary: When Node is installed with nvm, scripts invoked from Xcode need to set up nvm. This can be done either by sourcing .profile/.bash_profile/.bashrc/etc... or by sourcing nvm.sh directly -- this diff does the latter and handles the case where nvm may have been installed the official way (under ~/.nvm/nvm.sh AFAIK) or via homebrew.
Closes https://github.com/facebook/react-native/pull/4015
Reviewed By: svcscm
Differential Revision: D2633301
Pulled By: frantic
fb-gh-sync-id: 3c2b9b0d21887ba21d6f85f5d279314d50c1db28
Summary: public
`RCTProfileTrampoline` (and consequently `RCTProfileTrampoline(Start|End)`) should be as lightweight
as possible, since it's called for every BridgeModule's method invocation, so
avoid doing any string processing there by dispatching it to Profiler queue.
Reviewed By: jspahrsummers
Differential Revision: D2625918
fb-gh-sync-id: 86a98d4cf727c3be20eebee0bf8437c502c6a42a
Summary: public
Rename it to `RCT_PROFILE_(BEGIN|END)_EVENT` to make it clearer that it's a macro,
since it has special behaviours.
Reviewed By: jspahrsummers
Differential Revision: D2631542
fb-gh-sync-id: 629c139462c4aa3582f719b14482017d13676e33
Summary: public
Use OSAtomicBarrier to write the flags rather than using OSAtomic to read *and* write.
Reviewed By: jspahrsummers
Differential Revision: D2625915
fb-gh-sync-id: 2ed357ae408b2afe5ef2689582585bf4f9edd8a7
Summary: public
Added support for #rgba and #rrggbbaa colors, which are now officially recognized in the css spec, and supported by WebKit:
http://trac.webkit.org/changeset/192023
Reviewed By: davidaurelio
Differential Revision: D2631386
fb-gh-sync-id: 207a14f77f94bac8088568dc1bbe2bb29f0176c3
Summary: public
As jspahrsumemrs pointed out, `int` could overflow pretty easy, since it was static,
change it to an NSUInteger and downcast it when need to interop.
Reviewed By: jspahrsummers
Differential Revision: D2625902
fb-gh-sync-id: 2052be47a7b0ed81484da004fa18d6ef5baf26f7
Summary: public
The dev menu is a little bit flaky right now, and sometimes it emits messages twice,
so guard it not to hook into the modules twice.
Reviewed By: jspahrsummers
Differential Revision: D2625911
fb-gh-sync-id: 18fd6bc00e473ed226291e7aca4a02cec84bfc8f
Summary: Unfortunately ReactTestUtils requires ReactDOM (for renderIntoDocument), and ReactTestUtils is required by ReactNative. This worked internally because we already shimmed ReactDOM for Relay; now we shim it externally too, at least until we figure out a better solution for this in React.
public
Reviewed By: vjeux
Differential Revision: D2629811
fb-gh-sync-id: 94aac2c4eda39d039fdcedd88295e7afb0f5c5b2
Summary: public
We've noticed that some of the navigator functions are called after the navigator
being unmounted. This diff adds the checks to protect the navigator from throwing
error when it's calling function after be unmounted.
Reviewed By: fkgozali
Differential Revision: D2629484
fb-gh-sync-id: 1cbee02b1a8d2a5d285e7d76f382d2599ed8caed
Summary: All minor changes since we were already on the beta: most notable is that destructors are required in pooling to help prevent memory leaks.
public
Reviewed By: sebmarkbage
Differential Revision: D2608692
fb-gh-sync-id: acdad38768f7f48c0f0e7e44cbff6f0db316f4ca
Summary: Install react-haste and fbjs-haste, remove react-tools, update npm-shrinkwrap.json. This only updates the npm packages; the subsequent commit will update the repo to work correctly with this new version.
public
Reviewed By: vjeux
Differential Revision: D2608597
fb-gh-sync-id: a372e4033f7c5091fa15b068853dd00ee69f5f75
Summary: This fixes a leak in regards to web sockets, detailed in #3846 . The connection state constants referenced the class rather than the instance and were coming back undefined.
cc brentvatne stephenelliot
Closes https://github.com/facebook/react-native/pull/3896
Reviewed By: svcscm
Differential Revision: D2626399
Pulled By: vjeux
fb-gh-sync-id: f42670003b68ed5b86f078d7ed74c2695f30fc69
Summary: public
For "some" reason, exception is never `NULL`, it's `null` (the JavaScript value),
so the calls will never finish.
Reviewed By: javache
Differential Revision: D2625896
fb-gh-sync-id: fc8176a6ac485bfecc9903db05bf69b39ac2d9b4