Summary:
It allows HTTP connections in debug builds, and requires no configuration compared to previous/current solution where you need to edit config file to test on device.
Consulted with Salakar about this.
[Android] [Changed] - Allow HTTP in debug builds
Pull Request resolved: https://github.com/facebook/react-native/pull/24066
Differential Revision: D14540255
Pulled By: cpojer
fbshipit-source-id: f1239154c27c36c21c9b080a826f8b1d0eb0fc7d
Summary:
SYSTEM_ALERT_WINDOW permission is used only for debug builds to show draw overlay views or show warnings/errors. This permissions is unused in release builds, and there is an issue regarding removing unused permissions on Android build https://github.com/facebook/react-native/issues/5886#issuecomment-464495388. This PR removes SYSTEM_ALERT_WINDOW from all builds bug debug.
[Android] [Changed] - SYSTEM_ALERT_WINDOW permissions available only in debug builds
Pull Request resolved: https://github.com/facebook/react-native/pull/23504
Differential Revision: D14123045
Pulled By: cpojer
fbshipit-source-id: 68829a774ff23c7cb2721076a9d3870405f48fea
Summary:
Bump Android Plugin to 3.3.1, with many bug fixes and performance improvements. Split the change from https://github.com/facebook/react-native/pull/23324 to make cherry-pick easy to 0.59 branch.
[Android] [Changed] - bump Android Plugin to 3.3.1
Pull Request resolved: https://github.com/facebook/react-native/pull/23473
Differential Revision: D14099741
Pulled By: cpojer
fbshipit-source-id: 7491c49cd2467f1bb8776345bdda2ab9cea11c06
Summary:
Move react_native_config.xml so that it's available to all Android versions, and fixes https://github.com/facebook/react-native/issues/23445. It's my bad, I should've tested previous change on multiple versions of Android.
[Android] [Changed] - Fix network security
Pull Request resolved: https://github.com/facebook/react-native/pull/23470
Differential Revision: D14099612
Pulled By: cpojer
fbshipit-source-id: 15b5e5f575de8033bbfd524d9ad2aa0e22daa813
Summary:
This PR is trying to improve Android Network Security configuration introduced in 84572c4051. I found that Android merges all manifest files into a single manifest file when building an app, so this PR provides AndroidManifest.xml with network security config in debug folder, that will be used only for debug builds. Also the network security configuration will be applied to only app that target API 28. Moved security config file to xml-v28, so that it'll only visible to API 28 and above.
See https://developer.android.com/studio/build/manifest-merge
[Android] [Changed] - Android Network Security configuration.
Pull Request resolved: https://github.com/facebook/react-native/pull/23429
Differential Revision: D14065124
Pulled By: cpojer
fbshipit-source-id: 0f5ac5addbe968ed7e5cb57f356e2572de2690a8
Summary:
Fixes#23314 , the change came from #20945 , its purpose is to fix orientation change issue in HelloWord template, but I think it's just a trick, to make rootView's backgroundColor the same as window backgroundColor, the orientation issue seems related to [UIManager setAvailableSize:forRootView:](d2fc19f4aa/React/Modules/RCTUIManager.m (L343)) async layout things.
[iOS] [Fixed] - Revert RCTRootView's backgroundColor to white.
Pull Request resolved: https://github.com/facebook/react-native/pull/23358
Differential Revision: D14030666
Pulled By: cpojer
fbshipit-source-id: 7c9a45f03b87c3be0f2b7c64a3c837c6ae14af3e
Summary:
We have been working on turning on inline-requires/imports and RAM bundles for React Native for a long time, however we have not made real progress on making it the default, even though it is easy. In this diff I am adding a Metro configuration to a new React Native template with the defaults set to `false` (off). This means that everyone creating a new project now or upgrading from an existing one will receive this template file. In a future release of React Native we will turn this setting on to default. From then on, new projects will be using inline-requires while existing ones that are upgrading can make an explicit choice when they are diffing their template and the latest version of it.
This approach was outlined in https://github.com/react-native-community/discussions-and-proposals/blob/master/core-meetings/2018-09-metro-meeting.md#actions-that-will-be-taken
Note: There is a weird lint-ignore thing in there like in the other template files. I'm working on getting rid of that separately.
Reviewed By: TheSavior
Differential Revision: D14030370
fbshipit-source-id: cf4c5551c795f2ea0fd1b731b352489f04b8c22e
Summary:
add back buildToolsVersion to build.gradle, because many third-party modules depend on it. The lack of this info causing issues in 0.58.
[Android] [Changed] - add back buildToolsVersion to template
Pull Request resolved: https://github.com/facebook/react-native/pull/23316
Differential Revision: D13974264
Pulled By: hramos
fbshipit-source-id: 058fc5617196d6481d1b69d2420c8b2be9cf4f81
Summary:
Running *lint* on RN found that there are some Java 8 features used without specifying Java 8 compatibility in projects. This PR adds Java 8 compatibility and fixes errors caused by Java 8 feature use. I suspend that it may be cause of many failures on older Androids, but also found that many modules/packages switched to and require Java 8.
```java
../../src/main/java/com/facebook/react/devsupport/BundleDownloader.java:167: Try-with-resources requires API level 19 (current min is 16)
../../src/main/java/com/facebook/react/devsupport/DevServerHelper.java:658: Try-with-resources requires API level 19 (current min is 16)
```
For more information https://developer.android.com/studio/write/java8-support
[Android] [Changed] - Enable Java 8
Pull Request resolved: https://github.com/facebook/react-native/pull/23295
Differential Revision: D13959096
Pulled By: cpojer
fbshipit-source-id: 0bfd0565b61a132906cf35ee55b4afcf5450f7cb
Summary: Now that Flow v0.92.1 is deployed, we can backout {D13942380}, which was a temporary fix.
Reviewed By: avikchaudhuri
Differential Revision: D13952515
fbshipit-source-id: d423379a03fff09316aa499e1152b410a1bb4178
Summary: Flow v0.92 is crashing sometimes after a save when run through Nuclide. This fixes the issue temporarily until we can push a Flow v0.92.1
Reviewed By: samwgoldman
Differential Revision: D13942380
fbshipit-source-id: f7bf2aef0aab90980bbb786d89710f399c9427d5
Summary:
This change is required to make `yarn test` work in newly initialized project.
`Jest@23` doesn't play well with new babel, so we need to install `babel-core@^7.0.0-bridge.0` and change `.babelrc` to `babel.config.js` to make it work. This is a temporary change till `jest` releases stable `24` version.
Pull Request resolved: https://github.com/facebook/react-native/pull/23150
Differential Revision: D13811428
Pulled By: hramos
fbshipit-source-id: 8db6b9177cd31d4a1213fb44964b05f26982bdf2
Summary: Upgrades flow in xplat/js to 0.91. This diff also adds and removes suppressions.
Reviewed By: samwgoldman
Differential Revision: D13720697
fbshipit-source-id: 1bf8830ce286db92277476a2d2404cf0c0dddca2
Summary:
The main goal of this change is to fix an issue that happens on iOS when the native app starts before the packager server is available which causes app reloads to fail continually until the app is restarted.
What happens is that with the current setup we call `RCTBundleURLProvider#jsBundleURLForBundleRoot` once in `AppDelegate#didFinishLaunchingWithOptions`. If at that point the packager server is not running yet it will return nil (expected behaviour) and that will be passed to the bridge constructor. Subsequent reloads will keep trying to load this nil bundle url since it has no way to ask `RCTBundleURLProvider` for a new url now that the packager is actually running.
We can fix this by using `RCTBridgeDelegate` instead which is a lot more flexible. Instead of passing the bundle url at construction time it will call the `sourceURLForBridge` method each time the bridge is reloaded. This means that even if the packager is not running yet and that `RCTBundleURLProvider` returns nil for the first invocation, subsequent reloads will call `RCTBundleURLProvider` again for a new value.
Changelog:
----------
[iOS] [Added] - Use RCTBridgeDelegate in the new project template
Pull Request resolved: https://github.com/facebook/react-native/pull/23031
Differential Revision: D13710048
Pulled By: cpojer
fbshipit-source-id: 0059c5c962d508737ae410a82315c11ad305efe8
Summary: Bump Android Build Tools to Version 28.0.3, Gradle to 4.10.2, and the Android Gradle Plugin to 3.2.1.
Reviewed By: mdvacca
Differential Revision: D13631120
fbshipit-source-id: 709aa25a7a8e1ff0bfc0a969ba6e7cd92850bc0f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/22231
- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: https://github.com/facebook/react-native/pull/22263
Reviewed By: hramos
Differential Revision: D13004499
Pulled By: DanielZlotin
fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
Summary:
These comments were confusing since we don't use flow-typed.
cc bvaughn.
I have replaced our local types by flow-typed, removed metro custom stub and deleted `flow-github` directory.
As result, createReactClass, PropTypes and Metro types won't be distributed to RN users. If you need it, you should relay on flow-typed.
Pull Request resolved: https://github.com/facebook/react-native/pull/20320
Reviewed By: TheSavior
Differential Revision: D13517157
Pulled By: rickhanlonii
fbshipit-source-id: e52c0b6114114a706f6152b2031c600e3dece0d2
Summary: This diff moves the React Native template from `local-cli/templates/HelloWorld` to `template`. Keeping it in the react-native repo will allow us to make changes to the template and version it together with react-native, instead of moving it out into a separate repo and trying to keep the template in sync with RN.
Reviewed By: TheSavior
Differential Revision: D13372949
fbshipit-source-id: e68e267b4dcf6384535d7b48fc11e297a12e9676