Commit Graph

10427 Commits

Author SHA1 Message Date
Tim Yung 73c85e4f31 RN: Cleanup Flow / Jest / Metro Configs
Reviewed By: kassens

Differential Revision: D4777088

fbshipit-source-id: d07f4d1dd019a814c8bee4caeb57fc1dd3721c27
2017-03-26 16:05:10 -07:00
Aaron Chiu e2204c5ccb measure delay of calling into UI thread when setting up ReactContext
Reviewed By: yungsters

Differential Revision: D4736627

fbshipit-source-id: 6d425ef0ad7bbd54296a619009136c929cb16030
2017-03-25 09:52:16 -07:00
Brian Vaughn 848593c0f0 Moved takeSnapshot method from UIManager to ReactNative
Reviewed By: spicyj

Differential Revision: D4767428

fbshipit-source-id: 77c80c0135641ab46f9dce2763f27499a96373a0
2017-03-25 00:46:54 -07:00
Héctor Ramos 30778b62ea Update RunningOnDevice.md
Summary:
Taking another pass at this doc after running apps on iOS and Android devices this week. Of note, the Connecting to Dev server section on iOS seemed incomplete.

Tested steps on iOS and Android.

Tested rendering of the site on all permutations.
Closes https://github.com/facebook/react-native/pull/13143

Differential Revision: D4775026

Pulled By: hramos

fbshipit-source-id: 9b64120922a093ac646d12861d8dee98fb4e5d7d
2017-03-24 18:45:58 -07:00
dabit1 94d93f7d41 PositionError must be an object, not string
Summary:
As specifications says, the Position error must be an object with code and message attributes. Right now it is a string. If not, we can't know what kind of error is. Another issue is that the message must be exactly "No available location provider."

Specifications:
https://developer.mozilla.org/en/docs/Web/API/PositionError
Closes https://github.com/facebook/react-native/pull/13140

Differential Revision: D4774922

Pulled By: ericvicenti

fbshipit-source-id: f956af051461e9f8d6435496283e54b3c4dc8ef5
2017-03-24 18:30:59 -07:00
Spencer Ahrens 27c3e32abf FrameRateLogger JS module
Summary:
This adds a flowified JS module for the FrameRateLogger native module and plugs
it into `ScrollResponder` and `AppRegistry`.

If there is no `FrameRateLogger` native module, then the function calls will be no-ops.

One major limitation is that we can't track animated/programatic scrolls because we don't
have reliable end events. Would be generally useful to add those in a followup though.

Reviewed By: fkgozali

Differential Revision: D4765694

fbshipit-source-id: f3bec771df6ac918200c1afd1a7d8b6da540a4e2
2017-03-24 18:30:59 -07:00
Sokovikov c87c4d052f Fixed previously broken support for negative `scale` (`transform` style property)
Summary:
closes #13081

UIExplorer, TransformExample
Closes https://github.com/facebook/react-native/pull/13083

Reviewed By: mmmulani

Differential Revision: D4758237

Pulled By: shergin

fbshipit-source-id: 58385a4cde7a739b6657c293c381644a92918265
2017-03-24 18:15:42 -07:00
Eric Vicenti 09fe99972d Fix license headers on SwipableRow
Reviewed By: hramos

Differential Revision: D4770164

fbshipit-source-id: fc1cbbdd2161d4fd307cb14821318466fa6fca57
2017-03-24 14:47:28 -07:00
Eric Vicenti 8ff813e6e0 Fix license header on websocket_integration_test_server
Reviewed By: hramos

Differential Revision: D4770121

fbshipit-source-id: c05b45e8775cf3d05c8c9a6e87ab35a3bd032087
2017-03-24 14:47:25 -07:00
Eric Vicenti ff4468ad1b Re-License Lists with standard React Native License
Reviewed By: sahrens

Differential Revision: D4771084

fbshipit-source-id: 9878a813b7dacb6ec1215fee469b946df0752de9
2017-03-24 14:31:19 -07:00
Eric Vicenti 77d52fecbe Remove old examples from RN repo
Summary:
React Native originally shipped with these examples, which have gotten super old and unmaintained.

Cruft like this in the core repo only slows us down with extra issues and pull requests. Eventually we may create a different repo for samples that will be maintained into the future.

We are doing some spring cleaning in the repo, so now is a good time to remove these and let the community share their own examples.
Closes https://github.com/facebook/react-native/pull/13064

Differential Revision: D4770699

Pulled By: ericvicenti

fbshipit-source-id: bbcdec336b28e5a9330afbdb6b166e94e15fa485
2017-03-24 14:17:40 -07:00
Lee Byron d2fc08d33b Move classic relay into oss packages
Reviewed By: kassens

Differential Revision: D4769497

fbshipit-source-id: 0144456a82c3969b399a4a0b37814b5627d191c5
2017-03-24 11:31:01 -07:00
Andrew Y. Chen 820c8e2466 Instrumentation test for PokesDashboardApp
Reviewed By: AaaChiuuu

Differential Revision: D4758149

fbshipit-source-id: 17e448d44af4deccc288738d294146a612d5e9c3
2017-03-24 11:16:21 -07:00
Pieter De Baets 3f46e591ff Fix crash when overriding native modules on RCTJSCExecutor
Reviewed By: alexeylang

Differential Revision: D4769955

fbshipit-source-id: 20f4f4c469eafbe2c7a81ad9f5b9a8386195a8ac
2017-03-24 09:31:04 -07:00
Andrew Y. Chen 893689c82b Fix buck build
Reviewed By: AaaChiuuu

Differential Revision: D4768765

fbshipit-source-id: 91e34faa2fe864b9a9835e6dab07c8396477505f
2017-03-24 08:47:02 -07:00
Pieter De Baets ff7fb6efda Allow overrides of NativeModules
Reviewed By: mhorowitz

Differential Revision: D4764126

fbshipit-source-id: 036f848f8b3debbb3cc4a34fc99044304615760e
2017-03-24 05:04:05 -07:00
Brian Vaughn de8ce45258 Ran codemod to replace View.propTypes with ViewPropTypes
Reviewed By: yungsters

Differential Revision: D4764838

fbshipit-source-id: 0b47a0fdd6793dab9333bb73bb93053fccc27dae
2017-03-24 00:30:48 -07:00
jrodiger f891985bd8 Update runAndroid.js to fix startServerInNewWindow() (Windows)
Summary:
**Motivation**
Resolves issue: #12367. The issue is that the packager does not launch automatically on Windows when running `react-native run-android` like it does on OSX. The proposed change fixes this issue, and causes the packager to be launched automatically on Windows 10. Also note the updated code uses the syntax described in the [Node.js documentation](https://nodejs.org/api/all.html#child_process_spawning_bat_and_cmd_files_on_windows) on spawning .bat files on Windows.

**Test plan**
Manually tested on Windows 10.

Running just `react-native run-android` now results in the packager launching, without needing to run `react-native start` in a new command prompt window.

**Screenshot:**
![packager](https://cloud.githubusercontent.com/assets/17132071/23641540/8d82bb7c-02c2-11e7-9c47-d1c9b582bd65.png)
Closes https://github.com/facebook/react-native/pull/12755

Differential Revision: D4767321

fbshipit-source-id: a14f369ba99939aa44d0ee3403e1d262e2657e6e
2017-03-23 18:20:10 -07:00
Brian Vaughn 9a88c72163 Exposed new ViewPropTypes object on ReactNative renderer (stack and fiber)
Reviewed By: yungsters

Differential Revision: D4765002

fbshipit-source-id: 54be903bf6529df7ab2cff265c1f87b145da8d94
2017-03-23 17:45:30 -07:00
Eric Vicenti febf3d00ed Remove Deprecated NavigationExperimental
Summary:
Now that there are a number of good navigation solutions provided by the community, we are ready to remove NavigationExperimental from the RN core. The latest navigation doc explains the available options pretty well: http://facebook.github.io/react-native/docs/navigation.html . We should also add a mention to Airbnb's new native-navigation.

For anybody who continues to rely on it, it is recommended to migrate to React Navigation, which will be maintained over the long-term. For those who cannot migrate yet, it is possible to copy this code into your app.
Closes https://github.com/facebook/react-native/pull/13066

Differential Revision: D4757539

Pulled By: ericvicenti

fbshipit-source-id: 949d9b33f188584fb095155fa67d3ce24beba29f
2017-03-23 17:29:56 -07:00
Gabe Levi d868e86df0 Deploy v0.42.0
Reviewed By: zertosh

Differential Revision: D4732064

fbshipit-source-id: 12fb8f9aff983ff5d1cb01f413bab761259829f9
2017-03-23 16:46:23 -07:00
Pieter De Baets 7c9173bc9e Enable -Wimplicit-retain-self en sync warning config for all projects
Summary:
This is enforced for all of our internal iOS code and a common cause of import failures.

cc janicduplessis
Closes https://github.com/facebook/react-native/pull/13124

Differential Revision: D4765016

fbshipit-source-id: 7c8248c98bca0fa6bad24d5a52b666243375e0db
2017-03-23 15:01:34 -07:00
Jean Lauliac 20ba987139 packager: TerminalReporter: stop reporting global cache errors
Summary: At FB we log errors into the error infra, and these errors are not actionnable for end users, so let's reduce the noise generated on the terminal. In the OSS case, people can simply add a handler in a TerminalReporter decorator, the same way we do internally (anyhow, I do not know of anyone using the global cache in OSS for now).

Reviewed By: davidaurelio

Differential Revision: D4762858

fbshipit-source-id: 880c02e175ae551df11b7ce273acc318222c46bf
2017-03-23 12:31:39 -07:00
Michael Lee dcf3cbeb31 Clean up some of the ReactNative Buck rules
Reviewed By: yangchi

Differential Revision: D4739284

fbshipit-source-id: 0ee335df0d114631e5fc60d5d6e51547e5312d39
2017-03-23 12:02:25 -07:00
Gustavo Perdomo 3df654e28e Integrare UNUserNotification
Summary:
Implementing removeAllDeliveredNotifications and removeDeliveredNotifications for remove notifications from notification center, and getDeliveredNotifications

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.

Currently, calling PushNotificationIOS.cancelAllLocalNotifications not remove the notification from the Notification Center

In iOS 10, a new UNUserNotification class was introduced, this class has a method which get and remove the notifications from notification center

This PR try to solve that.

In my case, i'm working with an messaging app, every message is a new notification, when the user tap a notification, the app is opened and the rest of notifications should be gon
Closes https://github.com/facebook/react-native/pull/13036

Differential Revision: D4761828

Pulled By: javache

fbshipit-source-id: 216e44a64f1bf88b5ae3045d1fa6eca8a1278a71
2017-03-23 12:02:25 -07:00
Pieter De Baets 9d377e98a0 Fix warnings in React.xcodeproj
Summary:
Various fixes of xcode projects and cleaning up some warnings
Closes https://github.com/facebook/react-native/pull/13109

Differential Revision: D4762652

Pulled By: lacker

fbshipit-source-id: b452976a58962439de4adecc8e703264af40cb38
2017-03-23 11:36:17 -07:00
Hector Ramos 1f15c7526a Fix broken icons in Safari
Summary:
The Play Store started serving WebP files for these icons, which are not rendered well in Safari. Switched to JPEGs from the App Store.

Periodical pruning of the showcase: Removed several entries to keep the showcase fresh.
Closes https://github.com/facebook/react-native/pull/13098

Differential Revision: D4762944

Pulled By: hramos

fbshipit-source-id: 5f9c43fd186f20b432c54496b143b4a9dd5851e3
2017-03-23 11:20:46 -07:00
Héctor Ramos 53f9e6a659 Update ISSUE_TEMPLATE.md
Summary:
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.

What existing problem does the pull request solve?

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

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.
Closes https://github.com/facebook/react-native/pull/13122

Differential Revision: D4763115

Pulled By: hramos

fbshipit-source-id: 5d4852a133d42e3fd6eb084cf491a672cf075c29
2017-03-23 11:20:46 -07:00
Jean Lauliac 337daa3d19 packager: ResolutionRequest.js: sync _resolveHasteDependency()
Summary: Some more synchronicity, one step at a time.

Reviewed By: davidaurelio

Differential Revision: D4756542

fbshipit-source-id: 0c56dbca61b3da764aa8d28e29c0e20b54de091e
2017-03-23 11:20:46 -07:00
Jean Lauliac 3f0f7357cf packager: ResolutionRequest.js: sync _resolveFileOrDir
Reviewed By: davidaurelio

Differential Revision: D4754138

fbshipit-source-id: d19792a726220a673dead1c8c6cdf487e34a6808
2017-03-23 11:20:46 -07:00
Jean Lauliac f06384b1b7 packager: ResolutionRequest.js: _loadAsDir and _loadAsFile sync
Reviewed By: davidaurelio

Differential Revision: D4754090

fbshipit-source-id: 84ad1d988bf097d3094d90f3738ce64cc523879c
2017-03-23 11:20:46 -07:00
Héctor Ramos 10918680eb Fix grammar in the "Running on a device" docs
Summary:
The wording had some grammar issues. The instructions were also not as precise as they could be.

Verified on Xcode 8.2.1.
Closes https://github.com/facebook/react-native/pull/13093

Differential Revision: D4763071

Pulled By: hramos

fbshipit-source-id: fe9da098f0e457efba4712db704692f6f4857624
2017-03-23 11:20:46 -07:00
Andrew Y. Chen 04ccbdd887 Move NetworkRecordingModuleMock into testing/network
Reviewed By: AaaChiuuu

Differential Revision: D4755904

fbshipit-source-id: 8a68530453b1d288da402f17e16fec9c57e5bb2a
2017-03-23 11:03:44 -07:00
Brian Vaughn 333dd59533 ReactNativeFiber findNodeHandle() bugfix
Reviewed By: sahrens

Differential Revision: D4762397

fbshipit-source-id: d047f5c77067dbf8b0331695bb661e04ce00913c
2017-03-23 11:03:43 -07:00
Peter Hoang 123311cad2 Update GettingStarted.md
Summary:
Typing "android avd" into the terminal is not supported anymore. The android command is no longer available. There are workarounds, but it involves replacing files with the older ones.

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.

What existing problem does the pull request solve?

A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.

If you have added code that should be tested, add tests.

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

Small pull requests are much easier to review and more likely to get merged
Closes https://github.com/facebook/react-native/pull/13096

Reviewed By: AsyncDBConnMarkedDownDBException

Differential Revision: D4762937

Pulled By: AsyncDBConnMarkedDownDBException

fbshipit-source-id: 5289402d7e6934d3493a902247a991cd1d887ec0
2017-03-23 10:45:21 -07:00
Brian Vaughn 53905a537a ReactNative moved View.propTypes to ViewPropTypes
Reviewed By: yungsters

Differential Revision: D4761354

fbshipit-source-id: b49922d78ee5d8628f945e5dee476ffe5d889b07
2017-03-23 09:15:42 -07:00
Pieter De Baets a2cfea1934 Fix usages of ReactComponentWithPureRenderMixin
Summary: Closes https://github.com/facebook/react-native/pull/13111

Differential Revision: D4761971

Pulled By: davidaurelio

fbshipit-source-id: 668dcc58e8e1b075ee760233abc6904beede9218
2017-03-23 06:33:24 -07:00
Tim 720e19525e Picker (android): Convert children to an array before accessing with a position
Summary:
When using the following component, `this.props.children` is not a flat array.

``` js
class Example extends Component {
    // ...

    render() {
        const values = ['1', '2'];

        return (
            <Picker
                value={this.state.value}
                onValueChange={this.onValueChange.bind(this)}
            >
                <Picker.Item
                    label="n/a"
                    value={null}
                />

                {values.map(value => {
                    return (
                        <Picker.Item
                            label={value}
                            value={value}
                        />
                    );
                })}
            </Picker>
        );
    }
}
```

The resulting `this.props.children` is:

``` js
[
    (child),
    [
        (child),
        (child),
    ],
];
```

Therefor you can't use `this.props.children[2]` to get the last item.

The Android version of the [Picker](https://facebook.github.io/react-native/do
Closes https://github.com/facebook/react-native/pull/8153

Differential Revision: D4753480

Pulled By: javache

fbshipit-source-id: deb0264746b39303e66c69c191af0c962db39085
2017-03-23 06:16:51 -07:00
Yann Pringault 8a8f34ae10 Improve dark mode for debugger
Summary:
* Added a label so we can click on the text to toggle the dark mode
* Added `height: 100%` in the CSS to make the dark background fill the entire view
* Improving JS code with `classList.toggle()` instead of redundant `if else` and fragile `document.styleSheets` access
* Adjusted the link color in dark mode to be less flashy

![image](https://cloud.githubusercontent.com/assets/5436545/24155304/bb80bb9a-0e53-11e7-9298-ce2c1ec6672c.png)

![image](https://cloud.githubusercontent.com/assets/5436545/24155311/c27e85f8-0e53-11e7-87ae-0245f54870c5.png)
Closes https://github.com/facebook/react-native/pull/13052

Differential Revision: D4748893

fbshipit-source-id: a81266c52b24f8e5dcedf0b9f37134688342d8d2
2017-03-23 04:38:57 -07:00
Janic Duplessis 971c2be070 Remove duplicate flow ignore
Summary:
Added this as part of a random PR to get flow passing. This collides with a similar fix by bvaughn so let's remove mine. Also I messed up and there is a + at the start of the line :o
Closes https://github.com/facebook/react-native/pull/13103

Differential Revision: D4761349

fbshipit-source-id: 0abde66a1ac4c185bbd7142ecd800cf5ac8f3c5b
2017-03-22 23:36:08 -07:00
Brian Vaughn 703936d9e3 Sync React master (and 16 alpha 4)
Reviewed By: sebmarkbage

Differential Revision: D4747529

fbshipit-source-id: 5efea6422a2502f27c1b23506cbae2187c7f7b0d
2017-03-22 21:30:50 -07:00
Janic Duplessis 14c31d93da Remove React addons from react-native-implementation
Summary:
These modules don't exist in React anymore so this causes new apps to redscreen because the packager cannot resolve those modules.

**Test plan**
Tested that this and removing NavigationExperimental (it also uses removed React exports) causes UIExplorer to work again.
Closes https://github.com/facebook/react-native/pull/13095

Differential Revision: D4757762

Pulled By: ericvicenti

fbshipit-source-id: bb246d4c6b15f5d3c71e31f133a468aea220f308
2017-03-22 17:46:01 -07:00
Andrew Clark d9910a5d61 Use checkPropTypes instead of directly calling PropTypes
Reviewed By: sebmarkbage

Differential Revision: D4748563

fbshipit-source-id: 137c8bd637549c455bff3be61143e8e438c6a886
2017-03-22 16:04:12 -07:00
Jean Lauliac 30548427ef packager: Module.js: cover the error cases
Summary: We want any exception thrown by `_getHasteName` to be captured by the promise instead of breaking the outer stack.

Reviewed By: davidaurelio

Differential Revision: D4754825

fbshipit-source-id: 173c7c8867da73efb198ed3159704d6fd0e7b87d
2017-03-22 12:01:45 -07:00
Jean Lauliac 909d2e5503 packager: Package.js: cover the error cases
Summary: In case the sync function throws, it wouldn't be handled through the promise anymore, that is not what we want. So we revert that in this changeset.

Reviewed By: davidaurelio

Differential Revision: D4754740

fbshipit-source-id: 4da360f4b629bbdf9cd284389060429cc9259c2c
2017-03-22 11:49:08 -07:00
Jonathan Lawlor 379b60d5e8 Fix ClassCastException in ReactModuleSpecProcessor
Reviewed By: AaaChiuuu

Differential Revision: D4752195

fbshipit-source-id: 7c01f9be4d82dbc605f1e6d3b217f0c83f177165
2017-03-22 11:17:48 -07:00
Brian Vaughn ef3db66bb1 Added deprecation warning for View.* static accessibility traits accessors
Reviewed By: spicyj

Differential Revision: D4749932

fbshipit-source-id: 5f07200e953f589f939196a161a1bc796c553868
2017-03-22 10:00:54 -07:00
Jean Lauliac 5eb954f660 packager: Module.js: make read()-based API sync
Reviewed By: davidaurelio

Differential Revision: D4746218

fbshipit-source-id: 1a36bd00a47a6b871cc77433b2325a11e90035b2
2017-03-22 08:31:07 -07:00
Alexey Lang e22898bcff Refactor measuring app require time
Reviewed By: javache

Differential Revision: D4746020

fbshipit-source-id: cfc9de286feeac49b4b569560dc29c7a1c25eee1
2017-03-22 08:00:27 -07:00
Jean Lauliac ebd8b2ab43 packager: Package.js: make read()-based API sync
Reviewed By: davidaurelio

Differential Revision: D4745885

fbshipit-source-id: 3d327e5ca91fcbe7ec1d30ff8e6135b415074aa4
2017-03-22 06:54:20 -07:00