mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
58
Commits
@@ -188,6 +188,7 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
status: 201,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
}),
|
||||
@@ -208,9 +209,11 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
body: fetchBody,
|
||||
},
|
||||
);
|
||||
expect(response).toEqual(
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
);
|
||||
expect(response).toEqual({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
});
|
||||
});
|
||||
|
||||
it('creates a draft release for prerelease on GitHub', async () => {
|
||||
@@ -238,6 +241,7 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
status: 201,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
}),
|
||||
@@ -258,9 +262,11 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
body: fetchBody,
|
||||
},
|
||||
);
|
||||
expect(response).toEqual(
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
);
|
||||
expect(response).toEqual({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
});
|
||||
});
|
||||
|
||||
it('throws if the post failes', async () => {
|
||||
|
||||
@@ -101,7 +101,11 @@ async function _createDraftReleaseOnGitHub(version, body, latest, token) {
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data.html_url;
|
||||
const {html_url, id} = data;
|
||||
return {
|
||||
html_url,
|
||||
id,
|
||||
};
|
||||
}
|
||||
|
||||
function moveToChangelogBranch(version) {
|
||||
@@ -124,7 +128,8 @@ async function createDraftRelease(version, latest, token) {
|
||||
latest,
|
||||
token,
|
||||
);
|
||||
log(`Created draft release: ${release}`);
|
||||
log(`Created draft release: ${release.html_url}, ID ${release.id}`);
|
||||
return release;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -10,6 +10,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -21,9 +21,24 @@ jobs:
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Create draft release
|
||||
uses: actions/github-script@v6
|
||||
id: create-draft-release
|
||||
with:
|
||||
script: |
|
||||
const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js');
|
||||
const version = '${{ github.ref_name }}';
|
||||
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
|
||||
await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}');
|
||||
return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}')).id;
|
||||
result-encoding: string
|
||||
- name: Upload release assets for DotSlash
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
RELEASE_ID: ${{ steps.create-draft-release.outputs.result }}
|
||||
with:
|
||||
script: |
|
||||
const {uploadReleaseAssetsForDotSlashFiles} = require('./scripts/releases/upload-release-assets-for-dotslash.js');
|
||||
const version = '${{ github.ref_name }}';
|
||||
await uploadReleaseAssetsForDotSlashFiles({
|
||||
version,
|
||||
token: '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}',
|
||||
releaseId: process.env.RELEASE_ID,
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
@@ -22,6 +23,7 @@ jobs:
|
||||
- name: Generate Changelog
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const {generateChangelog} = require('./.github/workflow-scripts/generateChangelog');
|
||||
const version = '${{ github.ref_name }}';
|
||||
|
||||
@@ -273,7 +273,8 @@ jobs:
|
||||
NEW_ARCH_ENABLED=1
|
||||
|
||||
export RCT_USE_LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
|
||||
# Disable prebuilds for now, as they are causing issues with E2E tests for 0.82-stable branch
|
||||
# export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
|
||||
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
|
||||
|
||||
xcodebuild \
|
||||
@@ -379,7 +380,8 @@ jobs:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs: [set_release_type]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
# Version is pinned to v18.0 to unblock `run_fantom_tests` - see https://github.com/react-native-community/docker-android/pull/242#issuecomment-3280029122
|
||||
image: reactnativecommunity/react-native-android:v18.0
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
name: Validate DotSlash Artifacts
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- packages/debugger-shell/bin/react-native-devtools
|
||||
- "scripts/releases/**"
|
||||
- package.json
|
||||
- yarn.lock
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- packages/debugger-shell/bin/react-native-devtools
|
||||
- "scripts/releases/**"
|
||||
- package.json
|
||||
- yarn.lock
|
||||
# Same time as the nightly build: 2:15 AM UTC
|
||||
schedule:
|
||||
- cron: "15 2 * * *"
|
||||
|
||||
jobs:
|
||||
validate-dotslash-artifacts:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Configure Git
|
||||
shell: bash
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Validate DotSlash artifacts
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const {validateDotSlashArtifacts} = require('./scripts/releases/validate-dotslash-artifacts.js');
|
||||
await validateDotSlashArtifacts();
|
||||
-181
@@ -1,186 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## v0.82.0-rc.0
|
||||
|
||||
### Breaking
|
||||
|
||||
- **Appearance.setColorScheme:** `Appearance.setColorScheme` no longer accepts a nullable value ([a4581ecd8b](https://github.com/facebook/react-native/commit/a4581ecd8b6df5efa44dfe6d43708320209c900b) by [@huntie](https://github.com/huntie))
|
||||
- **`CxxSharedModuleWrapper`:** Removed CxxSharedModuleWrapper ([fafbee2402](https://github.com/facebook/react-native/commit/fafbee240235ea0e63eb01abd31ce32d6a576429) by [@javache](https://github.com/javache))
|
||||
- **DOM API:** Enable DOM APIs in host component refs ([2ad845ccb2](https://github.com/facebook/react-native/commit/2ad845ccb2fea277e05513dcf41407026a8224f0) by [@rubennorte](https://github.com/rubennorte))
|
||||
- **Error Handling:** Unhandled promises are now handled by ExceptionsManager.handleException, instead of being swallowed as Logbox Warnings. ([c4082c9ce2](https://github.com/facebook/react-native/commit/c4082c9ce208a324c2d011823ca2ba432411aafc) by [@krystofwoldrich](https://github.com/krystofwoldrich))
|
||||
- **`shouldEmitW3CPointerEvents`:** Migrate `shouldPressibilityUseW3CPointerEventsForHover` to common private feature flags and remove `shouldEmitW3CPointerEvents` flag. ([fb4587780e](https://github.com/facebook/react-native/commit/fb4587780e8d6111139d73598a9a26ff392dee28) by [@coado](https://github.com/coado))
|
||||
- **TurboModuleUtils:** Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray ([ead669ade3](https://github.com/facebook/react-native/commit/ead669ade31ee703c407f96c0ce98d8f2991bdc8) by [@christophpurrer](https://github.com/christophpurrer))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Deps:** Gradle to 9.0 ([7f93b664b4](https://github.com/facebook/react-native/commit/7f93b664b41ba11226aae7cca0e7c9b7f38a7d18) by [@cortinico](https://github.com/cortinico))
|
||||
- **Image Prefetching:** Android: Image Prefetching send ImageResizeMode as enum value ([e30f34eda6](https://github.com/facebook/react-native/commit/e30f34eda689994cab8cd62aa38175238da8638b) by [@christophpurrer](https://github.com/christophpurrer))
|
||||
- **New Architecture:** Remove possibility to newArchEnabled=false in 0.82 ([d5d21d0614](https://github.com/facebook/react-native/commit/d5d21d061493ee973c789a7c6ab8cceebc1f04f9) by [@cortinico](https://github.com/cortinico))
|
||||
- **`reactNativeHost`:** Throw Exception if ReactApplication.reactNativeHost is not overriden ([0d3791ca0a](https://github.com/facebook/react-native/commit/0d3791ca0ab30d5a12881c9901f31291b3e998c6) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **ViewManagerInterfaces:** Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc) ([79ca9036d3](https://github.com/facebook/react-native/commit/79ca9036d39c16cd115dc0427cb7092f358ac47e) by [@mdvacca](https://github.com/mdvacca))
|
||||
|
||||
#### iOS Specific
|
||||
- **New Architecture:** Removed the opt-out from the New Architecture. ([83e6eaf693](https://github.com/facebook/react-native/commit/83e6eaf693f967b7870a5d4896cbb799206a14f0) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
|
||||
### Added
|
||||
|
||||
- **Animated:** `Animated.CompositeAnomation` is now exposed when using `"react-native-strict-api"` ([024d25794a](https://github.com/facebook/react-native/commit/024d25794a51c94c877c1dfa115a82ebbf559614) by [@huntie](https://github.com/huntie))
|
||||
- **Animated:** Allow calling createAnimatedNode without batching ([d9d9a49e18](https://github.com/facebook/react-native/commit/d9d9a49e18f3c51caa18cf7da0a1fcd62f1ecf18) by [@zeyap](https://github.com/zeyap))
|
||||
- **Animated:** Allow filter usage with native animated driver. ([138d0eb01d](https://github.com/facebook/react-native/commit/138d0eb01dbe597261459a37d364d1780c3ef228) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
||||
- **API:** Expose NativeComponentRegistry API as JavaScript root export ([f936780cd5](https://github.com/facebook/react-native/commit/f936780cd5c0c17797f9d2bbc8f5cee81c2eefce) by [@zhongwuzw](https://github.com/zhongwuzw))
|
||||
- **API:** Expose `ReactNativeVersion` API as JavaScript root export ([ec5638abd0](https://github.com/facebook/react-native/commit/ec5638abd0e872be62b6ea5d8df9bed6335c2191) by [@huntie](https://github.com/huntie))
|
||||
- **Codegen:** Added getDebugProps to codegen ([e547f466ee](https://github.com/facebook/react-native/commit/e547f466ee41415a75ec6b6f910171285ee7bfc3) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **Pressable:** Allow setting `blockNativeResponder` on Pressable ([6e4d23ded2](https://github.com/facebook/react-native/commit/6e4d23ded2da4a717bafcc032e3d7a0a5fbe3731) by [@zeyap](https://github.com/zeyap))
|
||||
- **Yoga/API:** Make yoga/Yoga.h an umbrell header ([8ed2cee80e](https://github.com/facebook/react-native/commit/8ed2cee80e0aaac2f2a6a897ba450888f274a5a4) by [@rudybear](https://github.com/rudybear))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Build Type:** Create a `debugOptimized` `buildType` for Android ([eb2461c7c9](https://github.com/facebook/react-native/commit/eb2461c7c902ebed272bd2d22d6cff4d3c586da6) by [@cortinico](https://github.com/cortinico))
|
||||
- **DevMenu:** Add long-press back as an option to open the DevMenu for devices that lack menu & fast-forward. ([32d37f03ad](https://github.com/facebook/react-native/commit/32d37f03ad05290205a4f04d756f6e1880c4ff89) by [@sbuggay](https://github.com/sbuggay))
|
||||
- **DevTools:** `DevSupportManager::openDebugger` now supports an optional `panel` param determining the starting panel ([7eb3536728](https://github.com/facebook/react-native/commit/7eb3536728c4a20f7e51245f4f7b64aa505bd799) by [@huntie](https://github.com/huntie))
|
||||
- **DevTools:** Adds a landing view parameter to opening RNDT, enabling arbitrary view focus on launch. ([635c707eec](https://github.com/facebook/react-native/commit/635c707eec18f6d2ceceac2dcee9f458f17f8aab) by [@sbuggay](https://github.com/sbuggay))
|
||||
- **HWInput:** Channel up/down hardware events. ([c2a3e4420e](https://github.com/facebook/react-native/commit/c2a3e4420e07147f9a040a665da98dbe22b87a2a) by [@sbuggay](https://github.com/sbuggay))
|
||||
- **Manifest:** Add support to specify a single Manifest rather than 2 (main/debug) by using the `usesCleartextTraffic` manifest placeholder which is autoconfigured by RNGP. ([d89acc1596](https://github.com/facebook/react-native/commit/d89acc1596345534882938d2bbf40275a6cb89bd) by [@cortinico](https://github.com/cortinico))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **API:** Add deprecation message for RCTAppdelegate APIs ([d503ea4efc](https://github.com/facebook/react-native/commit/d503ea4efc84b6511cef2a46421a16e044862e88) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **New Architecture:** Add warning if RCT_NEW_ARCH_ENABLED is set to 0 ([7d0bef2f25](https://github.com/facebook/react-native/commit/7d0bef2f25a206d917e7f5cc2b9a6c088f13a832) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
|
||||
### Changed
|
||||
|
||||
- **Font:** Enabled `enableFontScaleChangesUpdatingLayout` feature flag by default ([686d14f1d1](https://github.com/facebook/react-native/commit/686d14f1d16c2f02720104ddd395f7d27c908350) by [@j-piasecki](https://github.com/j-piasecki))
|
||||
- **Hermes:** Changed names of hermes binaries ([776fca1e7c](https://github.com/facebook/react-native/commit/776fca1e7c978a2d8f817d042836073e4dcb4e0e) by [@j-piasecki](https://github.com/j-piasecki))
|
||||
- **Metro:** Bump Metro to ^0.83.1 ([840fd6c83f](https://github.com/facebook/react-native/commit/840fd6c83f45326a796bf2823f8c2fa942aed06c) by [@robhogan](https://github.com/robhogan))
|
||||
- **React:** Bumped React to 19.1.1 ([ec5a98b1f5](https://github.com/facebook/react-native/commit/ec5a98b1f5c2137f5f6ff5f5f6706f20384c44df) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **Runtime:** CDP backend now accepts `addBinding` and `removeBinding` methods earlier, before a Runtime exists. ([3271e57c75](https://github.com/facebook/react-native/commit/3271e57c751e7d1193c1e9f7b53e545231511b9d) by [@motiz88](https://github.com/motiz88))
|
||||
- **Typing:** Update types for Platform.version ([f6ba2dbf3b](https://github.com/facebook/react-native/commit/f6ba2dbf3b4c85da1a7f9079fd366a41b160fa69) by [@riteshshukla04](https://github.com/riteshshukla04))
|
||||
- **UIManager:** Avoid unnecessary copy of view props map in UIManager::updateShadowTree ([5b38bb4745](https://github.com/facebook/react-native/commit/5b38bb47457f853c2c3d5f275facbb9fbc150683) by [@zeyap](https://github.com/zeyap))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **AGP:** AGP to 8.12.0 ([742ef3d661](https://github.com/facebook/react-native/commit/742ef3d6615c8c1202e9f683e6127ac97d7a9e23) by [@cortinico](https://github.com/cortinico))
|
||||
- **DevSupportManager:** DevSupport `openDebugger()` methods now accept a `panel: String?` param. Frameworks directly implementing `DevSupportManager` will need to adjust call signatures. ([9dba7112cf](https://github.com/facebook/react-native/commit/9dba7112cfd09b02300869a77dba3dca16f49a28) by [@huntie](https://github.com/huntie))
|
||||
- **Kotlin:**Migrated TextAttributeProps to Kotlin. You might need to update your property access to use camelCase instead of Hungarian notation. ([fa921b3c7b](https://github.com/facebook/react-native/commit/fa921b3c7b289800a79196468f993a0eb0bf693f) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrated ReactBaseTextShadowNode to Kotlin. You might need to update your property access to use camelCase instead of Hungarian notation. ([8ccfff9a46](https://github.com/facebook/react-native/commit/8ccfff9a46f317fd78f478c8b3f180441535d1ca) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrated com.facebook.react.bridge.Arguments to Kotlin. ([2534aeaddb](https://github.com/facebook/react-native/commit/2534aeaddb0490b69dfaba6b8d316616c7e10a9c) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaConfig` to Kotlin ([4d5caef76b](https://github.com/facebook/react-native/commit/4d5caef76b83eb7e983364ecc81abb6027e5f98e) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaValue` to Kotlin ([4340dcbae8](https://github.com/facebook/react-native/commit/4340dcbae8fc41cde844e805a1ebfc23d23d164f) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaNative` to Kotlin ([bc54a06fcb](https://github.com/facebook/react-native/commit/bc54a06fcb5b5d1efd8996d8568733b657fc1b06) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaConfigFactory` to Kotlin ([33ca53d9db](https://github.com/facebook/react-native/commit/33ca53d9dbe53b92d65f82dbd53a2e9f23efd4f3) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `DoNotStrip` to Kotlin ([35d8086881](https://github.com/facebook/react-native/commit/35d8086881fac643b0ebc0d53aaf7e79b7ccd830) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaLayoutType` to Kotlin ([7e461003c6](https://github.com/facebook/react-native/commit/7e461003c6592c8c539960bd5e8169c48dd27f50) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `LayoutPassReason` to Kotlin ([db2a9c089c](https://github.com/facebook/react-native/commit/db2a9c089cd5802d99e0fc86e4dc0dbf7c888307) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaNodeFactory` to Kotlin ([40afa75a7c](https://github.com/facebook/react-native/commit/40afa75a7c816a5581223c7bcd1b65b8713edf47) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaMeasureOutput` to Kotlin ([453508ada8](https://github.com/facebook/react-native/commit/453508ada837554455733e3ca94440a7143f51b1) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaMeasureFunction` to Kotlin ([05eddd354e](https://github.com/facebook/react-native/commit/05eddd354e2e80ad3c95ed5a2199a59a77317891) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaStyleInputs` to Kotlin ([001736000f](https://github.com/facebook/react-native/commit/001736000f69ce98db86c17707408bbf3f0ae9a5) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaBaselineFunction` to Kotlin ([a2eb3b299d](https://github.com/facebook/react-native/commit/a2eb3b299dddea60c510821b662dfed55b334df7) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **Kotlin:** Migrate `YogaLogger` to Kotlin ([9c9a39b58e](https://github.com/facebook/react-native/commit/9c9a39b58e12bc734c27a5d9306e792b0dcaf927) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **OnBatchCompleteListener:** Make OnBatchCompleteListener interface internal ([046ff8e58b](https://github.com/facebook/react-native/commit/046ff8e58bed5da0f19adc860b327c7248b19f48) by [@cortinico](https://github.com/cortinico))
|
||||
- **ReactSurface:** Changed return type of ReactSurfaceImpl.view to ReactSurfaceView to align with parameter recived by ReactSurfaceImpl.attachView() ([41029d8e91](https://github.com/facebook/react-native/commit/41029d8e91492c34c377374b442b31755874618c) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **TextAttributeProps:** Deprecate the field `TextAttributeProps.effectiveLineHeight`. This field was public but never used in OSS. ([ede037ade7](https://github.com/facebook/react-native/commit/ede037ade795bd44725f9bd82cace193a74aa68d) by [@cortinico](https://github.com/cortinico))
|
||||
- **ViewManagers:** Changed method arguments names for Core ViewManagers to match the names of ViewManagerInterfaces ([e7d9e0d197](https://github.com/facebook/react-native/commit/e7d9e0d1977c136a85b9a78ef36a258631d1e9ba) by [@mdvacca](https://github.com/mdvacca))
|
||||
|
||||
### Deprecated
|
||||
|
||||
- **StyleSheet:** `StyleSheet.absoluteFillObject` is deprecated in favor of `StyleSheet.absoluteFill` (equivalent). ([83e19813ff](https://github.com/facebook/react-native/commit/83e19813ff5498ab3497d97fe38dba63a5554425) by [@huntie](https://github.com/huntie))
|
||||
- Deprecate all the c++ classes not used by interop, or the new architecture. ([9539cd2626](https://github.com/facebook/react-native/commit/9539cd26261aef646379104833c7f719e3d83d02) by [@RSNara](https://github.com/RSNara))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **DevMenu:** Remove bridge mode string from React Native Dev Menu title ([1c838f32a9](https://github.com/facebook/react-native/commit/1c838f32a9bcee3867ec0502b344889308302f26) by [@sbuggay](https://github.com/sbuggay))
|
||||
- **New Architecture:** DefaultDevSupportManagerFactory.create() method used for Old Arch ([026e22bb8d](https://github.com/facebook/react-native/commit/026e22bb8d7b38b3bd66ffcc7d4ee446adfee943) by [@cortinico](https://github.com/cortinico))
|
||||
- **New Architecture:** Deprecate `BridgelessReactContext.getCatalystInstance()` method ([4583fbe052](https://github.com/facebook/react-native/commit/4583fbe052924df1ad030e51ad80e8d754a4c5a4) by [@cortinico](https://github.com/cortinico))
|
||||
- **New Architecture:** Deprecate legacy architecture classes ReactInstanceManager and ReactInstanceManagerBuilder, these classes will be deleted in a future release ([fb84932e48](https://github.com/facebook/react-native/commit/fb84932e4894a45c0a2725e1d665acdf7bcea435) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Depreacate `CoreModulesPackage` and `NativeModuleRegistryBuilder` legacy architecture classes, these classes unused in the new architecture and will be deleted in the future ([d3bbbd893a](https://github.com/facebook/react-native/commit/d3bbbd893acd500237ab4e1778c6a2e0fe1948a9) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future ([da74d5da2c](https://github.com/facebook/react-native/commit/da74d5da2cac5306e37368c65490c434e7ff9f4f) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture ShadowNode classes included in React Native ([07091a9ae8](https://github.com/facebook/react-native/commit/07091a9ae8d70a601d969d9def4952563d3b7bcf) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Depreacte all LegacyArchitecture classes from the bridge package ([c1f7c5e321](https://github.com/facebook/react-native/commit/c1f7c5e3217a7e8a77a859652aadff2a41e3ea58) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture class UIManagerProvider ([b29b86f275](https://github.com/facebook/react-native/commit/b29b86f27553eac50daa18ffb6bca07be3f24f25) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate BridgeDevSupportManager and JSInstance ([25c011eb4d](https://github.com/facebook/react-native/commit/25c011eb4d403040b57e338bec704769de20793c) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate NativeModuleRegistry Legacy Architecture class ([22e4c25211](https://github.com/facebook/react-native/commit/22e4c252116da1a6658b15a84720e0ee314dddd6) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate subset of LegacyArchitecture classes in com/facebook/react/bridge ([78a3ff81eb](https://github.com/facebook/react-native/commit/78a3ff81eb38ae26fb15106580de841477897101) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture class FrescoBasedReactTextInlineImageShadowNode ([25f466cc4d](https://github.com/facebook/react-native/commit/25f466cc4dd28c962b967475c04c284d26efb722) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate Legacy Architecture class CallbackImpl ([718126fcf0](https://github.com/facebook/react-native/commit/718126fcf0296969ee659c31fae51b4317c896d3) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture class JavaMethodWrapper ([19a99dd088](https://github.com/facebook/react-native/commit/19a99dd0882d786daea3db486fd3aed3c10419b5) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate Legacy Architecture ShadowNode classes ([c4715886a9](https://github.com/facebook/react-native/commit/c4715886a917eb3eb63aab366de5225090dff5a1) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture UIManagerModules class ([85610c8b43](https://github.com/facebook/react-native/commit/85610c8b43ea132154cddcfed973ee6ceb3e55b3) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture classes from com/facebook/react/uimanager ([7f5b2b8f84](https://github.com/facebook/react-native/commit/7f5b2b8f84d7941891a447978c6adc17929ef87f) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture classes from package com.facebook.react.uimanager ([39d24bade3](https://github.com/facebook/react-native/commit/39d24bade317920544a3715e3a1f131663d8cded) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** Deprecate LegacyArchitecture classes from LayoutAnimation package ([f67078df07](https://github.com/facebook/react-native/commit/f67078df07b6c9ad995eb43ff47fc4a43bb2eaee) by [@mdvacca](https://github.com/mdvacca))
|
||||
- **New Architecture:** ReactPackageLogger is not supported in the new architecture and being deprecated ([65671108f6](https://github.com/facebook/react-native/commit/65671108f69d9b23a011841102e4141293581d9c) by [@mdvacca](https://github.com/mdvacca))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **DevMenu:** Remove bridge mode title and description from React Native Dev Menu title ([775daf5972](https://github.com/facebook/react-native/commit/775daf597280db94354ed484f2ce81690f1eb7b0) by [@sbuggay](https://github.com/sbuggay))
|
||||
- **New Architecture:** Deprecate all the objc classes not used by interop, or the new architecture. ([70f53ac4ea](https://github.com/facebook/react-native/commit/70f53ac4ea144020560906f5931e480ed4dee87c) by [@RSNara](https://github.com/RSNara))
|
||||
|
||||
### Removed
|
||||
|
||||
- **New Architecture:** Core: Remove legacy components ([9c8a4c2297](https://github.com/facebook/react-native/commit/9c8a4c22973c7ce6fcf6b5d22c6d5fd4c6dc0d92) by [@RSNara](https://github.com/RSNara))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **DefaultReactHost:** Delete unused `DefaultReactHost.getDefaultReactHost()` overload ([d35ddb5e59](https://github.com/facebook/react-native/commit/d35ddb5e59a8cb990dd61a154a8e15e9542f8b15) by [@cortinico](https://github.com/cortinico))
|
||||
- **DefaultReactHost:** Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 2 ([bda6acf3b0](https://github.com/facebook/react-native/commit/bda6acf3b08779c0dae7bdadbc9913eea79acd0d) by [@cortinico](https://github.com/cortinico))
|
||||
- **DefaultReactHost:** Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 1 ([474f455a75](https://github.com/facebook/react-native/commit/474f455a7591049382da0d0308ddd21589f0cc7e) by [@cortinico](https://github.com/cortinico))
|
||||
- **Inspector:** Removed unused `Inspector` public class from React Android ([cf528526cc](https://github.com/facebook/react-native/commit/cf528526cc375f1003125cf63f66fbd88790ceae) by [@cortinico](https://github.com/cortinico))
|
||||
- **JSONArguments:** Remove the `com.facebook.react.bridge.JSONArguments` class ([04ae15d99b](https://github.com/facebook/react-native/commit/04ae15d99bb2ee6f7987bbe8c3d7acfdd46a482f) by [@cortinico](https://github.com/cortinico))
|
||||
- **MessageQueueThreadPerfStats:** Deprecated MessageQueueThreadPerfStats API and replaced with stub. ([3bf5cb3d0e](https://github.com/facebook/react-native/commit/3bf5cb3d0e7d9d1749ef19a8392b9bbd3ec7ab7d) by [@javache](https://github.com/javache))
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Accessibility:** Fix for setting the default value for accessibility props ([586f5ba89c](https://github.com/facebook/react-native/commit/586f5ba89cc20a81a9e2d5d0f2708e9cd1b440c0) by Vineeth K)
|
||||
- **Accessibility:** `aria-hidden` support for `Text`, non-editable `TextInput` and `Image` ([0f39fc3000](https://github.com/facebook/react-native/commit/0f39fc3000411a43711814e0ab9cca1f7093b625) by [@mdjastrzebski](https://github.com/mdjastrzebski))
|
||||
- **Build:** Fixed babel plugin validation error when coverage instrumentation is enabled ([191ddc1ec7](https://github.com/facebook/react-native/commit/191ddc1ec72be6641ebb8b9cb729cf0e142fff55) by Umar Mohammad)
|
||||
- **Casting:** Casting rawValue to int was incorrectly truncating ([31b9f10364](https://github.com/facebook/react-native/commit/31b9f103645e67586bdfc5c2f590c28c04ca3871) by [@javache](https://github.com/javache))
|
||||
- **Codegen:** Help Codegen find library's package.json if some libraries using `exports` field in their package.json file and the `./package.json` subpath is not explicitly defined ([739dfd2141](https://github.com/facebook/react-native/commit/739dfd2141015a8126448bda64a559f5bf22672e) by [@RakaDoank](https://github.com/RakaDoank))
|
||||
- **Hermes:** Change leftover references to `hermes.framework` to `hermesvm.framework` ([7f051c5470](https://github.com/facebook/react-native/commit/7f051c54701b3585f76f63846abbf7e68e2688d2) by [@j-piasecki](https://github.com/j-piasecki))
|
||||
- **Performance Panel:** Fix typo in Performance.js type checking condition ([6caf2dfa38](https://github.com/facebook/react-native/commit/6caf2dfa382fd4f1184b8d21b030c36687a256e4) by [@YangJonghun](https://github.com/YangJonghun))
|
||||
- **Performance Panel:** Add default cases to switch statements in headers ([323fe3a5d4](https://github.com/facebook/react-native/commit/323fe3a5d471ae5a2f94d5c2bd13cc97feffe0a5) by [@NSProgrammer](https://github.com/NSProgrammer))
|
||||
- **ReactCommon:** Bring back ContextContainer::Shared = std::shared_ptr<const ContextContainer> alias ([daeb6e99ab](https://github.com/facebook/react-native/commit/daeb6e99abbca2b6395a9a703d2b0bb9e5091fb7) by [@christophpurrer](https://github.com/christophpurrer))
|
||||
- **ReactCommon:** Bring back SharedImageManager = std::shared_ptr<ImageManager> alias ([4718b35259](https://github.com/facebook/react-native/commit/4718b35259135b3503033a0061ae84e15d4eb450) by [@christophpurrer](https://github.com/christophpurrer))
|
||||
- **ReactCommon:** Fixed Type Conversion Error in DynamicEventPayload ([ff38d59cff](https://github.com/facebook/react-native/commit/ff38d59cff92e0a50f0dd70384fbc4dd11d969c4) by Harini Malothu)
|
||||
- **ReactCommon:** Fixed Type Conversion Error in CSSHexColor ([2ca88a0069](https://github.com/facebook/react-native/commit/2ca88a0069969bf115da6f0ea9f2fbbae9c9226c) by [@anupriya13](https://github.com/anupriya13))
|
||||
- **TestCallInvoker:** Fix memory leak in TestCallInvoker ([9f2fbc23e4](https://github.com/facebook/react-native/commit/9f2fbc23e48af9be56b3729d514fbb3fff4ba376) by [@christophpurrer](https://github.com/christophpurrer))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Accessability:** Stabilize custom accessibility action IDs to prevent "incompatible action" errors in TalkBack. ([626568f9a3](https://github.com/facebook/react-native/commit/626568f9a3f956a52f6c55df1dc3bc5cd017e353) by [@leg234-png](https://github.com/leg234-png))
|
||||
- **Determinism:** Turned off build IDs for native libraries, fixing issues with reproducibility ([4b8dbe7642](https://github.com/facebook/react-native/commit/4b8dbe7642be53d0ccfc68ca8c9b3f5e750a68c0) by [@Rexogamer](https://github.com/Rexogamer))
|
||||
- **DevTools:** Fix stack trace linkifying failing when using Android emulator and other situations where the device and debugger have different bundle urls ([794df48ad6](https://github.com/facebook/react-native/commit/794df48ad6a259022e66de1a38ff54b5ec67c3e4) by [@vzaidman](https://github.com/vzaidman))
|
||||
- **Edge to Edge:** Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled ([3b185e4bce](https://github.com/facebook/react-native/commit/3b185e4bcef24e0689cccd4cf250d469b114d4da) by [@zoontek](https://github.com/zoontek))
|
||||
- **Fonts:** Update font scale when recreating `RootView` ([5cda3065ce](https://github.com/facebook/react-native/commit/5cda3065ce635460a7458cbab5c10e24bea3bfe2) by [@j-piasecki](https://github.com/j-piasecki))
|
||||
- **Fonts:** Fix incorrect positioning of inline view at the end of string when RTL text in LTR container ([7f224941bb](https://github.com/facebook/react-native/commit/7f224941bb807919b487d8e1634dd2124f9258b8) by [@NickGerleman](https://github.com/NickGerleman))
|
||||
- **Locale:** Use the first available locale instead of the default one to decide `isDevicePreferredLanguageRTL` ([a03780d279](https://github.com/facebook/react-native/commit/a03780d279d0944e0dcbbf5a93680775006598b0) by Kaining Zhong)
|
||||
- **New Architecture:** Correctly account for insets on first render of Modals on New Arch ([2e76fc8e8e](https://github.com/facebook/react-native/commit/2e76fc8e8ea01fbce5bd131f675364e688f49088) by [@cortinico](https://github.com/cortinico))
|
||||
- **Performance:** Fix mounting is very slow on Android by shipping native transform optimizations ([c557311ed8](https://github.com/facebook/react-native/commit/c557311ed836cded8548c5bca32f3eded0abc7ff) by [@cortinico](https://github.com/cortinico))
|
||||
- **Scroll:** Fixed an issue where shadow tree and native tree layouts mismatch at the end of a scroll event ([1828c53f85](https://github.com/facebook/react-native/commit/1828c53f85faf599a485b3859f8b62586696265f) by [@Abbondanzo](https://github.com/Abbondanzo))
|
||||
- **Start up:** Fix wrong default for `jsBundleAssetPath` on `DefaultReactHost` ([2246e2b82c](https://github.com/facebook/react-native/commit/2246e2b82cf0c433f9a9b385ea98e532c6f322c6) by [@cortinico](https://github.com/cortinico))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **Build:** Fixed using USE_FRAMEWORKS (static/dynamic) with precompiled binaries ([e723ca4d6b](https://github.com/facebook/react-native/commit/e723ca4d6b86d5a98449498395c700513ceba555) by [@chrfalch](https://github.com/chrfalch))
|
||||
- **Build:** Non-UTF8 crashes Info.plist local frameworks ([91e69b5d4c](https://github.com/facebook/react-native/commit/91e69b5d4c768278680a8d9ae979bc267624ce98) by [@philipheinser](https://github.com/philipheinser))
|
||||
- **Build:** Fixed variable naming error in `set_fast_float_config` method in `react_native_pods.rb` ([327057fad5](https://github.com/facebook/react-native/commit/327057fad5c78a95e6c039bfe380d78672e83a43) by [@eliotfallon213](https://github.com/eliotfallon213))
|
||||
- **Build:** Fix pure cocoapods dynamic framework build ([aa4555eaf1](https://github.com/facebook/react-native/commit/aa4555eaf1b6aab83660c600e867fa6c2da4128e) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **Native Modules:** Fix concurrent calls into resolve/reject inside native modules ([dc879950d1](https://github.com/facebook/react-native/commit/dc879950d196dfd429229f1c4c8e743ef1799d11) by [@RSNara](https://github.com/RSNara))
|
||||
- **New Architecture:** Fix overriding (xc)framework Info.plist files with RCTNewArchEnabled field ([f84514a88b](https://github.com/facebook/react-native/commit/f84514a88be00f8dcae7972f84aa89d829392a58) by [@msynowski](https://github.com/msynowski))
|
||||
- **RCTPullToRefreshViewComponentView:** Properly initialize the `RCTPullToRefreshViewComponentView` ([27217e8bd6](https://github.com/facebook/react-native/commit/27217e8bd601757b5db6efc022db428b552a2aa4) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **RCTReactNativeFactory:** Ask the delegate for `getModuleForClass` and `getModuleInstanceFromClass` ([85b47afb48](https://github.com/facebook/react-native/commit/85b47afb48e50b036d2c2c79a008f571d3bfcb43) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **ScrollView:** Correctly propagate `ScrollView` props to `RefreshControl` ([09daad27ea](https://github.com/facebook/react-native/commit/09daad27ea22b83fab65176ea3c7f5f1488ba408) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **ScrollView:** Make sure that `ScrollView` recycled refresh control have the right props setup. ([21b93d8d7d](https://github.com/facebook/react-native/commit/21b93d8d7d46a26f728df19764f85a8aebf318bb) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **Switch:** Fixed a crash when rendering the `Switch` component ([28275a0f7b](https://github.com/facebook/react-native/commit/28275a0f7b182a215010d47fb841d9c2c36bb24c) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **Text:** Fix selectable prop not working correctly ([f004cd39bc](https://github.com/facebook/react-native/commit/f004cd39bc4b632006085cbcf61df52bc5d25242) by [@iamAbhi-916](https://github.com/iamAbhi-916))
|
||||
- **TextInput:** Update TextInput recycling logic to clean up the `inputAccessoryView` dependency. ([eb08f54594](https://github.com/facebook/react-native/commit/eb08f545948de9e2eca91ab3cb7569670c553b15) by [@ArturKalach](https://github.com/ArturKalach))
|
||||
- **TextInput:** Fixed TextInput behavior when `maxLength={null}` is passed ([56ad53cb14](https://github.com/facebook/react-native/commit/56ad53cb14b5c842714fcf976b6ba81f68c140f2) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **View:** Inline `View` alignment with `lineHeight` in Text ([6da351a5ed](https://github.com/facebook/react-native/commit/6da351a5ed80a10138a5558afcb380410c8a93c9) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
||||
|
||||
### Security
|
||||
|
||||
- **Network:** Fixed vulnerability on undici and on-headers ([dd00c9055a](https://github.com/facebook/react-native/commit/dd00c9055a8f0c9ceac1716385a8a9874f7a4c2e) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
|
||||
## v0.81.1
|
||||
|
||||
### Added
|
||||
|
||||
@@ -135,6 +135,7 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
|
||||
configurations.all {
|
||||
resolutionStrategy.dependencySubstitution {
|
||||
substitute(project(":packages:react-native:ReactAndroid:hermes-engine"))
|
||||
// TODO: T237406039 update coordinates
|
||||
.using(module("com.facebook.react:hermes-android:0.+"))
|
||||
.because("Users opted to use hermes from nightly")
|
||||
}
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
declare module '@expo/spawn-async' {
|
||||
type SpawnOptions = {
|
||||
cwd?: string,
|
||||
env?: Object,
|
||||
argv0?: string,
|
||||
stdio?: string | Array<any>,
|
||||
detached?: boolean,
|
||||
uid?: number,
|
||||
gid?: number,
|
||||
shell?: boolean | string,
|
||||
windowsVerbatimArguments?: boolean,
|
||||
windowsHide?: boolean,
|
||||
encoding?: string,
|
||||
ignoreStdio?: boolean,
|
||||
};
|
||||
|
||||
declare class SpawnPromise<T> extends Promise<T> {
|
||||
child: child_process$ChildProcess;
|
||||
}
|
||||
type SpawnResult = {
|
||||
pid?: number,
|
||||
output: string[],
|
||||
stdout: string,
|
||||
stderr: string,
|
||||
status: number | null,
|
||||
signal: string | null,
|
||||
};
|
||||
|
||||
declare function spawnAsync(
|
||||
command: string,
|
||||
args?: $ReadOnlyArray<string>,
|
||||
options?: SpawnOptions,
|
||||
): SpawnPromise<SpawnResult>;
|
||||
|
||||
declare module.exports: typeof spawnAsync;
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
// Partial types for Octokit based on the usage in react-native-github
|
||||
declare module '@octokit/rest' {
|
||||
declare class Octokit {
|
||||
constructor(options?: {auth?: string, ...}): this;
|
||||
|
||||
repos: $ReadOnly<{
|
||||
listReleaseAssets: (
|
||||
params: $ReadOnly<{
|
||||
owner: string,
|
||||
repo: string,
|
||||
release_id: string,
|
||||
}>,
|
||||
) => Promise<{
|
||||
data: Array<{
|
||||
id: string,
|
||||
name: string,
|
||||
...
|
||||
}>,
|
||||
...
|
||||
}>,
|
||||
uploadReleaseAsset: (
|
||||
params: $ReadOnly<{
|
||||
owner: string,
|
||||
repo: string,
|
||||
release_id: string,
|
||||
name: string,
|
||||
data: Buffer,
|
||||
headers: $ReadOnly<{
|
||||
'content-type': string,
|
||||
...
|
||||
}>,
|
||||
...
|
||||
}>,
|
||||
) => Promise<{
|
||||
data: {
|
||||
browser_download_url: string,
|
||||
...
|
||||
},
|
||||
...
|
||||
}>,
|
||||
deleteReleaseAsset: (params: {
|
||||
owner: string,
|
||||
repo: string,
|
||||
asset_id: string,
|
||||
...
|
||||
}) => Promise<mixed>,
|
||||
}>;
|
||||
}
|
||||
|
||||
declare export {Octokit};
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
declare module 'fb-dotslash' {
|
||||
declare module.exports: string;
|
||||
}
|
||||
+421
@@ -0,0 +1,421 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
declare module 'jsonc-parser' {
|
||||
/**
|
||||
* Creates a JSON scanner on the given text.
|
||||
* If ignoreTrivia is set, whitespaces or comments are ignored.
|
||||
*/
|
||||
declare export const createScanner: (
|
||||
text: string,
|
||||
ignoreTrivia?: boolean,
|
||||
) => JSONScanner;
|
||||
export type ScanError = number;
|
||||
export type SyntaxKind = number;
|
||||
/**
|
||||
* The scanner object, representing a JSON scanner at a position in the input string.
|
||||
*/
|
||||
export type JSONScanner = $ReadOnly<{
|
||||
/**
|
||||
* Sets the scan position to a new offset. A call to 'scan' is needed to get the first token.
|
||||
*/
|
||||
setPosition(pos: number): void,
|
||||
/**
|
||||
* Read the next token. Returns the token code.
|
||||
*/
|
||||
scan(): SyntaxKind,
|
||||
/**
|
||||
* Returns the zero-based current scan position, which is after the last read token.
|
||||
*/
|
||||
getPosition(): number,
|
||||
/**
|
||||
* Returns the last read token.
|
||||
*/
|
||||
getToken(): SyntaxKind,
|
||||
/**
|
||||
* Returns the last read token value. The value for strings is the decoded string content. For numbers it's of type number, for boolean it's true or false.
|
||||
*/
|
||||
getTokenValue(): string,
|
||||
/**
|
||||
* The zero-based start offset of the last read token.
|
||||
*/
|
||||
getTokenOffset(): number,
|
||||
/**
|
||||
* The length of the last read token.
|
||||
*/
|
||||
getTokenLength(): number,
|
||||
/**
|
||||
* The zero-based start line number of the last read token.
|
||||
*/
|
||||
getTokenStartLine(): number,
|
||||
/**
|
||||
* The zero-based start character (column) of the last read token.
|
||||
*/
|
||||
getTokenStartCharacter(): number,
|
||||
/**
|
||||
* An error code of the last scan.
|
||||
*/
|
||||
getTokenError(): ScanError,
|
||||
}>;
|
||||
/**
|
||||
* For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.
|
||||
*/
|
||||
declare export const getLocation: (
|
||||
text: string,
|
||||
position: number,
|
||||
) => Location;
|
||||
/**
|
||||
* Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
* Therefore, always check the errors list to find out if the input was valid.
|
||||
*/
|
||||
declare export const parse: (
|
||||
text: string,
|
||||
errors?: ParseError[],
|
||||
options?: ParseOptions,
|
||||
) => any;
|
||||
/**
|
||||
* Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
*/
|
||||
declare export const parseTree: (
|
||||
text: string,
|
||||
errors?: ParseError[],
|
||||
options?: ParseOptions,
|
||||
) => Node | void;
|
||||
/**
|
||||
* Finds the node at the given path in a JSON DOM.
|
||||
*/
|
||||
declare export const findNodeAtLocation: (
|
||||
root: Node,
|
||||
path: JSONPath,
|
||||
) => Node | void;
|
||||
/**
|
||||
* Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
|
||||
*/
|
||||
declare export const findNodeAtOffset: (
|
||||
root: Node,
|
||||
offset: number,
|
||||
includeRightBound?: boolean,
|
||||
) => Node | void;
|
||||
/**
|
||||
* Gets the JSON path of the given JSON DOM node
|
||||
*/
|
||||
declare export const getNodePath: (node: Node) => JSONPath;
|
||||
/**
|
||||
* Evaluates the JavaScript object of the given JSON DOM node
|
||||
*/
|
||||
declare export const getNodeValue: (node: Node) => any;
|
||||
/**
|
||||
* Parses the given text and invokes the visitor functions for each object, array and literal reached.
|
||||
*/
|
||||
declare export const visit: (
|
||||
text: string,
|
||||
visitor: JSONVisitor,
|
||||
options?: ParseOptions,
|
||||
) => any;
|
||||
/**
|
||||
* Takes JSON with JavaScript-style comments and remove
|
||||
* them. Optionally replaces every none-newline character
|
||||
* of comments with a replaceCharacter
|
||||
*/
|
||||
declare export const stripComments: (
|
||||
text: string,
|
||||
replaceCh?: string,
|
||||
) => string;
|
||||
export type ParseError = {
|
||||
error: ParseErrorCode,
|
||||
offset: number,
|
||||
length: number,
|
||||
};
|
||||
export type ParseErrorCode = number;
|
||||
declare export function printParseErrorCode(
|
||||
code: ParseErrorCode,
|
||||
):
|
||||
| 'InvalidSymbol'
|
||||
| 'InvalidNumberFormat'
|
||||
| 'PropertyNameExpected'
|
||||
| 'ValueExpected'
|
||||
| 'ColonExpected'
|
||||
| 'CommaExpected'
|
||||
| 'CloseBraceExpected'
|
||||
| 'CloseBracketExpected'
|
||||
| 'EndOfFileExpected'
|
||||
| 'InvalidCommentToken'
|
||||
| 'UnexpectedEndOfComment'
|
||||
| 'UnexpectedEndOfString'
|
||||
| 'UnexpectedEndOfNumber'
|
||||
| 'InvalidUnicode'
|
||||
| 'InvalidEscapeCharacter'
|
||||
| 'InvalidCharacter'
|
||||
| '<unknown ParseErrorCode>';
|
||||
export type NodeType =
|
||||
| 'object'
|
||||
| 'array'
|
||||
| 'property'
|
||||
| 'string'
|
||||
| 'number'
|
||||
| 'boolean'
|
||||
| 'null';
|
||||
export type Node = {
|
||||
type: NodeType,
|
||||
value?: any,
|
||||
offset: number,
|
||||
length: number,
|
||||
colonOffset?: number,
|
||||
parent?: Node,
|
||||
children?: Node[],
|
||||
};
|
||||
/**
|
||||
* A {@linkcode JSONPath} segment. Either a string representing an object property name
|
||||
* or a number (starting at 0) for array indices.
|
||||
*/
|
||||
export type Segment = string | number;
|
||||
export type JSONPath = Segment[];
|
||||
export type Location = {
|
||||
/**
|
||||
* The previous property key or literal value (string, number, boolean or null) or undefined.
|
||||
*/
|
||||
previousNode?: Node,
|
||||
/**
|
||||
* The path describing the location in the JSON document. The path consists of a sequence of strings
|
||||
* representing an object property or numbers for array indices.
|
||||
*/
|
||||
path: JSONPath,
|
||||
/**
|
||||
* Matches the locations path against a pattern consisting of strings (for properties) and numbers (for array indices).
|
||||
* '*' will match a single segment of any property name or index.
|
||||
* '**' will match a sequence of segments of any property name or index, or no segment.
|
||||
*/
|
||||
matches: (patterns: JSONPath) => boolean,
|
||||
/**
|
||||
* If set, the location's offset is at a property key.
|
||||
*/
|
||||
isAtPropertyKey: boolean,
|
||||
};
|
||||
export type ParseOptions = {
|
||||
disallowComments?: boolean,
|
||||
allowTrailingComma?: boolean,
|
||||
allowEmptyContent?: boolean,
|
||||
};
|
||||
/**
|
||||
* Visitor called by {@linkcode visit} when parsing JSON.
|
||||
*
|
||||
* The visitor functions have the following common parameters:
|
||||
* - `offset`: Global offset within the JSON document, starting at 0
|
||||
* - `startLine`: Line number, starting at 0
|
||||
* - `startCharacter`: Start character (column) within the current line, starting at 0
|
||||
*
|
||||
* Additionally some functions have a `pathSupplier` parameter which can be used to obtain the
|
||||
* current `JSONPath` within the document.
|
||||
*/
|
||||
export type JSONVisitor = {
|
||||
/**
|
||||
* Invoked when an open brace is encountered and an object is started. The offset and length represent the location of the open brace.
|
||||
*/
|
||||
onObjectBegin?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a property is encountered. The offset and length represent the location of the property name.
|
||||
* The `JSONPath` created by the `pathSupplier` refers to the enclosing JSON object, it does not include the
|
||||
* property name yet.
|
||||
*/
|
||||
onObjectProperty?: (
|
||||
property: string,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a closing brace is encountered and an object is completed. The offset and length represent the location of the closing brace.
|
||||
*/
|
||||
onObjectEnd?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when an open bracket is encountered. The offset and length represent the location of the open bracket.
|
||||
*/
|
||||
onArrayBegin?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a closing bracket is encountered. The offset and length represent the location of the closing bracket.
|
||||
*/
|
||||
onArrayEnd?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a literal value is encountered. The offset and length represent the location of the literal value.
|
||||
*/
|
||||
onLiteralValue?: (
|
||||
value: any,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a comma or colon separator is encountered. The offset and length represent the location of the separator.
|
||||
*/
|
||||
onSeparator?: (
|
||||
character: string,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* When comments are allowed, invoked when a line or block comment is encountered. The offset and length represent the location of the comment.
|
||||
*/
|
||||
onComment?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked on an error.
|
||||
*/
|
||||
onError?: (
|
||||
error: ParseErrorCode,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
};
|
||||
/**
|
||||
* An edit result describes a textual edit operation. It is the result of a {@linkcode format} and {@linkcode modify} operation.
|
||||
* It consist of one or more edits describing insertions, replacements or removals of text segments.
|
||||
* * The offsets of the edits refer to the original state of the document.
|
||||
* * No two edits change or remove the same range of text in the original document.
|
||||
* * Multiple edits can have the same offset if they are multiple inserts, or an insert followed by a remove or replace.
|
||||
* * The order in the array defines which edit is applied first.
|
||||
* To apply an edit result use {@linkcode applyEdits}.
|
||||
* In general multiple EditResults must not be concatenated because they might impact each other, producing incorrect or malformed JSON data.
|
||||
*/
|
||||
export type EditResult = Edit[];
|
||||
/**
|
||||
* Represents a text modification
|
||||
*/
|
||||
export type Edit = {
|
||||
/**
|
||||
* The start offset of the modification.
|
||||
*/
|
||||
offset: number,
|
||||
/**
|
||||
* The length of the modification. Must not be negative. Empty length represents an *insert*.
|
||||
*/
|
||||
length: number,
|
||||
/**
|
||||
* The new content. Empty content represents a *remove*.
|
||||
*/
|
||||
content: string,
|
||||
};
|
||||
/**
|
||||
* A text range in the document
|
||||
*/
|
||||
export type Range = {
|
||||
/**
|
||||
* The start offset of the range.
|
||||
*/
|
||||
offset: number,
|
||||
/**
|
||||
* The length of the range. Must not be negative.
|
||||
*/
|
||||
length: number,
|
||||
};
|
||||
/**
|
||||
* Options used by {@linkcode format} when computing the formatting edit operations
|
||||
*/
|
||||
export type FormattingOptions = $ReadOnly<{
|
||||
/**
|
||||
* If indentation is based on spaces (`insertSpaces` = true), the number of spaces that make an indent.
|
||||
*/
|
||||
tabSize?: number,
|
||||
/**
|
||||
* Is indentation based on spaces?
|
||||
*/
|
||||
insertSpaces?: boolean,
|
||||
/**
|
||||
* The default 'end of line' character. If not set, '\n' is used as default.
|
||||
*/
|
||||
eol?: string,
|
||||
}>;
|
||||
/**
|
||||
* Computes the edit operations needed to format a JSON document.
|
||||
*
|
||||
* @param documentText The input text
|
||||
* @param range The range to format or `undefined` to format the full content
|
||||
* @param options The formatting options
|
||||
* @returns The edit operations describing the formatting changes to the original document following the format described in {@linkcode EditResult}.
|
||||
* To apply the edit operations to the input, use {@linkcode applyEdits}.
|
||||
*/
|
||||
declare export function format(
|
||||
documentText: string,
|
||||
range: Range | void,
|
||||
options: FormattingOptions,
|
||||
): EditResult;
|
||||
/**
|
||||
* Options used by {@linkcode modify} when computing the modification edit operations
|
||||
*/
|
||||
export type ModificationOptions = {
|
||||
/**
|
||||
* Formatting options.
|
||||
*/
|
||||
formattingOptions: FormattingOptions,
|
||||
/**
|
||||
* Optional function to define the insertion index given an existing list of properties.
|
||||
*/
|
||||
getInsertionIndex?: (properties: string[]) => number,
|
||||
};
|
||||
/**
|
||||
* Computes the edit operations needed to modify a value in the JSON document.
|
||||
*
|
||||
* @param documentText The input text
|
||||
* @param path The path of the value to change. The path represents either to the document root, a property or an array item.
|
||||
* If the path points to an non-existing property or item, it will be created.
|
||||
* @param value The new value for the specified property or item. If the value is undefined,
|
||||
* the property or item will be removed.
|
||||
* @param options Options
|
||||
* @returns The edit operations describing the changes to the original document, following the format described in {@linkcode EditResult}.
|
||||
* To apply the edit operations to the input, use {@linkcode applyEdits}.
|
||||
*/
|
||||
declare export function modify(
|
||||
text: string,
|
||||
path: JSONPath,
|
||||
value: any,
|
||||
options: ModificationOptions,
|
||||
): EditResult;
|
||||
/**
|
||||
* Applies edits to an input string.
|
||||
* @param text The input text
|
||||
* @param edits Edit operations following the format described in {@linkcode EditResult}.
|
||||
* @returns The text with the applied edits.
|
||||
* @throws An error if the edit operations are not well-formed as described in {@linkcode EditResult}.
|
||||
*/
|
||||
declare export function applyEdits(text: string, edits: EditResult): string;
|
||||
}
|
||||
@@ -12,3 +12,6 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
||||
# Controls whether to use Hermes from nightly builds. This will speed up builds
|
||||
# but should NOT be turned on for CI or release builds.
|
||||
react.internal.useHermesNightly=false
|
||||
|
||||
# Controls whether to use Hermes 1.0. Clean and rebuild when changing.
|
||||
hermesV1Enabled=false
|
||||
|
||||
+7
-2
@@ -54,13 +54,16 @@
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/preset-flow": "^7.24.7",
|
||||
"@electron/packager": "^18.3.6",
|
||||
"@expo/spawn-async": "^1.7.2",
|
||||
"@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",
|
||||
"@octokit/rest": "^22.0.0",
|
||||
"@react-native/metro-babel-transformer": "0.82.1",
|
||||
"@react-native/metro-config": "0.82.1",
|
||||
"@tsconfig/node22": "22.0.2",
|
||||
"@types/react": "^19.1.0",
|
||||
"@typescript-eslint/parser": "^8.36.0",
|
||||
"ansi-regex": "^5.0.0",
|
||||
"ansi-styles": "^4.2.1",
|
||||
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
|
||||
"babel-plugin-syntax-hermes-parser": "0.32.0",
|
||||
@@ -81,6 +84,7 @@
|
||||
"eslint-plugin-react-native": "^4.0.0",
|
||||
"eslint-plugin-redundant-undefined": "^0.4.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"fb-dotslash": "0.5.8",
|
||||
"flow-api-translator": "0.32.0",
|
||||
"flow-bin": "^0.280.0",
|
||||
"glob": "^7.1.1",
|
||||
@@ -93,6 +97,7 @@
|
||||
"jest-diff": "^29.7.0",
|
||||
"jest-junit": "^16.0.0",
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"jsonc-parser": "2.2.1",
|
||||
"markdownlint-cli2": "^0.17.2",
|
||||
"markdownlint-rule-relative-links": "^3.0.0",
|
||||
"memfs": "^4.7.7",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"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.82.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,7 +22,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.82.0-main",
|
||||
"@react-native/dev-middleware": "0.82.1",
|
||||
"debug": "^4.4.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro": "^0.83.1",
|
||||
|
||||
@@ -88,6 +88,7 @@ Diff: ${styleText(['dim', 'underline'], newVersion?.diffUrl ?? 'none')}
|
||||
}
|
||||
}
|
||||
|
||||
// $FlowFixMe
|
||||
function isDiffPurgeEntry(data: Partial<DiffPurge>): data is DiffPurge {
|
||||
return (
|
||||
// $FlowFixMe[incompatible-type-guard]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env dotslash
|
||||
|
||||
// @generated SignedSource<<e93d55b5e28943e44271f5d3738083e0>>
|
||||
// @generated SignedSource<<ea146009f0eb66caf2e1e8c6ad9a664b>>
|
||||
|
||||
|
||||
{
|
||||
@@ -11,6 +11,9 @@
|
||||
"hash": "sha256",
|
||||
"digest": "4352f1c9848ca919101ec628bd08b87a72a828d1ab55fa43a02098329fa452fa",
|
||||
"providers": [
|
||||
{
|
||||
"url": "https://github.com/facebook/react-native/releases/download/v0.82.1/React.Native.DevTools-linux-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQM24LW0nPZRk0ypuIG9prz_72YjBJNcVlGSIEpO4zdlLXgw4dFNodH7MKg9eKNTnx7wrVDDBNACrnEPt_OfXOjZyZsV9Oaqu0-vNFRdlEyis4YqmpqGLtz3LvD-9R6fzcWxJI9zrhdPvOvlXP-3Syt1UNITaxXDVqIwAAYpCaAh0oLpupAFCc2yvYw"
|
||||
@@ -24,6 +27,9 @@
|
||||
"hash": "sha256",
|
||||
"digest": "11c7b07942928a6301b07fbf2bc77ce1229b2a52891f23541cdd9858b5250e64",
|
||||
"providers": [
|
||||
{
|
||||
"url": "https://github.com/facebook/react-native/releases/download/v0.82.1/React.Native.DevTools-linux-x86_64.tar.gz"
|
||||
},
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQNDwm7HZRhtNxHqMr1FfSb0afHFGrn1OHxH0gOiggrLrht9QRUgJ3GG5jj7huhQzMRogE-LCMsnxh1ioOZks-YYX4KRt6Kj1-whdWsGFc7lBhPOpk1ssbYFGN1NNyuyFRmH-3nCY3lBC4AmbCUkbDTUeCi9DidCtJeyc73CZJEu7M62rIzxR2yV"
|
||||
@@ -37,6 +43,9 @@
|
||||
"hash": "sha256",
|
||||
"digest": "3cbe8b1b3d17e433347f1601435bb9a6cb758528a5c176a66fc52d9977223175",
|
||||
"providers": [
|
||||
{
|
||||
"url": "https://github.com/facebook/react-native/releases/download/v0.82.1/React.Native.DevTools-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOmC2cqqSv4OrSJKJroYVg_NE8OE4O73AXqY7wXiYqiWQVkDt0Xnyw3ZeUpQT_Qb0-OoT5F8REKoFrB6eqwat8Ovkyina30peYTTwNUzmwnnGQEg7J0fOHNxLF4dkmU1FagXtsoWgex4dKgsK_VpcMsHj3Vp7diomkYvWBVTf_gPVEseYSN9oKq92qa"
|
||||
@@ -50,6 +59,9 @@
|
||||
"hash": "sha256",
|
||||
"digest": "6fb79bc2ba3008401b4c9c128248657b95b98581ccde60f8fadb622163779775",
|
||||
"providers": [
|
||||
{
|
||||
"url": "https://github.com/facebook/react-native/releases/download/v0.82.1/React.Native.DevTools-macos-x86_64.tar.gz"
|
||||
},
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQMMtGn-YGdfLfTVWC8zbQkQx65Asq6iArKt1t__cjZ8UY_s6-sX5XBHr8k1SaexAO21dFZENQVZ1jW_wn_gJ9ENvosQDG1KfWMViKsHli0xRzZ1HVsgPIj_KVXe907QZwwtJf2XhgH0HT8dfH-AQdDcd0_TB5DFUwOsHzhH0nBrHet7YFkbJtPTaA"
|
||||
@@ -63,6 +75,9 @@
|
||||
"hash": "sha256",
|
||||
"digest": "579a5b0944c51c3b1b541ad5af66c1ffedf93cae2a891ecdf88cb7219fd9b096",
|
||||
"providers": [
|
||||
{
|
||||
"url": "https://github.com/facebook/react-native/releases/download/v0.82.1/React.Native.DevTools-windows-x86_64.tar.gz"
|
||||
},
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOQ3E8lBXqdVHbDPyVb5AOQMrDWjFrFV8fnLLBsygQvLWdpu6ixyG9PgWdwpi5jM-XcDdCHkhBdhaq-5dwT_tgRWKCAMsEBoAIUk0Xg77mGyHG2VF7bNfQ2qFBMuObrsTmrKy1nJ-UFDDm29pJD4GkFQW5NesiBwndJj8t3B8Ur8cczh_XR8rF5"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-shell",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -152,11 +152,7 @@ function getShellBinaryAndArgs(
|
||||
): [string, Array<string>] {
|
||||
switch (flavor) {
|
||||
case 'prebuilt':
|
||||
return [
|
||||
// $FlowFixMe[cannot-resolve-module] fb-dotslash includes Flow types but Flow does not pick them up
|
||||
require('fb-dotslash'),
|
||||
[DEVTOOLS_BINARY_DOTSLASH_FILE],
|
||||
];
|
||||
return [require('fb-dotslash'), [DEVTOOLS_BINARY_DOTSLASH_FILE]];
|
||||
case 'dev':
|
||||
return [
|
||||
// NOTE: Internally at Meta, this is aliased to a workspace that is
|
||||
|
||||
@@ -44,11 +44,11 @@ async function spawnAndGetStderr(
|
||||
async function prepareDebuggerShellFromDotSlashFile(
|
||||
filePath: string,
|
||||
): Promise<DebuggerShellPreparationResult> {
|
||||
const {code, stderr} = await spawnAndGetStderr(
|
||||
// $FlowFixMe[cannot-resolve-module] fb-dotslash includes Flow types but Flow does not pick them up
|
||||
require('fb-dotslash'),
|
||||
['--', 'fetch', filePath],
|
||||
);
|
||||
const {code, stderr} = await spawnAndGetStderr(require('fb-dotslash'), [
|
||||
'--',
|
||||
'fetch',
|
||||
filePath,
|
||||
]);
|
||||
if (code === 0) {
|
||||
return {code: 'success'};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Dev server middleware for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -23,8 +23,8 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@isaacs/ttlcache": "^1.4.1",
|
||||
"@react-native/debugger-frontend": "0.82.0-main",
|
||||
"@react-native/debugger-shell": "0.82.0-main",
|
||||
"@react-native/debugger-frontend": "0.82.1",
|
||||
"@react-native/debugger-shell": "0.82.1",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
@@ -39,7 +39,7 @@
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native/debugger-shell": "0.82.0-main",
|
||||
"@react-native/debugger-shell": "0.82.1",
|
||||
"selfsigned": "^2.4.1",
|
||||
"undici": "^5.29.0",
|
||||
"wait-for-expect": "^3.0.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"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.82.1",
|
||||
"@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.82.1",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"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.82.1",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+11
-4
@@ -28,6 +28,7 @@ import com.facebook.react.utils.DependencyUtils.readVersionAndGroupStrings
|
||||
import com.facebook.react.utils.JdkConfiguratorUtils.configureJavaToolChains
|
||||
import com.facebook.react.utils.JsonUtils
|
||||
import com.facebook.react.utils.NdkConfiguratorUtils.configureReactNativeNdk
|
||||
import com.facebook.react.utils.ProjectUtils.isHermesV1Enabled
|
||||
import com.facebook.react.utils.ProjectUtils.needsCodegenFromPackageJson
|
||||
import com.facebook.react.utils.findPackageJsonFile
|
||||
import java.io.File
|
||||
@@ -54,6 +55,10 @@ class ReactPlugin : Plugin<Project> {
|
||||
project,
|
||||
)
|
||||
|
||||
if (project.rootProject.isHermesV1Enabled) {
|
||||
rootExtension.hermesV1Enabled.set(true)
|
||||
}
|
||||
|
||||
// App Only Configuration
|
||||
project.pluginManager.withPlugin("com.android.application") {
|
||||
// We wire the root extension with the values coming from the app (either user populated or
|
||||
@@ -66,10 +71,12 @@ class ReactPlugin : Plugin<Project> {
|
||||
project.afterEvaluate {
|
||||
val reactNativeDir = extension.reactNativeDir.get().asFile
|
||||
val propertiesFile = File(reactNativeDir, "ReactAndroid/gradle.properties")
|
||||
val versionAndGroupStrings = readVersionAndGroupStrings(propertiesFile)
|
||||
val versionString = versionAndGroupStrings.first
|
||||
val groupString = versionAndGroupStrings.second
|
||||
configureDependencies(project, versionString, groupString)
|
||||
val hermesVersionPropertiesFile =
|
||||
File(reactNativeDir, "sdks/hermes-engine/version.properties")
|
||||
val versionAndGroupStrings =
|
||||
readVersionAndGroupStrings(propertiesFile, hermesVersionPropertiesFile)
|
||||
val hermesV1Enabled = rootExtension.hermesV1Enabled.get()
|
||||
configureDependencies(project, versionAndGroupStrings, hermesV1Enabled)
|
||||
configureRepositories(project)
|
||||
}
|
||||
|
||||
|
||||
+19
-20
@@ -65,26 +65,25 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio
|
||||
if (!isDebuggableVariant) {
|
||||
val entryFileEnvVariable = System.getenv("ENTRY_FILE")
|
||||
val bundleTask =
|
||||
tasks.register("createBundle${targetName}JsAndAssets", BundleHermesCTask::class.java) { task
|
||||
->
|
||||
task.root.set(config.root)
|
||||
task.nodeExecutableAndArgs.set(config.nodeExecutableAndArgs)
|
||||
task.cliFile.set(cliFile)
|
||||
task.bundleCommand.set(config.bundleCommand)
|
||||
task.entryFile.set(detectedEntryFile(config, entryFileEnvVariable))
|
||||
task.extraPackagerArgs.set(config.extraPackagerArgs)
|
||||
task.bundleConfig.set(config.bundleConfig)
|
||||
task.bundleAssetName.set(config.bundleAssetName)
|
||||
task.jsBundleDir.set(jsBundleDir)
|
||||
task.resourcesDir.set(resourcesDir)
|
||||
task.hermesEnabled.set(isHermesEnabledInThisVariant)
|
||||
task.minifyEnabled.set(!isHermesEnabledInThisVariant)
|
||||
task.devEnabled.set(false)
|
||||
task.jsIntermediateSourceMapsDir.set(jsIntermediateSourceMapsDir)
|
||||
task.jsSourceMapsDir.set(jsSourceMapsDir)
|
||||
task.hermesCommand.set(config.hermesCommand)
|
||||
task.hermesFlags.set(config.hermesFlags)
|
||||
task.reactNativeDir.set(config.reactNativeDir)
|
||||
tasks.register("createBundle${targetName}JsAndAssets", BundleHermesCTask::class.java) {
|
||||
it.root.set(config.root)
|
||||
it.nodeExecutableAndArgs.set(config.nodeExecutableAndArgs)
|
||||
it.cliFile.set(cliFile)
|
||||
it.bundleCommand.set(config.bundleCommand)
|
||||
it.entryFile.set(detectedEntryFile(config, entryFileEnvVariable))
|
||||
it.extraPackagerArgs.set(config.extraPackagerArgs)
|
||||
it.bundleConfig.set(config.bundleConfig)
|
||||
it.bundleAssetName.set(config.bundleAssetName)
|
||||
it.jsBundleDir.set(jsBundleDir)
|
||||
it.resourcesDir.set(resourcesDir)
|
||||
it.hermesEnabled.set(isHermesEnabledInThisVariant)
|
||||
it.minifyEnabled.set(!isHermesEnabledInThisVariant)
|
||||
it.devEnabled.set(false)
|
||||
it.jsIntermediateSourceMapsDir.set(jsIntermediateSourceMapsDir)
|
||||
it.jsSourceMapsDir.set(jsSourceMapsDir)
|
||||
it.hermesCommand.set(config.hermesCommand)
|
||||
it.hermesFlags.set(config.hermesFlags)
|
||||
it.reactNativeDir.set(config.reactNativeDir)
|
||||
}
|
||||
variant.sources.res?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::resourcesDir)
|
||||
variant.sources.assets?.addGeneratedSourceDirectory(bundleTask, BundleHermesCTask::jsBundleDir)
|
||||
|
||||
+3
@@ -11,6 +11,7 @@ import javax.inject.Inject
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.provider.ListProperty
|
||||
import org.gradle.api.provider.Property
|
||||
|
||||
/**
|
||||
* A private extension we set on the rootProject to make easier to share values at execution time
|
||||
@@ -57,4 +58,6 @@ abstract class PrivateReactExtension @Inject constructor(project: Project) {
|
||||
|
||||
val codegenDir: DirectoryProperty =
|
||||
objects.directoryProperty().convention(root.dir("node_modules/@react-native/codegen"))
|
||||
|
||||
val hermesV1Enabled: Property<Boolean> = objects.property(Boolean::class.java).convention(false)
|
||||
}
|
||||
|
||||
+6
-1
@@ -94,7 +94,12 @@ abstract class BundleHermesCTask : DefaultTask() {
|
||||
runCommand(bundleCommand)
|
||||
|
||||
if (hermesEnabled.get()) {
|
||||
val detectedHermesCommand = detectOSAwareHermesCommand(root.get().asFile, hermesCommand.get())
|
||||
val hermesV1Enabled =
|
||||
if (project.rootProject.hasProperty("hermesV1Enabled"))
|
||||
project.rootProject.findProperty("hermesV1Enabled") == "true"
|
||||
else false
|
||||
val detectedHermesCommand =
|
||||
detectOSAwareHermesCommand(root.get().asFile, hermesCommand.get(), hermesV1Enabled)
|
||||
val bytecodeFile = File("${bundleFile}.hbc")
|
||||
val outputSourceMap = resolveOutputSourceMap(bundleAssetFilename)
|
||||
val compilerSourceMap = resolveCompilerSourceMap(bundleAssetFilename)
|
||||
|
||||
+77
-21
@@ -7,12 +7,15 @@
|
||||
|
||||
package com.facebook.react.utils
|
||||
|
||||
import com.facebook.react.utils.PropertyUtils.DEFAULT_INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.DEFAULT_INTERNAL_HERMES_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.DEFAULT_INTERNAL_REACT_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY_DEFAULT
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_HERMES_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_HERMES_V1_VERSION_NAME
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_REACT_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_USE_HERMES_NIGHTLY
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_VERSION_NAME
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
@@ -25,6 +28,14 @@ import org.gradle.api.artifacts.repositories.MavenArtifactRepository
|
||||
|
||||
internal object DependencyUtils {
|
||||
|
||||
internal data class Coordinates(
|
||||
val versionString: String,
|
||||
val hermesVersionString: String,
|
||||
val hermesV1VersionString: String,
|
||||
val reactGroupString: String = DEFAULT_INTERNAL_REACT_PUBLISHING_GROUP,
|
||||
val hermesGroupString: String = DEFAULT_INTERNAL_HERMES_PUBLISHING_GROUP,
|
||||
)
|
||||
|
||||
/**
|
||||
* This method takes care of configuring the repositories{} block for both the app and all the 3rd
|
||||
* party libraries which are auto-linked.
|
||||
@@ -95,14 +106,20 @@ internal object DependencyUtils {
|
||||
* This method takes care of configuring the resolution strategy for both the app and all the 3rd
|
||||
* party libraries which are auto-linked. Specifically it takes care of:
|
||||
* - Forcing the react-android/hermes-android version to the one specified in the package.json
|
||||
* - Substituting `react-native` with `react-android` and `hermes-engine` with `hermes-android`.
|
||||
* - Substituting `react-native` with `react-android` and `hermes-engine` with `hermes-android`
|
||||
* - Selecting between the classic Hermes and Hermes V1
|
||||
*/
|
||||
fun configureDependencies(
|
||||
project: Project,
|
||||
versionString: String,
|
||||
groupString: String = DEFAULT_INTERNAL_PUBLISHING_GROUP,
|
||||
coordinates: Coordinates,
|
||||
hermesV1Enabled: Boolean = false,
|
||||
) {
|
||||
if (versionString.isBlank()) return
|
||||
if (
|
||||
coordinates.versionString.isBlank() ||
|
||||
(!hermesV1Enabled && coordinates.hermesVersionString.isBlank()) ||
|
||||
(hermesV1Enabled && coordinates.hermesV1VersionString.isBlank())
|
||||
)
|
||||
return
|
||||
project.rootProject.allprojects { eachProject ->
|
||||
eachProject.configurations.all { configuration ->
|
||||
// Here we set a dependencySubstitution for both react-native and hermes-engine as those
|
||||
@@ -110,61 +127,83 @@ internal object DependencyUtils {
|
||||
// This allows users to import libraries that are still using
|
||||
// implementation("com.facebook.react:react-native:+") and resolve the right dependency.
|
||||
configuration.resolutionStrategy.dependencySubstitution {
|
||||
getDependencySubstitutions(versionString, groupString).forEach { (module, dest, reason) ->
|
||||
getDependencySubstitutions(coordinates, hermesV1Enabled).forEach { (module, dest, reason)
|
||||
->
|
||||
it.substitute(it.module(module)).using(it.module(dest)).because(reason)
|
||||
}
|
||||
}
|
||||
configuration.resolutionStrategy.force(
|
||||
"${groupString}:react-android:${versionString}",
|
||||
"${coordinates.reactGroupString}:react-android:${coordinates.versionString}",
|
||||
)
|
||||
if (!(eachProject.findProperty(INTERNAL_USE_HERMES_NIGHTLY) as? String).toBoolean()) {
|
||||
// Contributors only: The hermes-engine version is forced only if the user has
|
||||
// not opted into using nightlies for local development.
|
||||
configuration.resolutionStrategy.force("${groupString}:hermes-android:${versionString}")
|
||||
configuration.resolutionStrategy.force(
|
||||
// TODO: T237406039 update coordinates
|
||||
if (hermesV1Enabled)
|
||||
"${coordinates.hermesGroupString}:hermes-android:${coordinates.hermesV1VersionString}"
|
||||
else
|
||||
"${coordinates.reactGroupString}:hermes-android:${coordinates.hermesVersionString}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal fun getDependencySubstitutions(
|
||||
versionString: String,
|
||||
groupString: String = DEFAULT_INTERNAL_PUBLISHING_GROUP,
|
||||
coordinates: Coordinates,
|
||||
hermesV1Enabled: Boolean = false,
|
||||
): List<Triple<String, String, String>> {
|
||||
// TODO: T231755027 update coordinates and versioning
|
||||
val dependencySubstitution = mutableListOf<Triple<String, String, String>>()
|
||||
// TODO: T237406039 update coordinates
|
||||
val hermesVersionString =
|
||||
if (hermesV1Enabled)
|
||||
"${coordinates.hermesGroupString}:hermes-android:${coordinates.hermesV1VersionString}"
|
||||
else "${coordinates.reactGroupString}:hermes-android:${coordinates.hermesVersionString}"
|
||||
dependencySubstitution.add(
|
||||
Triple(
|
||||
"com.facebook.react:react-native",
|
||||
"${groupString}:react-android:${versionString}",
|
||||
"${coordinates.reactGroupString}:react-android:${coordinates.versionString}",
|
||||
"The react-native artifact was deprecated in favor of react-android due to https://github.com/facebook/react-native/issues/35210.",
|
||||
)
|
||||
)
|
||||
dependencySubstitution.add(
|
||||
Triple(
|
||||
"com.facebook.react:hermes-engine",
|
||||
"${groupString}:hermes-android:${versionString}",
|
||||
hermesVersionString,
|
||||
"The hermes-engine artifact was deprecated in favor of hermes-android due to https://github.com/facebook/react-native/issues/35210.",
|
||||
)
|
||||
)
|
||||
if (groupString != DEFAULT_INTERNAL_PUBLISHING_GROUP) {
|
||||
if (coordinates.reactGroupString != DEFAULT_INTERNAL_REACT_PUBLISHING_GROUP) {
|
||||
dependencySubstitution.add(
|
||||
Triple(
|
||||
"com.facebook.react:react-android",
|
||||
"${groupString}:react-android:${versionString}",
|
||||
"${coordinates.reactGroupString}:react-android:${coordinates.versionString}",
|
||||
"The react-android dependency was modified to use the correct Maven group.",
|
||||
)
|
||||
)
|
||||
// TODO: T237406039 update coordinates
|
||||
dependencySubstitution.add(
|
||||
Triple(
|
||||
"com.facebook.react:hermes-android",
|
||||
"${groupString}:hermes-android:${versionString}",
|
||||
hermesVersionString,
|
||||
"The hermes-android dependency was modified to use the correct Maven group.",
|
||||
)
|
||||
)
|
||||
} else if (hermesV1Enabled) {
|
||||
dependencySubstitution.add(
|
||||
Triple(
|
||||
"com.facebook.react:hermes-android",
|
||||
hermesVersionString,
|
||||
"The hermes-android dependency was modified to use Hermes V1.",
|
||||
)
|
||||
)
|
||||
}
|
||||
return dependencySubstitution
|
||||
}
|
||||
|
||||
fun readVersionAndGroupStrings(propertiesFile: File): Pair<String, String> {
|
||||
fun readVersionAndGroupStrings(propertiesFile: File, hermesVersionFile: File): Coordinates {
|
||||
val reactAndroidProperties = Properties()
|
||||
propertiesFile.inputStream().use { reactAndroidProperties.load(it) }
|
||||
val versionStringFromFile = (reactAndroidProperties[INTERNAL_VERSION_NAME] as? String).orEmpty()
|
||||
@@ -176,10 +215,27 @@ internal object DependencyUtils {
|
||||
versionStringFromFile
|
||||
}
|
||||
// Returns Maven group for repos using different group for Maven artifacts
|
||||
val groupString =
|
||||
reactAndroidProperties[INTERNAL_PUBLISHING_GROUP] as? String
|
||||
?: DEFAULT_INTERNAL_PUBLISHING_GROUP
|
||||
return Pair(versionString, groupString)
|
||||
val reactGroupString =
|
||||
reactAndroidProperties[INTERNAL_REACT_PUBLISHING_GROUP] as? String
|
||||
?: DEFAULT_INTERNAL_REACT_PUBLISHING_GROUP
|
||||
val hermesGroupString =
|
||||
reactAndroidProperties[INTERNAL_HERMES_PUBLISHING_GROUP] as? String
|
||||
?: DEFAULT_INTERNAL_HERMES_PUBLISHING_GROUP
|
||||
// TODO: T237406039 read both versions from the same file
|
||||
val hermesVersionProperties = Properties()
|
||||
hermesVersionFile.inputStream().use { hermesVersionProperties.load(it) }
|
||||
|
||||
val hermesVersion = versionString
|
||||
val hermesV1Version =
|
||||
(hermesVersionProperties[INTERNAL_HERMES_V1_VERSION_NAME] as? String).orEmpty()
|
||||
|
||||
return Coordinates(
|
||||
versionString,
|
||||
hermesVersion,
|
||||
hermesV1Version,
|
||||
reactGroupString,
|
||||
hermesGroupString,
|
||||
)
|
||||
}
|
||||
|
||||
fun Project.mavenRepoFromUrl(
|
||||
|
||||
+15
-5
@@ -122,11 +122,16 @@ private fun detectCliFile(reactNativeRoot: File, preconfiguredCliFile: File?): F
|
||||
* used if the user is building Hermes from source.
|
||||
* 3. The file located in `node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc` where `%OS-BIN%`
|
||||
* is substituted with the correct OS arch. This will be used if the user is using a precompiled
|
||||
* hermes-engine package.
|
||||
* hermes-engine package. Or, if the user has opted in to use Hermes V1, the used file will be
|
||||
* located in `node_modules/hermes-compiler/%OS-BIN%/hermesc` where `%OS-BIN%` is substituted
|
||||
* with the correct OS arch.
|
||||
* 4. Fails otherwise
|
||||
*/
|
||||
internal fun detectOSAwareHermesCommand(projectRoot: File, hermesCommand: String): String {
|
||||
// 1. If the project specifies a Hermes command, don't second guess it.
|
||||
internal fun detectOSAwareHermesCommand(
|
||||
projectRoot: File,
|
||||
hermesCommand: String,
|
||||
hermesV1Enabled: Boolean = false,
|
||||
): String { // 1. If the project specifies a Hermes command, don't second guess it.
|
||||
if (hermesCommand.isNotBlank()) {
|
||||
val osSpecificHermesCommand =
|
||||
if ("%OS-BIN%" in hermesCommand) {
|
||||
@@ -146,9 +151,13 @@ internal fun detectOSAwareHermesCommand(projectRoot: File, hermesCommand: String
|
||||
return builtHermesc.cliPath(projectRoot)
|
||||
}
|
||||
|
||||
// 3. If the react-native contains a pre-built hermesc, use it.
|
||||
// 3. If Hermes V1 is enabled, use hermes-compiler from npm, otherwise, if the
|
||||
// react-native contains a pre-built hermesc, use it.
|
||||
// TODO: T237406039 use hermes-compiler from npm for both
|
||||
val hermesCPath = if (hermesV1Enabled) HERMES_COMPILER_NPM_DIR else HERMESC_IN_REACT_NATIVE_DIR
|
||||
val prebuiltHermesPath =
|
||||
HERMESC_IN_REACT_NATIVE_DIR.plus(getHermesCBin())
|
||||
hermesCPath
|
||||
.plus(getHermesCBin())
|
||||
.replace("%OS-BIN%", getHermesOSBin())
|
||||
// Execution on Windows fails with / as separator
|
||||
.replace('/', File.separatorChar)
|
||||
@@ -233,6 +242,7 @@ internal fun readPackageJsonFile(
|
||||
return packageJson?.let { JsonUtils.fromPackageJson(it) }
|
||||
}
|
||||
|
||||
private const val HERMES_COMPILER_NPM_DIR = "node_modules/hermes-compiler/hermesc/%OS-BIN%/"
|
||||
private const val HERMESC_IN_REACT_NATIVE_DIR = "node_modules/react-native/sdks/hermesc/%OS-BIN%/"
|
||||
private const val HERMESC_BUILT_FROM_SOURCE_DIR =
|
||||
"node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/"
|
||||
|
||||
+14
@@ -13,14 +13,17 @@ import com.facebook.react.utils.KotlinStdlibCompatUtils.lowercaseCompat
|
||||
import com.facebook.react.utils.KotlinStdlibCompatUtils.toBooleanStrictOrNullCompat
|
||||
import com.facebook.react.utils.PropertyUtils.EDGE_TO_EDGE_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.HERMES_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.HERMES_V1_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.REACT_NATIVE_ARCHITECTURES
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_EDGE_TO_EDGE_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_HERMES_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_HERMES_V1_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_REACT_NATIVE_ARCHITECTURES
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_USE_THIRD_PARTY_JSC
|
||||
import com.facebook.react.utils.PropertyUtils.USE_THIRD_PARTY_JSC
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.jetbrains.kotlin.gradle.plugin.extraProperties
|
||||
|
||||
internal object ProjectUtils {
|
||||
|
||||
@@ -68,6 +71,17 @@ internal object ProjectUtils {
|
||||
(project.hasProperty(SCOPED_USE_THIRD_PARTY_JSC) &&
|
||||
project.property(SCOPED_USE_THIRD_PARTY_JSC).toString().toBoolean())
|
||||
|
||||
internal val Project.isHermesV1Enabled: Boolean
|
||||
get() =
|
||||
(project.hasProperty(HERMES_V1_ENABLED) &&
|
||||
project.property(HERMES_V1_ENABLED).toString().toBoolean()) ||
|
||||
(project.hasProperty(SCOPED_HERMES_V1_ENABLED) &&
|
||||
project.property(SCOPED_HERMES_V1_ENABLED).toString().toBoolean()) ||
|
||||
(project.extraProperties.has(HERMES_V1_ENABLED) &&
|
||||
project.extraProperties.get(HERMES_V1_ENABLED).toString().toBoolean()) ||
|
||||
(project.extraProperties.has(SCOPED_HERMES_V1_ENABLED) &&
|
||||
project.extraProperties.get(SCOPED_HERMES_V1_ENABLED).toString().toBoolean())
|
||||
|
||||
internal fun Project.needsCodegenFromPackageJson(rootProperty: DirectoryProperty): Boolean {
|
||||
val parsedPackageJson = readPackageJsonFile(this, rootProperty)
|
||||
return needsCodegenFromPackageJson(parsedPackageJson)
|
||||
|
||||
+14
-2
@@ -18,6 +18,10 @@ object PropertyUtils {
|
||||
const val HERMES_ENABLED = "hermesEnabled"
|
||||
const val SCOPED_HERMES_ENABLED = "react.hermesEnabled"
|
||||
|
||||
/** Public property that toggles Hermes V1 */
|
||||
const val HERMES_V1_ENABLED = "hermesV1Enabled"
|
||||
const val SCOPED_HERMES_V1_ENABLED = "react.hermesV1Enabled"
|
||||
|
||||
/** Public property that toggles edge-to-edge */
|
||||
const val EDGE_TO_EDGE_ENABLED = "edgeToEdgeEnabled"
|
||||
const val SCOPED_EDGE_TO_EDGE_ENABLED = "react.edgeToEdgeEnabled"
|
||||
@@ -68,9 +72,17 @@ object PropertyUtils {
|
||||
const val INTERNAL_USE_HERMES_NIGHTLY = "react.internal.useHermesNightly"
|
||||
|
||||
/** Internal property used to override the publishing group for the React Native artifacts. */
|
||||
const val INTERNAL_PUBLISHING_GROUP = "react.internal.publishingGroup"
|
||||
const val DEFAULT_INTERNAL_PUBLISHING_GROUP = "com.facebook.react"
|
||||
const val INTERNAL_REACT_PUBLISHING_GROUP = "react.internal.publishingGroup"
|
||||
const val INTERNAL_HERMES_PUBLISHING_GROUP = "react.internal.hermesPublishingGroup"
|
||||
const val DEFAULT_INTERNAL_REACT_PUBLISHING_GROUP = "com.facebook.react"
|
||||
const val DEFAULT_INTERNAL_HERMES_PUBLISHING_GROUP = "com.facebook.hermes"
|
||||
|
||||
/** Internal property used to control the version name of React Native */
|
||||
const val INTERNAL_VERSION_NAME = "VERSION_NAME"
|
||||
|
||||
/**
|
||||
* Internal property, shared with iOS, used to control the version name of Hermes Engine. This is
|
||||
* stored in sdks/hermes-engine/version.properties
|
||||
*/
|
||||
const val INTERNAL_HERMES_V1_VERSION_NAME = "HERMES_V1_VERSION_NAME"
|
||||
}
|
||||
|
||||
+278
-24
@@ -275,71 +275,160 @@ class DependencyUtilsTest {
|
||||
fun configureDependencies_withEmptyVersion_doesNothing() {
|
||||
val project = createProject()
|
||||
|
||||
configureDependencies(project, "")
|
||||
configureDependencies(project, DependencyUtils.Coordinates("", "", ""))
|
||||
|
||||
assertThat(project.configurations.first().resolutionStrategy.forcedModules.isEmpty()).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureDependencies_withVersionString_appliesResolutionStrategy() {
|
||||
fun configureDependencies_withVersionString_appliesResolutionStrategy_withClassicHermes() {
|
||||
val project = createProject()
|
||||
|
||||
configureDependencies(project, "1.2.3")
|
||||
configureDependencies(project, DependencyUtils.Coordinates("1.2.3", "4.5.6", "7.8.9"))
|
||||
|
||||
val forcedModules = project.configurations.first().resolutionStrategy.forcedModules
|
||||
assertThat(forcedModules.any { it.toString() == "com.facebook.react:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(forcedModules.any { it.toString() == "com.facebook.react:hermes-android:1.2.3" })
|
||||
assertThat(forcedModules.any { it.toString() == "com.facebook.react:hermes-android:4.5.6" })
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureDependencies_withVersionString_appliesOnAllProjects() {
|
||||
fun configureDependencies_withVersionString_appliesResolutionStrategy_withHermesV1() {
|
||||
val project = createProject()
|
||||
|
||||
configureDependencies(
|
||||
project,
|
||||
DependencyUtils.Coordinates("1.2.3", "4.5.6", "7.8.9"),
|
||||
hermesV1Enabled = true,
|
||||
)
|
||||
|
||||
val forcedModules = project.configurations.first().resolutionStrategy.forcedModules
|
||||
assertThat(forcedModules.any { it.toString() == "com.facebook.react:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(forcedModules.any { it.toString() == "com.facebook.hermes:hermes-android:7.8.9" })
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureDependencies_withVersionString_appliesOnAllProjects_withClassicHermes() {
|
||||
val rootProject = ProjectBuilder.builder().build()
|
||||
val appProject = ProjectBuilder.builder().withName("app").withParent(rootProject).build()
|
||||
val libProject = ProjectBuilder.builder().withName("lib").withParent(rootProject).build()
|
||||
appProject.plugins.apply("com.android.application")
|
||||
libProject.plugins.apply("com.android.library")
|
||||
|
||||
configureDependencies(appProject, "1.2.3")
|
||||
configureDependencies(appProject, DependencyUtils.Coordinates("1.2.3", "4.5.6", "7.8.9"))
|
||||
|
||||
val appForcedModules = appProject.configurations.first().resolutionStrategy.forcedModules
|
||||
val libForcedModules = libProject.configurations.first().resolutionStrategy.forcedModules
|
||||
assertThat(appForcedModules.any { it.toString() == "com.facebook.react:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(appForcedModules.any { it.toString() == "com.facebook.react:hermes-android:1.2.3" })
|
||||
assertThat(appForcedModules.any { it.toString() == "com.facebook.react:hermes-android:4.5.6" })
|
||||
.isTrue()
|
||||
assertThat(libForcedModules.any { it.toString() == "com.facebook.react:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(libForcedModules.any { it.toString() == "com.facebook.react:hermes-android:1.2.3" })
|
||||
assertThat(libForcedModules.any { it.toString() == "com.facebook.react:hermes-android:4.5.6" })
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureDependencies_withVersionStringAndGroupString_appliesOnAllProjects() {
|
||||
fun configureDependencies_withVersionString_appliesOnAllProjects_withHermesV1() {
|
||||
val rootProject = ProjectBuilder.builder().build()
|
||||
val appProject = ProjectBuilder.builder().withName("app").withParent(rootProject).build()
|
||||
val libProject = ProjectBuilder.builder().withName("lib").withParent(rootProject).build()
|
||||
appProject.plugins.apply("com.android.application")
|
||||
libProject.plugins.apply("com.android.library")
|
||||
|
||||
configureDependencies(appProject, "1.2.3", "io.github.test")
|
||||
configureDependencies(
|
||||
appProject,
|
||||
DependencyUtils.Coordinates("1.2.3", "4.5.6", "7.8.9"),
|
||||
hermesV1Enabled = true,
|
||||
)
|
||||
|
||||
val appForcedModules = appProject.configurations.first().resolutionStrategy.forcedModules
|
||||
val libForcedModules = libProject.configurations.first().resolutionStrategy.forcedModules
|
||||
assertThat(appForcedModules.any { it.toString() == "com.facebook.react:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(appForcedModules.any { it.toString() == "com.facebook.hermes:hermes-android:7.8.9" })
|
||||
.isTrue()
|
||||
assertThat(libForcedModules.any { it.toString() == "com.facebook.react:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(libForcedModules.any { it.toString() == "com.facebook.hermes:hermes-android:7.8.9" })
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureDependencies_withVersionStringAndGroupString_appliesOnAllProjects_withClassicHermes() {
|
||||
val rootProject = ProjectBuilder.builder().build()
|
||||
val appProject = ProjectBuilder.builder().withName("app").withParent(rootProject).build()
|
||||
val libProject = ProjectBuilder.builder().withName("lib").withParent(rootProject).build()
|
||||
appProject.plugins.apply("com.android.application")
|
||||
libProject.plugins.apply("com.android.library")
|
||||
|
||||
configureDependencies(
|
||||
appProject,
|
||||
DependencyUtils.Coordinates(
|
||||
"1.2.3",
|
||||
"4.5.6",
|
||||
"7.8.9",
|
||||
"io.github.test",
|
||||
"io.github.test.hermes",
|
||||
),
|
||||
)
|
||||
|
||||
val appForcedModules = appProject.configurations.first().resolutionStrategy.forcedModules
|
||||
val libForcedModules = libProject.configurations.first().resolutionStrategy.forcedModules
|
||||
assertThat(appForcedModules.any { it.toString() == "io.github.test:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(appForcedModules.any { it.toString() == "io.github.test:hermes-android:1.2.3" })
|
||||
assertThat(appForcedModules.any { it.toString() == "io.github.test:hermes-android:4.5.6" })
|
||||
.isTrue()
|
||||
assertThat(libForcedModules.any { it.toString() == "io.github.test:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(libForcedModules.any { it.toString() == "io.github.test:hermes-android:1.2.3" })
|
||||
assertThat(libForcedModules.any { it.toString() == "io.github.test:hermes-android:4.5.6" })
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getDependencySubstitutions_withDefaultGroup_substitutesCorrectly() {
|
||||
val dependencySubstitutions = getDependencySubstitutions("0.42.0")
|
||||
fun configureDependencies_withVersionStringAndGroupString_appliesOnAllProjects_withHermesV1() {
|
||||
val rootProject = ProjectBuilder.builder().build()
|
||||
val appProject = ProjectBuilder.builder().withName("app").withParent(rootProject).build()
|
||||
val libProject = ProjectBuilder.builder().withName("lib").withParent(rootProject).build()
|
||||
appProject.plugins.apply("com.android.application")
|
||||
libProject.plugins.apply("com.android.library")
|
||||
|
||||
configureDependencies(
|
||||
appProject,
|
||||
DependencyUtils.Coordinates(
|
||||
"1.2.3",
|
||||
"4.5.6",
|
||||
"7.8.9",
|
||||
"io.github.test",
|
||||
"io.github.test.hermes",
|
||||
),
|
||||
hermesV1Enabled = true,
|
||||
)
|
||||
|
||||
val appForcedModules = appProject.configurations.first().resolutionStrategy.forcedModules
|
||||
val libForcedModules = libProject.configurations.first().resolutionStrategy.forcedModules
|
||||
assertThat(appForcedModules.any { it.toString() == "io.github.test:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(
|
||||
appForcedModules.any { it.toString() == "io.github.test.hermes:hermes-android:7.8.9" }
|
||||
)
|
||||
.isTrue()
|
||||
assertThat(libForcedModules.any { it.toString() == "io.github.test:react-android:1.2.3" })
|
||||
.isTrue()
|
||||
assertThat(
|
||||
libForcedModules.any { it.toString() == "io.github.test.hermes:hermes-android:7.8.9" }
|
||||
)
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getDependencySubstitutions_withDefaultGroup_substitutesCorrectly_withClassicHermes() {
|
||||
val dependencySubstitutions =
|
||||
getDependencySubstitutions(DependencyUtils.Coordinates("0.42.0", "0.42.0", "0.43.0"))
|
||||
|
||||
assertThat("com.facebook.react:react-native").isEqualTo(dependencySubstitutions[0].first)
|
||||
assertThat("com.facebook.react:react-android:0.42.0")
|
||||
@@ -358,8 +447,41 @@ class DependencyUtilsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getDependencySubstitutions_withCustomGroup_substitutesCorrectly() {
|
||||
val dependencySubstitutions = getDependencySubstitutions("0.42.0", "io.github.test")
|
||||
fun getDependencySubstitutions_withDefaultGroup_substitutesCorrectly_withHermesV1() {
|
||||
val dependencySubstitutions =
|
||||
getDependencySubstitutions(
|
||||
DependencyUtils.Coordinates("0.42.0", "0.42.0", "0.43.0"),
|
||||
hermesV1Enabled = true,
|
||||
)
|
||||
|
||||
assertThat("com.facebook.react:react-native").isEqualTo(dependencySubstitutions[0].first)
|
||||
assertThat("com.facebook.react:react-android:0.42.0")
|
||||
.isEqualTo(dependencySubstitutions[0].second)
|
||||
assertThat(
|
||||
"The react-native artifact was deprecated in favor of react-android due to https://github.com/facebook/react-native/issues/35210."
|
||||
)
|
||||
.isEqualTo(dependencySubstitutions[0].third)
|
||||
assertThat("com.facebook.react:hermes-engine").isEqualTo(dependencySubstitutions[1].first)
|
||||
assertThat("com.facebook.hermes:hermes-android:0.43.0")
|
||||
.isEqualTo(dependencySubstitutions[1].second)
|
||||
assertThat(
|
||||
"The hermes-engine artifact was deprecated in favor of hermes-android due to https://github.com/facebook/react-native/issues/35210."
|
||||
)
|
||||
.isEqualTo(dependencySubstitutions[1].third)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getDependencySubstitutions_withCustomGroup_substitutesCorrectly_withClassicHermes() {
|
||||
val dependencySubstitutions =
|
||||
getDependencySubstitutions(
|
||||
DependencyUtils.Coordinates(
|
||||
"0.42.0",
|
||||
"0.42.0",
|
||||
"0.43.0",
|
||||
"io.github.test",
|
||||
"io.github.test.hermes",
|
||||
)
|
||||
)
|
||||
|
||||
assertThat("com.facebook.react:react-native").isEqualTo(dependencySubstitutions[0].first)
|
||||
assertThat("io.github.test:react-android:0.42.0").isEqualTo(dependencySubstitutions[0].second)
|
||||
@@ -383,6 +505,44 @@ class DependencyUtilsTest {
|
||||
.isEqualTo(dependencySubstitutions[3].third)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getDependencySubstitutions_withCustomGroup_substitutesCorrectly_withHermesV1() {
|
||||
val dependencySubstitutions =
|
||||
getDependencySubstitutions(
|
||||
DependencyUtils.Coordinates(
|
||||
"0.42.0",
|
||||
"0.42.0",
|
||||
"0.43.0",
|
||||
"io.github.test",
|
||||
"io.github.test.hermes",
|
||||
),
|
||||
hermesV1Enabled = true,
|
||||
)
|
||||
|
||||
assertThat("com.facebook.react:react-native").isEqualTo(dependencySubstitutions[0].first)
|
||||
assertThat("io.github.test:react-android:0.42.0").isEqualTo(dependencySubstitutions[0].second)
|
||||
assertThat(
|
||||
"The react-native artifact was deprecated in favor of react-android due to https://github.com/facebook/react-native/issues/35210."
|
||||
)
|
||||
.isEqualTo(dependencySubstitutions[0].third)
|
||||
assertThat("com.facebook.react:hermes-engine").isEqualTo(dependencySubstitutions[1].first)
|
||||
assertThat("io.github.test.hermes:hermes-android:0.43.0")
|
||||
.isEqualTo(dependencySubstitutions[1].second)
|
||||
assertThat(
|
||||
"The hermes-engine artifact was deprecated in favor of hermes-android due to https://github.com/facebook/react-native/issues/35210."
|
||||
)
|
||||
.isEqualTo(dependencySubstitutions[1].third)
|
||||
assertThat("com.facebook.react:react-android").isEqualTo(dependencySubstitutions[2].first)
|
||||
assertThat("io.github.test:react-android:0.42.0").isEqualTo(dependencySubstitutions[2].second)
|
||||
assertThat("The react-android dependency was modified to use the correct Maven group.")
|
||||
.isEqualTo(dependencySubstitutions[2].third)
|
||||
assertThat("com.facebook.react:hermes-android").isEqualTo(dependencySubstitutions[3].first)
|
||||
assertThat("io.github.test.hermes:hermes-android:0.43.0")
|
||||
.isEqualTo(dependencySubstitutions[3].second)
|
||||
assertThat("The hermes-android dependency was modified to use the correct Maven group.")
|
||||
.isEqualTo(dependencySubstitutions[3].third)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun readVersionString_withCorrectVersionString_returnsIt() {
|
||||
val propertiesFile =
|
||||
@@ -396,9 +556,25 @@ class DependencyUtilsTest {
|
||||
)
|
||||
}
|
||||
|
||||
val versionString = readVersionAndGroupStrings(propertiesFile).first
|
||||
val hermesVersionFile =
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=1000.0.0
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
val strings = readVersionAndGroupStrings(propertiesFile, hermesVersionFile)
|
||||
val versionString = strings.versionString
|
||||
val hermesVersionString = strings.hermesVersionString
|
||||
val hermesV1VersionString = strings.hermesV1VersionString
|
||||
|
||||
assertThat(versionString).isEqualTo("1000.0.0")
|
||||
assertThat(hermesVersionString).isEqualTo("1000.0.0")
|
||||
assertThat(hermesV1VersionString).isEqualTo("1000.0.0")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -408,15 +584,33 @@ class DependencyUtilsTest {
|
||||
writeText(
|
||||
"""
|
||||
VERSION_NAME=0.0.0-20221101-2019-cfe811ab1
|
||||
HERMES_VERSION_NAME=0.12.0-commitly-20221101-2019-cfe811ab1
|
||||
HERMES_V1_VERSION_NAME=250829098.0.0-stable
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
val versionString = readVersionAndGroupStrings(propertiesFile).first
|
||||
val hermesVersionFile =
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=250829098.0.0-stable
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
val strings = readVersionAndGroupStrings(propertiesFile, hermesVersionFile)
|
||||
val versionString = strings.versionString
|
||||
val hermesVersionString = strings.hermesVersionString
|
||||
val hermesV1VersionString = strings.hermesV1VersionString
|
||||
|
||||
assertThat(versionString).isEqualTo("0.0.0-20221101-2019-cfe811ab1-SNAPSHOT")
|
||||
assertThat(hermesVersionString).isEqualTo("0.0.0-20221101-2019-cfe811ab1-SNAPSHOT")
|
||||
assertThat(hermesV1VersionString).isEqualTo("250829098.0.0-stable")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -431,8 +625,23 @@ class DependencyUtilsTest {
|
||||
)
|
||||
}
|
||||
|
||||
val versionString = readVersionAndGroupStrings(propertiesFile).first
|
||||
val hermesVersionFile =
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
val strings = readVersionAndGroupStrings(propertiesFile, hermesVersionFile)
|
||||
val versionString = strings.versionString
|
||||
val hermesVersionString = strings.hermesVersionString
|
||||
val hermesV1VersionString = strings.hermesV1VersionString
|
||||
assertThat(versionString).isEqualTo("")
|
||||
assertThat(hermesVersionString).isEqualTo("")
|
||||
assertThat(hermesV1VersionString).isEqualTo("")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -448,8 +657,24 @@ class DependencyUtilsTest {
|
||||
)
|
||||
}
|
||||
|
||||
val versionString = readVersionAndGroupStrings(propertiesFile).first
|
||||
val hermesVersionFile =
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
val strings = readVersionAndGroupStrings(propertiesFile, hermesVersionFile)
|
||||
val versionString = strings.versionString
|
||||
val hermesVersionString = strings.hermesVersionString
|
||||
val hermesV1VersionString = strings.hermesV1VersionString
|
||||
assertThat(versionString).isEqualTo("")
|
||||
assertThat(hermesVersionString).isEqualTo("")
|
||||
assertThat(hermesV1VersionString).isEqualTo("")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -459,15 +684,30 @@ class DependencyUtilsTest {
|
||||
writeText(
|
||||
"""
|
||||
react.internal.publishingGroup=io.github.test
|
||||
react.internal.hermesPublishingGroup=io.github.test
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
val groupString = readVersionAndGroupStrings(propertiesFile).second
|
||||
val hermesVersionFile =
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
assertThat(groupString).isEqualTo("io.github.test")
|
||||
val strings = readVersionAndGroupStrings(propertiesFile, hermesVersionFile)
|
||||
val reactGroupString = strings.reactGroupString
|
||||
val hermesGroupString = strings.hermesGroupString
|
||||
|
||||
assertThat(reactGroupString).isEqualTo("io.github.test")
|
||||
assertThat(hermesGroupString).isEqualTo("io.github.test")
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -482,9 +722,23 @@ class DependencyUtilsTest {
|
||||
)
|
||||
}
|
||||
|
||||
val groupString = readVersionAndGroupStrings(propertiesFile).second
|
||||
val hermesVersionFile =
|
||||
tempFolder.newFile("version.properties").apply {
|
||||
writeText(
|
||||
"""
|
||||
HERMES_V1_VERSION_NAME=
|
||||
ANOTHER_PROPERTY=true
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
assertThat(groupString).isEqualTo("com.facebook.react")
|
||||
val strings = readVersionAndGroupStrings(propertiesFile, hermesVersionFile)
|
||||
val reactGroupString = strings.reactGroupString
|
||||
val hermesGroupString = strings.hermesGroupString
|
||||
|
||||
assertThat(reactGroupString).isEqualTo("com.facebook.react")
|
||||
assertThat(hermesGroupString).isEqualTo("com.facebook.hermes")
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+10
@@ -162,6 +162,16 @@ class PathUtilsTest {
|
||||
assertThat(detectOSAwareHermesCommand(tempFolder.root, "")).isEqualTo(expected.toString())
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithOs(OS.MAC)
|
||||
fun detectOSAwareHermesCommand_withHermesV1Enabled() {
|
||||
tempFolder.newFolder("node_modules/hermes-compiler/hermesc/osx-bin/")
|
||||
val expected = tempFolder.newFile("node_modules/hermes-compiler/hermesc/osx-bin/hermesc")
|
||||
|
||||
assertThat(detectOSAwareHermesCommand(tempFolder.root, "", hermesV1Enabled = true))
|
||||
.isEqualTo(expected.toString())
|
||||
}
|
||||
|
||||
@Test(expected = IllegalStateException::class)
|
||||
@WithOs(OS.MAC)
|
||||
fun detectOSAwareHermesCommand_failsIfNotFound() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,8 +26,8 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.82.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.82.0-main",
|
||||
"@react-native/js-polyfills": "0.82.1",
|
||||
"@react-native/metro-babel-transformer": "0.82.1",
|
||||
"metro-config": "^0.83.1",
|
||||
"metro-runtime": "^0.83.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/new-app-screen",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "NewAppScreen component for React Native",
|
||||
"keywords": [
|
||||
"react-native"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"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.82.1",
|
||||
"babel-plugin-syntax-hermes-parser": "0.32.0",
|
||||
"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.82.1",
|
||||
"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.82.1",
|
||||
"hermes-parser": "0.32.0",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/compatibility-check",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"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.82.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-remove-types": "^2.237.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.82.0-main",
|
||||
"version": "0.82.1",
|
||||
"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.82.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.1.0",
|
||||
|
||||
@@ -873,56 +873,6 @@ describe('Animated', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Animated Interactions', () => {
|
||||
let Animated; // eslint-disable-line no-shadow
|
||||
let InteractionManager;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.mock('../../Interaction/InteractionManager');
|
||||
Animated = require('../Animated').default;
|
||||
InteractionManager =
|
||||
require('../../Interaction/InteractionManager').default;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.unmock('../../Interaction/InteractionManager');
|
||||
});
|
||||
|
||||
it('registers an interaction by default', () => {
|
||||
// $FlowFixMe[prop-missing]
|
||||
InteractionManager.createInteractionHandle.mockReturnValue(777);
|
||||
|
||||
const value = new Animated.Value(0);
|
||||
const callback = jest.fn();
|
||||
Animated.timing(value, {
|
||||
toValue: 100,
|
||||
duration: 100,
|
||||
useNativeDriver: false,
|
||||
}).start(callback);
|
||||
jest.runAllTimers();
|
||||
|
||||
expect(InteractionManager.createInteractionHandle).toBeCalled();
|
||||
expect(InteractionManager.clearInteractionHandle).toBeCalledWith(777);
|
||||
expect(callback).toBeCalledWith({finished: true});
|
||||
});
|
||||
|
||||
it('does not register an interaction when specified', () => {
|
||||
const value = new Animated.Value(0);
|
||||
const callback = jest.fn();
|
||||
Animated.timing(value, {
|
||||
toValue: 100,
|
||||
duration: 100,
|
||||
isInteraction: false,
|
||||
useNativeDriver: false,
|
||||
}).start(callback);
|
||||
jest.runAllTimers();
|
||||
|
||||
expect(InteractionManager.createInteractionHandle).not.toBeCalled();
|
||||
expect(InteractionManager.clearInteractionHandle).not.toBeCalled();
|
||||
expect(callback).toBeCalledWith({finished: true});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Animated Tracking', () => {
|
||||
it('should track values', () => {
|
||||
const value1 = new Animated.Value(0);
|
||||
|
||||
@@ -18,7 +18,6 @@ import type {AnimatedNodeConfig} from './AnimatedNode';
|
||||
import type AnimatedTracking from './AnimatedTracking';
|
||||
|
||||
import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
|
||||
import InteractionManager from '../../Interaction/InteractionManager';
|
||||
import AnimatedInterpolation from './AnimatedInterpolation';
|
||||
import AnimatedWithChildren from './AnimatedWithChildren';
|
||||
|
||||
@@ -312,10 +311,6 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
||||
* See https://reactnative.dev/docs/animatedvalue#animate
|
||||
*/
|
||||
animate(animation: Animation, callback: ?EndCallback): void {
|
||||
let handle = null;
|
||||
if (animation.__isInteraction) {
|
||||
handle = InteractionManager.createInteractionHandle();
|
||||
}
|
||||
const previousAnimation = this._animation;
|
||||
this._animation && this._animation.stop();
|
||||
this._animation = animation;
|
||||
@@ -328,9 +323,6 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
||||
},
|
||||
result => {
|
||||
this._animation = null;
|
||||
if (handle !== null) {
|
||||
InteractionManager.clearInteractionHandle(handle);
|
||||
}
|
||||
callback && callback(result);
|
||||
},
|
||||
previousAnimation,
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
Vendored
-32
@@ -2607,35 +2607,3 @@ describe('horizontal ScrollView in RTL script', () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Views with no layout', () => {
|
||||
it('are not culled', () => {
|
||||
const root = Fantom.createRoot({viewportWidth: 100, viewportHeight: 100});
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<ScrollView style={{height: 100, width: 100}}>
|
||||
<View nativeID={'viewWithLayout'} style={{height: 100, width: 100}} />
|
||||
<View style={{height: 1000, width: 100}} />
|
||||
<View
|
||||
nativeID={'culledViewWithLayout'}
|
||||
style={{height: 100, width: 100}}
|
||||
/>
|
||||
<View nativeID={'viewWithoutLayout'} style={{height: 0, width: 0}} />
|
||||
</ScrollView>,
|
||||
);
|
||||
});
|
||||
|
||||
expect(root.takeMountingManagerLogs()).toEqual([
|
||||
'Update {type: "RootView", nativeID: (root)}',
|
||||
'Create {type: "ScrollView", nativeID: (N/A)}',
|
||||
'Create {type: "View", nativeID: (N/A)}',
|
||||
'Create {type: "View", nativeID: "viewWithLayout"}',
|
||||
'Create {type: "View", nativeID: "viewWithoutLayout"}',
|
||||
'Insert {type: "View", parentNativeID: (N/A), index: 0, nativeID: "viewWithLayout"}',
|
||||
'Insert {type: "View", parentNativeID: (N/A), index: 1, nativeID: "viewWithoutLayout"}',
|
||||
'Insert {type: "View", parentNativeID: (N/A), index: 0, nativeID: (N/A)}',
|
||||
'Insert {type: "ScrollView", parentNativeID: (root), index: 0, nativeID: (N/A)}',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -264,7 +264,7 @@ const Switch: component(
|
||||
disabled,
|
||||
onTintColor: trackColorForTrue,
|
||||
style: StyleSheet.compose(
|
||||
{height: 31, width: 51},
|
||||
{alignSelf: 'flex-start' as const},
|
||||
StyleSheet.compose(
|
||||
style,
|
||||
ios_backgroundColor == null
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
* ```
|
||||
*/
|
||||
export default class ReactNativeVersion {
|
||||
static major: number = 1000;
|
||||
static minor: number = 0;
|
||||
static patch: number = 0;
|
||||
static major: number = 0;
|
||||
static minor: number = 82;
|
||||
static patch: number = 1;
|
||||
static prerelease: string | null = null;
|
||||
|
||||
static getVersionString(): string {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
import NativeTiming from './NativeTiming';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
export * from '../../../src/private/specs_DEPRECATED/modules/NativeTiming';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
+6
-51
@@ -12,7 +12,6 @@
|
||||
|
||||
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
||||
|
||||
const InteractionManager = require('./InteractionManager').default;
|
||||
const TouchHistoryMath = require('./TouchHistoryMath').default;
|
||||
|
||||
const currentCentroidXOfTouchesChangedAfter =
|
||||
@@ -31,9 +30,6 @@ const currentCentroidY = TouchHistoryMath.currentCentroidY;
|
||||
* single-touch gestures resilient to extra touches, and can be used to
|
||||
* recognize simple multi-touch gestures.
|
||||
*
|
||||
* By default, `PanResponder` holds an `InteractionManager` handle to block
|
||||
* long-running JS events from interrupting active gestures.
|
||||
*
|
||||
* It provides a predictable wrapper of the responder handlers provided by the
|
||||
* [gesture responder system](docs/gesture-responder-system.html).
|
||||
* For each handler, it provides a new `gestureState` object alongside the
|
||||
@@ -405,9 +401,6 @@ const PanResponder = {
|
||||
getInteractionHandle: () => ?number,
|
||||
panHandlers: GestureResponderHandlerMethods,
|
||||
} {
|
||||
const interactionState = {
|
||||
handle: (null: ?number),
|
||||
};
|
||||
const gestureState: PanResponderGestureState = {
|
||||
// Useful for debugging
|
||||
stateID: Math.random(),
|
||||
@@ -464,10 +457,6 @@ const PanResponder = {
|
||||
},
|
||||
|
||||
onResponderGrant(event: GestureResponderEvent): boolean {
|
||||
if (!interactionState.handle) {
|
||||
interactionState.handle =
|
||||
InteractionManager.createInteractionHandle();
|
||||
}
|
||||
gestureState.x0 = currentCentroidX(event.touchHistory);
|
||||
gestureState.y0 = currentCentroidY(event.touchHistory);
|
||||
gestureState.dx = 0;
|
||||
@@ -482,21 +471,11 @@ const PanResponder = {
|
||||
},
|
||||
|
||||
onResponderReject(event: GestureResponderEvent): void {
|
||||
clearInteractionHandle(
|
||||
interactionState,
|
||||
config.onPanResponderReject,
|
||||
event,
|
||||
gestureState,
|
||||
);
|
||||
config.onPanResponderReject?.call(undefined, event, gestureState);
|
||||
},
|
||||
|
||||
onResponderRelease(event: GestureResponderEvent): void {
|
||||
clearInteractionHandle(
|
||||
interactionState,
|
||||
config.onPanResponderRelease,
|
||||
event,
|
||||
gestureState,
|
||||
);
|
||||
config.onPanResponderRelease?.call(undefined, event, gestureState);
|
||||
PanResponder._initializeGestureState(gestureState);
|
||||
},
|
||||
|
||||
@@ -529,21 +508,11 @@ const PanResponder = {
|
||||
onResponderEnd(event: GestureResponderEvent): void {
|
||||
const touchHistory = event.touchHistory;
|
||||
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
||||
clearInteractionHandle(
|
||||
interactionState,
|
||||
config.onPanResponderEnd,
|
||||
event,
|
||||
gestureState,
|
||||
);
|
||||
config.onPanResponderEnd?.call(undefined, event, gestureState);
|
||||
},
|
||||
|
||||
onResponderTerminate(event: GestureResponderEvent): void {
|
||||
clearInteractionHandle(
|
||||
interactionState,
|
||||
config.onPanResponderTerminate,
|
||||
event,
|
||||
gestureState,
|
||||
);
|
||||
config.onPanResponderTerminate?.call(undefined, event, gestureState);
|
||||
PanResponder._initializeGestureState(gestureState);
|
||||
},
|
||||
|
||||
@@ -556,27 +525,13 @@ const PanResponder = {
|
||||
return {
|
||||
panHandlers,
|
||||
getInteractionHandle(): ?number {
|
||||
return interactionState.handle;
|
||||
// TODO: Deprecate and delete this method.
|
||||
return null;
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
function clearInteractionHandle(
|
||||
interactionState: {handle: ?number, ...},
|
||||
callback: ?(ActiveCallback | PassiveCallback),
|
||||
event: GestureResponderEvent,
|
||||
gestureState: PanResponderGestureState,
|
||||
) {
|
||||
if (interactionState.handle) {
|
||||
InteractionManager.clearInteractionHandle(interactionState.handle);
|
||||
interactionState.handle = null;
|
||||
}
|
||||
if (callback) {
|
||||
callback(event, gestureState);
|
||||
}
|
||||
}
|
||||
|
||||
export type PanResponderInstance = ReturnType<(typeof PanResponder)['create']>;
|
||||
|
||||
export default PanResponder;
|
||||
|
||||
+8
-8
@@ -13,8 +13,8 @@ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
||||
import type {
|
||||
ListRenderItem,
|
||||
ListRenderItemInfo,
|
||||
ListViewToken,
|
||||
ViewabilityConfigCallbackPair,
|
||||
ViewToken,
|
||||
VirtualizedListProps,
|
||||
} from '@react-native/virtualized-lists';
|
||||
|
||||
@@ -573,7 +573,7 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
|
||||
return keyExtractor(items, index);
|
||||
};
|
||||
|
||||
_pushMultiColumnViewable(arr: Array<ListViewToken>, v: ListViewToken): void {
|
||||
_pushMultiColumnViewable(arr: Array<ViewToken>, v: ViewToken): void {
|
||||
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
||||
const keyExtractor = this.props.keyExtractor ?? defaultKeyExtractor;
|
||||
v.item.forEach((item, ii) => {
|
||||
@@ -585,22 +585,22 @@ class FlatList<ItemT = any> extends React.PureComponent<FlatListProps<ItemT>> {
|
||||
|
||||
_createOnViewableItemsChanged(
|
||||
onViewableItemsChanged: ?(info: {
|
||||
viewableItems: Array<ListViewToken>,
|
||||
changed: Array<ListViewToken>,
|
||||
viewableItems: Array<ViewToken>,
|
||||
changed: Array<ViewToken>,
|
||||
...
|
||||
}) => void,
|
||||
// $FlowFixMe[missing-local-annot]
|
||||
) {
|
||||
return (info: {
|
||||
viewableItems: Array<ListViewToken>,
|
||||
changed: Array<ListViewToken>,
|
||||
viewableItems: Array<ViewToken>,
|
||||
changed: Array<ViewToken>,
|
||||
...
|
||||
}) => {
|
||||
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
||||
if (onViewableItemsChanged) {
|
||||
if (numColumns > 1) {
|
||||
const changed: Array<ListViewToken> = [];
|
||||
const viewableItems: Array<ListViewToken> = [];
|
||||
const changed: Array<ViewToken> = [];
|
||||
const viewableItems: Array<ViewToken> = [];
|
||||
info.viewableItems.forEach(v =>
|
||||
this._pushMultiColumnViewable(viewableItems, v),
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
export type {
|
||||
ListViewToken as ViewToken,
|
||||
ViewToken,
|
||||
ViewabilityConfig,
|
||||
ViewabilityConfigCallbackPair,
|
||||
} from '@react-native/virtualized-lists';
|
||||
|
||||
@@ -19,7 +19,6 @@ const VirtualizedListComponent: VirtualizedListType =
|
||||
export type {
|
||||
ListRenderItemInfo,
|
||||
ListRenderItem,
|
||||
ListViewToken,
|
||||
Separators,
|
||||
VirtualizedListProps,
|
||||
} from '@react-native/virtualized-lists';
|
||||
|
||||
@@ -102,6 +102,7 @@ export function testBadSectionsShape(): React.MixedElement {
|
||||
],
|
||||
},
|
||||
];
|
||||
// $FlowExpectedError - section missing `data` field
|
||||
return <SectionList renderItem={renderMyListItem} sections={sections} />;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
- (instancetype)initWithTag:(NSNumber *)tag config:(NSDictionary<NSString *, id> *)config
|
||||
{
|
||||
if ((self = [super init]) != nullptr) {
|
||||
if ((self = [super init])) {
|
||||
_nodeTag = tag;
|
||||
_config = [config copy];
|
||||
}
|
||||
@@ -37,10 +37,10 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||
|
||||
- (void)addChild:(RCTAnimatedNode *)child
|
||||
{
|
||||
if (_childNodes == nullptr) {
|
||||
if (!_childNodes) {
|
||||
_childNodes = [NSMapTable strongToWeakObjectsMapTable];
|
||||
}
|
||||
if (child != nullptr) {
|
||||
if (child) {
|
||||
[_childNodes setObject:child forKey:child.nodeTag];
|
||||
[child onAttachedToNode:self];
|
||||
}
|
||||
@@ -48,10 +48,10 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||
|
||||
- (void)removeChild:(RCTAnimatedNode *)child
|
||||
{
|
||||
if (_childNodes == nullptr) {
|
||||
if (!_childNodes) {
|
||||
return;
|
||||
}
|
||||
if (child != nullptr) {
|
||||
if (child) {
|
||||
[_childNodes removeObjectForKey:child.nodeTag];
|
||||
[child onDetachedFromNode:self];
|
||||
}
|
||||
@@ -59,20 +59,20 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||
|
||||
- (void)onAttachedToNode:(RCTAnimatedNode *)parent
|
||||
{
|
||||
if (_parentNodes == nullptr) {
|
||||
if (!_parentNodes) {
|
||||
_parentNodes = [NSMapTable strongToWeakObjectsMapTable];
|
||||
}
|
||||
if (parent != nullptr) {
|
||||
if (parent) {
|
||||
[_parentNodes setObject:parent forKey:parent.nodeTag];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onDetachedFromNode:(RCTAnimatedNode *)parent
|
||||
{
|
||||
if (_parentNodes == nullptr) {
|
||||
if (!_parentNodes) {
|
||||
return;
|
||||
}
|
||||
if (parent != nullptr) {
|
||||
if (parent) {
|
||||
[_parentNodes removeObjectForKey:parent.nodeTag];
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -86,7 +86,7 @@ NSString *RCTInterpolateString(
|
||||
|
||||
- (instancetype)initWithTag:(NSNumber *)tag config:(NSDictionary<NSString *, id> *)config
|
||||
{
|
||||
if ((self = [super initWithTag:tag config:config]) != nullptr) {
|
||||
if ((self = [super initWithTag:tag config:config])) {
|
||||
_inputRange = config[@"inputRange"];
|
||||
|
||||
NSArray *outputRangeConfig = config[@"outputRange"];
|
||||
@@ -104,7 +104,7 @@ NSString *RCTInterpolateString(
|
||||
switch (_outputType) {
|
||||
case RCTInterpolationOutputColor: {
|
||||
UIColor *color = [RCTConvert UIColor:value];
|
||||
[outputRange addObject:(color != nullptr) ? color : [UIColor whiteColor]];
|
||||
[outputRange addObject:color ? color : [UIColor whiteColor]];
|
||||
break;
|
||||
}
|
||||
case RCTInterpolationOutputString:
|
||||
@@ -141,7 +141,7 @@ NSString *RCTInterpolateString(
|
||||
- (void)performUpdate
|
||||
{
|
||||
[super performUpdate];
|
||||
if (_parentNode == nullptr) {
|
||||
if (!_parentNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ NSString *const NODE_TAG_KEY = @"nodeTag";
|
||||
if ([value isKindOfClass:[NSDictionary class]]) {
|
||||
NSDictionary<NSString *, id> *dict = (NSDictionary *)value;
|
||||
id nodeTag = [dict objectForKey:NODE_TAG_KEY];
|
||||
if ((nodeTag != nullptr) && [nodeTag isKindOfClass:[NSNumber class]]) {
|
||||
if (nodeTag && [nodeTag isKindOfClass:[NSNumber class]]) {
|
||||
RCTAnimatedNode *node = [self.parentNodes objectForKey:(NSNumber *)nodeTag];
|
||||
if ([node isKindOfClass:[RCTValueAnimatedNode class]]) {
|
||||
RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)node;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
- (instancetype)initWithTag:(NSNumber *)tag config:(NSDictionary<NSString *, id> *)config
|
||||
{
|
||||
if ((self = [super initWithTag:tag config:config]) != nullptr) {
|
||||
if ((self = [super initWithTag:tag config:config])) {
|
||||
_propsDictionary = [NSMutableDictionary new];
|
||||
}
|
||||
return self;
|
||||
@@ -36,11 +36,11 @@
|
||||
NSDictionary<NSString *, NSNumber *> *style = self.config[@"style"];
|
||||
[style enumerateKeysAndObjectsUsingBlock:^(NSString *property, NSNumber *nodeTag, __unused BOOL *stop) {
|
||||
RCTAnimatedNode *node = [self.parentNodes objectForKey:nodeTag];
|
||||
if (node != nullptr) {
|
||||
if (node) {
|
||||
if ([node isKindOfClass:[RCTValueAnimatedNode class]]) {
|
||||
RCTValueAnimatedNode *valueAnimatedNode = (RCTValueAnimatedNode *)node;
|
||||
id animatedObject = valueAnimatedNode.animatedObject;
|
||||
if (animatedObject != nullptr) {
|
||||
if (animatedObject) {
|
||||
_propsDictionary[property] = animatedObject;
|
||||
} else {
|
||||
_propsDictionary[property] = @(valueAnimatedNode.value);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
- (instancetype)initWithTag:(NSNumber *)tag config:(NSDictionary<NSString *, id> *)config
|
||||
{
|
||||
if ((self = [super initWithTag:tag config:config]) != nullptr) {
|
||||
if ((self = [super initWithTag:tag config:config])) {
|
||||
_animationId = config[@"animationId"];
|
||||
_toValueNodeTag = config[@"toValue"];
|
||||
_valueNodeTag = config[@"value"];
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
- (instancetype)initWithTag:(NSNumber *)tag config:(NSDictionary<NSString *, id> *)config
|
||||
{
|
||||
if ((self = [super initWithTag:tag config:config]) != nullptr) {
|
||||
if ((self = [super initWithTag:tag config:config])) {
|
||||
_propsDictionary = [NSMutableDictionary new];
|
||||
}
|
||||
return self;
|
||||
|
||||
@@ -59,7 +59,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
- (instancetype)initWithBridge:(nullable RCTBridge *)bridge
|
||||
surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter
|
||||
{
|
||||
if ((self = [super init]) != nullptr) {
|
||||
if ((self = [super init])) {
|
||||
_bridge = bridge;
|
||||
_surfacePresenter = surfacePresenter;
|
||||
_animationNodes = [NSMutableDictionary new];
|
||||
@@ -72,7 +72,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
- (BOOL)isNodeManagedByFabric:(NSNumber *)tag
|
||||
{
|
||||
RCTAnimatedNode *node = _animationNodes[tag];
|
||||
if (node != nullptr) {
|
||||
if (node) {
|
||||
return [node isManagedByFabric];
|
||||
}
|
||||
return false;
|
||||
@@ -106,7 +106,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
NSString *nodeType = [RCTConvert NSString:config[@"type"]];
|
||||
|
||||
Class nodeClass = map[nodeType];
|
||||
if (nodeClass == nullptr) {
|
||||
if (!nodeClass) {
|
||||
RCTLogError(@"Animated node type %@ not supported natively", nodeType);
|
||||
return;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
- (void)dropAnimatedNode:(NSNumber *)tag
|
||||
{
|
||||
RCTAnimatedNode *node = _animationNodes[tag];
|
||||
if (node != nullptr) {
|
||||
if (node) {
|
||||
[node detachNode];
|
||||
[_animationNodes removeObjectForKey:tag];
|
||||
}
|
||||
@@ -345,7 +345,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
NSNumber *nodeTag = [RCTConvert NSNumber:eventMapping[@"animatedValueTag"]];
|
||||
RCTAnimatedNode *node = _animationNodes[nodeTag];
|
||||
|
||||
if (node == nullptr) {
|
||||
if (!node) {
|
||||
RCTLogError(@"Animated node with tag %@ does not exist", nodeTag);
|
||||
return;
|
||||
}
|
||||
@@ -407,7 +407,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
|
||||
NSString *key = [NSString stringWithFormat:@"%@%@", event.viewTag, RCTNormalizeAnimatedEventName(event.eventName)];
|
||||
NSMutableArray<RCTEventAnimation *> *driversForKey = _eventDrivers[key];
|
||||
if (driversForKey != nullptr) {
|
||||
if (driversForKey) {
|
||||
for (RCTEventAnimation *driver in driversForKey) {
|
||||
[self stopAnimationsForNode:driver.valueNode];
|
||||
[driver updateWithEvent:event];
|
||||
@@ -439,7 +439,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
|
||||
- (void)startAnimationLoopIfNeeded
|
||||
{
|
||||
if ((_displayLink == nullptr) && _activeAnimations.count > 0) {
|
||||
if (!_displayLink && _activeAnimations.count > 0) {
|
||||
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(stepAnimations:)];
|
||||
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
|
||||
}
|
||||
@@ -454,7 +454,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
|
||||
- (void)stopAnimationLoop
|
||||
{
|
||||
if (_displayLink != nullptr) {
|
||||
if (_displayLink) {
|
||||
[_displayLink invalidate];
|
||||
_displayLink = nil;
|
||||
}
|
||||
@@ -486,7 +486,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
||||
NSArray<RCTEventAnimation *> *eventAnimations = _eventDrivers[key];
|
||||
for (RCTEventAnimation *animation in eventAnimations) {
|
||||
NSNumber *nodeTag = [animation.valueNode nodeTag];
|
||||
if (nodeTag != nullptr) {
|
||||
if (nodeTag) {
|
||||
[tags addObject:nodeTag];
|
||||
}
|
||||
for (NSNumber *childNodeKey in [animation.valueNode childNodes]) {
|
||||
|
||||
@@ -25,7 +25,7 @@ RCT_EXPORT_MODULE()
|
||||
- (void)invalidate
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
||||
if (_queue != nullptr) {
|
||||
if (_queue) {
|
||||
for (NSOperation *operation in _queue.operations) {
|
||||
if (!operation.isCancelled && !operation.isFinished) {
|
||||
[operation cancel];
|
||||
@@ -44,7 +44,7 @@ RCT_EXPORT_MODULE()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
||||
// Lazy setup
|
||||
if (_queue == nullptr) {
|
||||
if (!_queue) {
|
||||
_queue = [NSOperationQueue new];
|
||||
_queue.maxConcurrentOperationCount = 2;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ RCT_EXPORT_MODULE()
|
||||
// Get mime type
|
||||
NSRange firstSemicolon = [request.URL.resourceSpecifier rangeOfString:@";"];
|
||||
NSString *mimeType =
|
||||
(firstSemicolon.length != 0u) ? [request.URL.resourceSpecifier substringToIndex:firstSemicolon.location] : nil;
|
||||
firstSemicolon.length ? [request.URL.resourceSpecifier substringToIndex:firstSemicolon.location] : nil;
|
||||
|
||||
// Send response
|
||||
NSURLResponse *response = [[NSURLResponse alloc] initWithURL:request.URL
|
||||
@@ -72,7 +72,7 @@ RCT_EXPORT_MODULE()
|
||||
// Load data
|
||||
NSError *error;
|
||||
NSData *data = [NSData dataWithContentsOfURL:request.URL options:NSDataReadingMappedIfSafe error:&error];
|
||||
if (data != nullptr) {
|
||||
if (data) {
|
||||
[delegate URLRequest:strongOp didReceiveData:data];
|
||||
}
|
||||
[delegate URLRequest:strongOp didCompleteWithError:error];
|
||||
|
||||
@@ -46,7 +46,7 @@ RCT_EXPORT_MODULE()
|
||||
- (BOOL)isValid
|
||||
{
|
||||
// if session == nil and delegates != nil, we've been invalidated
|
||||
return (_session != nullptr) || (_delegates == nullptr);
|
||||
return _session || !_delegates;
|
||||
}
|
||||
|
||||
#pragma mark - NSURLRequestHandler
|
||||
@@ -67,7 +67,7 @@ RCT_EXPORT_MODULE()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
// Lazy setup
|
||||
if ((_session == nullptr) && [self isValid]) {
|
||||
if (!_session && [self isValid]) {
|
||||
// You can override default NSURLSession instance property allowsCellularAccess (default value YES)
|
||||
// by providing the following key to your RN project (edit ios/project/Info.plist file in Xcode):
|
||||
// <key>ReactNetworkForceWifiOnly</key> <true/>
|
||||
@@ -80,12 +80,12 @@ RCT_EXPORT_MODULE()
|
||||
callbackQueue.maxConcurrentOperationCount = 1;
|
||||
callbackQueue.underlyingQueue = [[_moduleRegistry moduleForName:"Networking"] methodQueue];
|
||||
NSURLSessionConfiguration *configuration;
|
||||
if (urlSessionConfigurationProvider != nullptr) {
|
||||
if (urlSessionConfigurationProvider) {
|
||||
configuration = urlSessionConfigurationProvider();
|
||||
} else {
|
||||
configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
// Set allowsCellularAccess to NO ONLY if key ReactNetworkForceWifiOnly exists AND its value is YES
|
||||
if (useWifiOnly != nullptr) {
|
||||
if (useWifiOnly) {
|
||||
configuration.allowsCellularAccess = ![useWifiOnly boolValue];
|
||||
}
|
||||
[configuration setHTTPShouldSetCookies:YES];
|
||||
|
||||
@@ -649,6 +649,8 @@ class XMLHttpRequest extends EventTarget {
|
||||
this._url,
|
||||
this._headers,
|
||||
data,
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
nativeResponseType,
|
||||
incrementalEvents,
|
||||
this.timeout,
|
||||
|
||||
@@ -39,7 +39,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (instancetype)initWithUserDefaults:(NSUserDefaults *)defaults
|
||||
{
|
||||
if ((self = [super init]) != nullptr) {
|
||||
if ((self = [super init])) {
|
||||
_defaults = defaults;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
@@ -84,7 +84,7 @@ RCT_EXPORT_METHOD(setValues : (NSDictionary *)values)
|
||||
_ignoringUpdates = YES;
|
||||
[values enumerateKeysAndObjectsUsingBlock:^(NSString *key, id json, BOOL *stop) {
|
||||
id plist = [RCTConvert NSPropertyList:json];
|
||||
if (plist != nullptr) {
|
||||
if (plist) {
|
||||
[self->_defaults setObject:plist forKey:key];
|
||||
} else {
|
||||
[self->_defaults removeObjectForKey:key];
|
||||
|
||||
+5
-1
@@ -41,7 +41,11 @@ export function testBadCompose() {
|
||||
(StyleSheet.compose(textStyle, textStyle): ImageStyleProp);
|
||||
|
||||
// $FlowExpectedError[incompatible-type] - Incompatible type.
|
||||
(StyleSheet.compose([textStyle], null): ImageStyleProp);
|
||||
(StyleSheet.compose(
|
||||
// $FlowExpectedError - Incompatible type.
|
||||
[textStyle],
|
||||
null,
|
||||
): ImageStyleProp);
|
||||
|
||||
// $FlowExpectedError[incompatible-type] - Incompatible type.
|
||||
(StyleSheet.compose(
|
||||
|
||||
@@ -141,7 +141,7 @@ RCT_EXPORT_METHOD(setTextAndSelection
|
||||
RCTExecuteOnUIManagerQueue(^{
|
||||
RCTBaseTextInputShadowView *shadowView =
|
||||
(RCTBaseTextInputShadowView *)[self.bridge.uiManager shadowViewForReactTag:viewTag];
|
||||
if (value != nullptr) {
|
||||
if (value) {
|
||||
[shadowView setText:value];
|
||||
}
|
||||
[self.bridge.uiManager setNeedsLayout];
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
+ (instancetype)newWithUnsafeDictionary:(NSDictionary<NSString *, id> *)dictionary
|
||||
{
|
||||
_RCTTypedModuleConstants *constants = [self new];
|
||||
if (constants != nullptr) {
|
||||
if (constants) {
|
||||
constants->_dictionary = dictionary;
|
||||
}
|
||||
return constants;
|
||||
|
||||
@@ -304,6 +304,13 @@ let reactIdleCallbacksNativeModule = RNTarget(
|
||||
dependencies: [.reactNativeDependencies, .reactDebug, .reactFeatureFlags, .reactUtils, .reactPerfLogger, .reactCxxReact, .reactTurboModuleCore]
|
||||
)
|
||||
|
||||
/// React-webperformance.podspec
|
||||
let reactWebPerformanceNativeModule = RNTarget(
|
||||
name: .reactWebPerformanceNativeModule,
|
||||
path: "ReactCommon/react/nativemodule/webperformance",
|
||||
dependencies: [.reactNativeDependencies, .reactCxxReact, .reactTurboModuleCore, .reactPerformanceTimeline]
|
||||
)
|
||||
|
||||
/// React-featureflagnativemodule.podspec
|
||||
let reactFeatureflagsNativemodule = RNTarget(
|
||||
name: .reactFeatureflagsNativemodule,
|
||||
@@ -590,6 +597,7 @@ let targets = [
|
||||
reactTurboModuleCoreDefaults,
|
||||
reactTurboModuleCoreMicrotasks,
|
||||
reactIdleCallbacksNativeModule,
|
||||
reactWebPerformanceNativeModule,
|
||||
reactFeatureflagsNativemodule,
|
||||
reactNativeModuleDom,
|
||||
reactAppDelegate,
|
||||
@@ -764,6 +772,7 @@ extension String {
|
||||
static let reactTurboModuleCoreDefaults = "ReactCommon/turbomodule/core/defaults"
|
||||
static let reactTurboModuleCoreMicrotasks = "ReactCommon/turbomodule/core/microtasks"
|
||||
static let reactIdleCallbacksNativeModule = "React-idlecallbacksnativemodule"
|
||||
static let reactWebPerformanceNativeModule = "React-webperformancenativemodule"
|
||||
static let reactFeatureflagsNativemodule = "React-featureflagsnativemodule"
|
||||
static let reactNativeModuleDom = "React-domnativemodule"
|
||||
static let reactAppDelegate = "React-RCTAppDelegate"
|
||||
|
||||
@@ -380,6 +380,11 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
|
||||
moduleProvider:(RCTBridgeModuleListProvider)block
|
||||
launchOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
// Only enabld this assertion in OSS
|
||||
#if COCOAPODS
|
||||
[RCTBridge throwIfOnLegacyArch];
|
||||
#endif
|
||||
|
||||
if (self = [super init]) {
|
||||
RCTEnforceNewArchitectureValidation(RCTNotAllowedInBridgeless, self, nil);
|
||||
_delegate = delegate;
|
||||
@@ -393,6 +398,17 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
// Wrap the exception throwing in a static method to avoid the warning: "The code following the exception will never be
|
||||
// executed". This might create build failures internally where we treat warnings as errors.
|
||||
+ (void)throwIfOnLegacyArch
|
||||
{
|
||||
@throw [NSException
|
||||
exceptionWithName:NSInternalInconsistencyException
|
||||
reason:
|
||||
@"You are trying to initialize the legacy architecture. This is not supported anymore and will be removed in the next version of React Native. Please use the New Architecture instead."
|
||||
userInfo:nil];
|
||||
}
|
||||
|
||||
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||
|
||||
- (void)dealloc
|
||||
|
||||
@@ -53,7 +53,7 @@ using namespace facebook;
|
||||
launchOptions:(nullable NSDictionary *)launchOptions
|
||||
{
|
||||
self = [super self];
|
||||
if (self != nullptr) {
|
||||
if (self) {
|
||||
_uiManagerProxy = [[RCTUIManagerProxy alloc] initWithViewRegistry:viewRegistry];
|
||||
_moduleRegistry = moduleRegistry;
|
||||
_bundleManager = bundleManager;
|
||||
@@ -75,7 +75,7 @@ using namespace facebook;
|
||||
|
||||
if (queue == RCTJSThread) {
|
||||
_dispatchToJSThread(block);
|
||||
} else if (queue != nullptr) {
|
||||
} else if (queue) {
|
||||
dispatch_async(queue, block);
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,7 @@ using namespace facebook;
|
||||
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
|
||||
{
|
||||
self = [super self];
|
||||
if (self != nullptr) {
|
||||
if (self) {
|
||||
_viewRegistry = viewRegistry;
|
||||
_legacyViewRegistry = [NSMutableDictionary new];
|
||||
}
|
||||
@@ -443,8 +443,8 @@ using namespace facebook;
|
||||
{
|
||||
[self logWarning:@"Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
|
||||
cmd:_cmd];
|
||||
UIView *view = ([_viewRegistry viewForReactTag:reactTag] != nullptr) ? [_viewRegistry viewForReactTag:reactTag]
|
||||
: [_legacyViewRegistry objectForKey:reactTag];
|
||||
UIView *view = [_viewRegistry viewForReactTag:reactTag] ? [_viewRegistry viewForReactTag:reactTag]
|
||||
: [_legacyViewRegistry objectForKey:reactTag];
|
||||
return RCTPaperViewOrCurrentView(view);
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ using namespace facebook;
|
||||
__weak __typeof(self) weakSelf = self;
|
||||
RCTExecuteOnMainQueue(^{
|
||||
__typeof(self) strongSelf = weakSelf;
|
||||
if (strongSelf != nullptr) {
|
||||
if (strongSelf) {
|
||||
RCTUIManager *proxiedManager = (RCTUIManager *)strongSelf;
|
||||
RCTComposedViewRegistry *composedViewRegistry =
|
||||
[[RCTComposedViewRegistry alloc] initWithUIManager:proxiedManager
|
||||
|
||||
@@ -21,9 +21,9 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(1000),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(82),
|
||||
RCTVersionPatch: @(1),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
});
|
||||
|
||||
+4
-4
@@ -18,17 +18,17 @@ void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
|
||||
*minimumSize = CGSizeZero;
|
||||
*maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
|
||||
|
||||
if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) != 0) {
|
||||
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {
|
||||
minimumSize->width = size.width;
|
||||
maximumSize->width = size.width;
|
||||
} else if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) != 0) {
|
||||
} else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {
|
||||
maximumSize->width = size.width;
|
||||
}
|
||||
|
||||
if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) != 0) {
|
||||
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {
|
||||
minimumSize->height = size.height;
|
||||
maximumSize->height = size.height;
|
||||
} else if ((sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) != 0) {
|
||||
} else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {
|
||||
maximumSize->height = size.height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ using namespace facebook::react;
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nullptr) {
|
||||
if (self) {
|
||||
_alertControllers = [NSMutableArray new];
|
||||
}
|
||||
return self;
|
||||
@@ -53,7 +53,7 @@ RCT_EXPORT_MODULE()
|
||||
alertController.modalPresentationStyle = UIModalPresentationPopover;
|
||||
UIView *sourceView = parentViewController.view;
|
||||
|
||||
if (anchorViewTag != nullptr) {
|
||||
if (anchorViewTag) {
|
||||
sourceView = [self.viewRegistry_DEPRECATED viewForReactTag:anchorViewTag];
|
||||
} else {
|
||||
alertController.popoverPresentationController.permittedArrowDirections = 0;
|
||||
@@ -166,12 +166,12 @@ RCT_EXPORT_METHOD(showActionSheetWithOptions
|
||||
index++;
|
||||
}
|
||||
|
||||
if (disabledButtonIndices != nullptr) {
|
||||
if (disabledButtonIndices) {
|
||||
for (NSNumber *disabledButtonIndex in disabledButtonIndices) {
|
||||
if ([disabledButtonIndex integerValue] < buttons.count) {
|
||||
UIAlertAction *action = alertController.actions[[disabledButtonIndex integerValue]];
|
||||
[action setEnabled:false];
|
||||
if (disabledButtonTintColor != nullptr) {
|
||||
if (disabledButtonTintColor) {
|
||||
[action setValue:disabledButtonTintColor forKey:@"titleTextColor"];
|
||||
}
|
||||
} else {
|
||||
@@ -235,14 +235,14 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions
|
||||
UIColor *tintColor = [RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (message != nullptr) {
|
||||
if (message) {
|
||||
[items addObject:message];
|
||||
}
|
||||
if (URL != nullptr) {
|
||||
if (URL) {
|
||||
if ([URL.scheme.lowercaseString isEqualToString:@"data"]) {
|
||||
NSError *error;
|
||||
NSData *data = [NSData dataWithContentsOfURL:URL options:(NSDataReadingOptions)0 error:&error];
|
||||
if (data == nullptr) {
|
||||
if (!data) {
|
||||
failureCallback(@[ RCTJSErrorFromNSError(error) ]);
|
||||
return;
|
||||
}
|
||||
@@ -258,17 +258,17 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions
|
||||
|
||||
UIActivityViewController *shareController = [[UIActivityViewController alloc] initWithActivityItems:items
|
||||
applicationActivities:nil];
|
||||
if (subject != nullptr) {
|
||||
if (subject) {
|
||||
[shareController setValue:subject forKey:@"subject"];
|
||||
}
|
||||
if (excludedActivityTypes != nullptr) {
|
||||
if (excludedActivityTypes) {
|
||||
shareController.excludedActivityTypes = excludedActivityTypes;
|
||||
}
|
||||
|
||||
UIViewController *controller = RCTPresentedViewController();
|
||||
shareController.completionWithItemsHandler =
|
||||
^(NSString *activityType, BOOL completed, __unused NSArray *returnedItems, NSError *activityError) {
|
||||
if (activityError != nullptr) {
|
||||
if (activityError) {
|
||||
failureCallback(@[ RCTJSErrorFromNSError(activityError) ]);
|
||||
} else if (completed || activityType == nil) {
|
||||
successCallback(@[ @(completed), RCTNullIfNil(activityType) ]);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
_alertWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
|
||||
}
|
||||
|
||||
if (_alertWindow != nullptr) {
|
||||
if (_alertWindow) {
|
||||
_alertWindow.rootViewController = [UIViewController new];
|
||||
_alertWindow.windowLevel = UIWindowLevelAlert + 1;
|
||||
}
|
||||
@@ -41,7 +41,7 @@
|
||||
UIUserInterfaceStyle style = self.overrideUserInterfaceStyle;
|
||||
if (style == UIUserInterfaceStyleUnspecified) {
|
||||
UIUserInterfaceStyle overriddenStyle = RCTKeyWindow().overrideUserInterfaceStyle;
|
||||
style = (overriddenStyle != 0) ? overriddenStyle : UIUserInterfaceStyleUnspecified;
|
||||
style = overriddenStyle ? overriddenStyle : UIUserInterfaceStyleUnspecified;
|
||||
}
|
||||
|
||||
self.overrideUserInterfaceStyle = style;
|
||||
|
||||
@@ -86,7 +86,7 @@ RCT_EXPORT_METHOD(alertWithArgs : (JS::NativeAlertManager::Args &)args callback
|
||||
UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()];
|
||||
UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];
|
||||
|
||||
if ((title == nullptr) && (message == nullptr)) {
|
||||
if (!title && !message) {
|
||||
RCTLogError(@"Must specify either an alert title, or message, or both");
|
||||
return;
|
||||
}
|
||||
@@ -193,7 +193,7 @@ RCT_EXPORT_METHOD(alertWithArgs : (JS::NativeAlertManager::Args &)args callback
|
||||
}
|
||||
}
|
||||
|
||||
if (self->_alertControllers == nullptr) {
|
||||
if (!self->_alertControllers) {
|
||||
self->_alertControllers = [NSHashTable weakObjectsHashTable];
|
||||
}
|
||||
[self->_alertControllers addObject:alertController];
|
||||
|
||||
@@ -47,7 +47,7 @@ NSString *const RCTShowDevMenuNotification = @"RCTShowDevMenuNotification";
|
||||
|
||||
- (instancetype)initWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock handler:(dispatch_block_t)handler
|
||||
{
|
||||
if ((self = [super init]) != nullptr) {
|
||||
if ((self = [super init])) {
|
||||
_titleBlock = [titleBlock copy];
|
||||
_handler = [handler copy];
|
||||
}
|
||||
@@ -72,14 +72,14 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
||||
|
||||
- (void)callHandler
|
||||
{
|
||||
if (_handler != nullptr) {
|
||||
if (_handler) {
|
||||
_handler();
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)title
|
||||
{
|
||||
if (_titleBlock != nullptr) {
|
||||
if (_titleBlock) {
|
||||
return _titleBlock();
|
||||
}
|
||||
return nil;
|
||||
@@ -120,7 +120,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if ((self = [super init]) != nullptr) {
|
||||
if ((self = [super init])) {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(showOnShake)
|
||||
name:RCTShowDevMenuNotification
|
||||
@@ -214,7 +214,7 @@ RCT_EXPORT_MODULE()
|
||||
if (_actionSheet.isBeingPresented || _actionSheet.beingDismissed) {
|
||||
return;
|
||||
}
|
||||
if (_actionSheet != nullptr) {
|
||||
if (_actionSheet) {
|
||||
[_actionSheet dismissViewControllerAnimated:YES
|
||||
completion:^(void) {
|
||||
self->_actionSheet = nil;
|
||||
@@ -379,7 +379,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
RCT_EXPORT_METHOD(show)
|
||||
{
|
||||
if ((_actionSheet != nullptr) || RCTRunningInAppExtension()) {
|
||||
if (_actionSheet || RCTRunningInAppExtension()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ RCT_EXPORT_METHOD(show)
|
||||
- (RCTDevMenuAlertActionHandler)alertActionHandlerForDevItem:(RCTDevMenuItem *__nullable)item
|
||||
{
|
||||
return ^(__unused UIAlertAction *action) {
|
||||
if (item != nullptr) {
|
||||
if (item) {
|
||||
[item callHandler];
|
||||
}
|
||||
|
||||
|
||||
@@ -71,14 +71,12 @@ RCT_EXPORT_MODULE()
|
||||
{
|
||||
[_callableJSModules invokeModule:@"RCTNativeAppEventEmitter"
|
||||
method:@"emit"
|
||||
withArgs:(body != nullptr) ? @[ name, body ] : @[ name ]];
|
||||
withArgs:body ? @[ name, body ] : @[ name ]];
|
||||
}
|
||||
|
||||
- (void)sendDeviceEventWithName:(NSString *)name body:(id)body
|
||||
{
|
||||
[_callableJSModules invokeModule:@"RCTDeviceEventEmitter"
|
||||
method:@"emit"
|
||||
withArgs:(body != nullptr) ? @[ name, body ] : @[ name ]];
|
||||
[_callableJSModules invokeModule:@"RCTDeviceEventEmitter" method:@"emit" withArgs:body ? @[ name, body ] : @[ name ]];
|
||||
}
|
||||
|
||||
- (void)sendTextEventWithType:(RCTTextEventType)type
|
||||
@@ -93,13 +91,13 @@ RCT_EXPORT_MODULE()
|
||||
@"eventCount" : @(eventCount),
|
||||
}];
|
||||
|
||||
if (text != nullptr) {
|
||||
if (text) {
|
||||
// We copy the string here because if it's a mutable string it may get released before we dispatch the event on a
|
||||
// different thread, causing a crash.
|
||||
body[@"text"] = [text copy];
|
||||
}
|
||||
|
||||
if (key != nullptr) {
|
||||
if (key) {
|
||||
if (key.length == 0) {
|
||||
key = @"Backspace"; // backspace
|
||||
} else {
|
||||
@@ -144,7 +142,7 @@ RCT_EXPORT_MODULE()
|
||||
if (event.canCoalesce) {
|
||||
eventID = RCTGetEventID(event.viewTag, event.eventName, event.coalescingKey);
|
||||
id<RCTEvent> previousEvent = _events[eventID];
|
||||
if (previousEvent != nullptr) {
|
||||
if (previousEvent) {
|
||||
event = [previousEvent coalesceWithEvent:event];
|
||||
} else {
|
||||
[_eventQueue addObject:eventID];
|
||||
@@ -175,13 +173,13 @@ RCT_EXPORT_MODULE()
|
||||
[_eventQueueLock unlock];
|
||||
|
||||
if (scheduleEventsDispatch) {
|
||||
if (_bridge != nullptr) {
|
||||
if (_bridge) {
|
||||
[_bridge
|
||||
dispatchBlock:^{
|
||||
[self flushEventsQueue];
|
||||
}
|
||||
queue:RCTJSThread];
|
||||
} else if (_dispatchToJSThread != nullptr) {
|
||||
} else if (_dispatchToJSThread) {
|
||||
_dispatchToJSThread(^{
|
||||
[self flushEventsQueue];
|
||||
});
|
||||
@@ -238,7 +236,7 @@ RCT_EXPORT_MODULE()
|
||||
{
|
||||
NSDictionary *userInfo = notification.userInfo;
|
||||
id<RCTEvent> event = [userInfo objectForKey:@"event"];
|
||||
if (event != nullptr) {
|
||||
if (event) {
|
||||
[self notifyObserversOfEvent:event];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (instancetype)initWithDelegate:(id<RCTExceptionsManagerDelegate>)delegate
|
||||
{
|
||||
if ((self = [self init]) != nullptr) {
|
||||
if ((self = [self init])) {
|
||||
_delegate = delegate;
|
||||
}
|
||||
return self;
|
||||
@@ -46,7 +46,7 @@ RCT_EXPORT_MODULE()
|
||||
[redbox showErrorMessage:message withStack:stack errorCookie:(int)exceptionId];
|
||||
}
|
||||
|
||||
if (_delegate != nullptr) {
|
||||
if (_delegate) {
|
||||
[_delegate handleSoftJSExceptionWithMessage:message
|
||||
stack:stack
|
||||
exceptionId:[NSNumber numberWithDouble:exceptionId]
|
||||
@@ -64,7 +64,7 @@ RCT_EXPORT_MODULE()
|
||||
[redbox showErrorMessage:message withStack:stack errorCookie:(int)exceptionId];
|
||||
}
|
||||
|
||||
if (_delegate != nullptr) {
|
||||
if (_delegate) {
|
||||
[_delegate handleFatalJSExceptionWithMessage:message
|
||||
stack:stack
|
||||
exceptionId:[NSNumber numberWithDouble:exceptionId]
|
||||
@@ -107,13 +107,13 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
|
||||
{
|
||||
NSMutableDictionary<NSString *, id> *mutableErrorData = [NSMutableDictionary new];
|
||||
mutableErrorData[@"message"] = data.message();
|
||||
if (data.originalMessage() != nullptr) {
|
||||
if (data.originalMessage()) {
|
||||
mutableErrorData[@"originalMessage"] = data.originalMessage();
|
||||
}
|
||||
if (data.name() != nullptr) {
|
||||
if (data.name()) {
|
||||
mutableErrorData[@"name"] = data.name();
|
||||
}
|
||||
if (data.componentStack() != nullptr) {
|
||||
if (data.componentStack()) {
|
||||
mutableErrorData[@"componentStack"] = data.componentStack();
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
|
||||
mutableErrorData[@"id"] = @(data.id_());
|
||||
mutableErrorData[@"isFatal"] = @(data.isFatal());
|
||||
|
||||
if (data.extraData() != nullptr) {
|
||||
if (data.extraData()) {
|
||||
mutableErrorData[@"extraData"] = data.extraData();
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame color:(UIColor *)color
|
||||
{
|
||||
if ((self = [super initWithFrame:frame]) != nullptr) {
|
||||
if ((self = [super initWithFrame:frame])) {
|
||||
_frameCount = -1;
|
||||
_prevTime = -1;
|
||||
_maxFPS = 0;
|
||||
@@ -64,7 +64,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
||||
|
||||
- (CAShapeLayer *)graph
|
||||
{
|
||||
if (_graph == nullptr) {
|
||||
if (!_graph) {
|
||||
_graph = [CAShapeLayer new];
|
||||
_graph.frame = self.bounds;
|
||||
_graph.backgroundColor = [_color colorWithAlphaComponent:0.2].CGColor;
|
||||
@@ -76,7 +76,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
||||
|
||||
- (UILabel *)label
|
||||
{
|
||||
if (_label == nullptr) {
|
||||
if (!_label) {
|
||||
_label = [[UILabel alloc] initWithFrame:self.bounds];
|
||||
_label.font = [UIFont boldSystemFontOfSize:13];
|
||||
_label.textAlignment = NSTextAlignmentCenter;
|
||||
|
||||
@@ -45,23 +45,23 @@ RCT_EXPORT_METHOD(show)
|
||||
__weak RCTLogBox *weakSelf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
__strong RCTLogBox *strongSelf = weakSelf;
|
||||
if (strongSelf == nullptr) {
|
||||
if (!strongSelf) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strongSelf->_view != nullptr) {
|
||||
if (strongSelf->_view) {
|
||||
[strongSelf->_view show];
|
||||
return;
|
||||
}
|
||||
|
||||
if (strongSelf->_bridgelessSurfacePresenter != nullptr) {
|
||||
if (strongSelf->_bridgelessSurfacePresenter) {
|
||||
strongSelf->_view = [[RCTLogBoxView alloc] initWithWindow:RCTKeyWindow()
|
||||
surfacePresenter:strongSelf->_bridgelessSurfacePresenter];
|
||||
[strongSelf->_view show];
|
||||
}
|
||||
#ifndef RCT_FIT_RM_OLD_RUNTIME
|
||||
else if ((strongSelf->_bridge != nullptr) && strongSelf->_bridge.valid) {
|
||||
if (strongSelf->_bridge.surfacePresenter != nullptr) {
|
||||
else if (strongSelf->_bridge && strongSelf->_bridge.valid) {
|
||||
if (strongSelf->_bridge.surfacePresenter) {
|
||||
strongSelf->_view = [[RCTLogBoxView alloc] initWithWindow:RCTKeyWindow()
|
||||
surfacePresenter:strongSelf->_bridge.surfacePresenter];
|
||||
} else {
|
||||
@@ -80,7 +80,7 @@ RCT_EXPORT_METHOD(hide)
|
||||
__weak RCTLogBox *weakSelf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
__strong RCTLogBox *strongSelf = weakSelf;
|
||||
if (strongSelf == nullptr) {
|
||||
if (!strongSelf) {
|
||||
return;
|
||||
}
|
||||
[strongSelf->_view setHidden:YES];
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if ((self = [super initWithFrame:frame]) != nullptr) {
|
||||
if ((self = [super initWithFrame:frame])) {
|
||||
self.windowLevel = UIWindowLevelStatusBar - 1;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ RCT_EXPORT_MODULE()
|
||||
#if __has_include(<React/RCTDevMenu.h>)
|
||||
- (RCTDevMenuItem *)devMenuItem
|
||||
{
|
||||
if (_devMenuItem == nullptr) {
|
||||
if (!_devMenuItem) {
|
||||
__weak __typeof__(self) weakSelf = self;
|
||||
__weak RCTDevSettings *devSettings = [self->_moduleRegistry moduleForName:"DevSettings"];
|
||||
if (devSettings.isPerfMonitorShown) {
|
||||
@@ -161,7 +161,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIPanGestureRecognizer *)gestureRecognizer
|
||||
{
|
||||
if (_gestureRecognizer == nullptr) {
|
||||
if (!_gestureRecognizer) {
|
||||
_gestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(gesture:)];
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UIView *)container
|
||||
{
|
||||
if (_container == nullptr) {
|
||||
if (!_container) {
|
||||
UIEdgeInsets safeInsets = RCTKeyWindow().safeAreaInsets;
|
||||
|
||||
_container =
|
||||
@@ -188,7 +188,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UILabel *)memory
|
||||
{
|
||||
if (_memory == nullptr) {
|
||||
if (!_memory) {
|
||||
_memory = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 44, RCTPerfMonitorBarHeight)];
|
||||
_memory.font = [UIFont systemFontOfSize:12];
|
||||
_memory.numberOfLines = 3;
|
||||
@@ -200,7 +200,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UILabel *)heap
|
||||
{
|
||||
if (_heap == nullptr) {
|
||||
if (!_heap) {
|
||||
_heap = [[UILabel alloc] initWithFrame:CGRectMake(44, 0, 44, RCTPerfMonitorBarHeight)];
|
||||
_heap.font = [UIFont systemFontOfSize:12];
|
||||
_heap.numberOfLines = 3;
|
||||
@@ -212,7 +212,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UILabel *)views
|
||||
{
|
||||
if (_views == nullptr) {
|
||||
if (!_views) {
|
||||
_views = [[UILabel alloc] initWithFrame:CGRectMake(88, 0, 44, RCTPerfMonitorBarHeight)];
|
||||
_views.font = [UIFont systemFontOfSize:12];
|
||||
_views.numberOfLines = 3;
|
||||
@@ -224,7 +224,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (RCTFPSGraph *)uiGraph
|
||||
{
|
||||
if (_uiGraph == nullptr) {
|
||||
if (!_uiGraph) {
|
||||
_uiGraph = [[RCTFPSGraph alloc] initWithFrame:CGRectMake(134, 14, 40, 30) color:[UIColor lightGrayColor]];
|
||||
}
|
||||
return _uiGraph;
|
||||
@@ -232,7 +232,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (RCTFPSGraph *)jsGraph
|
||||
{
|
||||
if (_jsGraph == nullptr) {
|
||||
if (!_jsGraph) {
|
||||
_jsGraph = [[RCTFPSGraph alloc] initWithFrame:CGRectMake(178, 14, 40, 30) color:[UIColor lightGrayColor]];
|
||||
}
|
||||
return _jsGraph;
|
||||
@@ -240,7 +240,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UILabel *)uiGraphLabel
|
||||
{
|
||||
if (_uiGraphLabel == nullptr) {
|
||||
if (!_uiGraphLabel) {
|
||||
_uiGraphLabel = [[UILabel alloc] initWithFrame:CGRectMake(134, 3, 40, 10)];
|
||||
_uiGraphLabel.font = [UIFont systemFontOfSize:11];
|
||||
_uiGraphLabel.textAlignment = NSTextAlignmentCenter;
|
||||
@@ -252,7 +252,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UILabel *)jsGraphLabel
|
||||
{
|
||||
if (_jsGraphLabel == nullptr) {
|
||||
if (!_jsGraphLabel) {
|
||||
_jsGraphLabel = [[UILabel alloc] initWithFrame:CGRectMake(178, 3, 38, 10)];
|
||||
_jsGraphLabel.font = [UIFont systemFontOfSize:11];
|
||||
_jsGraphLabel.textAlignment = NSTextAlignmentCenter;
|
||||
@@ -264,7 +264,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (UITableView *)metrics
|
||||
{
|
||||
if (_metrics == nullptr) {
|
||||
if (!_metrics) {
|
||||
_metrics = [[UITableView alloc] initWithFrame:CGRectMake(
|
||||
0,
|
||||
RCTPerfMonitorBarHeight,
|
||||
@@ -281,7 +281,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (void)show
|
||||
{
|
||||
if (_container != nullptr) {
|
||||
if (_container) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
- (void)hide
|
||||
{
|
||||
if (_container == nullptr) {
|
||||
if (!_container) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ RCT_EXPORT_MODULE()
|
||||
dispatch_io_set_low_water(_io, 20);
|
||||
|
||||
dispatch_io_read(_io, 0, SIZE_MAX, _queue, ^(__unused bool done, dispatch_data_t data, __unused int error) {
|
||||
if (data == nullptr) {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ RCT_EXPORT_MODULE()
|
||||
GCRegex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
|
||||
});
|
||||
|
||||
if (_remaining != nullptr) {
|
||||
if (_remaining) {
|
||||
log = [_remaining stringByAppendingString:log];
|
||||
_remaining = nil;
|
||||
}
|
||||
@@ -404,7 +404,7 @@ RCT_EXPORT_MODULE()
|
||||
|
||||
for (NSString *line in lines) {
|
||||
NSTextCheckingResult *match = [GCRegex firstMatchInString:line options:0 range:NSMakeRange(0, line.length)];
|
||||
if (match != nullptr) {
|
||||
if (match) {
|
||||
NSString *heapSizeStr = [line substringWithRange:[match rangeAtIndex:2]];
|
||||
_heapSize = [heapSizeStr integerValue];
|
||||
}
|
||||
@@ -417,7 +417,7 @@ RCT_EXPORT_MODULE()
|
||||
NSUInteger viewCount = views.count;
|
||||
NSUInteger visibleViewCount = 0;
|
||||
for (UIView *view in views.allValues) {
|
||||
if ((view.window != nullptr) || (view.superview.window != nullptr)) {
|
||||
if (view.window || view.superview.window) {
|
||||
visibleViewCount++;
|
||||
}
|
||||
}
|
||||
@@ -436,7 +436,7 @@ RCT_EXPORT_MODULE()
|
||||
__weak __typeof__(self) weakSelf = self;
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
__strong __typeof__(weakSelf) strongSelf = weakSelf;
|
||||
if ((strongSelf != nullptr) && (strongSelf->_container.superview != nullptr)) {
|
||||
if (strongSelf && strongSelf->_container.superview) {
|
||||
[strongSelf updateStats];
|
||||
}
|
||||
});
|
||||
@@ -512,7 +512,7 @@ RCT_EXPORT_MODULE()
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:RCTPerfMonitorCellIdentifier
|
||||
forIndexPath:indexPath];
|
||||
|
||||
if (cell == nullptr) {
|
||||
if (!cell) {
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
||||
reuseIdentifier:RCTPerfMonitorCellIdentifier];
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ void RCTMessageThread::runSync(std::function<void()> func)
|
||||
void RCTMessageThread::tryFunc(const std::function<void()> &func)
|
||||
{
|
||||
NSError *error = tryAndReturnError(func);
|
||||
if (error != nullptr) {
|
||||
if (error) {
|
||||
m_errorBlock(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class RCTObjcExecutor : public JSExecutor {
|
||||
: m_jse(jse), m_errorBlock(errorBlock), m_delegate(std::move(delegate)), m_jsThread(std::move(jsThread))
|
||||
{
|
||||
m_jsCallback = ^(id json, NSError *error) {
|
||||
if (error != nullptr) {
|
||||
if (error) {
|
||||
// Do not use "m_errorBlock" here as the bridge might be in the middle
|
||||
// of invalidation as a result of error handling and "this" can be
|
||||
// already deallocated.
|
||||
@@ -81,7 +81,7 @@ class RCTObjcExecutor : public JSExecutor {
|
||||
onComplete:^(NSError *error) {
|
||||
RCTProfileEndFlowEvent();
|
||||
|
||||
if (error != nullptr) {
|
||||
if (error) {
|
||||
m_errorBlock(error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ using namespace facebook::react;
|
||||
|
||||
- (instancetype)initWithCxxMethod:(const CxxModule::Method &)method
|
||||
{
|
||||
if ((self = [super init]) != nullptr) {
|
||||
if ((self = [super init])) {
|
||||
_method = std::make_unique<CxxModule::Method>(method);
|
||||
}
|
||||
return self;
|
||||
|
||||
@@ -76,7 +76,7 @@ folly::dynamic RCTNativeModule::getConstants()
|
||||
void RCTNativeModule::invoke(unsigned int methodId, folly::dynamic &¶ms, int callId)
|
||||
{
|
||||
id<RCTBridgeMethod> method = m_moduleData.methods[methodId];
|
||||
if (method != nullptr) {
|
||||
if (method) {
|
||||
RCT_PROFILE_BEGIN_EVENT(
|
||||
RCTProfileTagAlways,
|
||||
@"[RCTNativeModule invoke]",
|
||||
@@ -119,13 +119,13 @@ void RCTNativeModule::invoke(unsigned int methodId, folly::dynamic &¶ms, int
|
||||
if (isSyncModule) {
|
||||
block();
|
||||
BridgeNativeModulePerfLogger::syncMethodCallReturnConversionEnd(moduleName, methodName);
|
||||
} else if (queue != nullptr) {
|
||||
} else if (queue) {
|
||||
BridgeNativeModulePerfLogger::asyncMethodCallDispatch(moduleName, methodName);
|
||||
dispatch_async(queue, block);
|
||||
}
|
||||
|
||||
#ifdef RCT_DEV
|
||||
if (queue == nullptr) {
|
||||
if (!queue) {
|
||||
RCTLog(
|
||||
@"Attempted to invoke `%u` (method ID) on `%@` (NativeModule name) without a method queue.",
|
||||
methodId,
|
||||
@@ -153,7 +153,7 @@ static MethodCallResult invokeInner(
|
||||
int callId,
|
||||
SchedulingContext context)
|
||||
{
|
||||
if ((bridge == nullptr) || !bridge.valid || (moduleData == nullptr)) {
|
||||
if (!bridge || !bridge.valid || !moduleData) {
|
||||
if (context == Sync) {
|
||||
/**
|
||||
* NOTE: moduleName and methodName are "". This shouldn't be an issue because there can only be one ongoing sync
|
||||
@@ -166,7 +166,7 @@ static MethodCallResult invokeInner(
|
||||
}
|
||||
|
||||
id<RCTBridgeMethod> method = moduleData.methods[methodId];
|
||||
if (RCT_DEBUG && (method == nullptr)) {
|
||||
if (RCT_DEBUG && !method) {
|
||||
RCTLogError(@"Unknown methodID: %ud for module: %@", methodId, moduleData.name);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,14 +24,14 @@ static NSString *getServerHost(NSURL *bundleURL)
|
||||
{
|
||||
NSNumber *port = @8081;
|
||||
NSString *portStr = [[[NSProcessInfo processInfo] environment] objectForKey:@"RCT_METRO_PORT"];
|
||||
if ((portStr != nullptr) && [portStr length] > 0) {
|
||||
if (portStr && [portStr length] > 0) {
|
||||
port = [NSNumber numberWithInt:[portStr intValue]];
|
||||
}
|
||||
if ([bundleURL port] != nullptr) {
|
||||
if ([bundleURL port]) {
|
||||
port = [bundleURL port];
|
||||
}
|
||||
NSString *host = [bundleURL host];
|
||||
if (host == nullptr) {
|
||||
if (!host) {
|
||||
host = @"localhost";
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ static void sendEventToAllConnections(NSString *event)
|
||||
|
||||
NSString *key = [inspectorURL absoluteString];
|
||||
id<RCTInspectorPackagerConnectionProtocol> connection = socketConnections[key];
|
||||
if ((connection == nullptr) || !connection.isConnected) {
|
||||
if (!connection || !connection.isConnected) {
|
||||
connection = [[RCTCxxInspectorPackagerConnection alloc] initWithURL:inspectorURL];
|
||||
|
||||
socketConnections[key] = connection;
|
||||
|
||||
@@ -21,7 +21,7 @@ using ListenerBlock = void (^)(RCTInspectorNetworkListener *);
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nullptr) {
|
||||
if (self) {
|
||||
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||
self.session = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:nil];
|
||||
self.executorsByTaskId = [NSMutableDictionary new];
|
||||
@@ -63,7 +63,7 @@ using ListenerBlock = void (^)(RCTInspectorNetworkListener *);
|
||||
- (void)withListenerForTask:(NSURLSessionTask *)task execute:(ListenerBlock)block
|
||||
{
|
||||
void (^executor)(ListenerBlock) = self.executorsByTaskId[@(task.taskIdentifier)];
|
||||
if (executor != nullptr) {
|
||||
if (executor) {
|
||||
executor(block);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
if (_alertWindow == nil) {
|
||||
_alertWindow = [[UIWindow alloc] initWithWindowScene:RCTKeyWindow().windowScene];
|
||||
|
||||
if (_alertWindow != nullptr) {
|
||||
if (_alertWindow) {
|
||||
_alertWindow.rootViewController = [UIViewController new];
|
||||
_alertWindow.windowLevel = UIWindowLevelAlert + 1;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user