Граф коммитов

155 Коммитов

Автор SHA1 Сообщение Дата
Eli White 9a31fa5fd6 Delete ensureComponentIsNative.js
Summary:
This function was used by Touchable*. It was removed from the Touchables in D6494579 in 2017. The only remaining callsite was ImageBackground which is attaching a ref directly to the View so we know it is a native component.

This is needed for some setNativeProps cleanup

Reviewed By: sahrens

Differential Revision: D16796973

fbshipit-source-id: 19379094b3b91920efac4bf1969fc22d4b80bcc6
2019-08-14 11:46:58 -07:00
Logan Daniels 91f139b941 xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16657770

fbshipit-source-id: 4e260842c838a35317515044c54ccf55a083da33
2019-08-09 10:11:15 -07:00
Ramanpreet Nara ccde2fda6a Add NativeModule Spec for StatusBarManager
Summary: This diff introduces NativeStatusBarManager.

Reviewed By: mdvacca

Differential Revision: D16371384

fbshipit-source-id: a5485f8dec53a8f3f5bd22ad76e9f8ee0fc56f4c
2019-07-24 15:24:49 -07:00
Rick Hanlon 42cf8a9241 Retry add JS view config for View
Summary: Adds the JavaScript view config for View

Reviewed By: TheSavior

Differential Revision: D15862368

fbshipit-source-id: 8a6a77cf57e84744044a2d6034aff2be6e600f5f
2019-07-22 09:30:31 -07:00
Christoph Nakazawa 5dade01ca6 Remove setupDevtools file
Summary: There is a `setUpDeveloperTools.js` and a `setupDevtools.js` files. While they do set up different devtools it is very confusing to have these two files. This diff inlines one in the other which should bring more clarity.

Reviewed By: gaearon

Differential Revision: D16121236

fbshipit-source-id: 45641c7af9639ede6dc237ac53b763cd804a05c2
2019-07-04 09:22:09 -07:00
Eli White 28f1aac88c Remove extra component wrapper from View
Summary:
View needed this wrapper to add a dev time warning about text children. Text children became supported and this warning was removed in https://github.com/facebook/react-native/pull/23195

This check is no longer necessary and we can reduce the overhead and improve the performance of View by removing this.

Reviewed By: rickhanlonii

Differential Revision: D15914658

fbshipit-source-id: 6456a9cb356245fa8104036b2948aa5c5bf39e0f
2019-06-20 18:29:41 -07:00
Ryan Dy a4acd8899f mock Animated components with versions that skipSetNativeProps (#25108)
Summary:
Using Animated components like View and Image do not get created with __skipSetNativeProps_FOR_TESTS_ONLY = true since they get created before the jest mock can be applied to createAnimatedComponent. For these components mock getters to create versions that properly skip set native props.

Jest tests that render these components get warnings the setNativeProps gets called even though using a testRenderer this should not happen.

## Changelog

[Javascript] [Fixed] - Define Animated Components for react-native/jest/setup that properly skip setNativeProps
Pull Request resolved: https://github.com/facebook/react-native/pull/25108

Differential Revision: D15779434

Pulled By: cpojer

fbshipit-source-id: f39e21ed8e71c2c155297c791d3bf573909896d6
2019-06-12 06:24:25 -07:00
Michał Pierzchała ea090a10e6 Bump CLI to 2.0.0-rc.0 (#25175)
Summary:
Upgrading the CLI to the latest with a bunch of fixes and features included.

## Changelog

[General] [Changed] - Bump CLI to 2.0.0-rc.0
Pull Request resolved: https://github.com/facebook/react-native/pull/25175

Differential Revision: D15694764

Pulled By: cpojer

fbshipit-source-id: 25fbf1c275ed5379e1cdb372512b6bb6327dea92
2019-06-07 03:09:35 -07:00
James Ide 7a2463e1f3 Delete hasteImpl, providesModuleNodeModules, and modulePathNameMapper (#24811)
Summary:
**Depends on https://github.com/facebook/react-native/pull/25100**

This commit depends on having migrated all of RN away from Haste. With 100% standard path-based requires, the key foundation is set and we no longer need `hasteImpl` and related settings in the Jest configuration.

This commit deletes the `hasteImpl` file and setting as well as `providesModuleNodeModules` and `modulePathNameMapper`, removing most of the dependency graph overriding performed by Jest.

## Changelog

[General] [Changed] - Delete hasteImpl, providesModuleNodeModules, and modulePathNameMapper from Jest config
Pull Request resolved: https://github.com/facebook/react-native/pull/24811

Differential Revision: D15659274

Pulled By: cpojer

fbshipit-source-id: 8a4a3b97ddf7e38fbe62c6d3cc9c98248bfca343
2019-06-05 10:55:08 -07:00
Eric Lewis 18fededae0 add spec for I18nManager (#24908)
Summary:
Part of #24875.

## Changelog

[General] [Added] - add TM spec for I18nManager
Pull Request resolved: https://github.com/facebook/react-native/pull/24908

Reviewed By: fkgozali

Differential Revision: D15395163

Pulled By: RSNara

fbshipit-source-id: 8fd3a5a8ce5d0f74132efff4fae7224eab03405b
2019-05-31 19:56:37 -07:00
James Ide 1ed352517a Explicitly separate mocked native modules from mocked JS modules (#24809)
Summary:
This commit more clearly defines the mocks RN sets up and uses paths instead of Haste names to define the mocks. The Jest setup script defined mocks for native modules (Obj-C, Java) and mocks for JS modules in the same data structure. This meant that some non-native modules (that is, JS modules) were in the `mockNativeModules` map -- this commit splits them out and mocks them in typical `jest.mock` fashion.

Additionally, the setup script used to mock the modules using the Haste names. As one of the steps toward migrating to standard path-based imports, the setup script now mocks JS modules using paths (native modules don't need a Haste name nor path since they are just entries in `NativeModules`). This gets us closer to being able to remove `hasteImpl`. (Tracking in https://github.com/facebook/react-native/issues/24772.)

Also, this commit removes mocks that are not referenced anywhere in the RN and React repositories (grepped for the names and found no entries outside of the Jest setup scripts).

## Changelog

[General] [Changed] - Explicitly separate mocked native modules from mocked JS modules
Pull Request resolved: https://github.com/facebook/react-native/pull/24809

Differential Revision: D15316882

Pulled By: cpojer

fbshipit-source-id: 039e4e320121bea9580196fe0a091b8b1e8b41bf
2019-05-31 03:19:49 -07:00
Tom Sanderson 7fd08e1461 add spec for PlatformConstants (#24928)
Summary:
part of #24875.

## Changelog

[General] [Added] - add TM spec for PlatformConstants
Pull Request resolved: https://github.com/facebook/react-native/pull/24928

Reviewed By: RSNara

Differential Revision: D15551340

Pulled By: fkgozali

fbshipit-source-id: 9de15ff4cfe717f963332868bd873d5147a37506
2019-05-30 14:29:42 -07:00
Emily Janzer 96a5001024 Add spec for DeviceInfo module
Summary: Adding flow types for DeviceInfo module and migrating our codebase over to using `DeviceInfo.getConstants()`

Reviewed By: fkgozali

Differential Revision: D14645744

fbshipit-source-id: e30a060c6dc92938cd1420ba11a1d837c79d1e32
2019-05-29 16:37:15 -07:00
Rick Hanlon ac62274e56 Use generated view config for ActivityIndicatorView
Summary: This diff moves ActivityIndicatorView to the generated view config

Reviewed By: shergin

Differential Revision: D15392561

fbshipit-source-id: 67a2fa0dbbb884af9e9c02b9062d3a610a023240
2019-05-24 09:21:27 -07:00
Eric Lewis 342c81d754 Add spec for BlobModule (#24909)
Summary:
Part of #24875. Not sure that the id’s types are necessarily correct here…

## Changelog

[General] [Added] - Add TM spec for BlobModule
Pull Request resolved: https://github.com/facebook/react-native/pull/24909

Reviewed By: fkgozali

Differential Revision: D15433753

Pulled By: RSNara

fbshipit-source-id: 68193d1a82fc7c66d6cc7ba4f22a0d3786987599
2019-05-22 13:10:25 -07:00
Jean Regisser 163fb08792 Add spec for SourceCode (#24901)
Summary:
Part of #24875

## Changelog

[General] [Added] - Add TurboModule spec for SourceCode
Pull Request resolved: https://github.com/facebook/react-native/pull/24901

Reviewed By: fkgozali

Differential Revision: D15391727

Pulled By: rickhanlonii

fbshipit-source-id: 9d4622d809efdc3955d435c5a51b72c38cedccc5
2019-05-22 03:27:54 -07:00
James Ide 59749f527a Migrate Jest setup scripts from Haste to path-based requires (#24753)
Summary:
This is another step in moving RN towards standard path-based requires. All the requires in Jest's setup script have been rewritten to use relative requires. This commit uses relative requires instead of `react-native/...` so that if Facebook were to stop syncing out certain folders and therefore remove code from the react-native package, internal code at Facebook would not need to change.

[General] [Changed] - Migrate Jest setup scripts from Haste to path-based requires
Pull Request resolved: https://github.com/facebook/react-native/pull/24753

Differential Revision: D15258238

Pulled By: cpojer

fbshipit-source-id: aa05dc8ea2e4ba195226e8ec7ba6482b7de03240
2019-05-08 06:59:47 -07:00
Nicolas Breidinger 28e0de070d Fix HasteImpl Regex (#24628)
Summary:
The jest HasteImpl's `pluginNameReducers` regex was not properly escaping a backslash, resulting in unintended behavior.

The intent of the code is to strip the `.${name}` from the end of a filepath, where `name` is a platform name. The correct regex for that would be `^(.*)\.(myPlat)$`, but because the regex is being constructed from a string, the `\.` is being interpreted as an escaped period, resulting in the regex  `^(.*).(myPlat)$`. To correct this, the backslash needs to be escaped so it makes it into the regex.

[General] [Fixed] - Fix HasteImpl platform name regex
Pull Request resolved: https://github.com/facebook/react-native/pull/24628

Differential Revision: D15224468

Pulled By: hramos

fbshipit-source-id: 6eb507aa5410bdd7c247e6d301052d41995a2f11
2019-05-06 15:56:15 -07:00
empyrical b27d1d3da2 Remove out-of-tree platform tests (#24536)
Summary:
This pull request removes the tests for out-of-tree platforms and the dependency on the package `react-native-dummy` from the React Native repo.

The logic that this was meant to test was moved to the React Native CLI repo, and [it is being tested there](827daa4c16/packages/cli/src/tools/config/__tests__/index-test.js (L125-L152)) as well making this a bit redundant at this point.

The dependency on `react-native-dummy` was also an issue, because when the file structure under `Libraries/` changes, bundler errors could crop up if there wasn't an update made to the file structure of `react-native-dummy/Libraries/`.

This was an issue when [`TabBarIOS` was removed](02697291ff (diff-b9cfc7f2cdf78a7f4b91a753d10865a2)) - `react-native-dummy` was causing Haste errors and was stopping the commit from being able to land, and I needed to cut a new version just for it. With Lean Core, I expect more issues like this happening in the future.

[General] [Removed] - Removed Out-of-Tree platform tests (functionality is tested in the RN-CLI repo now)
Pull Request resolved: https://github.com/facebook/react-native/pull/24536

Differential Revision: D15063320

Pulled By: cpojer

fbshipit-source-id: 2a0467bed326b286623fa3cfa4e0bb6959b66b78
2019-04-24 07:56:30 -07:00
Brandon Carroll de12b98cd5 WIP: add snapshots for mocked and unmocked components (#24554)
Summary:
Per a conversation with TheSavior, in #24538, this adds snapshot tests for all components whose mocks will be addressed in that PR. Shallow and deep snapshots are included.

[General] [Added] - Snapshots
Pull Request resolved: https://github.com/facebook/react-native/pull/24554

Differential Revision: D15062197

Pulled By: cpojer

fbshipit-source-id: 70ddbaa5e6d1d2c0fd1130ab04c458d9c49d0ee8
2019-04-24 06:52:20 -07:00
Christoph Nakazawa ec90ad127f Fix React Native tests
Summary: At Facebook we do not install the cli or the packages around it. I added some workaround for that in D15044762 but failed to run Jest without cache to test it and it seems like it didn't run on sandcastle properly either (wtf?). Either way, this adds back the `ios` and `android` reducers for `hasteImpl` to run the tests properly again.

Reviewed By: rubennorte

Differential Revision: D15063152

fbshipit-source-id: 2f1fefe664f02d5f2f5e65b75ac1e0c5b813a343
2019-04-24 06:52:20 -07:00
Mike Grabowski 706f67a882 Use latest React Native CLI (#24517)
Summary:
Updates React Native to use latest CLI.

Changes:
- No more `--reactNativePath`, define it once in the configuration file. This reverts the previous PR that added this flag
- Add `platforms` and `commands` - React Native now defines platform like any other package. There's no longer concept of "out-of-tree" platform. All are treated equally. If React Native works, any other platform will work too.
- Updates `jest/hasteImpl.js` to use public CLI interface (`loadConfig`) instead of `findPlugins` and removes a weird conditional that checks for CI presence.

[INTERNAL] - Update React Native CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/24517

Differential Revision: D15044762

Pulled By: cpojer

fbshipit-source-id: 379b61e842e619312c542173219a7d326663cf24
2019-04-24 05:09:10 -07:00
Brandon Carroll a2b699daf6 change jest native method mocks to jest functions (#24337)
Summary:
Currently calling native methods on internal react native components throw a warning. I believe this is problematic because _users_ aren't calling native methods on internal components, the _component_ is making the call.

So for instance, if I unmount a component that has a form with a few uses of `TextInput`, which is a perfectly valid test case, my test output will be full of warnings that I can't call `.blur()` in the test renderer environment. That's very misleading, because I didn't, the internal component did. In fact, as far as I can tell, there's not really even anything I can do to stop that call or use the output from it, its all internal. `TextInput` is a black box, and 99% of users writing tests probably won't even know it calls `.blur()` under the hood on unmount.

I want to change these to `jest.fn()` because I think this eliminates a lot of chatter in test output, but also doesn't send users down a rabbit hole of trying to find workarounds that may involve filtering console output, which could potentially lead them to inadvertently filter out real warnings that they should see.

So I'm willing to change the implementation of how I did this, but I don't think its right to warn users that they called a native method when they didn't. If they build a component that calls these methods, I believe it's on them to do something similar to this, and maybe we can make this exposed as a helper that can be used for third party component mocks?

[General] [Changes] - Changed MockNativeMethods for core components to `jest.fn()` instead of function that warns about calling native methods.
Pull Request resolved: https://github.com/facebook/react-native/pull/24337

Differential Revision: D14822126

Pulled By: cpojer

fbshipit-source-id: 2199b8c8da8e289d38823bdcd2c43c82f3f635c9
2019-04-07 11:54:48 -07:00
Spencer Ahrens b8c8562ffb Set scroll view throttle by default
Summary:
Setting the scroll throttle for every animated scrollview is a pain, and if you forget it's super janky and can be confusing and frustrating.

Enables setting default props in createAnimatedComponent and uses it for scrollview.

Reviewed By: TheSavior

Differential Revision: D14790093

fbshipit-source-id: dd8f6f6540813245e87d696351f09ebb2e6ed5f2
2019-04-05 13:52:30 -07:00
Christoph Nakazawa 06cf7face2 Remove Polyfills from RN Open Source
Summary:
We don't need these polyfills in RN Open Source any longer because JSC supports these features natively.

We also don't need these internally at FB, but I want the removal to be a step by step process and separate from the open source work.

Reviewed By: rickhanlonii

Differential Revision: D14762827

fbshipit-source-id: 114626bd18516c42ced43c3f7aa29d42d1d95335
2019-04-04 15:20:33 -07:00
Estevão Lucas fa426cf05f - Add openSettings method to Linking module (#23965)
Summary:
This will create a cross-platform and safe way to programmatically open the app's settings into the iOS /Android Settings app.

Right now it's possible to open the app's settings, but _**only for iOS**_ via `Linking.openURL("app-settings:")`

To do the same for Android, you need to either create NodeModule or install a dependency such as [react-native-open-settings](https://github.com/lunarmayor/react-native-open-settings).

Why this new method is useful: since Android 6, app permissions work similar to iOS. It's granular and it's requested in the app runtime.

https://developer.android.com/guide/topics/permissions/overview#runtime_requests_android_60_and_higher

> If the device is running Android 6.0 (API level 23) or higher, and the app's targetSdkVersion is 23 or higher, the user isn't notified of any app permissions at install time. Your app must ask the user to grant the dangerous permissions at runtime. When your app requests permission, the user sees a system dialog telling the user which permission group your app is trying to access. The dialog includes a Deny and Allow button.

Thus, if the user checks the **"Never ask again box"** and taps **"Deny"**, for some specific permission, the only way to change the permission is going to the Android Setting app.

And that's where this new method becomes useful. It'll allow our apps to programmatically send the the user to  settings app.

Also, `openSettings()` doesn't receive a parameter to redirect to specific subsections of the Settings app because there's no public API to do it on iOS ([there's a way to have, via private API, but it causes the app to get rejected.](https://github.com/mauron85/cordova-plugin-background-geolocation/issues/394))

Create `Linking.openSettings()` for iOS and Android;

[General] [add ] - Add openSetting method to Linking module
Pull Request resolved: https://github.com/facebook/react-native/pull/23965

Differential Revision: D14502910

Pulled By: cpojer

fbshipit-source-id: d27d62282b9df499845c78d983d3b6936c36ea39
2019-03-18 08:06:12 -07:00
Georgios Andreadis 6047d42bc7 Add tests for Geolocation module (#23987)
Summary:
This PR adds a number of unit tests for the Geolocation module, as a follow-up of #23903. I also added two missing documentation strings to that module, with references to the online documentation, for consistency with the other methods in the same module.

Not applicable, since it only adds tests.
Pull Request resolved: https://github.com/facebook/react-native/pull/23987

Differential Revision: D14502848

Pulled By: cpojer

fbshipit-source-id: 8f7c1cee6be3fae081d9770e5e942fadda65e6c2
2019-03-18 07:40:56 -07:00
Estevão Lucas 65a8a51556 Add missing mock for AccessibilityInfo (#23982)
Summary:
I've realized after #23839 got merged, that `AccessibilityInfo` doesn't have a jest mock the same way as the other frameworks do.

This PR adds the testing mock for `AccessibilityInfo`.
Pull Request resolved: https://github.com/facebook/react-native/pull/23982

Differential Revision: D14502780

Pulled By: cpojer

fbshipit-source-id: ec11bd547b6f90858e7f51ed8230c8d02dc4904c
2019-03-18 07:28:46 -07:00
Mike Grabowski 5558333c60 Update React Native to use latest CLI (#23940)
Summary:
Landing D14472633 again which failed because of a metro-buck issue.

Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).

Fixes #23936

This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).

We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.

[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940

Reviewed By: rickhanlonii

Differential Revision: D14501686

Pulled By: cpojer

fbshipit-source-id: c8dac71b3806d81c9d18b6d4a7e92d82962791f9
2019-03-18 06:22:53 -07:00
Adam Ernst 0ceaaf0cf6 Revert D14472633: [react-native][PR] Update React Native to use latest CLI
Differential Revision:
D14472633

Original commit changeset: b7ea92ee130d

fbshipit-source-id: ed5bce3ba4a39c8b60e787cb678747231583f6f5
2019-03-15 14:07:54 -07:00
Mike Grabowski 1fe4799a88 Update React Native to use latest CLI (#23940)
Summary:
Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).

Fixes #23936

This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).

We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.

[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940

Differential Revision: D14472633

Pulled By: cpojer

fbshipit-source-id: b7ea92ee130da6730aa0093265958aa1b8c2ab97
2019-03-15 11:07:48 -07:00
Peter van der Zee dcd4e90d9a Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 07:00:27 -07:00
zhongwuzw 585d41b30a Add DerivedData to BLACKLISTED_PATTERNS for haste paths (#23807)
Summary:
Each time, when I run `iOS` tests like `RNTesterIntegrationTests`, Xcode will copy the bundle in `DerivedData` directory, and we added `RNTesterUnitTestsBundle.js` to bundle, so it leads `Haste module naming collision`, I think we can add `DerivedData` directory to blacklist.

<img width="752" alt="c7d7dcbd-6507-481a-a8ef-64f16fec3a6f" src="https://user-images.githubusercontent.com/5061845/53960917-6888cc80-4122-11e9-9d1d-faac97f73a26.png">

[iOS] [Fixed] - Add DerivedData to BLACKLISTED_PATTERNS for haste paths
Pull Request resolved: https://github.com/facebook/react-native/pull/23807

Differential Revision: D14436103

Pulled By: cpojer

fbshipit-source-id: fa4bbd87d429f70167253aa38ff20049c9df58b4
2019-03-12 22:32:18 -07:00
George Zahariev 35d2dfcabf Deploy 0.94 to xplat
Summary:
Update Flow version in xplat (https://our.intern.facebook.com/intern/wiki/Flow/Flow_Release_Process/#update-xplat-js)

allow-large-files
bypass-lint

Reviewed By: nmote

Differential Revision: D14317820

fbshipit-source-id: 07ec22c0745321db036f4e10a502009a4b640652
2019-03-06 14:57:30 -08:00
Christoph Nakazawa 14d9b2d68d Remove ListView and SwipeableListView from React Native
Summary:
This diff removes ListView and SwipeableListView from React Native:
* Removes the code and all examples
* Removes the exports on `react-native-implementation` but leaves an error message in dev mode only
* Uses `deprecated-react-native-listview` for `ListView` and `deprecated-react-native-swipeable-listview` for `SwipeableListView`

Both ListView and SwipeableListView are now fully removed from React Native in open source and we will continue to use the deprecated packages internally.

Reviewed By: TheSavior

Differential Revision: D14181708

fbshipit-source-id: 5030c33791f998567de058fee934449c16fa1d54
2019-02-25 22:40:10 -08:00
Nimish 9f4ee25cf7 fix: remove the unused packages and convert minimist to yargs (#23467)
Summary:
`Minimist` package functionality can be done easily using `yargs` package. Also removed couple of unused dependencies.

[General] [changed] - used `yarns` package instead of `minimist` package

Pull Request resolved: https://github.com/facebook/react-native/pull/23467

Differential Revision: D14099638

Pulled By: cpojer

fbshipit-source-id: 59de2086e4204e09c91fd2c99d209ca32c0ef82c
2019-02-15 05:54:10 -08:00
Mike Grabowski 1af390be19 Update references to the CLI (#23052)
Summary:
This updates React Native to use latest CLI. We also create Metro configuration, because CLI looks for React Native in "node_modules" by default. Since we are running React Native from source, it will fail to find required files.

To avoid hacky logic to detect if we are running from source backed into the CLI, I decided to leverage the Metro configuration instead.
Pull Request resolved: https://github.com/facebook/react-native/pull/23052

Reviewed By: rickhanlonii

Differential Revision: D13719938

Pulled By: cpojer

fbshipit-source-id: 1f40a40b3cdbb07ccd42daf75feb457556d3e40f
2019-01-21 09:13:08 -08:00
Ramanpreet Nara 9db0050635 Fix Jest mocks
Summary: Since we started relying on NativeModules' getConstants() method to access constants, we need to update our jest mocks of these NativeModules, so that the tests still pass. I do that in this diff.

Reviewed By: fkgozali

Differential Revision: D13561376

fbshipit-source-id: eaef3de82d842fd97d04be741d55bdded73c6a11
2018-12-30 13:31:16 -08:00
Rafael Oleza f5cb4b68eb Remove metro dependency from react native
Summary:
This diff removes the dependency of `metro` on `react-native` by using the newly created `metro-react-native-babel-transformer` package.

This package does not depend on any other internal metro logic and this will decouple RN from metro a bit more.

Reviewed By: cpojer

Differential Revision: D13434949

fbshipit-source-id: a02a3b327c71cef53111514b797f7d6bc9f9d71c
2018-12-14 08:15:09 -08:00
Christoph Nakazawa 63a6bb7637 Remove remaining references to local-cli
Summary: This removes the remaining references to `local-cli`. We already have a `cli.js` file on the root that was just forwarding to the local-cli folder, so I removed that. It also seems that `setupBabel.js` is no longer necessary in RN.

Reviewed By: TheSavior

Differential Revision: D13396218

fbshipit-source-id: a945cb91dae39c4b58c5cabcca6b0f0328fc4717
2018-12-10 19:08:10 -08:00
Rafael Oleza c8047bfe66 Fix flow types
Summary:
This diff ignores the `react-native-local-cli` from being used internally.

Unfortunately, since `react-native-local-cli` has its own dependency on Metro, and using `yarn` selective resolutions causes some issues with `flow` rechecks that have not been resolved (https://fb.facebook.com/groups/flow/permalink/2220467474668522/), the easiest way to move forward is to just not install the `react-native-local-cli` package internally (we don't need it since we have our own cli).

Reviewed By: pvdz

Differential Revision: D13377495

fbshipit-source-id: 6d6edbd947104e050ad1c31a657fc21fe6848692
2018-12-10 08:36:29 -08:00
ferrannp e8a6cb5e18 Android: Adding sendIntent on Linking module (#22302)
Summary:
This PR implements "Add a standardized way to send intents on Android" discussed in https://github.com/react-native-community/discussions-and-proposals/issues/34.
Pull Request resolved: https://github.com/facebook/react-native/pull/22302

Differential Revision: D13374186

Pulled By: cpojer

fbshipit-source-id: 2f0b9b9f46e99f382b6c35b1914e75df23a7fd74
2018-12-06 21:13:58 -08:00
Christoph Nakazawa 168ac8d83d Use `findPlugins` from `react-native-local-cli`
Summary: This module now lives outside of the React Native repo.

Reviewed By: TheSavior

Differential Revision: D13337412

fbshipit-source-id: 548868e5f1f3812574fda3d235eb9d47c81d6522
2018-12-06 20:15:46 -08:00
Rick Hanlon c5b80062ea Fix ActivityIndicator snapshot test, add toMatchShallowSnapshot
Summary:
This diff adds a custom matcher which will wrap a given component and shallow render it, snapshotting the result with the formatting users will see when they do the same.

I also update the ActivityIndicator test to use this new strategy, and add an additional check that the displayName is set.

For context see:
- https://github.com/facebook/react-native/pull/21950
- https://github.com/rajivshah3/rn-broken-snapshot/blob/broken-example/__tests__/App.spec.js#L3
- https://github.com/facebook/react-native/issues/21937

Reviewed By: TheSavior

Differential Revision: D13326689

fbshipit-source-id: 8ed2302a8aad12962fa2498a46d2502ccfb5c737
2018-12-05 17:23:42 -08:00
Panagiotis Vekris ef2084c6bd 0.87.0 in xplat/js
Summary: allow-large-files

Reviewed By: samwgoldman

Differential Revision: D13230018

fbshipit-source-id: f07e2371a3b7382de0592cc7c7b20e7f4faa6889
2018-11-28 17:32:50 -08:00
Spencer Ahrens 6f34bc4016 Back out "reapply TextInput es6 conversion with fixes, attemps to fix"
Summary:
Back it out again. This time really not sure why this is breaking, but it seems to be production only. The error seems to be "RCTSinglelineTextInputView" was not found in the UIManager" but the relavent logic is not changed in this diff, just moved around, so unclear why it would trigger a failure.

Reverting to be safe. When we re-apply the diff, we'll need to test a full OTA to prod to verify the fix.

Reviewed By: blairvanderhoof

Differential Revision: D13108463

fbshipit-source-id: 5f877a0c1a08dc114ce45921d6d92bf619575977
2018-11-16 14:50:23 -08:00
Spencer Ahrens 9ea1295179 reapply TextInput es6 conversion with fixes, attemps to fix
Summary: D10515754 reapplied by backing out D12989604 and then fixed by manually forwarding the instance methods to the host function instead of using `forwardRef`. This also removes the need for the $flowFixMe.

Reviewed By: TheSavior

Differential Revision: D13048482

fbshipit-source-id: ff2447aff123e0960eddaef645f7dc976a426e14
2018-11-15 20:51:52 -08:00
Gary Borton 0b314960aa Adds support for `publicPath` to enable serving assets from different locations. (#299)
Summary:
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

**Summary**

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

This is an updated followup from https://github.com/facebook/metro/pull/280, which we would still need to address the following assumptions about `/assets/`:

e7deea1900/packages/metro/src/Server.js (L332)

e7deea1900/packages/metro/src/Server.js (L379)

e7deea1900/packages/metro/src/Server.js (L385)

As pointed out by gdborton, there isn't currently a way to make this a configurable option. I am not certain how to find a proper workaround for `processRequest`.

We found a temporary solution to have our express app pick up serving the assets from a publicPath as a middleware. But the change in this PR is still necessary to get it working fully.

**Test plan**

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

- Will add tests once we figure out a comprehensive solution
Pull Request resolved: https://github.com/facebook/metro/pull/299

Reviewed By: rafeca

Differential Revision: D12939229

Pulled By: mjesun

fbshipit-source-id: 769c23468c5ac434f8319e5e7caaf46dd6453f2d
2018-11-09 05:51:06 -08:00
Eli White f386f831d2 Back out TextInput es6 conversion
Summary:
This was failing due to issues with refs, which we were able to fix and then finally due to some jest tests that were failing due to things being null that shouldn't be which I couldn't easily figure out. Reverting the stack until we can actually solve it, hopefully with additional tests.

This was created by running:

```
$ hg backout c2fe2c46e538
fetching tree '' b9bbfc1925c6daf85ba3227d12f177aca9c0c054, based on 4257c76aefa84aaa17279e65aa7ca1174f4401e7, found via 02368b670953
connected to hg015.frc2.facebook.com
60 trees fetched over 2.91s
fetching tree '' c3c304df13399f0f1a29a668242da454fc1d8a97, based on b9bbfc1925c6daf85ba3227d12f177aca9c0c054, found via c2fe2c46e538
7 trees fetched over 0.03s
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
commit 4270328:50a65c5c2e27 backs out commit 4266783:c2fe2c46e538
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 0.57s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (50a65c5)]$ hg backout 02368b670953
fetching tree '' a46c8ca065f5b92cf375d7ed899fc5ca268ba4da, based on b9bbfc1925c6daf85ba3227d12f177aca9c0c054, found via bade4285eafb
connected to hg024.frc2.facebook.com
27 trees fetched over 3.21s
fetching tree '' 361548a090e81d18bab6f4fc16036c518cb4d7c1, based on a46c8ca065f5b92cf375d7ed899fc5ca268ba4da, found via bade4285eafb
41 trees fetched over 0.10s
merging react-native-github/Libraries/Components/TextInput/TextInput.js
8 files updated, 1 files merged, 0 files removed, 0 files unresolved
commit 4270329:dbaca0daf0ac backs out commit 4266782:02368b670953
14 files fetched over 7 fetches - (14 misses, 0.00% hit ratio) over 1.72s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (dbaca0d)]$ hg backout bade4285eafb
connected to hg030.frc2.facebook.com
fetching tree '' 1b4a17164fdbfcad40139e46da4a9bfa8aa8def3, based on 361548a090e81d18bab6f4fc16036c518cb4d7c1, found via 5cfb25344385
7 trees fetched over 0.06s
merging react-native-github/Libraries/Components/TextInput/TextInput.js
20 files updated, 1 files merged, 0 files removed, 0 files unresolved
commit 4270330:2951740e5b32 backs out commit 4266781:bade4285eafb
33 files fetched over 14 fetches - (33 misses, 0.00% hit ratio) over 4.50s
[twsvcscm@sandcastle3265.ftw1 /data/sandcastle/boxes/instance-ide/xplat/js (2951740)]$ hg backout 5cfb25344385
connected to hg035.frc2.facebook.com
merging react-native-github/Libraries/Components/TextInput/TextInput.js
0 files updated, 1 files merged, 2 files removed, 0 files unresolved
commit 4270331:fffb4629a397 backs out commit 4266780:5cfb25344385
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 4.03s
```

Reviewed By: yungsters

Differential Revision: D12989604

fbshipit-source-id: 703a7c9c1f5bdd710077e515bdff06fdb34502ec
2018-11-08 17:59:10 -08:00
Eli White 7e818aed9a Fixing TextInput related jest tests
Reviewed By: yungsters

Differential Revision: D10519823

fbshipit-source-id: 02368b670953a0275fa6495b0c73ef84403598cb
2018-11-07 18:44:40 -08:00