react-native-macos/packages/rn-tester
Janic Duplessis 0959ff36d1 Move hermes to a separate podspec (#30478)
Summary:
Hermes being a subspec of ReactCore causes some build issues when RN is included in 2 different targets. It also causes it to include a lot of additional dependencies that it doesn't need. This moves it to a separate podspec loosely based on other specs in ReactCommon.

## Changelog

[iOS] [Fixed] - Move hermes to a separate podspec

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

Test Plan: Test that it builds and run properly in an app

Reviewed By: fkgozali

Differential Revision: D25308237

Pulled By: hramos

fbshipit-source-id: b4cc44ea2b1b854831e881dbbf9a2f30f6704001
2020-12-03 20:08:00 -08:00
..
NativeModuleExample Avoid Repo Structure Assumptions in RNTester Imports (#30141) 2020-10-12 19:56:09 -07:00
RCTTest Continuous Integration cleanup 2020-11-05 06:09:36 -08:00
RNTester Move hermes to a separate podspec (#30478) 2020-12-03 20:08:00 -08:00
RNTester-tvOS Continuous Integration cleanup 2020-11-05 06:09:36 -08:00
RNTesterIntegrationTests Continuous Integration cleanup 2020-11-05 06:09:36 -08:00
RNTesterPods.xcodeproj Fix use_framework RNTester crash (#30520) 2020-12-03 16:01:47 -08:00
RNTesterPods.xcworkspace Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
RNTesterUnitTests PlatformColors: add missing clearColor for iOS (#30054) 2020-10-12 02:14:42 -07:00
android/app Move TurboModuleManager to use RuntimeExecutor instead of jsContext (#30416) 2020-11-20 14:32:59 -08:00
e2e New Button Component Use Cases (#29848) 2020-09-23 19:51:49 -07:00
js Fix RNTester Not Resizing Examples on Rotation/Resize (#30376) 2020-12-03 09:39:17 -08:00
.eslintrc Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
BUCK Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
Gemfile Bump Xcode to 12.1.0, bump CocoaPods 1.10.0 (#30250) 2020-10-30 23:03:26 -07:00
Podfile Fix use_framework RNTester crash (#30520) 2020-12-03 16:01:47 -08:00
Podfile.lock Fix use_framework RNTester crash (#30520) 2020-12-03 16:01:47 -08:00
README.md feat: Enable Hermes to work on iOS (#29914) 2020-11-03 01:14:38 -08:00
package.json Update React Native to React 17.0.0 2020-10-26 20:28:00 -07:00

README.md

RNTester

The RNTester showcases React Native views and modules.

Running this app

Before running the app, make sure you ran:

git clone https://github.com/facebook/react-native.git
cd react-native
yarn install

Running on iOS

Both macOS and Xcode are required.

  • cd packages/rn-tester
  • Install Bundler: gem install bundler. We use bundler to install the right version of CocoaPods locally.
  • Install Bundler and CocoaPods dependencies: bundle install && bundle exec pod install. In order to use Hermes engine instead of JSC, run: USE_HERMES=1 bundle exec pod install instead.
  • Open the generated RNTesterPods.xcworkspace. This is not checked in, as it is generated by CocoaPods. Do not open RNTesterPods.xcodeproj directly.

Running on Android

You'll need to have all the prerequisites (SDK, NDK) for Building React Native installed.

Start an Android emulator.

cd react-native
./gradlew :packages:rn-tester:android:app:installJscDebug
./scripts/packager.sh

Note: Building for the first time can take a while.

Open the RNTester app in your emulator. If you want to use a physical device, run adb devices, then adb -s <device name> reverse tcp:8081 tcp:8081. See Running on Device for additional instructions on using a physical device.

Running with Buck

Follow the same setup as running with gradle.

Install Buck from here.

Run the following commands from the react-native folder:

./gradlew :ReactAndroid:packageReactNdkLibsForBuck
buck fetch rntester
buck install -r rntester
./scripts/packager.sh

Note: The native libs are still built using gradle. Full build with buck is coming soon(tm).

Running Detox Tests on iOS

Install Detox from here.

To run the e2e tests locally, run the following commands from the react-native folder:

yarn build-ios-e2e
yarn test-ios-e2e

These are the equivalent of running:

detox build -c ios.sim.release
detox test -c ios.sim.release --cleanup

These build the app in Release mode, so the production code is bundled and included in the built app.

When developing E2E tests, you may want to run in development mode, so that changes to the production code show up immediately. To do this, run:

detox build -c ios.sim.debug
detox test -c ios.sim.debug

You will also need to have Metro running in another terminal. Note that if you've previously run the E2E tests in release mode, you may need to delete the RNTester/build folder before rerunning detox build.

Building from source

Building the app on both iOS and Android means building the React Native framework from source. This way you're running the latest native and JS code the way you see it in your clone of the github repo.

This is different from apps created using react-native init which have a dependency on a specific version of React Native JS and native code, declared in a package.json file (and build.gradle for Android apps).