Commit Graph

3249 Commits

Author SHA1 Message Date
Pieter De Baets e9f657f2bd Stop using Map in JSTimers
Reviewed By: fromcelticpark

Differential Revision: D5292912

fbshipit-source-id: a14552b895d586cf24627cc457069d9909b2ecc2
2017-06-22 09:52:33 -07:00
Pieter De Baets 94d9f00dd6 Remove unused RCTRenderingPerf
Reviewed By: josephsavona

Differential Revision: D5292898

fbshipit-source-id: 33605c994c3457134556acc328542611a2247d27
2017-06-22 09:01:04 -07:00
Alan Wang 09ba07e4fa fix error caused by first argument short when calling warning function
Summary:
<details>
  Thanks for submitting a PR! Please read these instructions carefully:

  - [X] Explain the **motivation** for making this change.
  - [] Provide a **test plan** demonstrating that the code is solid.
  - [X] Match the **code formatting** of the rest of the codebase.
  - [X] Target the `master` branch, NOT a "stable" branch.

  Please read the [Contribution Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md) to learn more about contributing to React Native.
</details>

My app crashed when I call navigator.geolocation.stopObserving(). I found it is caused by the reason that one argument short. So I added false to the first argument. Then bug is fixed.

1. call both navigator.geolocation.watchPosition and navigator.geolocation.getCurrentPosition
2. then call navigator.geolocation.stopObserving()
3. error happened before I fixed, and correct Warning "Called stopObserving with existing subscriptions." shown after I fixed.
Closes https://github.com/facebook/react-native/pull/14673

Differential Revision: D5301503

Pulled By: javache

fbshipit-source-id: 9e85064beb1052bb89bf42355ffd308fe9eaec53
2017-06-22 08:46:43 -07:00
Pieter De Baets c5004d5dd0 Make startup errors in the websocket executor invalidate the bridge
Reviewed By: mhorowitz

Differential Revision: D5226936

fbshipit-source-id: b6d605974674d0e6f86559f2583553e3636d389b
2017-06-22 08:37:13 -07:00
Brian Vaughn 119959252e Remove RN fiber createClass wrapper around View
Reviewed By: spicyj

Differential Revision: D5241527

fbshipit-source-id: 9209004544e83cc0f03fcaa27c9b1acf8db09930
2017-06-21 12:38:06 -07:00
Tim Yung 5550a25628 RN: Expose `unstable_batchedUpdates` on react-native
Reviewed By: spicyj

Differential Revision: D5284484

fbshipit-source-id: bdc0a1c3babfa1a5c3343f084bdd5d4ff4f2d46a
2017-06-21 00:47:08 -07:00
Justin Stanley bc718fd729 Fixed an incorrect word in the blurTextInput() documentation.
Summary:
In `TextInputState`'s `blurTextInput()` documentation, the parameter description`id of the text field to focus` should be `id of the text field to unfocus`, since this is `blurTextInput` and not `focusTextInput`.

N/A (just documentation fix).
Closes https://github.com/facebook/react-native/pull/14367

Differential Revision: D5200263

Pulled By: shergin

fbshipit-source-id: b3e9ab60e555ad9050474b59a728761180618190
2017-06-20 19:31:29 -07:00
Hank Brekke ec68536e08 iOS `presentationStyle` Modal Appearance
Summary:
When using `<Modal` on larger iOS devices, esp. iPad and iPhone 7 Plus devices, there is no way to use the system functionality for controlling the appearance of modals (`presentationStyle`), which improves the native system's animation and display of smaller content appearing within large horizontal space.

I've added a new picker for selecting a `presentationStyle` within  the RNTester app. See below for the appearance of this change, as well as the relevant changes to the RN documentation.

![may-22-2017 09-49-50](https://cloud.githubusercontent.com/assets/3521186/26315020/6d4b1cb0-3ed5-11e7-8ac8-a996f1ee00f9.gif)
<img width="1051" alt="screen shot 2017-05-22 at 9 50 12 am" src="https://cloud.githubusercontent.com/assets/3521186/26315021/6d4cbf7a-3ed5-11e7-9d13-a5d20c9f3533.png">
Closes https://github.com/facebook/react-native/pull/14102

Differential Revision: D5281990

Pulled By: shergin

fbshipit-source-id: 882d8cb79e7adb0b4437cdf26e5e7ab1fc04f4c1
2017-06-20 19:22:57 -07:00
Yu Wang 70e0455522 Implement nativeID prop to allow native code to reference react managed views in iOS
Reviewed By: javache

Differential Revision: D5228055

fbshipit-source-id: 8c934501d4ac946d80bf93d2ddb50f5fc38aea3c
2017-06-20 19:01:27 -07:00
zongwan d217921b5e Update VirtualizedList.js, fix wrong position after scrollToEnd when props.refreshing === true
Summary:
Pull request again for clean branch

Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?
Fix #14033
Fix wrong position after `scrollToEnd` when `props.refreshing === true`

**Before**

![before](https://cloud.githubusercontent.com/assets/1185694/26242273/657f0180-3cba-11e7-9360-49269fd1bb2f.gif)

**After**

![after](https://cloud.githubusercontent.com/assets/1185694/26242503/465a856c-3cbb-11e7-98fb-f3256fd45c15.gif)

Sign the [CLA][2], if you haven't already.

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

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14089

Differential Revision: D5283973

Pulled By: sahrens

fbshipit-source-id: 9bef9a922c15aa5bed11a59acbd7b48a76946d29
2017-06-20 19:01:27 -07:00
Valentin Shergin b1e64a448a Refined type for `display` style property
Reviewed By: javache

Differential Revision: D5185158

fbshipit-source-id: 02fef3862e20e9a5023bfe57601c3cf92ac273e5
2017-06-20 17:16:46 -07:00
Janic Duplessis a2b0ee0fc3 FlatList - Add dev validation of the object returned by getItemLayout
Summary:
Returning an object that doesn't have all the required properties from `getItemLayout` doesn't cause a flow error (maybe because we are using `createAnimatedComponent`) and caused ALL items to be rendered which caused perf issues that were hard to debug (typo lenght -> length -_-). This adds a simple warning in DEV mode using checkPropTypes.

**Test plan**
Tested in RNTester by passing a bad `getItemLayout` function.
![image](https://cloud.githubusercontent.com/assets/2677334/26329030/5b32ba90-3f13-11e7-9190-08f05a5c0682.png)
Closes https://github.com/facebook/react-native/pull/14111

Differential Revision: D5283942

Pulled By: sahrens

fbshipit-source-id: 8909532dfddd8628b7fb3380c198f0dfa88f240a
2017-06-20 10:45:32 -07:00
Janic Duplessis 407ec0023f Disable subview clipping when sticky headers are enabled
Summary:
Subview clipping still causes issues on Android and would be pretty hard to fix properly, I investigated this a bit and sticky header views are getting removed because it doesn't take transform into consideration. It would also require to recalculate subview clipping on every transform change so I think it is better to just disable subview clipping in when there are sticky headers, especially since we seem to be moving away from subview clipping with things like FlatList.

**Test plan**
Tested that sticky headers work in ListView paging example.

Fixes #14000
Closes https://github.com/facebook/react-native/pull/14010

Differential Revision: D5283723

Pulled By: sahrens

fbshipit-source-id: 183b3202765ae09aaae05497694c3f514e969ea1
2017-06-20 09:34:55 -07:00
Rene Weber 75508c12ff Add setNativeProps
Summary:
Curently FlatList does not implement setting native props directly like the old ListView did. This pr introduce the `setNativeProps` function which delegates to MetroListView or VirtualizedList. Thos don't have `setNativeProps` handling either, so, I delegated further to the respective ListView and Scroll components, which do have handling for it, thus, allowing to set the native props through FlatList.

Create a project with a FlatList and change a native property using `setNativeProps`:

```javascript
  componentDidMount() {
        setInterval(() => {
            this.list.setNativeProps({ style: {backgroundColor:"white"} })
        }, 1000)
    }

  render() {
    return (
      <View style={styles.container}>
        <FlatList ref={component => this.list = component}
                  style={{backgroundColor:"black"}}
                  data={[{key: 'a'}, {key: 'b'}]}
                  renderItem={({item}) => <Text>{item.key}</Text>} />
      </View>
    )
  }
```

Fixes #13501
Closes https://github.com/facebook/react-native/pull/13529

Differential Revision: D5283593

Pulled By: sahrens

fbshipit-source-id: 8f96f88e286042d82452fef924689b5a8a783987
2017-06-20 09:34:55 -07:00
Guy Blank 60783aa6ba Expose content-available APS key for iOS silent push
Summary:
<details>
  Thanks for submitting a PR! Please read these instructions carefully:

  - [ ] Explain the **motivation** for making this change.
  - [ ] Provide a **test plan** demonstrating that the code is solid.
  - [ ] Match the **code formatting** of the rest of the codebase.
  - [ ] Target the `master` branch, NOT a "stable" branch.

  Please read the [Contribution Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md) to learn more about contributing to React Native.
</details>

_What existing problem does the pull request solve?
In iOS when sending a silent push notification you need to configure the 'content-available' APS key to the value of 1 (When this key is present, the system wakes up your app in the background and delivers the notification to its app delegate, see [apple docs](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html#//apple_ref/doc/uid/TP40008194-CH17-SW1)).

This PR exposes this property to the notification event handler so app code can handle silent push scenario specifically. Currently this property is not available.

I've updated the PushNotificationIOSExample in the RNTester.

1. Open RNTester in xcode
2. Enable the  push notifications capability
3. run on device
4. Go to PushNotificationIOS
5. click on "send fake notification"
6. verify alert message contains 'content-available' with a value of 1.
Closes https://github.com/facebook/react-native/pull/14584

Differential Revision: D5279181

Pulled By: shergin

fbshipit-source-id: d2288e147d89ba267f54265d819aa0a9969095e7
2017-06-19 16:46:31 -07:00
Mike Lambert ebcf5fd241 Fix initial-render triggering a render of all items.
Summary:
When rendering a large list without a getItemLayout (ie SectionList, where it's hard to compute), it freaks out and attempt to render them all, starving the rendering/layout engine from computing the size (and more accurately figurnge out how few it actually should render.)

Before this change, with <FlatList maxToRenderPerBatch={5} data={objectOfLengthN} />, I essentially saw it doing:
```
{first: 0, last: 0}
{first: 0, last: 5}
{first: 0, last: 10}
....
{first: 0, last: N}
```
(no more hiPri renders since all elements have been rendered)
(actually renders and lays out all N objects, and computes their sizes)
(realizes that it doesn't need to show all N for my current screen size and row size)
```{first: 0, last: 55}```

After this change, that whole first part where it keeps incrementing `last` to try to "keep up with the scrolling" disappears.
Closes https://github.com/facebook/react-native/pull/14563

Differential Revision: D5278796

Pulled By: sahrens

fbshipit-source-id: 5db117b40909ec4bc92fba9b5556c6a2add046ac
2017-06-19 16:04:44 -07:00
Tino 3ba8e6a901 Keyboard will show documentation
Summary:
Clarified documentation for keyboardWillShow on Android as seen in issue #14275

Clarifies documentation of keyboardWillShow

None as it is just a comment that changed.
Closes https://github.com/facebook/react-native/pull/14350

Differential Revision: D5275173

Pulled By: shergin

fbshipit-source-id: d4fb08de71e6be40bb363dfc82d38b191570c476
2017-06-19 11:06:33 -07:00
Pieter De Baets 3e4a8928b3 Fix reference to invariant
Reviewed By: davidaurelio, bvaughn

Differential Revision: D5274530

fbshipit-source-id: 0b75976bb91b530a371521d5381a3d53f0ad2640
2017-06-19 08:46:32 -07:00
Aleksei Androsov 8377b30b8d ImageBackground: use cached styles
Summary:
Replace object with cached styles from StyleSheet

Create new style object may cause performance problems

Check that ImageBackground position works the same way.
Closes https://github.com/facebook/react-native/pull/14486

Differential Revision: D5274503

Pulled By: shergin

fbshipit-source-id: 09b81e6f7ae2ada7f68854e409909caafd85e56a
2017-06-19 08:46:32 -07:00
Joe Rickerby fa147f02e5 Update overflow docstring to add note on Android
Summary:
The overflow: visible option does not work on Android. This just add a little note to the docs of that property to make that clear.

See #3198  and https://react-native.canny.io/feature-requests/p/add-overflow-support-to-android .

Make it clear that this property is unavailable on Android. We had to figure this out by trial and error when porting an existing codebase, a small note in the docs would be helpful!

I could not find how to build the website - I tried `cd website && npm install && node ./server/generate.js` but I'm getting an error (*JSDOC_ERROR: There are no input files to process.*). But it is such a small change I can't see how it would break the docs build!
Closes https://github.com/facebook/react-native/pull/14103

Differential Revision: D5225814

Pulled By: shergin

fbshipit-source-id: a3136e791178d2a7090f324041be23628130199e
2017-06-18 19:45:27 -07:00
Tim Yung 398746fa09 RN: Remove lodash (Attempt 2)
Reviewed By: cpojer

Differential Revision: D5268874

fbshipit-source-id: 795bc3fda6c29e514b6149f0bdf4f4aa3f131a6d
2017-06-16 18:15:17 -07:00
Taylor Kline fd34018d08 Use possessive 'its' not 'it's'
Summary:
Very simple documentation grammar update.
Closes https://github.com/facebook/react-native/pull/14567

Differential Revision: D5269433

Pulled By: hramos

fbshipit-source-id: 2cf38166f53d01fa2465da2b25a3247312dabfb7
2017-06-16 17:00:35 -07:00
Naman Goel 0801d94faa Revert D5255886: [JS] Stop using lodash in RN
Differential Revision: D5255886

fbshipit-source-id: 605dd413a579be5321006ffb26ce9e04843bc0f8
2017-06-16 12:17:00 -07:00
Christoph Pojer 8fa55ca7b5 Stop using lodash in RN
Reviewed By: yungsters

Differential Revision: D5255886

fbshipit-source-id: 18845785c3192f0ae1d02da0b944bc1b3c2fba52
2017-06-16 04:48:02 -07:00
Christoph Pojer 5d515113e7 Don't require prettyFormat in every single bundle.
Summary:
WTF

(I updated it to the latest version too)

Reviewed By: yungsters

Differential Revision: D5256525

fbshipit-source-id: f3c7d620faf817a0e3c1e4c2bed9370318dff40a
2017-06-16 04:31:56 -07:00
Miguel Jiménez Esún c9a39b3bd3 Move jest to version 20
Reviewed By: cpojer

Differential Revision: D5235642

fbshipit-source-id: eaeee1c5f67cf295fdc9798fb13bd5a83706af10
2017-06-14 12:48:22 -07:00
Pieter De Baets 534bbfac8f Report Java stack from errors from sync native module calls
Reviewed By: mhorowitz

Differential Revision: D5069794

fbshipit-source-id: ede314034a2eb6b063a22dbd6e5d13c8ad66e20c
2017-06-14 09:32:37 -07:00
James Burnett 51c0e81557 remove disableAutomock from jest tests (new default) @bypass-lint
Reviewed By: cpojer

Differential Revision: D5237192

fbshipit-source-id: dccca52a91259d7fea27931f92bca94184a82d4a
2017-06-13 15:04:09 -07:00
Valentin Shergin 7707905550 Improved <ImageBackground>
Reviewed By: sahrens

Differential Revision: D5214113

fbshipit-source-id: 1eca2347f97a1ff13f71906688a33b9ed7a3a7f4
2017-06-13 14:02:40 -07:00
Janic Duplessis f7044419be Native Animated - Call x.__makeNative before super.__makeNative
Summary:
This fixes a `Attempt to get native tag from node not marked as "native"` error that happens because some animated values are not converted to native before calling the base class `__makeNative`. This makes sure we call the `__makeNative` method of input nodes before calling `super.__makeNative`.

**Test plan**
Tested that it fixes the issue I encountered and that native animations still work with properly in RNTester.
Closes https://github.com/facebook/react-native/pull/14435

Differential Revision: D5236092

Pulled By: javache

fbshipit-source-id: cb02616aec05f220c65b58831ca4334b58d0383b
2017-06-13 08:45:42 -07:00
Josh Farrant 1dd825d261 Fixed typo in NavigatorIOS.ios.js
Summary:
Bboolean -> Boolean
Closes https://github.com/facebook/react-native/pull/14469

Differential Revision: D5236093

Pulled By: javache

fbshipit-source-id: b9318a933fa37b89dab320a879d3c60490edaeed
2017-06-13 08:31:37 -07:00
Fred Liu 8dd15f2c87 Allow video uploads
Summary: Allows video uploads from native iOS by using the proper network handler, `RCTAssetsLibrary` rather than `RCTImageLoader`. Currently, uploading a camera roll video via its `assets-library://` URI would upload the first image frame. This fixes it by checking if the `assets-library://` URI is of the extension `MOV`, and if so, declines to process it from `RCTImageLoader`.

Reviewed By: javache

Differential Revision: D5223351

fbshipit-source-id: 8de92c5bb72acb02ed4d9fb92d69f68c8b5d1b36
2017-06-13 08:16:43 -07:00
Spencer Ahrens 1d30f833a6 Add inverted option
Reviewed By: bvaughn

Differential Revision: D5210277

fbshipit-source-id: 5a8b196b90a2ac6d20397113ef4bd76446ea9fa3
2017-06-12 22:45:49 -07:00
Spencer Ahrens 0a3e6e0e76 prettier
Reviewed By: fkgozali

Differential Revision: D5210279

fbshipit-source-id: 4b376a09b4bcfb42a2dc48b9903849d58929b7db
2017-06-12 22:45:49 -07:00
Spencer Ahrens 63f7efcd32 Add basic nested VirtualizedList support
Summary:
This uses `context` to render inner lists of the same orientation to a plain `View` without
virtualization instead of rendering nested `ScrollView`s trying to scroll in the same direction,
which can cause problems.

Reviewed By: bvaughn

Differential Revision: D5174942

fbshipit-source-id: 989150294098de837b0ffb401c7f5679a3928a03
2017-06-12 22:45:48 -07:00
Andrew Imm 50b11aa09b Update remaining PropTypes references
Reviewed By: bvaughn

Differential Revision: D5231309

fbshipit-source-id: d54ee4f73dae63124f4462c138383447829a2551
2017-06-12 16:03:09 -07:00
Brian Vaughn 40b5486eea React sync for revisions a37012a...4aea7c3
Reviewed By: gaearon

Differential Revision: D5222812

fbshipit-source-id: 3dd3dd82f2a8a5080bb3a47b78f92eb26c435b11
2017-06-12 14:20:48 -07:00
Pieter De Baets 2e4284215c Handle fatal errors thrown by the Chrome debugger
Reviewed By: mmmulani

Differential Revision: D5219190

fbshipit-source-id: 16cff0e08de9c53d7a3e10897ddec3e6924c3bf5
2017-06-12 03:38:51 -07:00
Valentin Shergin b6cf4eeed6 Fixed: `blurOnSubmit` should be `true` by default for singleline <TextInput>
Differential Revision: D5224356

fbshipit-source-id: e8a9f607270ab93e40cca3b701bdcb31524137fe
2017-06-10 08:32:24 -07:00
Tim Yung 82edc131b0 RN: Fix deepFreezeAndThrowOnMutationInDev-test for Node v8.1.0
Reviewed By: raluca-elena

Differential Revision: D5222219

fbshipit-source-id: e34903a506b8e6e0c81e1c21fd9e8e015b25b2d7
2017-06-09 16:04:18 -07:00
Brian Vaughn 9d4cc7cce4 Check before overriding global.performance
Reviewed By: gaearon

Differential Revision: D5218876

fbshipit-source-id: 7fbe9ca020774a0c53d8cbb64996680112828709
2017-06-09 13:17:41 -07:00
Brian Vaughn a4947d1778 React Native sync
Reviewed By: sebmarkbage

Differential Revision: D5214576

fbshipit-source-id: 41f350ce8961851c7404257df8295d505471d9f4
2017-06-08 19:15:59 -07:00
Dan Abramov 32a0ee0975 Implement Systrace integration for Fiber
Reviewed By: bvaughn

Differential Revision: D5210738

fbshipit-source-id: db7df5ca7a1b4944f86719361d22ec3cc2ce8f22
2017-06-08 14:31:52 -07:00
Alex Dvornikov e38641cd73 Fixed error in _getCallableModule method in MessageQueue
Reviewed By: javache

Differential Revision: D5208462

fbshipit-source-id: 13f71e2b7988305eccfa91c349ff120fad9129f0
2017-06-08 12:49:37 -07:00
Kexi Long a0a7d97c7b Exposed progressViewOffset to VirtualizedList and FlatList
Reviewed By: sahrens

Differential Revision: D5204107

fbshipit-source-id: df2928830f84ea012d532f24c776dee8d2b96989
2017-06-08 12:32:14 -07:00
Mike Lambert 5840a9051d Fix deltatime calculation.
Summary:
This is necessary to fix an extraneous warning when a VirtualizedList is constructed on the first frame.

On the first frame, the dt is huge (ie, time since epoch).
On the second frame (which may legitimately be slow as a result of a lot to render), it will then assume there were two consecutive slow frames, and print a warning:
  "VirtualizedList: You have a large list that is slow to update..."
Closes https://github.com/facebook/react-native/pull/14393

Differential Revision: D5210467

Pulled By: sahrens

fbshipit-source-id: 2e79218c3d66a4a9df4884f328a125047ef264ed
2017-06-08 12:17:01 -07:00
John O'Leary 62b20ce582 Scrollview updatedChildFrames data controlled by prop
Summary: Optimize ScrollView by adding flag "DEPRECATED_sendUpdatedChildFrames" to gate whether updatedChildFrames data is computed and propagated on scroll events.  The frame data is used in ListView by the onChangeVisibleRows prop.  When this prop is not defined, unnecessary computation in ScrollView should not be performed.

Reviewed By: sahrens

Differential Revision: D5174898

fbshipit-source-id: e3eaed8760b76becf14dfeb00122bdebdaeae4ef
2017-06-08 12:03:02 -07:00
James Burnett 3360999431 disable automock by default in as many places as possible @bypass-lint
Reviewed By: cpojer

Differential Revision: D5190858

fbshipit-source-id: d3125cf81427dbbe3362ef1f958413394a6dc51d
2017-06-08 07:45:54 -07:00
Xavier Villelégier f7c89b4187 Update default blue on iOS
Summary:
Hey,

The `defaultBlue` variable is currently `#0C42FD`. We can see that it's not the same as iOS. According to the official Apple website it's supposed to be `#007AFF`.
See the `Blue` color on [this page](https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/)

No code added.
Closes https://github.com/facebook/react-native/pull/14339

Differential Revision: D5199906

Pulled By: hramos

fbshipit-source-id: c06b0081556dddbfe7fecd255eff941cbbfb95ee
2017-06-07 08:47:36 -07:00
Brian Vaughn 0bc3bb06ed Updated react sync script
Reviewed By: yungsters

Differential Revision: D5194769

fbshipit-source-id: c475d44616144ea354785b981b1f6068be49f848
2017-06-06 22:53:10 -07:00