Commit Graph

7189 Commits

Author SHA1 Message Date
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
Skotch Vail bcf4bb6edd Automated changes to remove implicit capture of self in blocks: Libraries/FBReactKit/BUCK
Reviewed By: javache

Differential Revision: D3442470

fbshipit-source-id: 584a2bb3df5f7122166778b8fd44fae45560491e
2016-07-07 12:44:14 -07:00
Konstantin Raev 41064991a2 fix: increased fs timeout for assetserver to test if this helps for large codebases
Reviewed By: jingc

Differential Revision: D3528913

fbshipit-source-id: f04eff42327bd729ebfcd71856a1d38ef9810986
2016-07-07 11:44:54 -07:00
Andy Street eeb9cd8075 Better error message when trying to parse a empty body in fetch
Summary: Previously, trying to parse an empty network body would throw "Unexpected EOF" from JSON.parse. Now we explicitly call out the error and provide steps for possible mitigation.

Reviewed By: frantic

Differential Revision: D3528297

fbshipit-source-id: 3b52c9491c1504c282eb9bc12ed46069cb6cbd60
2016-07-07 11:16:21 -07:00
Andy Street b5c3550857 Don't hard crash if you get a null stack trace in Android
Summary: If stacktrace-parser can't parse a stack trace, it'll return null. This can cause us to accidentally enter a crash loop where whenever you start your app, you load the last JS bundle you had, get a crash, and then hard crash trying to print the stack trace.

Reviewed By: frantic

Differential Revision: D3528141

fbshipit-source-id: 1146f43bc40492bfa79b6a1c0f81092383896164
2016-07-07 09:15:04 -07:00
Janic Duplessis 2537157d99 Implement TextInput onContentSizeChange
Summary:
This adds proper support for tracking a TextInput content size as discussed in #6552 by adding a new callback that is called every time the content size changes including when first rendering the view.

Some points that are up for discussion are what do we want to do with the onChange callback as I don't see any use left for it now that we can track text change in onChangeText and size changes in onContentSizeChange. Also a bit off topic but should we consider renaming onChangeText to onTextChange to keep the naming more consistent (see [this naming justification](https://twitter.com/notbrent/status/709445076850597888)).

This is split in 2 commits for easier review, one for iOS and one for android.

The iOS implementation simply checks if the content size has changed everytime we update it and fire the callback, the only small issue was that the content size had several different values on initial render so I added a check to not fire events before the layoutSubviews where at this point the value is g
Closes https://github.com/facebook/react-native/pull/8457

Differential Revision: D3528202

Pulled By: dmmiller

fbshipit-source-id: fefe83f10cc5bfde1f5937c48c88b10408e58d9d
2016-07-07 09:00:01 -07:00
Alexander Blom be0abd17e5 Remove a bunch of copies
Reviewed By: astreet

Differential Revision: D3475592

fbshipit-source-id: 37148bb8d8d47e9301ad549b183029337f7c4ca0
2016-07-07 09:00:01 -07:00
Alexander Blom 95401aba72 Create tracing name in C++ instead of Java
Reviewed By: mhorowitz

Differential Revision: D3469140

fbshipit-source-id: 77a00a7150573e44f219972556cbb936a57d7054
2016-07-07 09:00:00 -07:00
Tadeu Zagallo af24e8001a Add new FileSourceProvider
Reviewed By: michalgr

Differential Revision: D3207541

fbshipit-source-id: d53599c3cf36ae7c89e85a29f637987bc7139159
2016-07-07 08:44:30 -07:00
Alexander Blom f11a783e64 Make packager reconnect less noisy
Reviewed By: frantic

Differential Revision: D3509012

fbshipit-source-id: 66742ebed80ecf48ce8291b1816ef0ec672febee
2016-07-07 08:44:29 -07:00
Mike Lambert 6779d13dcb Reverted commit D3528215
Summary:
So `PanReponder.onPanResponderRelease/onPanResponderTerminate` receive a `gestureState` object containing a `onPanResponderTerminate.vx/vy` property. On Android and iOS, they appear to be orders of magnitude different, which appear to be due to the different scale of timestamps that are used when generating touch events.

This pull request fixes the timestamps to be milliseconds on both platforms (since I assume iOS is the more authoritative one, and is the one that `react-native-viewpager`'s vx thresholds written written to compare against.)

As far as I can tell, the RN code doesn't use the `vx/vy` properties, so they should be okay. And looks like the RN code only cares about relative values of `startTimestamp/currentTimestamp/previousTimestamp` though, so should be fine too. it's quite possible there will be downstream android breakage with this change, particularly for those who are already compensating for the RN discrepancy.
Closes https://github.com/facebook/react-native/pull/8199

Differential Revision: D3528215

Pulled By: davidaurelio

fbshipit-source-id: d81732e50a5ece2168e8347309d8d52a0db42951
2016-07-07 08:16:26 -07:00
Alexey Lang 97299260b6 Refactor RCTPerformanceLogger to avoid having global state
Reviewed By: javache

Differential Revision: D3509004

fbshipit-source-id: c4ab12b3f1defa32c2b1c211e775f6782ede4b7f
2016-07-07 07:29:57 -07:00
Mike Lambert 4f5c2b48fe Fix timestamps on android touch events to use milliseconds, to be consistent with iOS
Summary:
So `PanReponder.onPanResponderRelease/onPanResponderTerminate` receive a `gestureState` object containing a `onPanResponderTerminate.vx/vy` property. On Android and iOS, they appear to be orders of magnitude different, which appear to be due to the different scale of timestamps that are used when generating touch events.

This pull request fixes the timestamps to be milliseconds on both platforms (since I assume iOS is the more authoritative one, and is the one that `react-native-viewpager`'s vx thresholds written written to compare against.)

As far as I can tell, the RN code doesn't use the `vx/vy` properties, so they should be okay. And looks like the RN code only cares about relative values of `startTimestamp/currentTimestamp/previousTimestamp` though, so should be fine too. it's quite possible there will be downstream android breakage with this change, particularly for those who are already compensating for the RN discrepancy.
Closes https://github.com/facebook/react-native/pull/8199

Differential Revision: D3528215

Pulled By: dmmiller

fbshipit-source-id: cbd25bb7e7bb87fa77b661a057643a6ea97bc3f1
2016-07-07 05:59:43 -07:00
Andy Street f5345601d9 Add JSCHelper function to easily install native hooks outside of JSCExecutor
Summary: JSCExecutor has something like this, but for methods on JSCExecutor itself. Open to better ideas around how to share code

Reviewed By: lexs

Differential Revision: D3516314

fbshipit-source-id: 4b1265916c52d582bb0b9348e9b4a099f566d6c9
2016-07-07 04:58:47 -07:00
Andy Street 10d41b50c2 Add getType/getPrivate to Value
Summary:
Adds:
 - getType so you can switch on type
 - getPrivate

Reviewed By: lexs

Differential Revision: D3515510

fbshipit-source-id: d574b04f563ac650bacec3751b50be6345e8439a
2016-07-07 04:43:51 -07:00
Konstantin Raev 201433f05b Fixed flowconfig for user apps
Reviewed By: davidaurelio

Differential Revision: D3528031

fbshipit-source-id: baf74d68127038659f88fd65b8eb3fe41444d9aa
2016-07-07 03:15:11 -07:00
Mengjue Wang e209f2f1e9 Move Bridge functions to OSS -- RTL experiment
Summary:
Delete the bridge functions(isRTL, allowRTL()) in internal module and move to OSS.
 Create bridge for RCTI18nUtil

Reviewed By: fkgozali

Differential Revision: D3519224

fbshipit-source-id: 3853edcfcc78777d957874448117de72ae0700b5
2016-07-06 16:28:41 -07:00
Marc Horowitz a7d032b707 Display JS exceptions and stacks in a red box
Reviewed By: astreet

Differential Revision: D3510875

fbshipit-source-id: a7042434b68cb849f5b0c4ef782befff6a27ef5c
2016-07-06 16:13:21 -07:00
tychota c4fc504094 Fix the yeoman-environment version
Summary:
This closes #8610.
The release of 1.6.2 of yeoman-environment break react-native (since there is no lib folder)
Yeoman will be removed from RN as #8197 anyway.

Thanks cpsubrian, RobTS

**Test plan (required)**

I installed the 1.2.7 version and copied it in react-native nodes_modules.
Then I ran react-native upgrade

<img width="1337" alt="screen shot 2016-07-06 at 21 09 33" src="https://cloud.githubusercontent.com/assets/13785185/16631160/075fc422-43be-11e6-8625-92f03075b007.png">
Closes https://github.com/facebook/react-native/pull/8614

Differential Revision: D3524043

fbshipit-source-id: 1def4854ca0fd881b8a935f37c86eb373dfd97c5
2016-07-06 13:13:27 -07:00
Kevin Lacker d49ea020e1 update blog with misc minor requests
Summary:
A couple changes people requested. None of the author links were doing anything, so now they link to Twitter profiles, and also the references to react-native-web have a standardized style w\ react-native-web-player.
Closes https://github.com/facebook/react-native/pull/8617

Differential Revision: D3524125

Pulled By: JoelMarcey

fbshipit-source-id: 68afa1bafeceed98f82fa4ced766da143790b5ba
2016-07-06 13:13:27 -07:00
Marc Horowitz 7f790dc0de Pull an updated version of fbjni into RN OSS
Differential Revision: D3521227

fbshipit-source-id: 57db97ea2af2b2c9e55f380ce05d9e78a5f9d48c
2016-07-06 12:58:42 -07:00
Jeff Morrison 7795918eb4 Unrevert D3518381
Reviewed By: gabelevi

Differential Revision: D3522895

fbshipit-source-id: 52f28c7f3142566a07d8bc845be882aeda098809
2016-07-06 12:58:41 -07:00
Steven Scaffidi ba3c7ef08c Fix the getRowData method of SwipeableListViewDataSource in SwipeableListView
Summary:
This is simple fix to SwipeableListView. According to SwipeableListViewDataSource, the only method available is cloneWithRowsAndSections. If you try to get the data from a SwipeableListView, without this fix it won't work. This change fixes the problem so that SwipeableListView can work correctly.
Closes https://github.com/facebook/react-native/pull/8493

Differential Revision: D3523384

fbshipit-source-id: 359ff274fabcab676ed6dee24f0652c4146cde69
2016-07-06 11:58:32 -07:00
Vesa Laakso 3a24c63f73 Documentation: Fix LayoutWithFlexbox.md broken example
Summary:
This fixes the [Align Items example](http://facebook.github.io/react-native/releases/next/docs/flexbox.html#align-items) in Layout with Flexbox -documentation page by fixing a broken example.

<img width="892" alt="screen shot 2016-07-06 at 20 59 08" src="https://cloud.githubusercontent.com/assets/482561/16629040/ee0e819e-43bc-11e6-8ca1-eb9b90869b59.png">

EDIT: Seems like 34adde9e96 tried to cover all of these but missed one case :)
Closes https://github.com/facebook/react-native/pull/8608

Differential Revision: D3523445

Pulled By: JoelMarcey

fbshipit-source-id: ffc8be2b2e85d3b821a37e387e9385e57820a200
2016-07-06 11:58:31 -07:00
Dave Miller 8c9f190038 Fix Spacing lifecycle issue introduced by D3516692
Summary: D3516692 incorrectly assumed that the Spacing object was immutable.  This is not true as it can change in a measure pass on the shadow thread while the UI is displaying some other data.  This fixes it to just pull the values we need and pass them instead of the object.

Reviewed By: foghina

Differential Revision: D3523004

fbshipit-source-id: 056baecf60a9c2f2494d173a3c60396a93b97d42
2016-07-06 11:14:05 -07:00
Alexander Blom c57eb94b34 Execute init task on thread pool executor
Reviewed By: foghina

Differential Revision: D3522112

fbshipit-source-id: 8a0880d0e7bf3e0bce02c44e8d504f01ab47beb8
2016-07-06 10:43:24 -07:00
Dave Miller c3f2bba834 Fix padding with Text on Android
Summary: Text was not correctly respecting padding.  We would account for it when measuring, but then not actually apply the padding to the text.  This adds support for proper padding

Reviewed By: andreicoman11

Differential Revision: D3516692

fbshipit-source-id: 9a0991d89e9194c0e87af0af56c6631a6b95700a
2016-07-06 09:43:37 -07:00
Ian Childs 0fde81c816 Reverted commit D3518381
Reviewed By: gabelevi

Differential Revision: D3518381

fbshipit-source-id: 645c25191d5e7cff7689bd4dc583c478eba46496
2016-07-06 09:43:37 -07:00
Kevin Lacker 21e997a416 Fix link
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

(You can skip this if you're fixing a typo or adding an app to the Showcase.)

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see the ["Pull Requests" section of our "Contributing" guidelines](https://github.com/facebook/react-native/blob/mas
Closes https://github.com/facebook/react-native/pull/8606

Differential Revision: D3522490

Pulled By: JoelMarcey

fbshipit-source-id: ee9eb7114b5e952a4a70a6eda39edc45445223e9
2016-07-06 09:43:37 -07:00
Orta 948b381a14 Fix markdown link in blog post
Summary:
See the last sentence:

![screen shot 2016-07-06 at 11 42 11 am](https://cloud.githubusercontent.com/assets/49038/16624177/b1af026c-436e-11e6-94dc-ee1d163eb9ef.png)
Closes https://github.com/facebook/react-native/pull/8605

Differential Revision: D3522488

Pulled By: lacker

fbshipit-source-id: fd1d18dc793d00931c4aa2366f0ee8c3c7eb99b9
2016-07-06 09:28:20 -07:00
Jeff Morrison a8e6a236cc fbobjc -> Flow v0.28
Reviewed By: gabelevi

Differential Revision: D3518381

fbshipit-source-id: 2dd5f89177aaefbd098ba1fd3c193da111ff14c7
2016-07-06 08:58:42 -07:00