Summary:
## Motivation
The concept behind JSCallInvoker doesn't necessarily have to apply only to the JS thread. On Android, we need to re-use this abstraction to allow execution of async method calls on the NativeModules thread.
Reviewed By: PeteTheHeat
Differential Revision: D17377313
fbshipit-source-id: 3d9075cbfce0b908d800a366947cfd16a3013d1c
Summary:
We used to generate the documentation for the website but moved the docs to another repo.
There is some work on the docs to be able to ingest info from this repo in order to go back to generating API information. The current thinking is we will generate this JSON file and the website repo will pull it in to generate the docs.
I plan to make the script run on CI and fail if the generated file isn't updated, in a follow up PR.
Reviewed By: zackargyle
Differential Revision: D17183936
fbshipit-source-id: 99ce3fa5d7becc0ef20df5d439b175eedbe546f3
Summary:
This pull request makes the following changes to the script `scripts/generate-rncore.js`:
* Adds a missing argument to the call of `generate-tests.js`
* Ran `chmod +x generate-rncore.sh` so the script is executable
## Changelog
[Internal] [Fixed] - Updated `generate-rncore.sh` for recent versions of codegen
Pull Request resolved: https://github.com/facebook/react-native/pull/26477
Test Plan: `(cd scripts && ./generate-rncore.sh)` works perfectly now.
Differential Revision: D17439772
Pulled By: TheSavior
fbshipit-source-id: 141efc54aa45aa38dc537f65e425959666f33b3a
Summary:
Needed to capitalize the name, since this is the convention used elsewhere too
## Changelog:
[iOS] [Changed] - Renamed yoga podspec to Yoga
Reviewed By: shergin
Differential Revision: D17127104
fbshipit-source-id: 14047bf452edda000037701f4ba7f4a02a0e717b
Summary: This bothers me, we renamed the project to drop the "Metro" a while ago.
Reviewed By: rubennorte
Differential Revision: D16831281
fbshipit-source-id: bb6de412eccda61b617580f3660e3e635f2d2815
Summary:
Yesterday we shipped hermesengine.dev as part of the current 0.60 release. This PR brings those changes to master.
## Changelog
[General] [Added] - Added support for Hermes
Pull Request resolved: https://github.com/facebook/react-native/pull/25613
Test Plan:
* CI is green both on GitHub and at FB
* Creating a new app from source can use Hermes on Android
Reviewed By: cpojer
Differential Revision: D16221777
Pulled By: willholen
fbshipit-source-id: aa6be10537863039cb666292465ba2e1d44b64ef
Summary:
As part of the fix for https://github.com/facebook/react-native/issues/25349 I added `s.static_framework = true` to each podspec in repo (see https://github.com/facebook/react-native/pull/25619#discussion_r306993309 for more context).
This was required to ensure the existing conditional compilation with `#if RCT_DEV` and `__has_include` still worked correctly when `use_frameworks!` is enabled.
However, fkgozali pointed out that it would be ideal if we didn't have this requirement as it could make life difficult for third-party libraries.
This removes the requirement by moving `React-DevSupport.podspec` and `React-RCTWebSocket.podspec` into `React-Core.podspec` as subspecs. This means the symbols are present when `React-Core.podspec` is built dynamically so `s.static_framework = true` isn't required.
This means that any `Podfile` that refers to `React-DevSupport` or `React-RCTWebSocket` will need to be updated to avoid errors.
## Changelog
I don't think this needs a changelog entry since its just a refinement of https://github.com/facebook/react-native/pull/25619.
Pull Request resolved: https://github.com/facebook/react-native/pull/25816
Test Plan:
Check `RNTesterPods` still works both with and without `use_frameworks!`:
1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.
Reviewed By: hramos
Differential Revision: D16495030
Pulled By: fkgozali
fbshipit-source-id: 2708ac9fd20cd04cb0aea61b2e8ab0d931dfb6d5
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.
It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.
The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .
There are still a few breaking changes which I hope will be acceptable:
- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.
Still to do:
- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by 33573511f0.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �
## Changelog
[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619
Test Plan:
### FB
```
buck build catalyst
```
### Sample Project
Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.
You can see that it works with these steps:
1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`
The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.
### RNTesterPods
`RNTesterPodsPods` can now work with or without `use_frameworks!`.
1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.
Reviewed By: PeteTheHeat
Differential Revision: D16465247
Pulled By: PeteTheHeat
fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
Summary:
^
No need for a constructor here.
Reviewed By: fkgozali
Differential Revision: D15056802
fbshipit-source-id: 32a2c541e5c1fa6336b7f6f2131772198740626c
Summary: For better compatibility re: https://github.com/facebook/react-native/pull/25393, this target should just use `RCTTypeSafety`
Reviewed By: PeteTheHeat
Differential Revision: D16210888
fbshipit-source-id: 6a55d631453cc420909247a7d5a64379587225b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25583
We now use CocoaPods for better maintainability.
Reviewed By: hramos
Differential Revision: D16193719
fbshipit-source-id: 26382f2da4eaba14a71771540b587fdc80b41108
Summary: TurboModule is now included by default, so no need to have a toggle in autolink script anymore.
Reviewed By: mdvacca
Differential Revision: D16173820
fbshipit-source-id: 215ce7d188ce526b5a71df881bdc992c1ef34b34
Summary:
This removes the `--projectRoot` flag in `launchPackager.bat` as it was removed, fixing [this bundler not opening issue on cli repo](https://github.com/react-native-community/cli/issues/484) when `yarn react-native run-android` is run.
This is Windows related only so should be only tested on Windows.
## Changelog
[Internal] [Fixed] - Fixed Metro Bundler not opening when running `yarn react-native run-android`
Pull Request resolved: https://github.com/facebook/react-native/pull/25517
Test Plan:
1. Create a new repo using `react-native init`
2. Edit the `launchPackager.bat` file
3. Run `yarn react-native run-android`
Differential Revision: D16162108
Pulled By: cpojer
fbshipit-source-id: c12d9853ad49f00d56b9a8254a5b2c40a358cb2e
Summary: This defines various sub specs to support building TurboModules that implement the codegen'ed specs.
Reviewed By: PeteTheHeat
Differential Revision: D16043221
fbshipit-source-id: 27ed532be929c11c8fe648632da8a72061cbc8b0
Summary:
This PR adjusts rncore generation to the flow parser based approach introduced in 98b03fa.
## Changelog
[Internal] [Fixed] - Fix iOS build of RNTester with fabric_enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/25437
Test Plan:
As far as I see currently there's no automated testing for the RNTester build with `fabric_enbaled` set to `true`.
The quickest way to test this PR is building RNTester using cocoapods with `fabric_enabled`.
Differential Revision: D16071362
Pulled By: cpojer
fbshipit-source-id: 05d96686ea2d7c8c04f05eb7840c9eacff5a2738
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416
Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.
This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.
In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.
Changelog:
[iOS] [Changed] - Use RNTesterPods for iOS Tests
Reviewed By: fkgozali
Differential Revision: D16052466
fbshipit-source-id: 724b0c51008882d3c06a9074693fe23e74abe86b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416
Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.
This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.
In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.
Reviewed By: fkgozali
Differential Revision: D15958209
fbshipit-source-id: b51fb907812cb2d4d78cce445d39bc253ae5acf8
Summary:
We have too many options in the Dev Menu, and they're really hard to pick from. They're also somewhat conflicting. This replaces two menu choices that have a similar purpose (faster iteration cycle) with one.
"Fast Refresh" tries to only update the affected modules, but falls back to doing a full reload if the update can't be handled by the React components.
If for some reason you prefer the "Reload-on-Save" behavior, please:
- Reach out to me so I can learn more about your use case.
- As a workaround, you can add `if (__DEV__) require.Refresh.forceFullRefresh = true` to your app's entry point to always do a full refresh.
Also note that I only removed the user-facing part of "Reload-on-Save". So if you have automation depending on it, that's gonna keep working.
I moved it above Systrace since it's a more generic feature.
As a total aside nit, I renamed "Enable Inspector" and "Disable Inspector" to "Show Inspector" and "Hide Inspector" because... that's what those options do, really.
Reviewed By: rickhanlonii
Differential Revision: D15958697
fbshipit-source-id: 20e856d56f661fe4d39b5ab47d8c44754bf70f67
Summary: Fishhook was used to try to hide the log messages from RCTReconnectingWebSocket but that doesn't really work anymore. Deleting it now to unblock people trying to build for iOS 13.
Reviewed By: cpojer
Differential Revision: D15779390
fbshipit-source-id: ef18575d5d92ac374e189b1267dee3a9befc3551
Summary:
In 2019-6-4 version of Docker Android image, we've added Android NDK r19c. So this PR will change CI to use NDK r19c.
I'll create a PR to website once this merged.
Note: I tried to build RN with NDK 19 while I was setting up my laptop after format, and it worked.
## Changelog
[Android] [Changed] - Bump Android NDK to r19c
Pull Request resolved: https://github.com/facebook/react-native/pull/25140
Differential Revision: D15631301
Pulled By: cpojer
fbshipit-source-id: b9a5600df1dadeba328932b694493960b242c2f7
Summary:
The `test_end_to_end` job has been timing out due CocoaPods taking too long to check out the Specs repo. This repo is stored at `~/.cocoapods`, therefore by caching this folder we can keep the individual e2e test run from exceeding 10 minutes w/o output.
## Changelog
[Internal] [Added] - Cache CocoaPods
Pull Request resolved: https://github.com/facebook/react-native/pull/25095
Differential Revision: D15587702
Pulled By: hramos
fbshipit-source-id: 6669ff09a5021f012ac8a829db70442d8f7f07e8
Summary:
Migrate the Circle CI configuration to the 2.1 schema and take advantage of new config reuse features.
I've enabled pipelines in the facebook/react-native Circle CI project, a requirement for Circle CI 2.1 features.
### Overview
* Use executors to provide a common set of execution environments.
* Use commands to provide reusable steps (running yarn with cache, installing Android dependencies, ...)
* Use parametrized commands/jobs to reuse job definitions for `test_js` and `test_js_lts` where the only difference is the version of node provided by the environment.
* Reduce total execution time by [storing the git repo in a cache as opposed to using workspaces](https://circleci.com/blog/persisting-data-in-workflows-when-to-use-caching-artifacts-and-workspaces/)
* Fix various flaky end-to-end test failures related to CocoaPods and the CLI.
* Move `analyze` job to `analysis` workflow and rename to `analyze_pr`
* Rename `test_javascript` as `test_js`.
* Split up end-to-end test job into `test_ios_e2e` and `test_js_e2e`.
## Changelog
[Internal] [Changed] - Migrate to Circle CI 2.1 and fix e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/25036
Differential Revision: D15565515
Pulled By: hramos
fbshipit-source-id: cfba2154a9fdc96400cbf778bd5d13e9411ee3f8
Summary:
This diff reorganizes some of the code in react-native-codegen as requested in T44120025
There are two new dirs: `scr/cli` and `src/parsers`
```
buck_tests/
src/
cli/
generators/
parsers/
```
We moved anything cli-ish from `buck_tests` to the `src/cli` directory:
```
src/
cli/
combine/
combine_js_to_schema.sh
combine_js_to_schema-cli.js
combine_js_to_schema.js
viewconfigs/
generate-view-configs-cli.js
generate-view-configs.js
generate-view-configs.sh
```
And we created a new `src/parsers` directory that will contain the flow parser and the current schema parser:
```
src/
parsers/
flow/
index.js
schema/
index.js
```
This should organize the code a little better and make it easier to contribute 👍
Reviewed By: cpojer
Differential Revision: D15414264
fbshipit-source-id: 376af2e91def033855f6ed72a9a9cc4369c33c7d
Summary:
This PR cleans up some of our GitHub bots. The overall goal is to make the contribution process just a tad nicer.
### analysis-bot
* The bot will continue leaving GitHub Reviews when it finds lint issues, but will abstain from leaving inline comments if they would exceed 5 in number.
* The review comment left by the bot has instructions on how to reproduce the lint issues locally. This will educate PR authors on how to run lint and fix the issues without unnecessarily spamming the PR with 50+ comments, while still providing useful reviews to authors when only a handful of lint issues slip by.
* Code moved to `bots/` directory for ease of discovery and co-location with pull-bot.
* Added `yarn lint-ci` command. This seems like the right choice: it's running `yarn lint` and other linters, and it is only intended to run on CI.
* It's still possible to run `yarn lint-ci` locally, though the script will stop short of posting a review to GitHub unless the necessary envvars are provided.
* Added `yarn shellcheck` command. This can be run locally, though it requires `shellcheck` to be installed.
* Outside of this PR, I added instructions on using shellcheck to https://github.com/facebook/react-native/wiki/Development-Dependencies
* Updated Circle CI config to use these new commands, and streamlined the `analyze_pr` step.
* Documented analysis-bot in `bots/README.md`.
### pull-bot
* Bumped `danger-js` dependency. No breaking changes found in this minor bump from what I can tell.
* Documented pull-bot in `bots/README.md`.
### misc
* PR template: don't use jargon.
## Changelog
[Internal] [Changed] - GitHub Bots cleanup
Pull Request resolved: https://github.com/facebook/react-native/pull/24923
Differential Revision: D15399744
Pulled By: hramos
fbshipit-source-id: 32632e775f8554424072270e3f98542de84bfb8c
Summary:
Fixes broken ios/android e2e tests for CI.
Changes:
1. Use `npm pack` instead of `yarn pack` during e2e test
2. Update test string assertions in ios/android e2e tests
3. Use `Step One` as candidate for source code replacement to test for page changes (since the "Welcome to React Native" string exists in the `Header` component instead of being on `App.js`)
## Changelog
[Internal] [Fixed] - Fix ios/android e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/24974
Differential Revision: D15431539
Pulled By: cpojer
fbshipit-source-id: 054af2c2fff6bbdb2263c15d7f5cd416aaa507fd
Summary:
Some users (me included) have projects located in quirky places, resulting whitespaces in the path.
An example, , I symlink into my iCloud drive which result in the following path
```
/Users/r/Library/Mobile Documents/com~apple~CloudDocs/_/work/{a_company}/repos.nosync/app
```
This commit quotes the variable to make sure it gets properly passed to the CLI.
For reference, similar issue that has been resolved: 7d4e94edcc
Pull Request resolved: https://github.com/facebook/react-native/pull/24810
Differential Revision: D15316898
Pulled By: cpojer
fbshipit-source-id: 4ed2c8391d65d1680e836bfce8c51dfb5763caed
Summary:
Rename test_detox_end_to_end to test_end_to_end, then move JavaScript and iOS end-to-end tests to this job.
Fixes an issue in the end-to-end tests, but does not yet bring them back fully to green.
[General] [Changed] - Collect e2e tests under test_end_to_end job
Pull Request resolved: https://github.com/facebook/react-native/pull/24689
Differential Revision: D15202242
Pulled By: hramos
fbshipit-source-id: e7a9627896d2990cb6ddd0d3a91b915781ac2417
Summary: iOS TurboModules work in OSS. I pulled out JSCallInvoker from `React-turbomodule-core`, as a part of D15055511. In this diff, I'm adding it back in.
Reviewed By: mdvacca
Differential Revision: D15195007
fbshipit-source-id: 64ee294a68c0a63ba400b8a829864c6619d3311a
Summary:
RNTester currently has four third party dependencies that are fetched from the network at build time:
- glog
- double-conversion
- boost
- folly
These dependencies are cached to ~/.rncache by default. This location may not be ideal for use in CI, therefore the cache location is now made configurable via a RN_CACHE_DIR envvar.
Reviewed By: cpojer
Differential Revision: D15141391
fbshipit-source-id: b51d749412c49500a657bd18e4c9520ddb30ea2c
Summary:
Since initialisation flow changed with default template, we need to adjust the script to make it work properly.
[General] [Fixed] - Adjust text manual e2e script to work with new init.
Pull Request resolved: https://github.com/facebook/react-native/pull/24583
Differential Revision: D15062374
Pulled By: cpojer
fbshipit-source-id: 8110597b27056570784439362f12963154460613
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
Summary:
Simplifies the code anyone on iOS using RN has _to see_. In this case, React Native knows that everyone probably wants all these imports (unless they're using dev mode) and so we can auto-import the pod specs for a user from inside the lib.
Basically auto-link for the React side.
[iOS] [Added] - Adds a ruby function which imports the Pods for RN, so that users only have to include this function and it can change per RN version.
Pull Request resolved: https://github.com/facebook/react-native/pull/24555
Differential Revision: D15044780
Pulled By: cpojer
fbshipit-source-id: c3702a52104706def51da6f1d11ab966d57d1edb
Summary:
Bumps to Xcode 10.2.0 and uses the iOS 12.2 simulator when running tests.
The `testBundleURL` test is temporarily disabled to allow the iOS unit tests to run successfully in the internal Facebook CI system.
Changelog:
[iOS] [Changed] - iOS tests: Bump Xcode to 10.2.0, iOS to 12.2.
Reviewed By: TheSavior
Differential Revision: D14962710
fbshipit-source-id: 769cfb90aacce33903ab6e8dbcc5b5727deacf41
Summary:
Consolidate JavaScript tests from open source into a single script that can be executed by both Circle CI and Sandcastle, the internal Facebook CI.
[General] [Changed] - Switch internal and external CI to use the same script when running JavaScript tests
Pull Request resolved: https://github.com/facebook/react-native/pull/24422
Reviewed By: cpojer
Differential Revision: D14895773
fbshipit-source-id: d428929cc4e5219e02f5920259e08e0b3d24874c