Граф коммитов

7319 Коммитов

Автор SHA1 Сообщение Дата
Pieter De Baets 2ae23d9f36 Flush pending calls off the main-thread
Reviewed By: majak

Differential Revision: D3535193

fbshipit-source-id: 8c4736629eab3c723641f0c3fb449c168cd492a1
2016-07-11 13:33:52 -07:00
Adam Ernst af7104b49e Extract part of executeApplicationScript into a C function
Reviewed By: javache

Differential Revision: D3542897

fbshipit-source-id: aa74c0c7c4477158fc9c8aff69432aed592f472f
2016-07-11 13:33:50 -07:00
Adam Ernst 5e89baa7a0 Remove needless weakSelf from executeApplicationScript
Reviewed By: javache

Differential Revision: D3542798

fbshipit-source-id: bf3fe15c78b55691176aecf209210a6f35f98862
2016-07-11 13:33:48 -07:00
Adam Ernst 8fb6111fa5 Make loadRAMBundle a C function, not a method
Summary: This makes the state it uses more explicit. It also makes a bug with performance measurement obvious: if we early return to error, we never mark stop for `RCTPLRAMStartupCodeSize`.

Reviewed By: javache

Differential Revision: D3542751

fbshipit-source-id: e6c1e3f3a76098ca37b8078f6e9abc805ad2d9da
2016-07-11 13:33:46 -07:00
Héctor Ramos b33424e5ed Fix links from networking to navigation in The Basics.
Summary:
Fixes #8611.

Once this lands, we may want to cherry-pick it into 0.29 to fix the broken links.
Closes https://github.com/facebook/react-native/pull/8698

Differential Revision: D3544388

Pulled By: JoelMarcey

fbshipit-source-id: d5132b112e3079d1fd9ab6d84ff1a4328bee871f
2016-07-11 12:13:45 -07:00
Tim Yung 1db781316b RN: Clean JSTimersExecution JS
Reviewed By: sahrens

Differential Revision: D3539098

fbshipit-source-id: f17a35c5d6a45627bd6961b6b06266fe254d3976
2016-07-11 11:28:21 -07:00
Tim Yung ed4db631fa RN: Change Time Drift Error into Warning
Summary: Changes the time drift error into a warning that will only get logged once per debugging session.

Reviewed By: jingc

Differential Revision: D3539067

fbshipit-source-id: 357db15750d867a91c39b5fc5fd6ed4ae2852bc7
2016-07-11 10:28:27 -07:00
Andy Street 6d3c7b8a4c Fix 'Unexpected EOF' in old bridge
Summary: This is caused by receiving \u2028/2029 in callbacks/function calls. The correct solution is to not evaluate these strings as scripts but instead parse them as json and pass them through the JSC API.

Reviewed By: lexs

Differential Revision: D3543098

fbshipit-source-id: 4d8acce1d510bb17361d32103d4738fc0208b0a8
2016-07-11 09:58:27 -07:00
Pieter De Baets 7b718b03eb Allow RCTDisplayLink to pause more often
Summary:
By default we run the the JS display link, even if there are no modules listening. Given that most listeners will be lazily constructed, let's make it paused by default.

Since RCTTiming almost never unpauses due to some long-lived timers, implement a sleep timer that pauses the displaylink but uses an NSTimer to wake up in time.

Reviewed By: mhorowitz

Differential Revision: D3235044

fbshipit-source-id: 4a340fea552ada1bd8bc0d83b596a7df6f992387
2016-07-11 08:28:24 -07:00
Mehdi Mulani 4840233bcd Bring back FBPortForwarding into fbobjc (Revert D3056293)
Reviewed By: frantic

Differential Revision: D3542397

fbshipit-source-id: 7f25f9753ec8d7a88f736014bba231fc5fb8b245
2016-07-11 07:28:22 -07:00
Tadeu Zagallo 5d06918d07 Add new FileSourceProvider
Summary: Add a new interface to JSC that allows loading a file lazily from disk, i.e. using mmap, instead of loading the whole file upfront and copying into the VM.

Reviewed By: michalgr

Differential Revision: D3534042

fbshipit-source-id: 98b193cc7b7e33248073e2556ea94ce3391507c7
2016-07-11 06:58:26 -07:00
Alex Kotliarskyi e5650560c0 Class for JS stack frames instead of dictionaries
Summary:
Currently React Native codebase treats JS stack traces as array of dictionaries.

This diff switches the Red Box to use new `RCTJSStackFrame` for internal data representation, while keeping the exposed API unchanged. The next step would be to replace the rest of manual parsing and usage of dictionaries.

The new class has ability to parse the stack from raw strings or dictionaries.

Depends on D3429031

Reviewed By: javache

Differential Revision: D3473199

fbshipit-source-id: 90d2a4f5e8e054b75c99905f35c2ee54927bb311
2016-07-11 06:13:32 -07:00
Chirag 13a19a8897 Don't block scroll when using non-touchable visible row for SwipeableRow
Summary:
**motivation**
Currently when using a non-touchable visible row for a SwipeableRow, the scroll on list view is blocked.

**Test Plan**
```
<SwipeableListView
   dataSource={dataSource}
   renderRow={() => <View style={styles.row}/>}
   renderQuickActions={() => <View style={styles.hiddenrow}/>}
/>
```

* Tested that when using non-touchable for renderRow allows scrolling on list view.
* Tested that when using touchable for renderRow allows scrolling on list view.

cc fred2028
Closes https://github.com/facebook/react-native/pull/8537

Differential Revision: D3542407

Pulled By: fred2028

fbshipit-source-id: b7ad7ff7c7dd1b717544746a85bb265414aa18f4
2016-07-11 04:58:32 -07:00
sam a2c6a7bc64 export SwipeableListView component.
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

1. [`SwipeableListView`](https://github.com/facebook/react-native/blob/master/Libraries/Experimental/SwipeableRow/SwipeableListView.js) is already usable, I think it would be great to export it so users can test it.
Closes https://github.com/facebook/react-native/pull/8482

Differential Revision: D3542403

Pulled By: fred2028

fbshipit-source-id: 7b4e0aa8c50110e434c9d64b72b15d1206fa0470
2016-07-11 04:58:32 -07:00
Nathan Azaria c8b5880102 Renamed updateObject:forKey to updateValue:forKey
Reviewed By: javache

Differential Revision: D3534820

fbshipit-source-id: 32afa39aedd43319fb5933ee0b169a41f4c8cd19
2016-07-11 03:43:23 -07:00
Nathan Azaria defc34a28b Removed calls to RCTBundleURLProvider setDefaults
Reviewed By: javache

Differential Revision: D3534799

fbshipit-source-id: 0c784cd9a993c6379e49087906ebf670ddd4f8cd
2016-07-11 02:58:32 -07:00
Nivetha Singara Vadivelu 0b773c41ac Navigator - making changes so that a simple flick can be detected
Summary:
Decreased the distance threshold so that the user doesn't need to swipe a large distance to
set the pan responder.

Also, set a threshold for the velocity so that a simple flick can be detected.

Reviewed By: hedgerwang

Differential Revision: D3540354

fbshipit-source-id: 251a4f14dc014bc32b3a83fa8de419f86ca40b84
2016-07-10 20:43:26 -07:00
Pieter De Baets 4aedcc7670 Fix double completion callback in RCTJavascriptLoader
Reviewed By: foghina, mmmulani

Differential Revision: D3541511

fbshipit-source-id: 9a0a4be635ca910cb1a5c875a0f4a2b82c51cf71
2016-07-10 12:28:24 -07:00
Ritesh Kadmawala c0316c695d Fixed the issue due to which js assets are not bundled in the apk when separate build for different CPU architectures is enabled
Summary:
This PR tries to fix a minor bug in `react.gradle` due to which task that bundles JS into the assets folder of the APK is not run when separate build per CPU architecture is enabled and we are using different product flavors.
Closes https://github.com/facebook/react-native/pull/8675

Differential Revision: D3541348

fbshipit-source-id: 4c84f21a06a45046f84bdd8ae5c5d834ec080476
2016-07-10 05:43:20 -07:00
Nicolas Charpentier 65ff8192dd Remove instructions about IP address on iOS
Summary:
The documentation was not updated after this change : Implemented automatic IP detection for iOS (8c29a52)

Fixes #8651.
Closes https://github.com/facebook/react-native/pull/8660

Differential Revision: D3539749

fbshipit-source-id: fe3b37c446a8c37941adbb08c4301284950a176a
2016-07-08 19:33:22 -07:00
Simon Dohmen d73446c549 Fixed position of ripple-effect
Summary:
I recognised that the ripple effect was always located at the bottom of my buttons. So i started to search for other ppl having the same problem. I also found this bug on the f8 app.

The gifs show the behaviour before and after my changes:

[The ripple effect is always on the bottom of the element, because pageY is used instead of the relative pos]
![before](https://cloud.githubusercontent.com/assets/956410/16042805/df49d97e-323c-11e6-8ce2-b0658ec85b27.gif)

![after](https://cloud.githubusercontent.com/assets/956410/16042804/df483a60-323c-11e6-862f-e8c97b835339.gif)

Before, the absolute position of the touch was used to update the position during movement but it should be the relative position. Just some small calculation changes were needed to achieve the correct behaviour :)
Closes https://github.com/facebook/react-native/pull/8111

Differential Revision: D3539652

fbshipit-source-id: dd8c8f3c7402d0d435f1c2ca67c1a59b474efda3
2016-07-08 19:33:20 -07:00
Emil Sjolander 70b989eb67 Revert land of css-layout PR #199
Reviewed By: bestander

Differential Revision: D3536627

fbshipit-source-id: e89b2a5fd38d1228bd8526c46bb26c594947837a
2016-07-08 16:48:13 -07:00
Michał Gregorczyk dd06b74157 Make SoLoader an external dependency
Reviewed By: bestander

Differential Revision: D3535233

fbshipit-source-id: 9fddb654123a7606d46069a98e2f68dec7f520fa
2016-07-08 16:48:13 -07:00
David Aurelio 2426b3b5ec Prevent tests with invalid UTF-8 from failing when jest reads them from the cache
Summary: The utf-8 test was failing when run from Jest’s cache, because it contained unicode escape sequences for stray high and low surrogates. Somewhere in the process of transpiling, caching on disk, and reading from the cache, those stray surrogates are changed to U+FFFD (REPLACEMENT CHARACTER / �). This diffs changes the method of creating these strings from literals to `String.fromCharCode`, which survives the process as intended.

Reviewed By: bestander

Differential Revision: D3534711

fbshipit-source-id: 365bace77a1f914e6e2fbb3430b3e0ea6cec5e83
2016-07-08 12:35:53 -07:00
Adam Ernst 39cb110c5b Add the ability to pre-create the JavaScript thread with RCTJSCExecutor
Summary: This can be used to create a JavaScript thread and `JSContext` in advance, then supply them to the `RCTJSCExecutor` at creation time later.

Reviewed By: javache

Differential Revision: D3534553

fbshipit-source-id: 99ccf711928cd12e84c9fbe142c6d19a7af55d07
2016-07-08 12:35:50 -07:00
Adam Ernst 294173a427 Organize ivars in RCTJSCExecutor
Reviewed By: javache

Differential Revision: D3534380

fbshipit-source-id: 364213f24256602471a5b3cd1afe6c7be4aab743
2016-07-08 12:35:48 -07:00
Adam Ernst 7ee2f48451 Remove left-over ctx property from RCTJavaScriptContext
Summary: This was left over from a previous change.

Reviewed By: javache

Differential Revision: D3534376

fbshipit-source-id: 6932364d1c32d8fbdf56c642893f9ea5e6dc1fee
2016-07-08 12:35:45 -07:00
Mengjue Wang 7e5fc17983 Provide RTL support for SwipeableRow
Summary:
Flipped the gesture for SwipeableRow
 Provide RTL support for SwipeableRow. When developer set RTL layout in their app, all the animation and  gesture will change to RTL status.

Reviewed By: fkgozali

Differential Revision: D3532919

fbshipit-source-id: 76fc94cdaa8457350e9bbe3366aa714c9eb45245
2016-07-08 12:18:00 -07:00
Mengjue Wang cadc753e4c Change NavigatorSceneConfig for RTL
Summary:
For RTL experiment, we need to swap all the Left and Right gesture and animation.
 Provide RTL support for Navigator in RN.

Reviewed By: hedgerwang

Differential Revision: D3519811

fbshipit-source-id: b53d9bf901ec056614658b627823d2225bdc82b1
2016-07-08 10:58:55 -07:00
Emil Sjolander ca66383941 Correctly size cross axis when measuring flex basis
Summary:
https://github.com/facebook/css-layout/pull/199

- Nodes were measured with the assumption of being text nodes (height depends on width) when determining flex basis. This is not always true. Even when we are just interested in the main axis (flex basis) we need to correctly constrain the cross axis.
- Some tests were wrong. Measuring texts.big and expecting it to have textSizes.smallHeight which doesn't make a lot of sense.

Reviewed By: vjeux

Differential Revision: D3510163

fbshipit-source-id: ee53b548dd078005fdd153d279e4c7fef3dd02d0
2016-07-08 09:28:35 -07:00
Adam Ernst 1ebd9c5dea Create JSContext inside setUp
Summary:
In practice, it *MUST* be the call to `self.context` within `setUp` that triggers the creation of the context:

- It can't come before that point because `_jscWrapper` has not been set up yet
- It can't come after that point since `self.context` would create the context there.

Just move the creation to be inline, enforced by assert. This makes it easier to reason about where the context is created, and easier to change how it is created later.

Reviewed By: javache

Differential Revision: D3529843

fbshipit-source-id: 8ed5a9861ebefd4b9e0f7155db8587dcf0442b7a
2016-07-08 09:13:59 -07:00
Adam Ernst 29f9be6d9c Remove needless weak self in RCTJSCExecutor
Summary: There's no reason for this; setUp is once-and-done. Probably just trying to ignore the incorrect clang warning.

Reviewed By: javache

Differential Revision: D3528494

fbshipit-source-id: e4f986df8d097e4720dfd4a51e7fb6c9c9b5108f
2016-07-08 09:13:59 -07:00
Emil Sjolander 89a53b687c Use AT_MOST measurespec when onyl max dimension is defined
Summary:
https://github.com/facebook/css-layout/pull/200
Make use of max dimension styles to allow root to be measured with AT_MOST measure mode

Reviewed By: IanChilds

Differential Revision: D3513505

fbshipit-source-id: 169f49717e896eb6270b52fb7115ce005aa0e3a8
2016-07-08 03:58:28 -07:00
Konstantin Raev 3ddf3db551 Fixed objc test runner and bezier test
Summary:
- kill -9 SERVER_PID does not work for packager currently because it is started as daemon.
- And lego tests just hang until they are killed e.g. intern/sandcastle/1952254070/187417721/
- fixed bezier test because it annoyed me with random breaks because of precision

Reviewed By: davidaurelio

Differential Revision: D3528588

fbshipit-source-id: 87e5b4330fa69bc9a8a7f48e2250f3c2239f2b35
2016-07-08 03:28:58 -07:00
Gant c3f4d79475 changes link file on Android to MainApplication.java for 0.29 update
Summary:
rnpm aka `react-native link` is broken with Android 0.29 - #8603

This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed.
Closes https://github.com/facebook/react-native/pull/8612

Differential Revision: D3533960

fbshipit-source-id: 95d799eaebb26ba1d876c88107ccd2af72427f55
2016-07-08 01:45:58 -07:00
Jake Murzy 46a685169e Use active scene passed in `props` by `NavigationTransitioner`
Summary:
With facebook/react-native@c57bac4, `NavigationTransitioner` passes the currently active `scene` in transition `props`. This simplifies the handling of transition changes when rendering overlay.

🍺
Closes https://github.com/facebook/react-native/pull/8298

Differential Revision: D3533447

Pulled By: ericvicenti

fbshipit-source-id: df568dc5cf5d57d8948b9f0400a8d693cf5564e1
2016-07-07 21:13:31 -07:00
Adam Ernst 222060b218 Remove needless helper method
Summary: I think this obscures more than it helps. Remove it.

Reviewed By: javache

Differential Revision: D3528677

fbshipit-source-id: d90a636a6e34b66563d9a02e255c6ebc4cee1294
2016-07-07 16:44:15 -07:00
Adam Ernst 2b397c5094 Redo cookie map for nativeTraceBeginAsyncSection
Reviewed By: javache

Differential Revision: D3528604

fbshipit-source-id: 0feff3a09214af7c9c193733a5ad05d7de0dd21d
2016-07-07 16:44:14 -07:00
Adam Ernst dd5bb7b9e0 Pull native hook registration into class method
Summary:
Ideally, native hooks should not require any sort of reference to self. Pull all those that fulfill this criteria into a class method (to make it impossible to accidentally capture self).

Future diffs will pull more and more hooks into this category.

Reviewed By: javache

Differential Revision: D3528558

fbshipit-source-id: 270c5bec53674a91ec2129d55e5cad59440a51da
2016-07-07 16:44:14 -07:00
Adam Ernst 96b47eb933 Inline _addSynchronousHookWithName
Summary: It's just a simple helper. It's actually more readable and performant when inlined.

Reviewed By: javache

Differential Revision: D3528540

fbshipit-source-id: 8086770f7fd88b40623dc943c715deb4f9fd9262
2016-07-07 16:44:13 -07:00
Clement Genzmer 80c23ae324 Reverted commit D3207541
Reviewed By: michalgr

Differential Revision: D3207541

fbshipit-source-id: 36366188b7cb74c51d4aa974abd4a648498bcf78
2016-07-07 14:58:43 -07:00
Jon Green 6565edc9ed Fixing typo
Summary:
'iOS' was written but it should be 'Android'.
Closes https://github.com/facebook/react-native/pull/8637

Differential Revision: D3530611

Pulled By: JoelMarcey

fbshipit-source-id: 04dbb2e2188f3de73f9bc185f18950bc5de5607b
2016-07-07 14:31:04 -07:00
Corné Dorrestijn 5e10d3e385 Fixed the diagram in the FBPortForwarding README
Summary:
![screen shot 2016-07-07 at 17 11 05](https://cloud.githubusercontent.com/assets/570297/16658236/e3ae8f38-4465-11e6-9e24-2d6a1bf11ac6.png)
![screen shot 2016-07-07 at 17 11 12](https://cloud.githubusercontent.com/assets/570297/16658235/e3ab0fb6-4465-11e6-991b-a4dbcd675322.png)
Closes https://github.com/facebook/react-native/pull/8632

Differential Revision: D3529638

fbshipit-source-id: 7d7dba00975d738e32a7340cfe4d270cc4dc7686
2016-07-07 14:15:02 -07:00
Adam Ernst 7e1ea48379 Make executeAsyncBlockOnJavaScriptQueue required
Summary: This leaves no optional methods on `RCTJavaScriptExecutor`, which is certainly a good thing.

Reviewed By: majak

Differential Revision: D3518915

fbshipit-source-id: e606b9076c3299f81a225a181ea244148a1832cb
2016-07-07 13:43:39 -07:00
Adam Ernst a203cf4791 Make addSynchronousHookWithName private
Summary: It's not widely used, and you can do something equivalent anyway by using existing public API.

Reviewed By: javache

Differential Revision: D3518896

fbshipit-source-id: 6995a5d840aecfff4ffd78ac43f3f592a4f47f91
2016-07-07 13:43:39 -07:00
Adam Ernst 65120d7052 Avoid dispatching to the global queue to read the 4 byte RAM bundle magic number
Summary: Reading four bytes is not slow. Don't bother dispatching for that.

Reviewed By: javache

Differential Revision: D3518405

fbshipit-source-id: 910079cec2a1f624dd71760438765bd035055229
2016-07-07 13:43:38 -07:00
Adam Ernst 77752a0399 Move locals closer to point they are used
Summary: No need to have these way at the top; they're not used until later.

Reviewed By: majak

Differential Revision: D3518364

fbshipit-source-id: 3e7461665e90dea5c6d323d45b1ffb11fb610b09
2016-07-07 13:43:38 -07:00
Adam Ernst b3ac5f06d2 Close RAM bundle as soon as we read the magic number
Summary: No need to keep it open; it just makes it harder to reason about error handling.

Reviewed By: majak

Differential Revision: D3518200

fbshipit-source-id: dc1af6eb0f75de7e9f73513ed1dd522048f76670
2016-07-07 13:43:38 -07:00
Adam Ernst 5323b77fba Expose a way to get the JSContext from a RCTJSCExecutor
Reviewed By: javache

Differential Revision: D3517664

fbshipit-source-id: cafda7eccbf25f6e197ba9bd18e82c814f08e3bb
2016-07-07 13:43:38 -07:00
Jan Monschke f51fc36ebc remove unneeded preserve_paths declaration
Summary:
The subspec for `RTCAnimation` defines a `preserve_paths` attribute of `Libraries/NativeAnimation/*.js` (https://github.com/facebook/react-native/blob/master/React.podspec#L60) but there is no JavaScript file in that repository. Linting the podspec therefore fails. The fix was to simply remove `preserve_paths` for this subspec.
Closes https://github.com/facebook/react-native/pull/8626

Differential Revision: D3529959

fbshipit-source-id: b187f6ce3898493d9f6a03960caf5ec25c9e4ac2
2016-07-07 13:14:00 -07:00