Compare commits

..
Author SHA1 Message Date
Nicola Corti 185443e299 Migrate RNTester to use {usesCleartextTraffic} Manifest Placeholder (#52620)
Summary:
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

## Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android


Test Plan:
Tested locally with RNTester by doing:

```
./gradlew installDebugOptimized
```

This is the output of the 3 generated .aar. The size difference is a proof that we're correctly stripping out the C++ debug symbols:

<img width="193" height="54" alt="Screenshot 2025-07-15 at 17 49 50" src="https://github.com/user-attachments/assets/584a0e8d-2d17-40d4-ac29-da09049d6554" />
<img width="235" height="51" alt="Screenshot 2025-07-15 at 17 49 39" src="https://github.com/user-attachments/assets/eda8f9e7-3509-4334-8c16-990e55caa04d" />
<img width="184" height="52" alt="Screenshot 2025-07-15 at 17 49 32" src="https://github.com/user-attachments/assets/a5c94385-bc00-4484-b43e-088ee039827f" />

Rollback Plan:

Reviewed By: cipolleschi

Differential Revision: D78351347

Pulled By: cortinico
2025-07-18 07:43:44 -07:00
360 changed files with 4290 additions and 3689 deletions
+1 -1
View File
@@ -104,4 +104,4 @@ untyped-import
untyped-type-import
[version]
^0.276.0
^0.275.0
+12 -6
View File
@@ -4,6 +4,9 @@ inputs:
release-type:
required: true
description: The type of release we are building. It could be nightly, release or dry-run
run-e2e-tests:
default: 'false'
description: If we need to build to run E2E tests. If yes, we need to build also x86.
gradle-cache-encryption-key:
description: "The encryption key needed to store the Gradle Configuration cache"
runs:
@@ -28,11 +31,10 @@ runs:
uses: actions/cache/restore@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }}
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
restore-keys: |
v2-ccache-android-${{ github.job }}-${{ github.ref }}-
v2-ccache-android-${{ github.job }}-
v2-ccache-android-
v1-ccache-android-${{ github.job }}-
v1-ccache-android-
- name: Show ccache stats
shell: bash
run: ccache -s -v
@@ -41,7 +43,11 @@ runs:
run: |
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
# dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs.
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
if [[ "${{ inputs.run-e2e-tests }}" == 'true' ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
fi
TASKS="publishAllToMavenTempLocal build"
elif [[ "${{ inputs.release-type }}" == "nightly" ]]; then
# nightly: we set isSnapshot to true so artifacts are sent to the right repository on Maven Central.
@@ -57,7 +63,7 @@ runs:
uses: actions/cache/save@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }}
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
- name: Show ccache stats
shell: bash
run: ccache -s -v
@@ -15,6 +15,8 @@ runs:
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
@@ -43,8 +45,6 @@ runs:
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: ./.github/actions/yarn-install
+2 -2
View File
@@ -116,12 +116,12 @@ runs:
- name: Print Artifacts Directory
shell: bash
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Build packages
@@ -14,8 +14,6 @@ inputs:
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn install
uses: ./.github/actions/yarn-install
- name: Configure Git
-2
View File
@@ -35,8 +35,6 @@ runs:
with:
java-version: '17'
distribution: 'zulu'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Start Metro in Debug
@@ -17,6 +17,9 @@ outputs:
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
shell: bash
id: hermes-version
@@ -64,8 +67,6 @@ runs:
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
fi
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
uses: ./.github/actions/yarn-install
@@ -23,8 +23,6 @@ runs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Create Hermes folder
shell: bash
run: mkdir -p "$HERMES_WS_DIR"
@@ -36,6 +34,8 @@ runs:
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
@@ -31,7 +31,7 @@ runs:
run: |
cd /tmp/RNApp/ios
bundle install
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
bundle exec pod install
xcodebuild build \
-workspace RNApp.xcworkspace \
-scheme RNApp \
+2
View File
@@ -2,6 +2,8 @@ name: yarn-install
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
shell: bash
run: |
+4 -4
View File
@@ -23,7 +23,7 @@ jobs:
id: restore-ios-slice
uses: actions/cache/restore@v4
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: packages/react-native/
- name: Setup node.js
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
@@ -117,7 +117,7 @@ jobs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
packages/react-native/.build/headers
@@ -140,7 +140,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: packages/react-native/.build/output/xcframeworks
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
- name: Setup node.js
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-node
@@ -209,4 +209,4 @@ jobs:
path: |
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
+12 -3
View File
@@ -2,6 +2,11 @@ name: Test All
on:
workflow_dispatch:
inputs:
run-e2e-tests:
description: Whether to run E2E tests or not
type: boolean
default: false
pull_request:
push:
branches:
@@ -163,6 +168,7 @@ jobs:
flavor: ${{ matrix.flavor }}
test_e2e_ios_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: macos-14-large
needs:
[test_ios_rntester]
@@ -196,6 +202,7 @@ jobs:
flavor: ${{ matrix.flavor }}
test_e2e_ios_templateapp:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: macos-14-large
needs: [build_npm_package, prebuild_apple_dependencies]
env:
@@ -288,6 +295,7 @@ jobs:
working-directory: /tmp/RNTestProject
test_e2e_android_templateapp:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: 4-core-ubuntu
needs: build_npm_package
strategy:
@@ -406,9 +414,11 @@ jobs:
uses: ./.github/actions/build-android
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
test_e2e_android_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: 4-core-ubuntu
needs: [build_android]
strategy:
@@ -573,8 +583,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ["24", "22"]
# node-version: ["24", "22", "20.19.4"]
node-version: ["24", "22", "20"]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -607,7 +616,7 @@ jobs:
rerun-failed-jobs:
runs-on: ubuntu-latest
needs: [test_e2e_ios_rntester, test_e2e_android_rntester, test_e2e_ios_templateapp, test_e2e_android_templateapp]
if: ${{ github.ref == 'refs/heads/main' && always() }}
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
+1
View File
@@ -43,6 +43,7 @@ project.xcworkspace
/private/helloworld/android/app/build/
/private/helloworld/android/build/
/packages/react-native-popup-menu-android/android/build/
/packages/react-native-test-library/android/build/
# Buck
.buckd
+36
View File
@@ -0,0 +1,36 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": false,
"requirePragma": true,
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "lf",
"overrides": [
{
"files": ["*.code-workspace"],
"options": {
"parser": "json"
}
},
{
"files": [
"*.js",
"*.js.flow"
],
"options": {
"parser": "hermes"
}
},
{
"files": [
"**/__docs__/*.md"
],
"options": {
"parser": "markdown",
"proseWrap": "always",
"requirePragma": false
}
}
]
}
-46
View File
@@ -1,46 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
let plugins = ['prettier-plugin-hermes-parser'];
try {
plugins = require('./.prettier-plugins.fb.js');
} catch {}
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
requirePragma: true,
singleQuote: true,
trailingComma: 'all',
endOfLine: 'lf',
plugins,
overrides: [
{
files: ['*.code-workspace'],
options: {
parser: 'json',
},
},
{
files: ['*.js', '*.js.flow'],
options: {
parser: 'hermes',
},
},
{
files: ['**/__docs__/*.md'],
options: {
parser: 'markdown',
proseWrap: 'always',
requirePragma: false,
},
},
],
};
-31
View File
@@ -522,37 +522,6 @@ ChuiHW))
- **Style:** Fixed `centerContent` losing taps and causing jitter ([fe7e97a2fd](https://github.com/facebook/react-native/commit/fe7e97a2fd272db0d9d9aa7d0561337a7c8e2c30) by [@gaearon](https://github.com/gaearon))
- **Xcode:** Properly escape paths in Xcode build script used when bundling an app. ([2fee13094b](https://github.com/facebook/react-native/commit/2fee13094b3d384c071978776fd8b7cff0b6530f) by [@kraenhansen](https://github.com/kraenhansen))
# Changelog
## v0.77.3
### Added
#### Android specific
- **Gradle**: RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror. ([6cb8dc37c7](https://github.com/facebook/react-native/commit/6cb8dc37c74995cba3f9f0a845919f305de53c3d) by [@cortinico](https://github.com/cortinico))
### Changed
- **Metro**: Bump Metro minimum version from `^0.81.3` to `^0.81.5`. ([dfa81638dd](https://github.com/facebook/react-native/commit/dfa81638dd17e46f70f10b25c4f4fd9f370a4b0e) by [@robhogan](https://github.com/robhogan))
### Fixed
- **Timers**: Align timer IDs and timer function argument error handling with web standards. ([480a4642e5](https://github.com/facebook/react-native/commit/480a4642e5a644becf1c477d3d239f9b57efff3a) by [@kitten](https://github.com/kitten))
#### Android specific
- **Modal**: Fix Modal first frame being rendered on top-left corner. ([b950fa2afb](https://github.com/facebook/react-native/commit/b950fa2afb20e2213ff6c733cb1c2465b90406ef) by [@cortinico](https://github.com/cortinico))
- **layout**: Fix wrong `borderBottomEndRadius` on RTL. ([68d6ada448](https://github.com/facebook/react-native/commit/68d6ada44893701b6006a6b1753131c7e880a30a) by [@riteshshukla04](https://github.com/riteshshukla04))
- **Modal**: Fix `FLAG_SECURE` not respected in Modal dialog. ([7e029b0dcf](https://github.com/facebook/react-native/commit/7e029b0dcf6d1a6455a8a6343457b70e353d0ff6) by [@mateoguzmana](https://github.com/mateoguzmana))
- **lifecylcle**: Legacy arch: fix #50274, Fast Refresh sometimes breaks after full refresh. ([c43952ac22](https://github.com/facebook/react-native/commit/c43952ac22b2356be3130c906329f61e246082cb) by [@robhogan](https://github.com/robhogan))
#### iOS specific
- **Interop Layer**: Fixed adding child views to a native view using the interop layer. ([d53a60dd23](https://github.com/facebook/react-native/commit/d53a60dd23c5df8afca058a867c50df8b61f62e2) by [@chrfalch](https://github.com/chrfalch))
- **Debugger**: Restore "Paused in debugger" overlay icon. ([f30c46efbd](https://github.com/facebook/react-native/commit/f30c46efbd964d367f678181589865a3faa931cd) by [@robhogan](https://github.com/robhogan))
- **layout**: Layout direction changes are now honored on bundle reload. ([36f29beac4](https://github.com/facebook/react-native/commit/36f29beac47259768612bf56e5d9acfa4b94ab1a) by [@chrsmys](https://github.com/chrsmys))
- **file reads**: Fix crash caused by `[RCTFileRequestHanlder invalidate]`. ([789ed7d5ad](https://github.com/facebook/react-native/commit/789ed7d5ad75ad4c20ecd1eb19d1fc18275fc500) by [@zhouzh1](https://github.com/zhouzh1))
## v0.77.2
### Added
-113
View File
@@ -1,114 +1,5 @@
# Changelog
## v0.81.0-rc.2
### Breaking
#### Android specific
#### iOS specific
### Added
#### Android specific
#### iOS specific
### Changed
- Added support to `react-native/babel-preset` for a `hermesParserOptions` option, that expects an object that enables overriding `hermes-parser` options. ([0508eddfe6](https://github.com/facebook/react-native/commit/0508eddfe60df60cb3bfa4074ae199bd0e492d5f) by [@yungsters](https://github.com/yungsters))
- `NewAppScreen` no longer internally handles device safe area, use optional `safeAreaInsets` prop (aligned in 0.81 template) ([732bd12dc2](https://github.com/facebook/react-native/commit/732bd12dc21460641ef01b23f2eb722f26b060d5) by [@huntie](https://github.com/huntie))
#### Android specific
#### iOS specific
### Deprecated
#### Android specific
#### iOS specific
### Removed
#### Android specific
#### iOS specific
### Fixed
#### Android specific
#### iOS specific
- Fixed issue with RNDeps release/debug switch failing ([4ee2b60a1e](https://github.com/facebook/react-native/commit/4ee2b60a1eacca744d58a7ad336ca9d3714289f6) by [@chrfalch](https://github.com/chrfalch))
- Fixed missing script for resolving prebuilt xcframework when switching between release/debug ([2e55241a90](https://github.com/facebook/react-native/commit/2e55241a901b4cd95917de68ce9078928820a208) by [@chrfalch](https://github.com/chrfalch))
### Security
#### Android specific
#### iOS specific
### Unknown
- Release 0.81.0-rc.2 ([68ef746ec5](https://github.com/facebook/react-native/commit/68ef746ec5dd7d2874d190733e75bb8197034c5a) by [@react-native-bot](https://github.com/react-native-bot))
- Fix E2E test script when the ci flag is not specified ([cdd7f99581](https://github.com/facebook/react-native/commit/cdd7f995813727b630ff38abc8a910a0f8f10b37) by [@cipolleschi](https://github.com/cipolleschi))
- Fix E2E script when using CI artifacts ([d8bf94489a](https://github.com/facebook/react-native/commit/d8bf94489ab7498eba7e5f45d09dd2819fe739c3) by [@cipolleschi](https://github.com/cipolleschi))
- Bump Podfile.lock ([10b63c15b6](https://github.com/facebook/react-native/commit/10b63c15b6faaf54d555ede879f82ac565f030a9) by [@react-native-bot](https://github.com/react-native-bot))
- Release 0.81.0-rc.1 ([b06bb89ddd](https://github.com/facebook/react-native/commit/b06bb89ddd3cebddea4716036a4368b87a65f492) by [@react-native-bot](https://github.com/react-native-bot))
#### Android Unknown
#### iOS Unknown
#### Failed to parse
## v0.81.0-rc.1
### Added
@@ -701,10 +592,6 @@ See [CHANGELOG-0.7x](./CHANGELOG-0.7x#v0781)
See [CHANGELOG-0.7x](./CHANGELOG-0.7x#v0780)
## v0.77.3
See [CHANGELOG-0.7x](./CHANGELOG-0.7x#v0773)
## v0.77.2
See [CHANGELOG-0.7x](./CHANGELOG-0.7x#v0772)
-7
View File
@@ -157,11 +157,4 @@ allprojects {
com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask::class,
com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask::class)
.forEach { tasks.withType(it) { exclude(excludePatterns) } }
// Disable the problematic ktfmt script tasks due to symbolic link issues in subprojects
afterEvaluate {
listOf("ktfmtCheckScripts", "ktfmtFormatScripts").forEach {
tasks.findByName(it)?.enabled = false
}
}
}
+5 -5
View File
@@ -56,8 +56,8 @@
"@electron/packager": "^18.3.6",
"@jest/create-cache-key-function": "^29.7.0",
"@microsoft/api-extractor": "^7.52.2",
"@react-native/metro-babel-transformer": "0.82.0-main",
"@react-native/metro-config": "0.82.0-main",
"@react-native/metro-babel-transformer": "0.81.0-main",
"@react-native/metro-config": "0.81.0-main",
"@tsconfig/node22": "22.0.2",
"@types/react": "^19.1.0",
"@typescript-eslint/parser": "^8.36.0",
@@ -82,7 +82,7 @@
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.29.1",
"flow-bin": "^0.276.0",
"flow-bin": "^0.275.0",
"glob": "^7.1.1",
"hermes-eslint": "0.29.1",
"hermes-transform": "0.29.1",
@@ -96,8 +96,8 @@
"markdownlint-cli2": "^0.17.2",
"markdownlint-rule-relative-links": "^3.0.0",
"memfs": "^4.7.7",
"metro-babel-register": "^0.83.1",
"metro-transform-plugins": "^0.83.1",
"metro-babel-register": "^0.83.0",
"metro-transform-plugins": "^0.83.0",
"micromatch": "^4.0.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
],
"dependencies": {
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.82.0-main"
"@react-native/codegen": "0.81.0-main"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,16 +22,16 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.82.0-main",
"@react-native/dev-middleware": "0.81.0-main",
"debug": "^4.4.0",
"invariant": "^2.2.4",
"metro": "^0.83.1",
"metro-config": "^0.83.1",
"metro-core": "^0.83.1",
"metro": "^0.83.0",
"metro-config": "^0.83.0",
"metro-core": "^0.83.0",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.83.1"
"metro-resolver": "^0.83.0"
},
"peerDependencies": {
"@react-native-community/cli": "*",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
+2 -2
View File
@@ -1,5 +1,5 @@
@generated SignedSource<<74c5fb174ae5a8a3850a3c2373b3b6f5>>
Git revision: a7e4f59675edbda995b0cb0d40f277a59a3baebf
@generated SignedSource<<e2d97b04634bf3b566f33d455f38658f>>
Git revision: 8dc0d5b365e6b4600b78e5a7381aa861d8c1c81e
Built with --nohooks: false
Is local checkout: false
Remote URL: https://github.com/facebook/react-native-devtools-frontend
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
@@ -1,62 +0,0 @@
#!/usr/bin/env dotslash
// @generated SignedSource<<686df5695b32a90cd465412d979a1a3f>>
{
"name": "React Native DevTools",
"platforms": {
"linux-aarch64": {
"size": 113511487,
"hash": "sha256",
"digest": "c22f7d5e029357f05055ce7c56cc284a0d441d558e103a7b7ebae118c67d0b95",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPRilWDJV8xyKEv9lqYn7Hf2kyZg6nqW8KctGZCXsU95lS_MTFyAmEULrB3J6hGCjqBY2Zl-uq_FjERAIgzbZFWX2eceacTbutBSOKEj6QTZzkVN_L1zPh2lGh24x29MHpkwUzw4E-kAXV43f-11QxqD7orI1QicyOnsmUqeRNKE_QjM9rNRsw6iE8"
}
],
"format": "tar.gz",
"path": "React Native DevTools-linux-arm64/React Native DevTools"
},
"linux-x86_64": {
"size": 113244728,
"hash": "sha256",
"digest": "d749aee18d6c969f033511ed631b439c578068cc20786974bc0ee707c6c2f177",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQP8NAAXjHJ-9NJThip1nnmVim4yiS1tdYAXmWl2Remiluq5f13nXA8YEadsmGRLWxXz2WJouHXSK47ea4a30fxewyKeTt0niFn3T-lr_91m3Ve5ZS-FOZ_9CRVCkv5zC-Z1FlXJGOnphfWetIU10Pw9tho3IzjdSNlXle0XTrkJ2AyKSl4cKPaX"
}
],
"format": "tar.gz",
"path": "React Native DevTools-linux-x64/React Native DevTools"
},
"macos-aarch64": {
"size": 108805847,
"hash": "sha256",
"digest": "dc4a6cfa3d2d8646db8793ef497e43ad72be54bb14ed96345d059880ff72ce1e",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPuZx9G4h30mUDM0hZ8y74LbzAi7-S6jnOqq8uyfDdIptLwIgpb8CKB8F2tduvaBFMGd7obwXd2NVy01r6XKVdgAK5-QTp8PYUPUE7VSCi6QAqobXcQ2uq_lY-jgyj8XkV4Ua4gA6KR609Bmh-beSTOrSqMymqVodaGqoGjB_9jVwfD99_PfFlex-Ta"
}
],
"format": "tar.gz",
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
},
"macos-x86_64": {
"size": 113766610,
"hash": "sha256",
"digest": "74178859ce6a1c26c32055e192b1b123822c76c827ea86a6dfdb5463b89b1ace",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQN6DjGhr8_L7N_cwrh8pi3cfNcbn9dot_QQpgwe3Vv-780FDgi6JUeMvbo_wbFoT2rogxfHZ0-NbXbKdWYwhGUoGeQuikT57QnVMOYuPUTjlQUgYy0Ng9XPhq3iSEYwlMV1XsUJuPFRUg-hIHcgaaA55JoTLXZ1fLYydhHnmgRxGHc4pxaHvSpTtQ"
}
],
"format": "tar.gz",
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-shell",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
"keywords": [
"react-native",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
@@ -23,7 +23,7 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.82.0-main",
"@react-native/debugger-frontend": "0.81.0-main",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^0.2.0",
"connect": "^3.6.5",
@@ -184,7 +184,7 @@ describe.each(['HTTP', 'HTTPS'])(
describe.each(['10.0.2.2:8080', '[::1]', 'example.com:2000'])(
'%s aliasing to and from localhost',
sourceHost => {
test('Debugger.scriptParsed - in source map fetching', async () => {
test('in source map fetching during Debugger.scriptParsed', async () => {
serverRef.app.use('/source-map', serveStaticJson({version: 3}));
const {device, debugger_} = await createAndConnectTarget(
serverRef,
@@ -220,53 +220,6 @@ describe.each(['HTTP', 'HTTPS'])(
}
});
test('Runtime.consoleAPICalled - in location resolutions', async () => {
const {device, debugger_} = await createAndConnectTarget(
serverRef,
autoCleanup.signal,
{
app: 'bar-app',
id: 'page1',
title: 'bar-title',
vm: 'bar-vm',
},
{
deviceHostHeader: sourceHost,
},
);
try {
const consoleMessage = await sendFromTargetToDebugger(
device,
debugger_,
'page1',
{
method: 'Runtime.consoleAPICalled',
params: {
stackTrace: {
callFrames: [
{
url: `${protocol.toLowerCase()}://${sourceHost}/bundleFile:1:2`,
field2: 'aaa',
},
{
url: `${protocol.toLowerCase()}://${sourceHost}/bundleFile:5:4`,
field3: 'bbb',
},
],
},
},
},
);
expect(consoleMessage.params.stackTrace.callFrames).toEqual([
{url: `${serverRef.serverBaseUrl}/bundleFile:1:2`, field2: 'aaa'},
{url: `${serverRef.serverBaseUrl}/bundleFile:5:4`, field3: 'bbb'},
]);
} finally {
device.close();
debugger_.close();
}
});
test('in Debugger.setBreakpointByUrl', async () => {
const {device, debugger_} = await createAndConnectTarget(
serverRef,
@@ -844,23 +844,6 @@ export default class Device {
this.#isLegacyPageReloading = false;
}
if (payload.method === 'Runtime.consoleAPICalled') {
const callFrames = payload.params?.stackTrace?.callFrames ?? [];
for (const callFrame of callFrames) {
if (callFrame.url) {
const parsedUrl = this.#tryParseHTTPURL(callFrame.url);
if (parsedUrl) {
// Rewrite device-relative URLs pointing to the server so that they're
// reachable from the frontend.
callFrame.url = this.#deviceRelativeUrlToDebuggerRelativeUrl(
parsedUrl,
debuggerInfo,
).href;
}
}
}
}
}
/**
@@ -48,7 +48,6 @@ export type CDPClientMessage =
export type CDPServerMessage =
| CDPEvent<'Debugger.scriptParsed'>
| CDPEvent<'Runtime.consoleAPICalled'>
| CDPEvent<>
| CDPResponse<'Debugger.getScriptSource'>
| CDPResponse<>;
@@ -84,27 +84,10 @@ export interface Debugger {
*/
sourceMapURL: string,
};
ConsoleAPICalled: {
args: Array<{type: string, value: string}>,
executionContextId: number,
stackTrace: {
timestamp: number,
type: string,
callFrames: Array<{
columnNumber: number,
lineNumber: number,
functionName: string,
scriptId: string,
url: string,
}>,
},
};
}
export type Events = {
'Debugger.scriptParsed': Debugger['ScriptParsedEvent'],
'Runtime.consoleAPICalled': Debugger['ConsoleAPICalled'],
[method: string]: JSONSerializable,
};
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-config",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -22,7 +22,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@react-native/eslint-plugin": "0.82.0-main",
"@react-native/eslint-plugin": "0.81.0-main",
"@typescript-eslint/eslint-plugin": "^8.36.0",
"@typescript-eslint/parser": "^8.36.0",
"eslint-config-prettier": "^8.5.0",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@react-native/codegen": "0.82.0-main",
"@react-native/codegen": "0.81.0-main",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -100,10 +100,10 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
* Allows to specify the debuggable variants (by default just 'debug'). Variants in this list will
* not be bundled (the bundle file will not be created and won't be copied over).
*
* Default: ['debug', 'debugOptimized']
* Default: ['debug']
*/
val debuggableVariants: ListProperty<String> =
objects.listProperty(String::class.java).convention(listOf("debug", "debugOptimized"))
objects.listProperty(String::class.java).convention(listOf("debug"))
/** Hermes Config */
@@ -26,21 +26,5 @@ class ReactRootProjectPlugin : Plugin<Project> {
it.evaluationDependsOn(":app")
}
}
// We need to make sure that `:app:preBuild` task depends on all other subprojects' preBuild
// tasks. This is necessary in order to have all the codegen generated code before the CMake
// configuration build kicks in.
project.gradle.projectsEvaluated {
val appProject = project.rootProject.subprojects.find { it.name == "app" }
val appPreBuild = appProject?.tasks?.findByName("preBuild")
if (appPreBuild != null) {
// Find all other subprojects' preBuild tasks
val otherPreBuildTasks =
project.rootProject.subprojects
.filter { it != appProject }
.mapNotNull { it.tasks.findByName("preBuild") }
// Make :app:preBuild depend on all others
appPreBuild.dependsOn(otherPreBuildTasks)
}
}
}
}
@@ -42,16 +42,6 @@ internal object AgpConfiguratorUtils {
getByName("release").apply {
manifestPlaceholders["usesCleartextTraffic"] = "false"
}
maybeCreate("debugOptimized").apply {
manifestPlaceholders["usesCleartextTraffic"] = "true"
initWith(debug)
externalNativeBuild {
cmake {
arguments("-DCMAKE_BUILD_TYPE=Release")
matchingFallbacks += listOf("release")
}
}
}
}
}
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -26,9 +26,9 @@
"dist"
],
"dependencies": {
"@react-native/js-polyfills": "0.82.0-main",
"@react-native/metro-babel-transformer": "0.82.0-main",
"metro-config": "^0.83.1",
"metro-runtime": "^0.83.1"
"@react-native/js-polyfills": "0.81.0-main",
"@react-native/metro-babel-transformer": "0.81.0-main",
"metro-config": "^0.83.0",
"metro-runtime": "^0.83.0"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/new-app-screen",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "NewAppScreen component for React Native",
"keywords": [
"react-native"
+12 -2
View File
@@ -13,7 +13,6 @@ import {ThemedText, useTheme} from './Theme';
import * as React from 'react';
import {
Image,
ReactNativeVersion,
ScrollView,
StyleSheet,
Text,
@@ -23,6 +22,7 @@ import {
useWindowDimensions,
} from 'react-native';
import openURLInBrowser from 'react-native/Libraries/Core/Devtools/openURLInBrowser';
import {version as ReactNativeVersion} from 'react-native/Libraries/Core/ReactNativeVersion';
export type NewAppScreenProps = $ReadOnly<{
templateFileName?: string,
@@ -109,9 +109,19 @@ export default function NewAppScreen({
}
function getVersionLabel(): React.Node {
const version =
[
ReactNativeVersion.major,
ReactNativeVersion.minor,
ReactNativeVersion.patch,
].join('.') +
(ReactNativeVersion.prerelease != null
? '-' + ReactNativeVersion.prerelease
: '');
return (
<ThemedText color="secondary" style={styles.label}>
Version: {ReactNativeVersion.getVersionString()}
Version: {version}
</ThemedText>
);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/normalize-colors",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Color normalization for React Native.",
"license": "MIT",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Babel preset for React Native applications",
"repository": {
"type": "git",
@@ -66,7 +66,7 @@
"@babel/plugin-transform-typescript": "^7.25.2",
"@babel/plugin-transform-unicode-regex": "^7.24.7",
"@babel/template": "^7.25.0",
"@react-native/babel-plugin-codegen": "0.82.0-main",
"@react-native/babel-plugin-codegen": "0.81.0-main",
"babel-plugin-syntax-hermes-parser": "0.29.1",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-babel-transformer",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Babel transformer for React Native applications.",
"repository": {
"type": "git",
@@ -27,7 +27,7 @@
],
"dependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.82.0-main",
"@react-native/babel-preset": "0.81.0-main",
"hermes-parser": "0.29.1",
"nullthrows": "^1.1.1"
},
@@ -4,6 +4,5 @@
"bracketSpacing": false,
"requirePragma": true,
"singleQuote": true,
"trailingComma": "all",
"parser": "babel"
"trailingComma": "all"
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
+6 -8
View File
@@ -32,7 +32,7 @@ const prettier = require('prettier');
const {styleText} = require('util');
const prettierConfig = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '..', 'build.prettierrc'), 'utf8'),
fs.readFileSync(path.resolve(__dirname, '..', '.prettierrc'), 'utf8'),
);
const SRC_DIR = 'src';
@@ -58,7 +58,7 @@ function getBuildPath(file, buildFolder) {
return path.resolve(pkgBuildPath, relativeToSrcPath);
}
async function buildFile(file, silent) {
function buildFile(file, silent) {
const destPath = getBuildPath(file, BUILD_DIR);
fs.mkdirSync(path.dirname(destPath), {recursive: true});
@@ -82,7 +82,7 @@ async function buildFile(file, silent) {
'\n',
);
} else {
const transformed = await prettier.format(
const transformed = prettier.format(
babel.transformFileSync(file, {}).code,
{
...prettierConfig,
@@ -111,8 +111,6 @@ const files = glob.sync(pattern, {nodir: true});
process.stdout.write(fixedWidth(`${path.basename(PACKAGE_DIR)}\n`));
Promise.all(
files.map(file => buildFile(file, !process.argv.includes('--verbose'))),
).then(() => {
process.stdout.write(`[ ${styleText('green', 'OK')} ]\n`);
});
files.forEach(file => buildFile(file, !process.argv.includes('--verbose')));
process.stdout.write(`[ ${styleText('green', 'OK')} ]\n`);
@@ -317,9 +317,7 @@ function buildViewConfig(
return directEvents;
}, []);
const properties: Array<
BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeSpreadElement,
> = [
const properties = [
t.objectProperty(
t.identifier('uiViewClassName'),
t.stringLiteral(componentName),
@@ -47,15 +47,15 @@ const HostFunctionTemplate = ({
isVoid
? `\n ${methodCall};`
: isNullable
? `\n auto result = ${methodCall};`
: ''
? `\n auto result = ${methodCall};`
: ''
}
return ${
isVoid
? 'jsi::Value::undefined()'
: isNullable
? 'result ? jsi::Value(std::move(*result)) : jsi::Value::null()'
: methodCall
? 'result ? jsi::Value(std::move(*result)) : jsi::Value::null()'
: methodCall
};
}`;
};
@@ -572,17 +572,17 @@ function translateEventEmitterToCpp(
${
isVoidTypeAnnotation ? '' : `template <typename ${templateName}> `
}void emit${toPascalCase(eventEmitter.name)}(${
isVoidTypeAnnotation
? ''
: `${isArray ? `std::vector<${templateName}>` : templateName} value`
}) {${
isVoidTypeAnnotation
? ''
: `
isVoidTypeAnnotation
? ''
: `${isArray ? `std::vector<${templateName}>` : templateName} value`
}) {${
isVoidTypeAnnotation
? ''
: `
static_assert(bridging::supportsFromJs<${
isArray ? `std::vector<${templateName}>` : templateName
}, ${jsiType}>, "value cannnot be converted to ${jsiType}");`
}
}
static_cast<AsyncEventEmitter<${
isVoidTypeAnnotation ? '' : 'jsi::Value'
}>&>(*delegate_.eventEmitterMap_["${eventEmitter.name}"]).emit(${
@@ -84,10 +84,10 @@ function EventEmitterTemplate(
: ''
}) {
mEventEmitterCallback.invoke("${eventEmitter.name}"${
eventEmitter.typeAnnotation.typeAnnotation.type !== 'VoidTypeAnnotation'
? ', value'
: ''
});
eventEmitter.typeAnnotation.typeAnnotation.type !== 'VoidTypeAnnotation'
? ', value'
: ''
});
}`;
}
@@ -113,8 +113,8 @@ function MethodTemplate(
const methodClosing = abstract
? ';'
: methodBody != null && methodBody.length > 0
? ` { ${methodBody} }`
: ' {}';
? ` { ${methodBody} }`
: ' {}';
return ` ${methodJavaAnnotation}
public ${methodQualifier}${translatedReturnType} ${methodName}(${traversedArgs.join(
', ',
@@ -74,22 +74,22 @@ namespace facebook::react {
}),
)
.join('\n' + ' '.repeat(8))}${
eventEmitters.length > 0
? eventEmitters
.map(eventEmitter => {
return `
eventEmitters.length > 0
? eventEmitters
.map(eventEmitter => {
return `
eventEmitterMap_["${eventEmitter.name}"] = std::make_shared<AsyncEventEmitter<id>>();`;
})
.join('')
: ''
}${
eventEmitters.length > 0
? `
})
.join('')
: ''
}${
eventEmitters.length > 0
? `
setEventEmitterCallback([&](const std::string &name, id value) {
static_cast<AsyncEventEmitter<id> &>(*eventEmitterMap_[name]).emit(value);
});`
: ''
}
: ''
}
}
} // namespace facebook::react`;
@@ -116,10 +116,10 @@ describe('Flow Module Parser', () => {
nullable && optional
? 'a nullable and optional'
: nullable
? 'a nullable'
: optional
? 'an optional'
: 'a required';
? 'a nullable'
: optional
? 'an optional'
: 'a required';
function annotateArg(paramName: string, paramType: string) {
if (nullable && optional) {
@@ -167,10 +167,10 @@ describe('Flow Module Parser', () => {
(nullable && optional
? 'Nullable and Optional'
: nullable
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Parameter',
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Parameter',
() => {
it(`should not parse methods that have ${PARAM_TYPE_DESCRIPTION} parameter of type 'Function'`, () => {
expect(() => parseParamType('arg', 'Function')).toThrow(
@@ -397,10 +397,10 @@ describe('Flow Module Parser', () => {
isPropNullable && isPropOptional
? 'a nullable and optional'
: isPropNullable
? 'a nullable'
: isPropOptional
? 'an optional'
: 'a required';
? 'a nullable'
: isPropOptional
? 'an optional'
: 'a required';
function annotateProp(propName: string, propType: string) {
if (isPropNullable && isPropOptional) {
@@ -465,10 +465,10 @@ describe('Flow Module Parser', () => {
(isPropNullable && isPropOptional
? 'Nullable and Optional'
: isPropNullable
? 'Nullable'
: isPropOptional
? 'Optional'
: 'Required') + ' Property',
? 'Nullable'
: isPropOptional
? 'Optional'
: 'Required') + ' Property',
() => {
describe('Props with Primitive Types', () => {
PRIMITIVES.forEach(([FLOW_TYPE, PARSED_TYPE_NAME]) => {
@@ -932,10 +932,10 @@ describe('Flow Module Parser', () => {
nullable && optional
? 'a nullable and optional'
: nullable
? 'a nullable'
: optional
? 'an optional'
: 'a required';
? 'a nullable'
: optional
? 'an optional'
: 'a required';
function annotateProp(propName: string, propType: string) {
if (nullable && optional) {
@@ -1001,10 +1001,10 @@ describe('Flow Module Parser', () => {
(nullable && optional
? 'Nullable and Optional'
: nullable
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Property',
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Property',
() => {
/**
* TODO: Fill out props in promise
+10 -10
View File
@@ -187,8 +187,8 @@ class FlowParser implements Parser {
typeAnnotation.type === 'EnumStringBody'
? 'StringTypeAnnotation'
: typeAnnotation.type === 'EnumNumberBody'
? 'NumberTypeAnnotation'
: null;
? 'NumberTypeAnnotation'
: null;
if (!enumMembersType) {
throw new Error(
`Unknown enum type annotation type. Got: ${typeAnnotation.type}. Expected: EnumStringBody or EnumNumberBody.`,
@@ -242,14 +242,14 @@ class FlowParser implements Parser {
value: member.init.value,
}
: typeof member.init?.value === 'string'
? {
type: 'StringLiteralTypeAnnotation',
value: member.init.value,
}
: {
type: 'StringLiteralTypeAnnotation',
value: member.id.name,
};
? {
type: 'StringLiteralTypeAnnotation',
value: member.init.value,
}
: {
type: 'StringLiteralTypeAnnotation',
value: member.id.name,
};
return {
name: member.id.name,
@@ -353,8 +353,8 @@ function setDefaultValue(
common.default = ((defaultValue === null
? null
: defaultValue
? defaultValue
: 0): number | null);
? defaultValue
: 0): number | null);
break;
case 'BooleanTypeAnnotation':
common.default = defaultValue === null ? null : !!defaultValue;
@@ -192,10 +192,10 @@ describe('TypeScript Module Parser', () => {
nullable && optional
? 'a nullable and optional'
: nullable
? 'a nullable'
: optional
? 'an optional'
: 'a required';
? 'a nullable'
: optional
? 'an optional'
: 'a required';
function annotateArg(paramName: string, paramType: string) {
if (nullable && optional) {
@@ -243,10 +243,10 @@ describe('TypeScript Module Parser', () => {
(nullable && optional
? 'Nullable and Optional'
: nullable
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Parameter',
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Parameter',
() => {
it(`should not parse methods that have ${PARAM_TYPE_DESCRIPTION} parameter of type 'Function'`, () => {
expect(() => parseParamType('arg', 'Function')).toThrow(
@@ -473,10 +473,10 @@ describe('TypeScript Module Parser', () => {
isPropNullable && isPropOptional
? 'a nullable and optional'
: isPropNullable
? 'a nullable'
: isPropOptional
? 'an optional'
: 'a required';
? 'a nullable'
: isPropOptional
? 'an optional'
: 'a required';
function annotateProp(propName: string, propType: string) {
if (isPropNullable && isPropOptional) {
@@ -541,10 +541,10 @@ describe('TypeScript Module Parser', () => {
(isPropNullable && isPropOptional
? 'Nullable and Optional'
: isPropNullable
? 'Nullable'
: isPropOptional
? 'Optional'
: 'Required') + ' Property',
? 'Nullable'
: isPropOptional
? 'Optional'
: 'Required') + ' Property',
() => {
describe('Props with Primitive Types', () => {
PRIMITIVES.forEach(([FLOW_TYPE, PARSED_TYPE_NAME]) => {
@@ -1007,10 +1007,10 @@ describe('TypeScript Module Parser', () => {
nullable && optional
? 'a nullable and optional'
: nullable
? 'a nullable'
: optional
? 'an optional'
: 'a required';
? 'a nullable'
: optional
? 'an optional'
: 'a required';
function annotateProp(propName: string, propType: string) {
if (nullable && optional) {
@@ -1076,10 +1076,10 @@ describe('TypeScript Module Parser', () => {
(nullable && optional
? 'Nullable and Optional'
: nullable
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Property',
? 'Nullable'
: optional
? 'Optional'
: 'Required') + ' Property',
() => {
/**
* TODO: Fill out props in promise
@@ -233,8 +233,8 @@ class TypeScriptParser implements Parser {
enumMembersType === 'StringTypeAnnotation'
? 'StringLiteral'
: enumMembersType === 'NumberTypeAnnotation'
? 'NumericLiteral'
: null;
? 'NumericLiteral'
: null;
typeAnnotation.members.forEach(member => {
const isNegative =
@@ -263,19 +263,19 @@ class TypeScriptParser implements Parser {
value: -1 * member.initializer?.argument?.value,
}
: typeof member.initializer?.value === 'number'
? {
type: 'NumberLiteralTypeAnnotation',
value: member.initializer?.value,
}
: typeof member.initializer?.value === 'string'
? {
type: 'StringLiteralTypeAnnotation',
value: member.initializer?.value,
}
: {
type: 'StringLiteralTypeAnnotation',
value: member.id.name,
};
? {
type: 'NumberLiteralTypeAnnotation',
value: member.initializer?.value,
}
: typeof member.initializer?.value === 'string'
? {
type: 'StringLiteralTypeAnnotation',
value: member.initializer?.value,
}
: {
type: 'StringLiteralTypeAnnotation',
value: member.id.name,
};
return {
name: member.id.name,
@@ -1,6 +1,6 @@
{
"name": "@react-native/compatibility-check",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
"license": "MIT",
"repository": {
@@ -29,7 +29,7 @@
"dist"
],
"dependencies": {
"@react-native/codegen": "0.82.0-main"
"@react-native/codegen": "0.81.0-main"
},
"devDependencies": {
"flow-remove-types": "^2.237.2",
@@ -1,6 +1,6 @@
{
"name": "@react-native/popup-menu-android",
"version": "0.82.0-main",
"version": "0.81.0-main",
"description": "PopupMenu for the Android platform",
"main": "index.js",
"files": [
@@ -21,7 +21,7 @@
},
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "0.82.0-main"
"@react-native/codegen": "0.81.0-main"
},
"peerDependencies": {
"@types/react": "^19.1.0",
@@ -0,0 +1,24 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = 'OSSLibraryExample'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.homepage = package['homepage']
s.license = package['license']
s.platforms = min_supported_versions
s.author = 'Meta Platforms, Inc. and its affiliates'
s.source = { :git => package['repository']['url'], :tag => "#{s.version}" }
s.source_files = 'ios/**/*.{h,m,mm,cpp}'
install_modules_dependencies(s)
end
@@ -0,0 +1,9 @@
## Important
This package is for testing only. It is a subject to frequent change. It does not represent the recomended structure for React native libraries. It should not be used as a referece for such purposes.
## Building
```
yarn install
yarn build
npx react-native codegen
```
@@ -0,0 +1,32 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
plugins {
id("com.facebook.react")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
compileSdk = libs.versions.compileSdk.get().toInt()
buildToolsVersion = libs.versions.buildTools.get()
namespace = "com.facebook.react.osslibraryexample"
defaultConfig { minSdk = libs.versions.minSdk.get().toInt() }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions { jvmTarget = "17" }
}
dependencies {
// Build React Native from source
implementation(project(":packages:react-native:ReactAndroid"))
}
@@ -0,0 +1,4 @@
# We want to have more fine grained control on the Java version for
# ReactAndroid, therefore we disable RGNP Java version alignment mechanism
react.internal.disableJavaVersionAlignment=true
@@ -0,0 +1,37 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleJavaSpec.js
*
* @nolint
*/
package com.facebook.fbreact.specs;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
public abstract class NativeSampleModuleSpec extends ReactContextBaseJavaModule implements TurboModule {
public static final String NAME = "NativeSampleModule";
public NativeSampleModuleSpec(ReactApplicationContext reactContext) {
super(reactContext);
}
@Override
public @Nonnull String getName() {
return NAME;
}
@ReactMethod(isBlockingSynchronousMethod = true)
@DoNotStrip
public abstract double getRandomNumber();
}
@@ -0,0 +1,30 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.osslibraryexample
import com.facebook.fbreact.specs.NativeSampleModuleSpec
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.module.annotations.ReactModule
@ReactModule(name = NativeSampleModuleSpec.NAME)
public class NativeSampleModule(reactContext: ReactApplicationContext?) :
ReactContextBaseJavaModule(reactContext) {
override fun getName(): String = NAME
private companion object {
const val NAME = "NativeSampleModule"
}
@ReactMethod
public fun getRandomNumber(): Int {
return (0..99).random()
}
}
@@ -0,0 +1,23 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.osslibraryexample
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
@Suppress("DEPRECATION")
public class OSSLibraryExamplePackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
listOf(NativeSampleModule(reactContext))
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> =
listOf(SampleNativeComponentViewManager())
}
@@ -0,0 +1,105 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.osslibraryexample
import android.annotation.SuppressLint
import android.graphics.Color
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewProps
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.SampleNativeComponentManagerInterface
/** Legacy View manager (non Fabric compatible) for {@link SampleNativeView} components. */
@ReactModule(name = SampleNativeComponentViewManager.REACT_CLASS)
internal class SampleNativeComponentViewManager :
SimpleViewManager<SampleNativeView>(), SampleNativeComponentManagerInterface<SampleNativeView> {
override fun getName(): String = REACT_CLASS
// @ReactProp(name = ViewProps.OPACITY, defaultFloat = 1f)
override fun setOpacity(view: SampleNativeView, opacity: Float) {
super.setOpacity(view, opacity)
}
@SuppressLint("BadMethodUse-android.view.View.setBackgroundColor")
@ReactProp(name = ViewProps.COLOR)
fun setColor(view: SampleNativeView, color: String) {
view.setBackgroundColor(Color.parseColor(color))
}
@ReactProp(name = "cornerRadius")
fun setCornerRadius(view: SampleNativeView, cornerRadius: Float) {
view.setCornerRadius(cornerRadius)
}
override fun createViewInstance(reactContext: ThemedReactContext): SampleNativeView =
SampleNativeView(reactContext)
@SuppressLint("BadMethodUse-android.view.View.setBackgroundColor")
override fun changeBackgroundColor(view: SampleNativeView, color: String) {
view.setBackgroundColor(Color.parseColor(color))
}
override fun getExportedViewConstants(): Map<String, Any> = mapOf("PI" to 3.14)
override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any> {
return mapOf(
"onColorChanged" to
mapOf(
"phasedRegistrationNames" to
mapOf(
"bubbled" to "onColorChanged",
"captured" to "onColorChangedCapture",
)),
"topIntArrayChanged" to
mapOf(
"phasedRegistrationNames" to
mapOf(
"bubbled" to "topIntArrayChanged",
"captured" to "topIntArrayChangedCapture",
)))
}
@SuppressLint("BadMethodUse-android.view.View.setBackgroundColor")
override fun receiveCommand(view: SampleNativeView, commandId: String, args: ReadableArray?) {
if (commandId.contentEquals("changeBackgroundColor")) {
val sentColor: Int = Color.parseColor(args?.getString(0))
view.setBackgroundColor(sentColor)
}
}
@Deprecated("Deprecated in Java")
@SuppressLint("BadMethodUse-android.view.View.setBackgroundColor")
@Suppress("DEPRECATION") // We intentionally want to test against the legacy API here.
override fun receiveCommand(view: SampleNativeView, commandId: Int, args: ReadableArray?) {
when (commandId) {
COMMAND_CHANGE_BACKGROUND_COLOR -> {
val sentColor: Int = Color.parseColor(args?.getString(0))
view.setBackgroundColor(sentColor)
}
}
}
override fun getCommandsMap(): Map<String, Int> =
mapOf("changeBackgroundColor" to COMMAND_CHANGE_BACKGROUND_COLOR)
companion object {
const val REACT_CLASS = "SampleNativeComponent"
const val COMMAND_CHANGE_BACKGROUND_COLOR = 42
}
@ReactProp(name = "values")
override fun setValues(view: SampleNativeView, value: ReadableArray?) {
val values = mutableListOf<Int>()
value?.toArrayList()?.forEach { values.add((it as Double).toInt()) }
view.emitOnArrayChangedEvent(values)
}
}
@@ -0,0 +1,97 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.osslibraryexample
import android.graphics.drawable.GradientDrawable
import android.view.View
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.UIManagerHelper
import com.facebook.react.uimanager.events.Event
public class SampleNativeView(context: ThemedReactContext) : View(context) {
private var currentColor = 0
private var background: GradientDrawable = GradientDrawable()
private val reactContext: ReactContext = context.reactApplicationContext
override fun setBackgroundColor(color: Int) {
if (color != currentColor) {
background.setColor(color)
currentColor = color
setBackground(background)
}
}
public fun setCornerRadius(cornerRadius: Float) {
background.cornerRadius = cornerRadius
setBackground(background)
}
public fun emitOnArrayChangedEvent(ints: List<Int>) {
val newIntArray = Arguments.createArray()
val newBoolArray = Arguments.createArray()
val newFloatArray = Arguments.createArray()
val newDoubleArray = Arguments.createArray()
val newYesNoArray = Arguments.createArray()
val newStringArray = Arguments.createArray()
val newObjectArray = Arguments.createArray()
val newArrayArray = Arguments.createArray()
for (i in ints) {
newIntArray.pushInt(i * 2)
newBoolArray.pushBoolean(i % 2 == 1)
newFloatArray.pushDouble(i * 3.14)
newDoubleArray.pushDouble(i / 3.14)
newYesNoArray.pushString(if (i % 2 == 1) "yep" else "nope")
newStringArray.pushString(i.toString())
val latLon = Arguments.createMap()
latLon.putDouble("lat", -1.0 * i)
latLon.putDouble("lon", 2.0 * i)
newObjectArray.pushMap(latLon)
val innerArray: WritableArray = Arguments.createArray()
innerArray.pushInt(i)
innerArray.pushInt(i)
innerArray.pushInt(i)
newArrayArray.pushArray(innerArray)
}
val payload =
Arguments.createMap().apply {
putArray("values", newIntArray)
putArray("boolValues", newBoolArray)
putArray("floats", newFloatArray)
putArray("doubles", newDoubleArray)
putArray("yesNos", newYesNoArray)
putArray("strings", newStringArray)
putArray("latLons", newObjectArray)
putArray("multiArrays", newArrayArray)
}
val reactContext = context as ReactContext
val surfaceId = UIManagerHelper.getSurfaceId(reactContext)
val eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, id)
val event = OnIntArrayChangedEvent(surfaceId, id, payload)
eventDispatcher?.dispatchEvent(event)
}
private inner class OnIntArrayChangedEvent(
surfaceId: Int,
viewId: Int,
private val payload: WritableMap
) : Event<OnIntArrayChangedEvent>(surfaceId, viewId) {
override fun getEventName() = "topIntArrayChanged"
override fun getEventData() = payload
}
}
@@ -0,0 +1,45 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.LayoutShadowNode;
public class SampleNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & SampleNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public SampleNativeComponentManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "opacity":
mViewManager.setOpacity(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "values":
mViewManager.setValues(view, (ReadableArray) value);
break;
default:
super.setProperty(view, propName, value);
}
}
@Override
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
case "changeBackgroundColor":
mViewManager.changeBackgroundColor(view, args.getString(0));
break;
}
}
}
@@ -0,0 +1,21 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface SampleNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setOpacity(T view, float value);
void setValues(T view, @Nullable ReadableArray value);
void changeBackgroundColor(T view, String color);
}
@@ -0,0 +1,26 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/OSSLibraryExampleSpec/*.cpp)
add_library(
react_codegen_OSSLibraryExampleSpec
OBJECT
${react_codegen_SRCS}
)
target_include_directories(react_codegen_OSSLibraryExampleSpec PUBLIC . react/renderer/components/OSSLibraryExampleSpec)
target_link_libraries(
react_codegen_OSSLibraryExampleSpec
fbjni
jsi
reactnative
)
target_compile_reactnative_options(react_codegen_OSSLibraryExampleSpec PRIVATE)
@@ -0,0 +1,32 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleJniCpp.js
*/
#include "OSSLibraryExampleSpec.h"
namespace facebook::react {
static facebook::jsi::Value __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, NumberKind, "getRandomNumber", "()D", args, count, cachedMethodId);
}
NativeSampleModuleSpecJSI::NativeSampleModuleSpecJSI(const JavaTurboModule::InitParams &params)
: JavaTurboModule(params) {
methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber};
}
std::shared_ptr<TurboModule> OSSLibraryExampleSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
if (moduleName == "NativeSampleModule") {
return std::make_shared<NativeSampleModuleSpecJSI>(params);
}
return nullptr;
}
} // namespace facebook::react
@@ -0,0 +1,31 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleJniH.js
*/
#pragma once
#include <ReactCommon/JavaTurboModule.h>
#include <ReactCommon/TurboModule.h>
#include <jsi/jsi.h>
namespace facebook::react {
/**
* JNI C++ class for module 'NativeSampleModule'
*/
class JSI_EXPORT NativeSampleModuleSpecJSI : public JavaTurboModule {
public:
NativeSampleModuleSpecJSI(const JavaTurboModule::InitParams &params);
};
JSI_EXPORT
std::shared_ptr<TurboModule> OSSLibraryExampleSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
} // namespace facebook::react
@@ -0,0 +1,22 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorCpp.js
*/
#include "ComponentDescriptors.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
namespace facebook::react {
void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen(
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
registry->add(concreteComponentDescriptorProvider<SampleNativeComponentComponentDescriptor>());
}
} // namespace facebook::react
@@ -0,0 +1,24 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorH.js
*/
#pragma once
#include "ShadowNodes.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
namespace facebook::react {
using SampleNativeComponentComponentDescriptor = ConcreteComponentDescriptor<SampleNativeComponentShadowNode>;
void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen(
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
} // namespace facebook::react
@@ -0,0 +1,95 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterCpp.js
*/
#include "EventEmitters.h"
namespace facebook::react {
void SampleNativeComponentEventEmitter::onIntArrayChanged(OnIntArrayChanged $event) const {
dispatchEvent("intArrayChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
auto $payload = jsi::Object(runtime);
auto values = jsi::Array(runtime, $event.values.size());
size_t valuesIndex = 0;
for (auto valuesValue : $event.values) {
values.setValueAtIndex(runtime, valuesIndex++, valuesValue);
}
$payload.setProperty(runtime, "values", values);
auto boolValues = jsi::Array(runtime, $event.boolValues.size());
size_t boolValuesIndex = 0;
for (auto boolValuesValue : $event.boolValues) {
boolValues.setValueAtIndex(runtime, boolValuesIndex++, (bool)boolValuesValue);
}
$payload.setProperty(runtime, "boolValues", boolValues);
auto floats = jsi::Array(runtime, $event.floats.size());
size_t floatsIndex = 0;
for (auto floatsValue : $event.floats) {
floats.setValueAtIndex(runtime, floatsIndex++, floatsValue);
}
$payload.setProperty(runtime, "floats", floats);
auto doubles = jsi::Array(runtime, $event.doubles.size());
size_t doublesIndex = 0;
for (auto doublesValue : $event.doubles) {
doubles.setValueAtIndex(runtime, doublesIndex++, doublesValue);
}
$payload.setProperty(runtime, "doubles", doubles);
auto yesNos = jsi::Array(runtime, $event.yesNos.size());
size_t yesNosIndex = 0;
for (auto yesNosValue : $event.yesNos) {
yesNos.setValueAtIndex(runtime, yesNosIndex++, toString(yesNosValue));
}
$payload.setProperty(runtime, "yesNos", yesNos);
auto strings = jsi::Array(runtime, $event.strings.size());
size_t stringsIndex = 0;
for (auto stringsValue : $event.strings) {
strings.setValueAtIndex(runtime, stringsIndex++, stringsValue);
}
$payload.setProperty(runtime, "strings", strings);
auto latLons = jsi::Array(runtime, $event.latLons.size());
size_t latLonsIndex = 0;
for (auto latLonsValue : $event.latLons) {
auto latLonsObject = jsi::Object(runtime);
latLonsObject.setProperty(runtime, "lat", latLonsValue.lat);
latLonsObject.setProperty(runtime, "lon", latLonsValue.lon);
latLons.setValueAtIndex(runtime, latLonsIndex++, latLonsObject);
}
$payload.setProperty(runtime, "latLons", latLons);
auto multiArrays = jsi::Array(runtime, $event.multiArrays.size());
size_t multiArraysIndex = 0;
for (auto multiArraysValue : $event.multiArrays) {
auto multiArraysArray = jsi::Array(runtime, multiArraysValue.size());
size_t multiArraysIndexInternal = 0;
for (auto multiArraysValueInternal : multiArraysValue) {
multiArraysArray.setValueAtIndex(runtime, multiArraysIndexInternal++, multiArraysValueInternal);
}
multiArrays.setValueAtIndex(runtime, multiArraysIndex++, multiArraysArray);
}
$payload.setProperty(runtime, "multiArrays", multiArrays);
return $payload;
});
}
} // namespace facebook::react
@@ -0,0 +1,49 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterH.js
*/
#pragma once
#include <react/renderer/components/view/ViewEventEmitter.h>
namespace facebook::react {
class SampleNativeComponentEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;
enum class OnIntArrayChangedYesNos {
Yep,
Nope
};
static char const *toString(const OnIntArrayChangedYesNos value) {
switch (value) {
case OnIntArrayChangedYesNos::Yep: return "yep";
case OnIntArrayChangedYesNos::Nope: return "nope";
}
}
struct OnIntArrayChangedLatLons {
double lat;
double lon;
};
struct OnIntArrayChanged {
std::vector<int> values;
std::vector<bool> boolValues;
std::vector<Float> floats;
std::vector<double> doubles;
std::vector<OnIntArrayChangedYesNos> yesNos;
std::vector<std::string> strings;
std::vector<OnIntArrayChangedLatLons> latLons;
std::vector<std::vector<int>> multiArrays;
};
void onIntArrayChanged(OnIntArrayChanged value) const;
};
} // namespace facebook::react
@@ -0,0 +1,26 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleCpp.js
*/
#include "OSSLibraryExampleSpecJSI.h"
namespace facebook::react {
static jsi::Value __hostFunction_NativeSampleModuleCxxSpecJSI_getRandomNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
return static_cast<NativeSampleModuleCxxSpecJSI *>(&turboModule)->getRandomNumber(
rt
);
}
NativeSampleModuleCxxSpecJSI::NativeSampleModuleCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
: TurboModule("NativeSampleModule", jsInvoker) {
methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleCxxSpecJSI_getRandomNumber};
}
} // namespace facebook::react
@@ -0,0 +1,67 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
*/
#pragma once
#include <ReactCommon/TurboModule.h>
#include <react/bridging/Bridging.h>
namespace facebook::react {
class JSI_EXPORT NativeSampleModuleCxxSpecJSI : public TurboModule {
protected:
NativeSampleModuleCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
public:
virtual double getRandomNumber(jsi::Runtime &rt) = 0;
};
template <typename T>
class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule {
public:
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
return delegate_.create(rt, propName);
}
static constexpr std::string_view kModuleName = "NativeSampleModule";
protected:
NativeSampleModuleCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
: TurboModule(std::string{NativeSampleModuleCxxSpec::kModuleName}, jsInvoker),
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
private:
class Delegate : public NativeSampleModuleCxxSpecJSI {
public:
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
}
double getRandomNumber(jsi::Runtime &rt) override {
static_assert(
bridging::getParameterCount(&T::getRandomNumber) == 1,
"Expected getRandomNumber(...) to have 1 parameters");
return bridging::callFromJs<double>(
rt, &T::getRandomNumber, jsInvoker_, instance_);
}
private:
friend class NativeSampleModuleCxxSpec;
T *instance_;
};
Delegate delegate_;
};
} // namespace facebook::react
@@ -0,0 +1,26 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsCpp.js
*/
#include "Props.h"
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/propsConversions.h>
namespace facebook::react {
SampleNativeComponentProps::SampleNativeComponentProps(
const PropsParserContext &context,
const SampleNativeComponentProps &sourceProps,
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {0.0})),
values(convertRawProp(context, rawProps, "values", sourceProps.values, {}))
{}
} // namespace facebook::react
@@ -0,0 +1,29 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsH.js
*/
#pragma once
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <vector>
namespace facebook::react {
class SampleNativeComponentProps final : public ViewProps {
public:
SampleNativeComponentProps() = default;
SampleNativeComponentProps(const PropsParserContext& context, const SampleNativeComponentProps &sourceProps, const RawProps &rawProps);
#pragma mark - Props
Float opacity{0.0};
std::vector<int> values{};
};
} // namespace facebook::react
@@ -0,0 +1,17 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateShadowNodeCpp.js
*/
#include "ShadowNodes.h"
namespace facebook::react {
extern const char SampleNativeComponentComponentName[] = "SampleNativeComponent";
} // namespace facebook::react
@@ -0,0 +1,32 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateShadowNodeH.js
*/
#pragma once
#include "EventEmitters.h"
#include "Props.h"
#include "States.h"
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
#include <jsi/jsi.h>
namespace facebook::react {
JSI_EXPORT extern const char SampleNativeComponentComponentName[];
/*
* `ShadowNode` for <SampleNativeComponent> component.
*/
using SampleNativeComponentShadowNode = ConcreteViewShadowNode<
SampleNativeComponentComponentName,
SampleNativeComponentProps,
SampleNativeComponentEventEmitter,
SampleNativeComponentState>;
} // namespace facebook::react
@@ -0,0 +1,16 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateStateCpp.js
*/
#include "States.h"
namespace facebook::react {
} // namespace facebook::react
@@ -0,0 +1,29 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateStateH.js
*/
#pragma once
#ifdef RN_SERIALIZABLE_STATE
#include <folly/dynamic.h>
#endif
namespace facebook::react {
class SampleNativeComponentState {
public:
SampleNativeComponentState() = default;
#ifdef RN_SERIALIZABLE_STATE
SampleNativeComponentState(SampleNativeComponentState const &previousState, folly::dynamic data){};
folly::dynamic getDynamic() const {
return {};
};
#endif
};
} // namespace facebook::react
@@ -0,0 +1,18 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @noflow
*/
module.exports = {
presets: [
[
'module:@react-native/babel-preset',
{disableStaticViewConfigsCodegen: false},
],
],
};
+16
View File
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
export {default as SampleNativeComponent} from './src/SampleNativeComponent';
export type {NativeComponentType} from './src/SampleNativeComponent';
import {Commands as SampleNativeComponentCommands} from './src/SampleNativeComponent';
export {SampleNativeComponentCommands};
export {default as NativeSampleModule} from './src/NativeSampleModule';
@@ -0,0 +1,22 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorCpp.js
*/
#include "ComponentDescriptors.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
namespace facebook::react {
void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen(
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
registry->add(concreteComponentDescriptorProvider<SampleNativeComponentComponentDescriptor>());
}
} // namespace facebook::react
@@ -0,0 +1,24 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorH.js
*/
#pragma once
#include "ShadowNodes.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
namespace facebook::react {
using SampleNativeComponentComponentDescriptor = ConcreteComponentDescriptor<SampleNativeComponentShadowNode>;
void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen(
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
} // namespace facebook::react
@@ -0,0 +1,95 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterCpp.js
*/
#include "EventEmitters.h"
namespace facebook::react {
void SampleNativeComponentEventEmitter::onIntArrayChanged(OnIntArrayChanged $event) const {
dispatchEvent("intArrayChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
auto $payload = jsi::Object(runtime);
auto values = jsi::Array(runtime, $event.values.size());
size_t valuesIndex = 0;
for (auto valuesValue : $event.values) {
values.setValueAtIndex(runtime, valuesIndex++, valuesValue);
}
$payload.setProperty(runtime, "values", values);
auto boolValues = jsi::Array(runtime, $event.boolValues.size());
size_t boolValuesIndex = 0;
for (auto boolValuesValue : $event.boolValues) {
boolValues.setValueAtIndex(runtime, boolValuesIndex++, (bool)boolValuesValue);
}
$payload.setProperty(runtime, "boolValues", boolValues);
auto floats = jsi::Array(runtime, $event.floats.size());
size_t floatsIndex = 0;
for (auto floatsValue : $event.floats) {
floats.setValueAtIndex(runtime, floatsIndex++, floatsValue);
}
$payload.setProperty(runtime, "floats", floats);
auto doubles = jsi::Array(runtime, $event.doubles.size());
size_t doublesIndex = 0;
for (auto doublesValue : $event.doubles) {
doubles.setValueAtIndex(runtime, doublesIndex++, doublesValue);
}
$payload.setProperty(runtime, "doubles", doubles);
auto yesNos = jsi::Array(runtime, $event.yesNos.size());
size_t yesNosIndex = 0;
for (auto yesNosValue : $event.yesNos) {
yesNos.setValueAtIndex(runtime, yesNosIndex++, toString(yesNosValue));
}
$payload.setProperty(runtime, "yesNos", yesNos);
auto strings = jsi::Array(runtime, $event.strings.size());
size_t stringsIndex = 0;
for (auto stringsValue : $event.strings) {
strings.setValueAtIndex(runtime, stringsIndex++, stringsValue);
}
$payload.setProperty(runtime, "strings", strings);
auto latLons = jsi::Array(runtime, $event.latLons.size());
size_t latLonsIndex = 0;
for (auto latLonsValue : $event.latLons) {
auto latLonsObject = jsi::Object(runtime);
latLonsObject.setProperty(runtime, "lat", latLonsValue.lat);
latLonsObject.setProperty(runtime, "lon", latLonsValue.lon);
latLons.setValueAtIndex(runtime, latLonsIndex++, latLonsObject);
}
$payload.setProperty(runtime, "latLons", latLons);
auto multiArrays = jsi::Array(runtime, $event.multiArrays.size());
size_t multiArraysIndex = 0;
for (auto multiArraysValue : $event.multiArrays) {
auto multiArraysArray = jsi::Array(runtime, multiArraysValue.size());
size_t multiArraysIndexInternal = 0;
for (auto multiArraysValueInternal : multiArraysValue) {
multiArraysArray.setValueAtIndex(runtime, multiArraysIndexInternal++, multiArraysValueInternal);
}
multiArrays.setValueAtIndex(runtime, multiArraysIndex++, multiArraysArray);
}
$payload.setProperty(runtime, "multiArrays", multiArrays);
return $payload;
});
}
} // namespace facebook::react
@@ -0,0 +1,49 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterH.js
*/
#pragma once
#include <react/renderer/components/view/ViewEventEmitter.h>
namespace facebook::react {
class SampleNativeComponentEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;
enum class OnIntArrayChangedYesNos {
Yep,
Nope
};
static char const *toString(const OnIntArrayChangedYesNos value) {
switch (value) {
case OnIntArrayChangedYesNos::Yep: return "yep";
case OnIntArrayChangedYesNos::Nope: return "nope";
}
}
struct OnIntArrayChangedLatLons {
double lat;
double lon;
};
struct OnIntArrayChanged {
std::vector<int> values;
std::vector<bool> boolValues;
std::vector<Float> floats;
std::vector<double> doubles;
std::vector<OnIntArrayChangedYesNos> yesNos;
std::vector<std::string> strings;
std::vector<OnIntArrayChangedLatLons> latLons;
std::vector<std::vector<int>> multiArrays;
};
void onIntArrayChanged(OnIntArrayChanged value) const;
};
} // namespace facebook::react
@@ -0,0 +1,29 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleObjCpp
*
* We create an umbrella header (and corresponding implementation) here since
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
* must have a single output. More files => more genrule()s => slower builds.
*/
#import "OSSLibraryExampleSpec.h"
namespace facebook::react {
static facebook::jsi::Value __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, NumberKind, "getRandomNumber", @selector(getRandomNumber), args, count);
}
NativeSampleModuleSpecJSI::NativeSampleModuleSpecJSI(const ObjCTurboModule::InitParams &params)
: ObjCTurboModule(params) {
methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber};
}
} // namespace facebook::react
@@ -0,0 +1,49 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleObjCpp
*
* We create an umbrella header (and corresponding implementation) here since
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
* must have a single output. More files => more genrule()s => slower builds.
*/
#ifndef __cplusplus
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
#endif
// Avoid multiple includes of OSSLibraryExampleSpec symbols
#ifndef OSSLibraryExampleSpec_H
#define OSSLibraryExampleSpec_H
#import <Foundation/Foundation.h>
#import <RCTRequired/RCTRequired.h>
#import <RCTTypeSafety/RCTConvertHelpers.h>
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTCxxConvert.h>
#import <React/RCTManagedPointer.h>
#import <ReactCommon/RCTTurboModule.h>
#import <optional>
#import <vector>
@protocol NativeSampleModuleSpec <RCTBridgeModule, RCTTurboModule>
- (NSNumber *)getRandomNumber;
@end
namespace facebook::react {
/**
* ObjC++ class for module 'NativeSampleModule'
*/
class JSI_EXPORT NativeSampleModuleSpecJSI : public ObjCTurboModule {
public:
NativeSampleModuleSpecJSI(const ObjCTurboModule::InitParams &params);
};
} // namespace facebook::react
#endif // OSSLibraryExampleSpec_H
@@ -0,0 +1,26 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsCpp.js
*/
#include "Props.h"
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/propsConversions.h>
namespace facebook::react {
SampleNativeComponentProps::SampleNativeComponentProps(
const PropsParserContext &context,
const SampleNativeComponentProps &sourceProps,
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {0.0})),
values(convertRawProp(context, rawProps, "values", sourceProps.values, {}))
{}
} // namespace facebook::react
@@ -0,0 +1,29 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsH.js
*/
#pragma once
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <vector>
namespace facebook::react {
class SampleNativeComponentProps final : public ViewProps {
public:
SampleNativeComponentProps() = default;
SampleNativeComponentProps(const PropsParserContext& context, const SampleNativeComponentProps &sourceProps, const RawProps &rawProps);
#pragma mark - Props
Float opacity{0.0};
std::vector<int> values{};
};
} // namespace facebook::react
@@ -0,0 +1,50 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentHObjCpp.js
*/
#import <Foundation/Foundation.h>
#import <React/RCTDefines.h>
#import <React/RCTLog.h>
NS_ASSUME_NONNULL_BEGIN
@protocol RCTSampleNativeComponentViewProtocol <NSObject>
- (void)changeBackgroundColor:(NSString *)color;
@end
RCT_EXTERN inline void RCTSampleNativeComponentHandleCommand(
id<RCTSampleNativeComponentViewProtocol> componentView,
NSString const *commandName,
NSArray const *args)
{
if ([commandName isEqualToString:@"changeBackgroundColor"]) {
#if RCT_DEBUG
if ([args count] != 1) {
RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"SampleNativeComponent", commandName, (int)[args count], 1);
return;
}
#endif
NSObject *arg0 = args[0];
#if RCT_DEBUG
if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"SampleNativeComponent", commandName, @"1st")) {
return;
}
#endif
NSString * color = (NSString *)arg0;
[componentView changeBackgroundColor:color];
return;
}
#if RCT_DEBUG
RCTLogError(@"%@ received command %@, which is not a supported command.", @"SampleNativeComponent", commandName);
#endif
}
NS_ASSUME_NONNULL_END
@@ -0,0 +1,17 @@
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateShadowNodeCpp.js
*/
#include "ShadowNodes.h"
namespace facebook::react {
extern const char SampleNativeComponentComponentName[] = "SampleNativeComponent";
} // namespace facebook::react

Some files were not shown because too many files have changed in this diff Show More