Commit Graph

11510 Commits

Author SHA1 Message Date
Kevin Gozali b58207e61f remove internal copy of ReactNativeFeatureFlags
Reviewed By: bvaughn, davidaurelio

Differential Revision: D5618991

fbshipit-source-id: 8b93bca186523585732c2177540189a1d83f9c90
2017-08-14 11:05:35 -07:00
David Aurelio 475cf1ad29 Allow to pass regular expressions to `buildRegExps`
Summary: Allows to use `setupBabel.buildRegExps` with regular expressions, not only with strings.

Reviewed By: mjesun

Differential Revision: D5614738

fbshipit-source-id: ccad4d49f8d2006a714833989b3c6be2ce7071ab
2017-08-14 08:33:16 -07:00
Paco Estevez Garcia 41504103ce Force the debugger to disconnect before a bundle reload
Reviewed By: bnham

Differential Revision: D5594238

fbshipit-source-id: feff9f179534c8e617f8fa7c8a7b1bc525c07cae
2017-08-14 08:16:52 -07:00
Alexey Lang f11f00197d Gate more code with if (__DEV__) { }
Reviewed By: amnn

Differential Revision: D5621165

fbshipit-source-id: ee8b3df523858323a3ce4484ab56fcae0da3d633
2017-08-14 07:19:00 -07:00
Kathy Gray 419652d4e9 Move native modules into different packages for fb4a shared bundle
Reviewed By: javache

Differential Revision: D5536155

fbshipit-source-id: 4d4bb0415d3012f09e98e185a92a0e1f3fdbc474
2017-08-14 07:02:08 -07:00
Kathy Gray 84e80eb781 Allow reactinstancemanager to set an initialization function
Reviewed By: javache

Differential Revision: D5227811

fbshipit-source-id: e7868481de2a8799af5d6a6bcad26369d054b35e
2017-08-14 07:02:07 -07:00
Alex Dvornikov 6783694158 Add support for Cxx objects as arguments to native modules
Reviewed By: fkgozali

Differential Revision: D5589269

fbshipit-source-id: 1bd7004adc397241cabfb1dc59ba1aebad943bf8
2017-08-14 05:22:17 -07:00
Alex Dvornikov 2a6965df90 Refactor memory management of RCTModuleMethod's arguments
Reviewed By: javache

Differential Revision: D5589246

fbshipit-source-id: a4e70268c818f386784b3e20f0fb97a1c89092d3
2017-08-14 05:22:17 -07:00
Charles Dick 37754c5c83 refactor MemoryPressureListener to use Android levels
Reviewed By: bnham

Differential Revision: D5603426

fbshipit-source-id: 6d09a56544c27e46f4b9ef491798720e37214e47
2017-08-12 06:31:02 -07:00
Rafael Oleza 8b2975ad7b Add multi-client support for HMR
Summary:
This diff builds on top of the refactor to use `async/await` and adds multi-client support to Hot Module Reloading.

Thanks to async/await it's been quite straightforward to add this logic, since the only thing that I've had to do is to create a `Set` with the currently connected clients and passed the specified client to each method that was using the global client before.

This closes https://github.com/facebook/react-native/issues/14334

Reviewed By: davidaurelio

Differential Revision: D5611176

fbshipit-source-id: ec29438887342877c372b61132efada16af58fa5
2017-08-11 12:24:20 -07:00
Rafael Oleza f32d0eed17 Refactor attachHMRServer to use async/await
Reviewed By: davidaurelio

Differential Revision: D5603552

fbshipit-source-id: 8fc5f9bcd35a6adf3e3cdf5de47384d8420601cd
2017-08-11 12:24:20 -07:00
David Aurelio 2512a34bea Add `@providesModule` to `IntegrationTests/WebViewTest.js`
Reviewed By: cpojer

Differential Revision: D5611573

fbshipit-source-id: 78a56524c1941a1d42fb1add5c5410c1bf8597c5
2017-08-11 09:34:44 -07:00
Dmitry Zakharov cf38b083dd Implement lazy discovery scaffolding for loading NativeModules on demand.
Reviewed By: javache

Differential Revision: D5364734

fbshipit-source-id: 5162f7d41434a3ba38c82fa610e84f865bfacf50
2017-08-11 06:41:33 -07:00
Summer Kitahara 21b1ed3115 autoGrow for RN TextInput
Reviewed By: sahrens

Differential Revision: D5527855

fbshipit-source-id: 1dad11851495a0b8b432903537a5a281840dc681
2017-08-10 18:47:35 -07:00
Andrew Y. Chen 64e9b24ef5 Expose the ReactApplicationContext to createShadowNodeInstance()
Reviewed By: AaaChiuuu

Differential Revision: D5581337

fbshipit-source-id: 5030e4f046ede1a99d22b2ffebbbfe79e7ce9c5d
2017-08-10 18:31:59 -07:00
Valentin Shergin b06672e6cf TextInput: `onSubmitEditing` is now woriking with disabled `blurOnSubmit`
Reviewed By: fmoo

Differential Revision: D5606771

fbshipit-source-id: 6b769553c08c56b93036e517f71e011b6ecd779b
2017-08-10 18:19:43 -07:00
Slava Kim 4510760447 React Native: run Relay DevTools runtime
Reviewed By: fkgozali

Differential Revision: D5589121

fbshipit-source-id: 8324e123c0786a7864aaa5ebaa7134ca6afa5c18
2017-08-10 15:48:19 -07:00
Riley Dulin 1df198da02 Expose ModuleRegistry from Instance
Reviewed By: javache

Differential Revision: D5586566

fbshipit-source-id: 786ecf2aa67f12861df7d98f0d32ab79b3d02962
2017-08-10 10:48:25 -07:00
Michael Lee a9eaf6f8a7 Switch soname from .so to .$(ext)
Reviewed By: dinhviethoa

Differential Revision: D5595092

fbshipit-source-id: f6fe1822938693d59f884f0957c7b73d50977668
2017-08-10 10:08:43 -07:00
Kathy Gray 5d4c6e5f23 Rename module name to module path
Reviewed By: javache

Differential Revision: D5592950

fbshipit-source-id: 7e32043ba6d1de129a4f8dc694bb5987393b0ebc
2017-08-10 09:19:20 -07:00
Miguel Jimenez Esun 9b30f56693 Update Jest to 20.1.0-echo.1
Reviewed By: cpojer

Differential Revision: D5591819

fbshipit-source-id: 91830096988d88a6f0601d73225a12ae31e61a17
2017-08-10 07:33:20 -07:00
Rob Hogan cd9d6e34fd WebSocket API change to make room for other connection options (SSL pinning)
Summary:
This is a simple groundwork PR to allow options to be passed to the `WebSocket` constructor. It represents a minor change to an undocumented part of the API, moving `headers` to within `options`.

This will be a BC for anyone manually specifying headers other than `origin` but a) that's not a common use case with WebSockets and b) it's not documented even in code and wouldn't currently pass a flow check.

NB: The third argument to the WebSocket constructor isn't part of the W3C spec, so I think this is a good place for RN-specific named parameters, better than adding a fourth argument. `protocols` needs to stay where it is, in line with the spec.

If this goes through I'd like to build on it by adding an additional connection option for SSL certificate pinning, as already supported by the underlying `okhttp` and `RCTSRWebSocket`. It could later be expanded for various other uses.

Currently, there's no way for a `WebSocket` user to specify any connection options other than url, protocol and headers. The fact that `WebSocket` connects in its constructor means any options have to go in there.

Connect to a websocket server using iOS and Android, observe the connection headers:
1. Without specifying `origin`, the default header should be set
2. Specifying it in the old way `new WebSocket(url, protocols, { origin: 'customorigin.com' })`
3. Specifying it in the new way `new WebSocket(url, protocols, { headers: { origin: 'customorigin.com' }})`.

I've tested myself using the test app with iOS and Android.
Closes https://github.com/facebook/react-native/pull/15334

Differential Revision: D5601675

Pulled By: javache

fbshipit-source-id: 5959d03a3e1d269b2c6775f3e0cf071ff08617bf
2017-08-10 06:02:42 -07:00
Douglas Lowder 0e7375ae36 Apple TV: RCTTabBar selection controlled by native after render (fix #15081)
Summary:
**Motivation**

Fix flickering in TabBarIOS on Apple TV... issue #15081

After this change, on Apple TV, TabBarIOS item selections will be controlled purely from the native side after initial render with the `selected` prop.  This is necessary because the `UITabBar` implementation in tvOS moves the selection before calling `shouldSelectViewController:`; this issue does not occur on iOS.

**Test plan**

Existing CI should still pass. Issue is resolved when testing the example code in #15081 .
Closes https://github.com/facebook/react-native/pull/15220

Differential Revision: D5601671

Pulled By: javache

fbshipit-source-id: c18e7d3482d6c07d534ff40a443a6f642d4267bb
2017-08-10 05:36:06 -07:00
Alexey Lang 3a031cc93a Bring back React Stack support
Reviewed By: javache

Differential Revision: D5547208

fbshipit-source-id: 25cef6aa27fc4f17b26e1088256819ea235f79cf
2017-08-10 04:17:27 -07:00
Kashav Madan c404425d0f Improve spacing in polyfill error messages
Summary:
<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->

Noticed a lack of spacing in the following error message:

```
In this environment the sources for assign MUST be an object.This error is a performance optimization and not spec compliant.
TypeError: In this environment the sources for assign MUST be an object.This error is a performance optimization and not spec compliant.
    at Object.assign (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:230:15)
    at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:134559:46
    at Array.map (native)
    at GridComponent._callee$ (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:134554:58)
    at tryCatch (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:7388:40)
    at Generator.invoke [as _invoke] (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:7576:22)
    at Generator.prototype.(anonymous function) [as next] (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:7413:21)
    at tryCatch (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:7388:40)
    at invoke (http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:7446:20)
    at http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:7476:11
```

Tested by updating the message locally in `/path/to/rn-project/node_modules/react-native/packager/src/Resolver/polyfills/Object.es6.js`.
Closes https://github.com/facebook/react-native/pull/15166

Differential Revision: D5481475

Pulled By: javache

fbshipit-source-id: f3e4e482a8ee61d52e8c3e0c5f038b1109bd1113
2017-08-10 03:56:01 -07:00
Danil Gontovnik d565bc3e3f Fix TextInput numeric keyboard submit
Summary:
When you have a numeric non-multiline `TextInput` and a `returnKeyType` is `done` we automatically add an input accessory view ([implementation](603cc48ceb/Libraries/Text/RCTTextInput.m (L269)#L315)).

That view has a done button which triggers [handleInputAccessoryDoneButton](603cc48ceb/Libraries/Text/RCTTextInput.m (L317...L320)) which currently directly sends `endEditing:` to the text field / text view. As a consequence, the [textInputShouldReturn](603cc48ceb/Libraries/Text/RCTTextInput.m (L118...L121)) is not called and we dismiss the keyboard even if the `blurOnSubmit` value is `false`.

Confirm that the keyboard is not dismissed when you tap on Done button on this `TextInput`:
```
<TextInput
  keyboardType={'numeric'}
  returnKeyType={'done'}
  blurOnSubmit={false}
/>
```

and that the keyboard is dismissed for this `TextInput`:
```
<TextInput
  keyboardType={'numeric'}
  returnKeyType={'done'}
  blurOnSubmit
/>
```
Closes https://github.com/facebook/react-native/pull/15438

Differential Revision: D5601462

Pulled By: javache

fbshipit-source-id: 24e4048e2e66d1a42fa97d83b4a3eb61e5d817ea
2017-08-10 03:36:36 -07:00
Mark 9075ff6b05 Fix typo
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I saw a word missing; I just wanted to correct the typo.

No testing needed for a typo in the documentation
Closes https://github.com/facebook/react-native/pull/15393

Differential Revision: D5601466

Pulled By: javache

fbshipit-source-id: 7cfb6ba957ac4053fd8645af419a7be2361c6c75
2017-08-10 03:21:07 -07:00
Sergei Dryganets 7e515479b0 LocalString doesn't have a check for nullptr
Summary:
LocalString doesn't have a check for null ptr which causes a crash if the null string passed.
Closes https://github.com/facebook/react-native/pull/15372

Differential Revision: D5601469

Pulled By: javache

fbshipit-source-id: a1b20efbae90009f0d465c077e6401a701d7515f
2017-08-10 03:21:07 -07:00
Ben Alpert 92dd6b9c9d Fix destructuring-style PropTypes references
Reviewed By: bvaughn

Differential Revision: D5600808

fbshipit-source-id: 8634d199b3480ea5c65ca095a51278efc3c44bcd
2017-08-09 23:52:51 -07:00
Kyle Decot f17b130c9c Fixes bad link in docs
Summary:
Fixes link in `IntegrationWithExistingApps.md`.
Closes https://github.com/facebook/react-native/pull/15435

Differential Revision: D5600616

Pulled By: shergin

fbshipit-source-id: 64ff5c9e6956274adf2b832b2c71b5092eed26ae
2017-08-09 21:52:30 -07:00
Janic Duplessis b103903ec8 Fix updating a view z-index on Android
Summary:
If the z-index was updated after the initial mount, changes would not be reflected because we did not recalculate the z-index mapped child views and redraw the view. This adds code to do that and call it whenever we update z-index.

**Test plan**
Tested by reproducing the bug with 2 overlapping views that change z-index every second. Made sure it now works properly and z-index changes are reflected.
Closes https://github.com/facebook/react-native/pull/15203

Differential Revision: D5564832

Pulled By: achen1

fbshipit-source-id: 5b6c20147211ce0b7e8954d60f8614eafe128fb4
2017-08-09 20:52:11 -07:00
Ben Alpert 460c5dbdf9 unbreak touching in prod mode
Reviewed By: ejanzer, bvaughn

Differential Revision: D5599808

fbshipit-source-id: bbc666c5a7e15323504100bdf3b04452e152fdb5
2017-08-09 20:02:17 -07:00
Riley Dulin de4e51beaf Make console work with JS engines which use print
Reviewed By: javache

Differential Revision: D5586381

fbshipit-source-id: e40dea048129bef6755817297a7d9eb701f71d41
2017-08-09 18:03:39 -07:00
Brian Vaughn 046f600cc2 React 16 beta 5 sync (5495e49...c3718c4)
Reviewed By: spicyj

Differential Revision: D5564030

fbshipit-source-id: fd3e6133df7ee8e7488a3c515ce6c783c11d9401
2017-08-09 12:35:30 -07:00
Pieter De Baets b1bb0a71d5 Wait for bridge to disappear when running tests
Reviewed By: fkgozali

Differential Revision: D5592347

fbshipit-source-id: c9a672f2d79c8656b72f585aac7c6f5fec6e72b0
2017-08-09 09:50:44 -07:00
Pieter De Baets b78b8cc9e7 Fix infinite recursion in RCTSettingsManager init
Reviewed By: fromcelticpark

Differential Revision: D5592555

fbshipit-source-id: edf5cdd91f057879edb22b8883902fec99b2d2cc
2017-08-09 09:39:40 -07:00
Miguel Jimenez Esun d268c1f731 Upgrade fbjs-scripts
Reviewed By: aaronabramov

Differential Revision: D5486802

fbshipit-source-id: 3b55b3aa9c8ab354aee9abcba7b933fe83a6e2d6
2017-08-09 07:48:16 -07:00
Pieter De Baets c984d04f11 Merge fishhook.xcodeproj in RCTWebSocket
Reviewed By: emilsjolander

Differential Revision: D5592235

fbshipit-source-id: dce70c337080041d3660a521359151218c504dd8
2017-08-09 07:48:09 -07:00
Pieter De Baets 39eb6c5053 Fix podspec test
Summary:
Travis-CI
Closes https://github.com/facebook/react-native/pull/15428

Differential Revision: D5592214

Pulled By: javache

fbshipit-source-id: f006976d7183d845201c001be51d1546c9c31c5a
2017-08-09 07:04:59 -07:00
Julien K f06d992964 Fix syntax error
Summary:
It is not itemPositoning it is itemPositioning

I have test it on iOS and tvOS
Closes https://github.com/facebook/react-native/pull/15426

Differential Revision: D5591807

Pulled By: javache

fbshipit-source-id: 0ad0bc32012c63f93f6b1528cae46c6dcba56706
2017-08-09 04:25:08 -07:00
Dave Lee d81e549297 Fix format specifier used in RCTUIManager
Summary:
Here, `reactTag` is an `NSNumber *` which uses `%@` as the format specifier. Newer versions of clang can warn or error on this. This change prevents that from happening.

See also #15402

Local builds with clang 5.
Closes https://github.com/facebook/react-native/pull/15414

Differential Revision: D5583703

Pulled By: javache

fbshipit-source-id: a6d0d2246725cd096b1f3cd062ab5924740ab76c
2017-08-09 04:25:08 -07:00
Pieter De Baets b06bfdd280 Fix crash when converting NSNull values
Reviewed By: fkgozali

Differential Revision: D5583401

fbshipit-source-id: 7adbdaf91c3f7d9a87f44c53ff342c54a04a1e50
2017-08-09 03:35:16 -07:00
Pieter De Baets 0241cb76d1 Improve definition of RCTNilIfNull
Reviewed By: fkgozali

Differential Revision: D5479733

fbshipit-source-id: 460845f79a970dd6614b11de3ce8898ea17ae1dc
2017-08-09 03:35:16 -07:00
David Aurelio 55117ea607 Remove typed option loading
Summary: The API to load custom config types is no longer needed, and can be removed

Reviewed By: cpojer

Differential Revision: D5579721

fbshipit-source-id: f8bc117491134c1177cf17a84360524432579ab9
2017-08-08 19:11:15 -07:00
Pranay Prakash bb7a78c446 Add travis bot for react-native
Reviewed By: AaaChiuuu

Differential Revision: D5588729

fbshipit-source-id: 7d1a08696f7680efb16cdbdb0ba131414d099962
2017-08-08 18:48:54 -07:00
Oleg Lokhvitsky ad21ad2559 Fix stale separator props and expose CellRenderer refs
Reviewed By: sahrens

Differential Revision: D5554920

fbshipit-source-id: 4b6ebc88603afeb642b2860c6069f28cb415d8be
2017-08-08 17:01:39 -07:00
dlowder-salesforce d9db3bc4bf Fishhook needs to support Apple TV
Summary:
**Motivation**

Fix compile error in Apple TV caused by RCTWebSocket using fishhook library.

**Test plan**

objc-tvos Travis tests are currently breaking, this should fix it.
Closes https://github.com/facebook/react-native/pull/15416

Differential Revision: D5587637

Pulled By: hramos

fbshipit-source-id: f05e765d7044650caf6d500fe21249e3fdc4f181
2017-08-08 16:06:08 -07:00
Dave Lee 0e3117c972 Fix format specifier used in RCTCxxMethod
Summary:
[`CxxModule::Method::callbacks`](2161f92aaf/ReactCommon/cxxreact/CxxModule.h (L66)) is `size_t` which uses `%zu` as the format specifier. Newer versions of clang can warn or error on this. This change prevents that from happening.

Local builds with clang 5.
Closes https://github.com/facebook/react-native/pull/15402

Differential Revision: D5583710

Pulled By: javache

fbshipit-source-id: 1d1e740c275fddfea177cf9476cd1d03b7e27330
2017-08-08 11:55:17 -07:00
Ben Nham d013ba3915 add perf marker that fires first time content is added to root view
Reviewed By: javache

Differential Revision: D5582838

fbshipit-source-id: f90376ab11b4d44c002759829e4b2bbb4bbeeb56
2017-08-08 10:48:27 -07:00
Andres Suarez cc4de7abc4 Reject local-cli promises with Error objects
Reviewed By: davidaurelio

Differential Revision: D5581520

fbshipit-source-id: 4929906ac79271c17e65fbdf5ba635f06efefd76
2017-08-08 09:38:21 -07:00