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
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
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
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
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
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
Summary:
Adds:
- getType so you can switch on type
- getPrivate
Reviewed By: lexs
Differential Revision: D3515510
fbshipit-source-id: d574b04f563ac650bacec3751b50be6345e8439a
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
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
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
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
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
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
Summary:
This pull request fixes a small typo when a module fails being transformed through the React Packager.
Closes https://github.com/facebook/react-native/pull/8596
Differential Revision: D3522272
Pulled By: mkonicek
fbshipit-source-id: e117a26bab5a99573ac68fb0e7618df0a14325a4
Summary:
Pretty self-explanatory. I dated it July 5 so we can push stuff on July 4, blog about it July 5 (and it won't be on a holiday).
Closes https://github.com/facebook/react-native/pull/8497
Differential Revision: D3522149
Pulled By: lacker
fbshipit-source-id: 4f361310699d84e49347c25aa69a8602d7de7e06
Summary:
Adds:
- callAsConstructor
- Ability to provide `this` object to callAsFunction
- getPropertyNames() now returns Strings (which can be converted by the caller to std::string if they want).
Fixes:
- double free issue with the String move constructor
Reviewed By: lexs
Differential Revision: D3515398
fbshipit-source-id: afa1342044e41fdd833dd27b8a244a58d4078442
Summary:
Looks like spaces in function names can happen, but the lib we use for parsing stacktraces doesn't support that. As result, when error is thrown in global scope, new JSC puts "global code" as function name, our parser chokes on it and thinks "global code@http://...." is a file name and sends it to packager. The packager can't resolve that URL and fails the whole symbolication request.
Longer term fix here: https://github.com/errwischt/stacktrace-parser/pull/5
Reviewed By: astreet
Differential Revision: D3516741
fbshipit-source-id: 7f14b52a50a118dc95a3463aee842941e904e984
Summary:
`Animated.parallel` among other functions expects the `start(callback)` function to be invoked with an `endState` object. Currently natively driven animations call the handler with `null`, this PR changes that to `{ finished: true }`.
**Test plan**
This should not throw any errors:
```js
Animated.parallel([
Animated.timing(
new Animated.Value(0),
{
toValue: 1,
useNativeDriver: true
}
),
Animated.timing(
new Animated.Value(0),
{
toValue: 1,
useNativeDriver: true
}
)
]).start();
```
Closes https://github.com/facebook/react-native/pull/8567
Differential Revision: D3517291
Pulled By: javache
fbshipit-source-id: 0056a5b4261546b061451c0b1b249718739086bc
Summary:
The **motivation** for this PR is my sad colleague bestander: I managed to break travis with bd60d828c5, without considering the consequences. This PR solves this failure, and will fix it for good.
**Test plan (required)**
Travis will demonstrate that the code is solid.
Let’s make sure tests pass on both Travis and Circle CI.
Closes https://github.com/facebook/react-native/pull/8576
Differential Revision: D3516652
Pulled By: bestander
fbshipit-source-id: 09bb488517a0ee2b5b6219dfda559aef568bbbc2
Summary: We prefer not showing the accurate time information in the exception message of time drift, in order to be able to group this kind of exception only by exception message.
Reviewed By: foghina
Differential Revision: D3515390
fbshipit-source-id: f38bf3091ba749d4daeae24f7d42653b76c3289c
Summary:
When multiple simulator runtimes are available, this change will make it possible to specify which one to run. So assuming you have e.g. iOS 9.0 and 9.3 runtimes, all following calls will now work:
```
react-native run-ios --simulator "iPhone 6s (9.0)"
react-native run-ios --simulator "iPhone 6s (9.3)"
react-native run-ios --simulator "iPhone 6s"
```
Closes https://github.com/facebook/react-native/pull/8559
Differential Revision: D3516811
Pulled By: frantic
fbshipit-source-id: c81658f77e482e712293367b13d27e783e538aad
Summary:
Looks like spaces in function names can happen, but the lib we use for parsing stacktraces doesn't support that. As result, when error is thrown in global scope, new JSC puts "global code" as function name, our parser chokes on it and thinks "global code@http://...." is a file name and sends it to packager. The packager can't resolve that URL and fails the whole symbolication request.
Longer term fix here: https://github.com/errwischt/stacktrace-parser/pull/5
Reviewed By: astreet
Differential Revision: D3516741
fbshipit-source-id: 4f2bb70084437ed9d37495cd775622a8c981fad1
Summary: This removes `node_modules/react` from the list of directories that are used for haste module resolutions. Modules required from React are now imported with `require('react/lib/…')`.
Reviewed By: astreet
Differential Revision: D3509863
fbshipit-source-id: 32cd34e2b8496f0a6676dbe6bb1eacc18124c01e
Summary:
Idle WebSocket connections get reset after a few minutes of inactivity. To prevent this, most WebSocket implementations offer sending special ping messages. This PR adds a method `sendPing()` to WebSocket. Ping payloads are not supported.
Manual testing can be done by adding `connection.on('ping', _ => console.log('Received ping'));` to a ws connection or using a packet sniffer while sending pings.
Closes https://github.com/facebook/react-native/pull/8505
Differential Revision: D3516260
Pulled By: dmmiller
fbshipit-source-id: cfebf5899188ae53254d5be6b666a9075e0eed89
Summary:
Right now systrace generates an html file that is using the Object.observe function which is now deprecated in most up to date browsers.
Since we don't want to depend on the systrace being up to date, we should advise opening the trace through the Tracing tool, since that is the only way to get it working until systrace removes its dependency on Object.observe.
Closes https://github.com/facebook/react-native/pull/7880
Differential Revision: D3516305
Pulled By: astreet
fbshipit-source-id: ab9ae46ba74b7a34b6cfb8c37ca1ec2e6b41e353
Summary: These are helpful for development and shouldn't affect anything when DEBUG=false
Reviewed By: lexs
Differential Revision: D3515015
fbshipit-source-id: 0bd5ff833f90fea8e70b3103eb1f9bc803bef27c