react-native-macos/packages/rn-tester
Vincent Riemer c48cb04ce4 Add pointerMove between platform test
Summary:
Changelog: [RNTester][Internal] - Add "PointerMove Between" platform test

This diff adds another port of a web platform test which verifies the event order when a hoverable pointer moves between elements.

Reviewed By: lunaleaps

Differential Revision: D40164303

fbshipit-source-id: 12f39dfcf7a1a4acabfd762185bc2227451b1057
2022-10-07 12:07:19 -07:00
..
NativeComponentExample Simplify the dependencies migration for new libraries (#34619) 2022-09-09 04:25:56 -07:00
NativeModuleExample Simplify the dependencies migration for new libraries (#34619) 2022-09-09 04:25:56 -07:00
RCTTest bump RTC-Folly to 2021.07.22 (#33841) 2022-06-21 12:36:43 -07:00
RNTester Prepare AppDelegate to enable Concurrent Root on iOS (#33671) 2022-04-21 06:59:17 -07:00
RNTester-tvOS Continuous Integration cleanup 2020-11-05 06:09:36 -08:00
RNTesterIntegrationTests Fix race condition in RCTLoggingTests integration tests (#34858) 2022-10-04 04:38:07 -07:00
RNTesterPods.xcodeproj Create RCTAppDelegate to simplify New Architecture Setup (#34384) 2022-08-15 01:30:55 -07:00
RNTesterPods.xcworkspace
RNTesterUnitTests test RCTView with c swizzling example 2022-02-11 13:46:02 -08:00
android/app Hide the C++/Cmake configuration from user space inside the framework 2022-10-06 06:40:22 -07:00
js Add pointerMove between platform test 2022-10-07 12:07:19 -07:00
.eslintrc
.xcode.env Introduce .xcode.env configuration file to source `node` (#33546) 2022-04-11 02:50:57 -07:00
BUCK Rename js_glob as js_library_glob 2022-07-12 05:20:36 -07:00
Gemfile Bump CocoaPods to 1.11.3 and Ruby to 2.7.5 in tests/cache (#33654) 2022-04-20 15:13:49 -07:00
Podfile Simplify furthermore App migration 2022-09-14 04:21:02 -07:00
Podfile.lock Add Mapbuffer module to podspec (#34847) 2022-10-03 09:42:45 -07:00
README.md Make Hermes the default engine on iOS (#34085) 2022-06-28 10:04:51 -07:00
package.json `@react-native/tester` should be private (#34570) 2022-09-16 03:46:03 -07:00
react-native.config.js Attempt to fix test_android by adding a react-native.config.js inside rn-tester (#33901) 2022-05-24 05:55:40 -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

If you are testing non-fabric component, modify the fabric_enabled flag in RNTester's Podfile.

fabric_enabled = false

Also, if you previously built RNTester with fabric enabled, you might need to clean up the build files and Pods.

# Clean the generated files and folders to clean install RNTester
cd packages/rn-tester
yarn clean-ios

If you are still having a problem after doing the clean up (which can happen if you have built RNTester with older React Native versions where files were generated inside the react-native folder.), the best way might be to clean-install react-native (e.g. remove node_modules and yarn install).

Both macOS and Xcode are required.

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

Note for M1 users

If you own a Mac M1 laptop, you need to run some different commands to install and run cocoapods.

  • sudo arch -x86_64 gem install ffi: this installs the ffi package to load dynamically-linked libraries.
  • arch -x86_64 pod install: this run pod install with the right architecture.

Running on Android

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

Start an Android emulator.

cd packages/rn-tester
# In order to use Hermes engine, run `yarn install-android-hermes` instead.
yarn install-android-jsc
yarn start

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).

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).