mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fafef8365 |
+2
-5
@@ -75,10 +75,7 @@ module.system.haste.module_ref_prefix=m#
|
||||
|
||||
react.runtime=automatic
|
||||
|
||||
experimental.only_support_flow_fixme_and_expected_error=true
|
||||
experimental.require_suppression_with_error_code=true
|
||||
experimental.invariant_subtyping_error_message_improvement=true
|
||||
experimental.natural_inference.local_object_literals.followup_fix=true
|
||||
experimental.error_code_migration=new
|
||||
|
||||
ban_spread_key_props=true
|
||||
|
||||
@@ -103,4 +100,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.280.0
|
||||
^0.279.0
|
||||
|
||||
@@ -179,9 +179,8 @@ jobs:
|
||||
- name: Compress and Rename dSYM
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/react-native/third-party/Symbols/
|
||||
tar -cz -f ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz .
|
||||
mv ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz ./ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
|
||||
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
|
||||
- name: Upload XCFramework Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
-210
@@ -1,215 +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
|
||||
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **Prebuild:** Added setting SWIFT_ENABLE_EXPLICIT_MODULES=NO when using precompiled to support Xcode 26 ([939a75b5ce](https://github.com/facebook/react-native/commit/939a75b5ce2a580ece4a62689582ea81480c3e97) by [@chrfalch](https://github.com/chrfalch))
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Infra:** Add missing Babel dependencies ([bf2c3af93b](https://github.com/facebook/react-native/commit/bf2c3af93b146943cb35866fa9badcd188e63f5b) by [@tido64](https://github.com/tido64))
|
||||
- **Accessibility:** fix `aria-label` on `TextInput` ([6965d57e75](https://github.com/facebook/react-native/commit/6965d57e75ed0cf9f265c6020d478ddb9af4bf10) by [@mdjastrzebski](https://github.com/mdjastrzebski))
|
||||
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **TextInput:** Setting maxLength to 0 in TextInput now correctly blocks typing ([c5956da8c0](https://github.com/facebook/react-native/commit/c5956da8c0b735d47761af51019ed25b49001c00) by [@riteshshukla04](https://github.com/riteshshukla04))
|
||||
- **Switch:** Fix Switch layout to work with iOS 26 ([ba51aeaa90](https://github.com/facebook/react-native/commit/ba51aeaa9040014e1d77c93158c96e9bf09940cf) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- **C++:** Fix import RuntimeExecutor.h with USE_FRAMEWORKS ([dacd8f26fd](https://github.com/facebook/react-native/commit/dacd8f26fda61b16b52a4953267f2108181c3282) by [@sharifhh](https://github.com/sharifhh))
|
||||
- **Infra:** Fix scripts for paths containing whitespaces ([94623ca8ec](https://github.com/facebook/react-native/commit/94623ca8ec969f09d8ec430e7633c3bf49a3d71e) by [@kitten](https://github.com/kitten))
|
||||
- **Prebuild:** Fixed how we copy and build the Symbols folder when precompiling ReactNativeDependencies ([a843119ff1](https://github.com/facebook/react-native/commit/a843119ff1f0e2dfb1d3884ccf255784e3cea1a7) by [@chrfalch](https://github.com/chrfalch))
|
||||
- **Prebuild:** Fixed wrong jsi symbols in use when using React.xcframework ([8a2e7efe01](https://github.com/facebook/react-native/commit/8a2e7efe010c49a293c146654094b1cb5d6e6acd) by [@chrfalch](https://github.com/chrfalch))
|
||||
- **Prebuild:** Fixed copying bundles correctly to xcframeworks when precompiling ReactNativeDependencies.xcframework ([e3adf47214](https://github.com/facebook/react-native/commit/e3adf4721467557f19e6cd7a65c4e2314796bc17) by [@chrfalch](https://github.com/chrfalch))
|
||||
- **Prebuild:** Aligned Symbols folder in React.xcframework symbols with ReactNativeDependencies.xcframework symbols. ([8c444f773a](https://github.com/facebook/react-native/commit/8c444f773a44e8554745c9cfc1451083c12b00e3) by [@chrfalch](https://github.com/chrfalch))
|
||||
- **Prebuild:** Fix "file exists" error in `ReactNativeDependencies.podspec` ([4c570b5d31](https://github.com/facebook/react-native/commit/4c570b5d31ef46e04e5fa26fa92d7f7090bf15e2) by [@vonovak](https://github.com/vonovak))
|
||||
- **Prebuild:** added explicit handling of ReactCodegen ([6526a98d68](https://github.com/facebook/react-native/commit/6526a98d68dbc8578ea15cbf117c0a216c6e9af0) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
|
||||
|
||||
## v0.81.0
|
||||
|
||||
### Breaking
|
||||
|
||||
+2
-2
@@ -82,7 +82,7 @@
|
||||
"eslint-plugin-redundant-undefined": "^0.4.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"flow-api-translator": "0.32.0",
|
||||
"flow-bin": "^0.280.0",
|
||||
"flow-bin": "^0.279.0",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-eslint": "0.32.0",
|
||||
"hermes-transform": "0.32.0",
|
||||
@@ -91,7 +91,7 @@
|
||||
"jest": "^29.7.0",
|
||||
"jest-config": "^29.7.0",
|
||||
"jest-diff": "^29.7.0",
|
||||
"jest-junit": "^16.0.0",
|
||||
"jest-junit": "^10.0.0",
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"markdownlint-cli2": "^0.17.2",
|
||||
"markdownlint-rule-relative-links": "^3.0.0",
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
"peerDependenciesMeta": {
|
||||
"@react-native-community/cli": {
|
||||
"optional": true
|
||||
},
|
||||
"@react-native/metro-config": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -31,9 +31,9 @@ type MiddlewareReturn = {
|
||||
...
|
||||
};
|
||||
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe
|
||||
const unusedStubWSServer: ws$WebSocketServer = {};
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe
|
||||
const unusedMiddlewareStub: Server = {};
|
||||
|
||||
const communityMiddlewareFallback = {
|
||||
|
||||
@@ -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,33 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`prepareDebuggerShellFromDotSlashFile fails with the expected error message for a missing dotslash file 1`] = `
|
||||
Object {
|
||||
"code": "unexpected_error",
|
||||
"humanReadableMessage": "An unexpected error occured while installing the latest version of React Native DevTools. Using a fallback version instead.",
|
||||
"verboseInfo": Any<String>,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`prepareDebuggerShellFromDotSlashFile fails with the expected error message for missing platforms 1`] = `
|
||||
Object {
|
||||
"code": "platform_not_supported",
|
||||
"humanReadableMessage": "The latest version of React Native DevTools is not supported on this platform. Using a fallback version instead.",
|
||||
"verboseInfo": Any<String>,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`prepareDebuggerShellFromDotSlashFile scenarios requiring a local HTTP server fails with the expected error message for a corrupted tarball 1`] = `
|
||||
Object {
|
||||
"code": "possible_corruption",
|
||||
"humanReadableMessage": "Failed to verify the latest version of React Native DevTools. Using a fallback version instead. ",
|
||||
"verboseInfo": Any<String>,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`prepareDebuggerShellFromDotSlashFile scenarios requiring a local HTTP server fails with the expected error message for a network error 1`] = `
|
||||
Object {
|
||||
"code": "likely_offline",
|
||||
"humanReadableMessage": "Failed to download the latest version of React Native DevTools. Using a fallback version instead. Connect to the internet or check your network settings.",
|
||||
"verboseInfo": Any<String>,
|
||||
}
|
||||
`;
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env dotslash
|
||||
|
||||
{
|
||||
"name": "React Native DevTools",
|
||||
"platforms": {
|
||||
"linux-aarch64": {
|
||||
"size": 113510892,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "http://$HOST:$PORT/corrupted.tar.gz"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-arm64/React Native DevTools"
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"size": 113243910,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "http://$HOST:$PORT/corrupted.tar.gz"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-x64/React Native DevTools"
|
||||
},
|
||||
"macos-aarch64": {
|
||||
"size": 108810433,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "http://$HOST:$PORT/corrupted.tar.gz"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
},
|
||||
"macos-x86_64": {
|
||||
"size": 113769989,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "http://$HOST:$PORT/corrupted.tar.gz"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env dotslash
|
||||
|
||||
{
|
||||
"name": "React Native DevTools",
|
||||
"platforms": {
|
||||
"linux-aarch64": {
|
||||
"size": 113510892,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://$HOST:$PORT/does-not-exist"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-arm64/React Native DevTools"
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"size": 113243910,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://$HOST:$PORT/does-not-exist"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-x64/React Native DevTools"
|
||||
},
|
||||
"macos-aarch64": {
|
||||
"size": 108810433,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://$HOST:$PORT/does-not-exist"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
},
|
||||
"macos-x86_64": {
|
||||
"size": 113769989,
|
||||
"hash": "sha256",
|
||||
"digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://$HOST:$PORT/does-not-exist"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env dotslash
|
||||
|
||||
{
|
||||
"name": "React Native DevTools",
|
||||
"platforms": {}
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {
|
||||
prepareDebuggerShellFromDotSlashFile,
|
||||
} = require('../src/node/private/LaunchUtils');
|
||||
const fs = require('fs').promises;
|
||||
const http = require('http');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
// The implementation of prepareDebuggerShellFromDotSlashFile relies on
|
||||
// details of DotSlash that are not guaranteed to be stable (support for
|
||||
// `dotslash -- fetch <file>`, certain strings being printed to stderr).
|
||||
// This (admittedly elaborate) test suite ensures we'll fail loudly if we
|
||||
// try to upgrade DotSlash to a version that breaks our assumptions.
|
||||
describe('prepareDebuggerShellFromDotSlashFile', () => {
|
||||
test('fails with the expected error message for missing platforms', async () => {
|
||||
const result = await prepareDebuggerShellFromDotSlashFile(
|
||||
path.join(__dirname, 'dotslash-file-with-missing-platforms.jsonc'),
|
||||
);
|
||||
expect(result).toMatchSnapshot({
|
||||
verboseInfo: expect.any(String),
|
||||
});
|
||||
});
|
||||
|
||||
test('fails with the expected error message for a missing dotslash file', async () => {
|
||||
const result = await prepareDebuggerShellFromDotSlashFile(
|
||||
path.join(__dirname, 'dotslash-file-that-does-not-exist.jsonc'),
|
||||
);
|
||||
expect(result).toMatchSnapshot({
|
||||
verboseInfo: expect.any(String),
|
||||
});
|
||||
});
|
||||
|
||||
describe('scenarios requiring a local HTTP server', () => {
|
||||
let server, scratchDir;
|
||||
|
||||
beforeEach(async () => {
|
||||
scratchDir = await fs.mkdtemp(path.join(os.tmpdir(), 'dotslash-test-'));
|
||||
server = http.createServer((request, response) => {
|
||||
if (request.url === '/corrupted.tar.gz') {
|
||||
response.writeHead(200, {'Content-Type': 'application/gzip'});
|
||||
response.end(
|
||||
'Hello, world!\n' + 'This simulated a corrupted tarball.',
|
||||
);
|
||||
} else {
|
||||
response.writeHead(404);
|
||||
response.end();
|
||||
}
|
||||
});
|
||||
await new Promise((resolve, reject) => {
|
||||
server.on('error', reject);
|
||||
server.listen(0, 'localhost', () => {
|
||||
server.removeListener('error', reject);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await fs.rm(scratchDir, {recursive: true, force: true});
|
||||
if (server.listening) {
|
||||
await new Promise((resolve, reject) => {
|
||||
server.close(error => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
test('fails with the expected error message for a corrupted tarball', async () => {
|
||||
const dotslashFileContents = injectHostPort(
|
||||
await fs.readFile(
|
||||
path.join(
|
||||
__dirname,
|
||||
'dotslash-file-simulating-data-corruption.jsonc',
|
||||
),
|
||||
'utf8',
|
||||
),
|
||||
server.address(),
|
||||
);
|
||||
|
||||
await fs.writeFile(
|
||||
path.join(scratchDir, 'dotslash-file.jsonc'),
|
||||
dotslashFileContents,
|
||||
);
|
||||
const result = await prepareDebuggerShellFromDotSlashFile(
|
||||
path.join(scratchDir, 'dotslash-file.jsonc'),
|
||||
);
|
||||
expect(result).toMatchSnapshot({
|
||||
verboseInfo: expect.any(String),
|
||||
});
|
||||
});
|
||||
|
||||
test('fails with the expected error message for a network error', async () => {
|
||||
const dotslashFileContents = injectHostPort(
|
||||
await fs.readFile(
|
||||
path.join(__dirname, 'dotslash-file-simulating-network-error.jsonc'),
|
||||
'utf8',
|
||||
),
|
||||
server.address(),
|
||||
);
|
||||
|
||||
await fs.writeFile(
|
||||
path.join(scratchDir, 'dotslash-file.jsonc'),
|
||||
dotslashFileContents,
|
||||
);
|
||||
const result = await prepareDebuggerShellFromDotSlashFile(
|
||||
path.join(scratchDir, 'dotslash-file.jsonc'),
|
||||
);
|
||||
expect(result).toMatchSnapshot({
|
||||
verboseInfo: expect.any(String),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function injectHostPort(
|
||||
dotslashFileContents: string,
|
||||
address: net$Socket$address,
|
||||
) {
|
||||
const host =
|
||||
address.family === 'IPv6' ? `[${address.address}]` : address.address;
|
||||
return dotslashFileContents
|
||||
.replaceAll('$HOST', host)
|
||||
.replaceAll('$PORT', address.port.toString());
|
||||
}
|
||||
@@ -22,7 +22,7 @@ describe('Electron dependency', () => {
|
||||
// $FlowFixMe[untyped-import] - package.json is not typed
|
||||
const ourPackageJson = require('../package.json');
|
||||
|
||||
const declaredElectronVersion = ourPackageJson.devDependencies.electron;
|
||||
const declaredElectronVersion = ourPackageJson.dependencies.electron;
|
||||
expect(declaredElectronVersion).toBeTruthy();
|
||||
|
||||
// $FlowFixMe[untyped-import] - package.json is not typed
|
||||
|
||||
@@ -1,75 +1,62 @@
|
||||
#!/usr/bin/env dotslash
|
||||
|
||||
// @generated SignedSource<<e93d55b5e28943e44271f5d3738083e0>>
|
||||
// @generated SignedSource<<14de73ea0ed751d80c7c687c6aeb123f>>
|
||||
|
||||
|
||||
{
|
||||
"name": "React Native DevTools",
|
||||
"platforms": {
|
||||
"linux-aarch64": {
|
||||
"size": 116060647,
|
||||
"size": 116120331,
|
||||
"hash": "sha256",
|
||||
"digest": "4352f1c9848ca919101ec628bd08b87a72a828d1ab55fa43a02098329fa452fa",
|
||||
"digest": "5a1747bdb50f8140d96e99b31f9a603ceaf52e777e5dd59f65edacd87f8c6348",
|
||||
"providers": [
|
||||
{
|
||||
"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"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQMRq1ou56GjpsIRFHpozEYiPfCuVvgWQVwiMMPBbwKyBnebit8HDGKof5XgDHbAKCqAZSgC8L22eJETnqIUM3kEAMYNXcHviIGy41rsXKVDYDgyWlGFB1zP2WzHrjWagfD062Pt4q5GqvCG5RVlhz656BOsutU7B4pDXGFCIdry7FveKn0PXGxvd1E"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-arm64/React Native DevTools"
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"size": 115930333,
|
||||
"size": 116056146,
|
||||
"hash": "sha256",
|
||||
"digest": "11c7b07942928a6301b07fbf2bc77ce1229b2a52891f23541cdd9858b5250e64",
|
||||
"digest": "b48a3e392ac482de8058917879cf07fd5934dcb84aa901d4fe0d29273b503f54",
|
||||
"providers": [
|
||||
{
|
||||
"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"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOyyb_LXrME2ubBGSkEi1vDw-2hwuHgHwnR-kAGQyhJK7lnELQDXKX1xW_u0joDwbTOhmiptwenq07G2NFkrY3t_AXefb_xTu2qHzpmrsX2YcwJlewbprgbuX7Uvdhqncb_IRAnJ4ogYKHUg6CZBNmLCQsyDsoqmkXtJ9ikJcQeDu2aiqbb-RWJ"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-x64/React Native DevTools"
|
||||
},
|
||||
"macos-aarch64": {
|
||||
"size": 110891041,
|
||||
"size": 110957864,
|
||||
"hash": "sha256",
|
||||
"digest": "3cbe8b1b3d17e433347f1601435bb9a6cb758528a5c176a66fc52d9977223175",
|
||||
"digest": "7964d83c857f12bb741abf4377771f3f3697b81df6283dd88d75ae43991afb73",
|
||||
"providers": [
|
||||
{
|
||||
"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"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQM7USVzavWxZkjOO6CasnSfPIfE08jJAkwfVO0qWiYBli136vpzA_HS89ZqsIsAC_GXeT7K-K9BxdON7z5qBoRMUygAay7z4DGT5OZ9YSf9MDCd0JOzah5_6s3ijw2j4eeRu8ZNYzI3aTutDXtPMJAb2KfBHGx2lEiSW5YK9idcB5Y2boAWeDXXX5nb"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
},
|
||||
"macos-x86_64": {
|
||||
"size": 117766158,
|
||||
"size": 117827315,
|
||||
"hash": "sha256",
|
||||
"digest": "6fb79bc2ba3008401b4c9c128248657b95b98581ccde60f8fadb622163779775",
|
||||
"digest": "bab2fac43def4a82fb88300aac05180eeda24f31cc00402a3ff7ca2e612bd532",
|
||||
"providers": [
|
||||
{
|
||||
"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"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPYS0ZRQ7RV1S-yy3tut6pRqcKdPcOiKfekrA5AXdd_M-HDaXLwJS57iAFU2K2X-EA_cyg25C3L-5L7O3eyNKPMToZHbV282GiojnNSKFNjsjj9_B737lOwHI_XqbDQEIiNJZ7NjbkZ8_iMKK-LNL-Ydha2ORWWqytuzP4sWQ6sm0XIxsdyQ6bOLw"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
},
|
||||
"windows-x86_64": {
|
||||
"size": 125527537,
|
||||
"hash": "sha256",
|
||||
"digest": "579a5b0944c51c3b1b541ad5af66c1ffedf93cae2a891ecdf88cb7219fd9b096",
|
||||
"providers": [
|
||||
{
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-win32-x64/React Native DevTools.exe"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,20 +26,14 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 20.19.4",
|
||||
"electron": ">=37.2.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.6",
|
||||
"fb-dotslash": "0.5.8"
|
||||
"electron": "37.2.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "37.2.6",
|
||||
"semver": "^7.1.3"
|
||||
},
|
||||
"files": [
|
||||
"!**/__tests__/**",
|
||||
"bin",
|
||||
"dist",
|
||||
"!src/electron"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
export default {
|
||||
revision: 'dev',
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* %s
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
default: {
|
||||
revision: %s,
|
||||
},
|
||||
__esModule: true,
|
||||
};
|
||||
@@ -36,7 +36,7 @@ function handleLaunchArgs(argv: string[]) {
|
||||
});
|
||||
|
||||
// Find an existing window for this app and launch configuration.
|
||||
let frontendWindow = BrowserWindow.getAllWindows().find(window => {
|
||||
const existingWindow = BrowserWindow.getAllWindows().find(window => {
|
||||
const metadata = windowMetadata.get(window);
|
||||
if (!metadata) {
|
||||
return false;
|
||||
@@ -44,39 +44,41 @@ function handleLaunchArgs(argv: string[]) {
|
||||
return metadata.windowKey === windowKey;
|
||||
});
|
||||
|
||||
if (frontendWindow) {
|
||||
if (existingWindow) {
|
||||
// If the window is already visible, flash it.
|
||||
if (frontendWindow.isVisible()) {
|
||||
frontendWindow.flashFrame(true);
|
||||
if (existingWindow.isVisible()) {
|
||||
existingWindow.flashFrame(true);
|
||||
setTimeout(() => {
|
||||
frontendWindow.flashFrame(false);
|
||||
existingWindow.flashFrame(false);
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
// Create the browser window.
|
||||
frontendWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
partition: 'persist:react-native-devtools',
|
||||
preload: require.resolve('./preload.js'),
|
||||
},
|
||||
// Icon for Linux
|
||||
icon: path.join(__dirname, 'resources', 'icon.png'),
|
||||
});
|
||||
// Auto-hide the Windows/Linux menu bar
|
||||
frontendWindow.setMenuBarVisibility(false);
|
||||
if (process.platform === 'darwin') {
|
||||
app.focus({
|
||||
steal: true,
|
||||
});
|
||||
}
|
||||
existingWindow.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the browser window.
|
||||
const frontendWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
partition: 'persist:react-native-devtools',
|
||||
preload: require.resolve('./preload.js'),
|
||||
},
|
||||
// Icon for Linux
|
||||
icon: path.join(__dirname, 'resources', 'icon.png'),
|
||||
});
|
||||
|
||||
// Open links in the default browser instead of in new Electron windows.
|
||||
frontendWindow.webContents.setWindowOpenHandler(({url}) => {
|
||||
shell.openExternal(url);
|
||||
return {action: 'deny'};
|
||||
});
|
||||
|
||||
// TODO: If the window contains a live, working frontend instance with a valid connection to the backend,
|
||||
// we should avoid this reload and instead send the frontend a message to handle the launch arguments
|
||||
// dynamically (e.g. update the launch ID for telemetry purposes, handle deeplinking to a specific CDT panel, etc).
|
||||
frontendWindow.loadURL(frontendUrl);
|
||||
|
||||
windowMetadata.set(frontendWindow, {
|
||||
@@ -88,7 +90,6 @@ function handleLaunchArgs(argv: string[]) {
|
||||
steal: true,
|
||||
});
|
||||
}
|
||||
frontendWindow.focus();
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
|
||||
@@ -8,18 +8,9 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import buildInfo from './BuildInfo';
|
||||
|
||||
// $FlowFixMe[untyped-import] Flow doesn't infer JSON types
|
||||
const pkg = require('../../package.json');
|
||||
const util = require('util');
|
||||
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
|
||||
const {app} = require('electron') as any;
|
||||
|
||||
// Set the app name and version early - these are used in --version as well as
|
||||
// in the User-Agent string.
|
||||
app.setName(pkg.name);
|
||||
app.setVersion(pkg.version + '-' + buildInfo.revision);
|
||||
const util = require('util');
|
||||
|
||||
// Handle global command line arguments which don't require a window
|
||||
// or the single instance lock to be held.
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
const {unstable_spawnDebuggerShellWithArgs} = require('../../');
|
||||
|
||||
describe('debugger-shell Node package', () => {
|
||||
test('can spawn in detached+prebuilt mode without crashing', async () => {
|
||||
await expect(
|
||||
unstable_spawnDebuggerShellWithArgs(['--version'], {
|
||||
flavor: 'prebuilt',
|
||||
mode: 'detached',
|
||||
}),
|
||||
).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
// When running in the internal react-native-oss-js job, Electron isn't
|
||||
// installed correctly (postinstall scripts don't run) but the internal
|
||||
// `electron` workspace isn't available either. Detecting this dynamically
|
||||
// weakens the test somewhat in environments where it *should* pass, but this
|
||||
// is a dev-only feature anyway so this is fine.
|
||||
if (isElectronInstalled()) {
|
||||
test('can spawn in detached+dev mode without crashing', async () => {
|
||||
await expect(
|
||||
unstable_spawnDebuggerShellWithArgs(['--version'], {
|
||||
flavor: 'dev',
|
||||
mode: 'detached',
|
||||
}),
|
||||
).resolves.toBeUndefined();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function isElectronInstalled() {
|
||||
try {
|
||||
require('electron');
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -8,54 +8,44 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {
|
||||
prepareDebuggerShellFromDotSlashFile,
|
||||
spawnAndGetStderr,
|
||||
} from './private/LaunchUtils';
|
||||
|
||||
const {spawn} = require('cross-spawn');
|
||||
const path = require('path');
|
||||
|
||||
// The 'prebuilt' flavor will use the prebuilt shell binary (and the JavaScript embedded in it).
|
||||
// The 'dev' flavor will use a stock Electron binary and run the shell code from the `electron/` directory.
|
||||
type DebuggerShellFlavor = 'prebuilt' | 'dev';
|
||||
|
||||
const DEVTOOLS_BINARY_DOTSLASH_FILE = path.join(
|
||||
__dirname,
|
||||
'../../bin/react-native-devtools',
|
||||
);
|
||||
|
||||
async function unstable_spawnDebuggerShellWithArgs(
|
||||
args: string[],
|
||||
{
|
||||
mode = 'detached',
|
||||
flavor = 'prebuilt',
|
||||
}: $ReadOnly<{
|
||||
// In 'syncAndExit' mode, the current process will block until the spawned process exits, and then it will exit
|
||||
// with the same exit code as the spawned process.
|
||||
// In 'detached' mode, the spawned process will be detached from the current process and the current process will
|
||||
// continue to run normally.
|
||||
mode?: 'syncThenExit' | 'detached',
|
||||
flavor?: DebuggerShellFlavor,
|
||||
}> = {},
|
||||
): Promise<void> {
|
||||
const [binaryPath, baseArgs] = getShellBinaryAndArgs(flavor);
|
||||
// NOTE: Internally at Meta, this is aliased to a workspace that is
|
||||
// API-compatible with the 'electron' package, but contains prebuilt binaries
|
||||
// that do not need to be downloaded in a postinstall action.
|
||||
const electronPath = require('electron');
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const child = spawn(binaryPath, [...baseArgs, ...args], {
|
||||
stdio: 'inherit',
|
||||
windowsHide: true,
|
||||
detached: mode === 'detached',
|
||||
});
|
||||
const child = spawn(
|
||||
electronPath,
|
||||
[require.resolve('../electron'), ...args],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
windowsHide: true,
|
||||
detached: mode === 'detached',
|
||||
},
|
||||
);
|
||||
if (mode === 'detached') {
|
||||
child.on('spawn', () => {
|
||||
resolve();
|
||||
});
|
||||
child.on('close', (code: number) => {
|
||||
child.on('close', (code /*: number */) => {
|
||||
if (code !== 0) {
|
||||
reject(
|
||||
new Error(
|
||||
`Failed to open debugger shell: exited with code ${code}`,
|
||||
`Failed to open debugger shell: ${electronPath} exited with code ${code}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -64,7 +54,7 @@ async function unstable_spawnDebuggerShellWithArgs(
|
||||
} else if (mode === 'syncThenExit') {
|
||||
child.on('close', function (code, signal) {
|
||||
if (code === null) {
|
||||
console.error('Debugger shell exited with signal', signal);
|
||||
console.error(electronPath, 'exited with signal', signal);
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(code);
|
||||
@@ -84,91 +74,4 @@ async function unstable_spawnDebuggerShellWithArgs(
|
||||
});
|
||||
}
|
||||
|
||||
export type DebuggerShellPreparationResult = $ReadOnly<{
|
||||
code:
|
||||
| 'success'
|
||||
| 'not_implemented'
|
||||
| 'likely_offline'
|
||||
| 'platform_not_supported'
|
||||
| 'possible_corruption'
|
||||
| 'unexpected_error',
|
||||
humanReadableMessage?: string,
|
||||
verboseInfo?: string,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Attempts to prepare the debugger shell for use and returns a coded result
|
||||
* that can be used to advise the user on how to proceed in case of failure.
|
||||
* In particular, this function will attempt to download and extract an
|
||||
* appropriate binary for the "prebuilt" flavor.
|
||||
*
|
||||
* This function should be called early during dev server startup, in parallel
|
||||
* with other initialization steps, so that the debugger shell is ready to use
|
||||
* instantly when the user tries to open it (and conversely, the user is
|
||||
* informed ASAP if it is not ready to use).
|
||||
*/
|
||||
async function unstable_prepareDebuggerShell(
|
||||
flavor: DebuggerShellFlavor,
|
||||
): Promise<DebuggerShellPreparationResult> {
|
||||
const [binaryPath, baseArgs] = getShellBinaryAndArgs(flavor);
|
||||
|
||||
try {
|
||||
switch (flavor) {
|
||||
case 'prebuilt':
|
||||
const prebuiltResult = await prepareDebuggerShellFromDotSlashFile(
|
||||
DEVTOOLS_BINARY_DOTSLASH_FILE,
|
||||
);
|
||||
if (prebuiltResult.code !== 'success') {
|
||||
return prebuiltResult;
|
||||
}
|
||||
break;
|
||||
case 'dev':
|
||||
break;
|
||||
default:
|
||||
flavor as empty;
|
||||
throw new Error(`Unknown flavor: ${flavor}`);
|
||||
}
|
||||
const {code, stderr} = await spawnAndGetStderr(binaryPath, [
|
||||
...baseArgs,
|
||||
'--version',
|
||||
]);
|
||||
if (code !== 0) {
|
||||
return {
|
||||
code: 'unexpected_error',
|
||||
verboseInfo: stderr,
|
||||
};
|
||||
}
|
||||
return {code: 'success'};
|
||||
} catch (e) {
|
||||
return {
|
||||
code: 'unexpected_error',
|
||||
verboseInfo: e.message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function getShellBinaryAndArgs(
|
||||
flavor: DebuggerShellFlavor,
|
||||
): [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],
|
||||
];
|
||||
case 'dev':
|
||||
return [
|
||||
// NOTE: Internally at Meta, this is aliased to a workspace that is
|
||||
// API-compatible with the 'electron' package, but contains prebuilt binaries
|
||||
// that do not need to be downloaded in a postinstall action.
|
||||
require('electron'),
|
||||
[require.resolve('../electron')],
|
||||
];
|
||||
default:
|
||||
flavor as empty;
|
||||
throw new Error(`Unknown flavor: ${flavor}`);
|
||||
}
|
||||
}
|
||||
|
||||
export {unstable_spawnDebuggerShellWithArgs, unstable_prepareDebuggerShell};
|
||||
export {unstable_spawnDebuggerShellWithArgs};
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {DebuggerShellPreparationResult} from '../';
|
||||
|
||||
const {spawn} = require('cross-spawn');
|
||||
|
||||
async function spawnAndGetStderr(
|
||||
command: string,
|
||||
args: string[],
|
||||
): Promise<{
|
||||
code: number,
|
||||
stderr: string,
|
||||
}> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const child = spawn(command, args, {
|
||||
stdio: ['ignore', 'ignore', 'pipe'],
|
||||
encoding: 'utf8',
|
||||
windowsHide: true,
|
||||
});
|
||||
let stderr = '';
|
||||
child.stderr.on('data', data => {
|
||||
stderr += data;
|
||||
});
|
||||
child.on('error', error => {
|
||||
reject(error);
|
||||
});
|
||||
child.on('close', (code, signal) => {
|
||||
resolve({
|
||||
code,
|
||||
stderr,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
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],
|
||||
);
|
||||
if (code === 0) {
|
||||
return {code: 'success'};
|
||||
}
|
||||
if (
|
||||
stderr.includes('dotslash error') &&
|
||||
stderr.includes('no providers succeeded')
|
||||
) {
|
||||
if (stderr.includes('failed to verify artifact')) {
|
||||
return {
|
||||
code: 'possible_corruption',
|
||||
humanReadableMessage:
|
||||
'Failed to verify the latest version of React Native DevTools. ' +
|
||||
'Using a fallback version instead. ',
|
||||
verboseInfo: stderr,
|
||||
};
|
||||
}
|
||||
return {
|
||||
code: 'likely_offline',
|
||||
humanReadableMessage:
|
||||
'Failed to download the latest version of React Native DevTools. ' +
|
||||
'Using a fallback version instead. ' +
|
||||
'Connect to the internet or check your network settings.',
|
||||
verboseInfo: stderr,
|
||||
};
|
||||
}
|
||||
if (
|
||||
stderr.includes('dotslash error') &&
|
||||
stderr.includes('platform not supported')
|
||||
) {
|
||||
return {
|
||||
code: 'platform_not_supported',
|
||||
humanReadableMessage:
|
||||
'The latest version of React Native DevTools is not supported on this platform. ' +
|
||||
'Using a fallback version instead.',
|
||||
verboseInfo: stderr,
|
||||
};
|
||||
}
|
||||
return {
|
||||
code: 'unexpected_error',
|
||||
humanReadableMessage:
|
||||
'An unexpected error occured while installing the latest version of React Native DevTools. ' +
|
||||
'Using a fallback version instead.',
|
||||
verboseInfo: stderr,
|
||||
};
|
||||
}
|
||||
|
||||
export {spawnAndGetStderr, prepareDebuggerShellFromDotSlashFile};
|
||||
@@ -88,16 +88,6 @@ WebSocket handler for registering device connections.
|
||||
|
||||
WebSocket handler that proxies CDP messages to/from the corresponding device.
|
||||
|
||||
## Experimental features
|
||||
|
||||
React Native frameworks may pass an `unstable_experiments` option to `createDevMiddleware` to configure experimental features. Note that these features might not work correctly, and they may change or be removed in the future without notice. Some of the experiment flags available are documented below.
|
||||
|
||||
### `unstable_experiments.enableStandaloneFuseboxShell`
|
||||
|
||||
When `true`, the debugger frontend will launch in a standalone app shell (provided by the `@react-native/debugger-shell` package) rather than in a browser window. The standalone shell provides an improved experience and will become the default in a future version of React Native.
|
||||
|
||||
The shell is powered by a separate binary that is downloaded and cached in the background (immediately after the call to `createDevMiddleware`). If there is a problem downloading or invoking this binary for the first time, the debugger frontend will revert to launching in a browser window until the next time `createDevMiddleware` is called (typically, on the next dev server start).
|
||||
|
||||
## Contributing
|
||||
|
||||
Changes to this package can be made locally and tested against the `rn-tester` app, per the [Contributing guide](https://reactnative.dev/contributing/overview#contributing-code). During development, this package is automatically run from source with no build step.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
"dependencies": {
|
||||
"@isaacs/ttlcache": "^1.4.1",
|
||||
"@react-native/debugger-frontend": "0.82.0-main",
|
||||
"@react-native/debugger-shell": "0.82.0-main",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
@@ -39,7 +38,6 @@
|
||||
"node": ">= 20.19.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-native/debugger-shell": "0.82.0-main",
|
||||
"selfsigned": "^2.4.1",
|
||||
"undici": "^5.29.0",
|
||||
"wait-for-expect": "^3.0.2"
|
||||
|
||||
@@ -28,9 +28,6 @@ describe('enableStandaloneFuseboxShell experiment', () => {
|
||||
unstable_showFuseboxShell: () => {
|
||||
throw new Error('Not implemented');
|
||||
},
|
||||
unstable_prepareFuseboxShell: async () => {
|
||||
return {code: 'not_implemented'};
|
||||
},
|
||||
};
|
||||
const serverRef = withServerForEachTest({
|
||||
logger: undefined,
|
||||
@@ -130,7 +127,5 @@ describe('enableStandaloneFuseboxShell experiment', () => {
|
||||
device.close();
|
||||
}
|
||||
});
|
||||
|
||||
// TODO(moti): Add tests around unstable_prepareFuseboxShell
|
||||
});
|
||||
});
|
||||
|
||||
@@ -92,7 +92,6 @@ export default function createDevMiddleware({
|
||||
const eventReporter = createWrappedEventReporter(
|
||||
unstable_eventReporter,
|
||||
logger,
|
||||
experiments,
|
||||
);
|
||||
|
||||
const inspectorProxy = new InspectorProxy(
|
||||
@@ -153,7 +152,6 @@ function getExperiments(config: ExperimentsConfig): Experiments {
|
||||
function createWrappedEventReporter(
|
||||
reporter: ?EventReporter,
|
||||
logger: ?Logger,
|
||||
experiments: Experiments,
|
||||
): EventReporter {
|
||||
return {
|
||||
logEvent(event: ReportableEvent) {
|
||||
@@ -168,42 +166,10 @@ function createWrappedEventReporter(
|
||||
logger?.info(
|
||||
'\u001B[1m\u001B[7m💡 JavaScript logs have moved!\u001B[22m They can now be ' +
|
||||
'viewed in React Native DevTools. Tip: Type \u001B[1mj\u001B[22m in ' +
|
||||
'the terminal to open' +
|
||||
(experiments.enableStandaloneFuseboxShell
|
||||
? ''
|
||||
: ' (requires Google Chrome or Microsoft Edge)') +
|
||||
'.\u001B[27m',
|
||||
'the terminal to open (requires Google Chrome or Microsoft Edge).' +
|
||||
'\u001B[27m',
|
||||
);
|
||||
break;
|
||||
case 'fusebox_shell_preparation_attempt':
|
||||
switch (event.result.code) {
|
||||
case 'success':
|
||||
case 'not_implemented':
|
||||
break;
|
||||
case 'unexpected_error': {
|
||||
let message =
|
||||
event.result.humanReadableMessage ??
|
||||
'An unknown error occurred while installing React Native DevTools.';
|
||||
if (event.result.verboseInfo != null) {
|
||||
message += ` Details:\n\n${event.result.verboseInfo}`;
|
||||
} else {
|
||||
message += '.';
|
||||
}
|
||||
logger?.error(message);
|
||||
break;
|
||||
}
|
||||
case 'possible_corruption':
|
||||
case 'platform_not_supported':
|
||||
case 'likely_offline':
|
||||
logger?.warn(
|
||||
event.result.humanReadableMessage ??
|
||||
`An error of type ${event.result.code} occurred while installing React Native DevTools.`,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
(event.result.code: empty);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
reporter?.logEvent(event);
|
||||
|
||||
@@ -10,15 +10,10 @@
|
||||
|
||||
export {default as createDevMiddleware} from './createDevMiddleware';
|
||||
|
||||
export type {
|
||||
BrowserLauncher,
|
||||
DebuggerShellPreparationResult,
|
||||
} from './types/BrowserLauncher';
|
||||
export type {BrowserLauncher} from './types/BrowserLauncher';
|
||||
export type {EventReporter, ReportableEvent} from './types/EventReporter';
|
||||
export type {
|
||||
CustomMessageHandler,
|
||||
CustomMessageHandlerConnection,
|
||||
CreateCustomMessageHandlerFn,
|
||||
} from './inspector-proxy/CustomMessageHandler';
|
||||
|
||||
export {default as unstable_DefaultBrowserLauncher} from './utils/DefaultBrowserLauncher';
|
||||
|
||||
@@ -970,10 +970,7 @@ export default class Device {
|
||||
socket: WS,
|
||||
): void {
|
||||
const sendSuccessResponse = (scriptSource: string) => {
|
||||
const result: {
|
||||
scriptSource: string,
|
||||
bytecode?: string,
|
||||
} = {scriptSource};
|
||||
const result = {scriptSource};
|
||||
const response: CDPResponse<'Debugger.getScriptSource'> = {
|
||||
id: req.id,
|
||||
result,
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
|
||||
import type {InspectorProxyQueries} from '../inspector-proxy/InspectorProxy';
|
||||
import type {PageDescription} from '../inspector-proxy/types';
|
||||
import type {
|
||||
BrowserLauncher,
|
||||
DebuggerShellPreparationResult,
|
||||
} from '../types/BrowserLauncher';
|
||||
import type {BrowserLauncher} from '../types/BrowserLauncher';
|
||||
import type {EventReporter} from '../types/EventReporter';
|
||||
import type {Experiments} from '../types/Experiments';
|
||||
import type {Logger} from '../types/Logger';
|
||||
@@ -51,19 +48,6 @@ export default function openDebuggerMiddleware({
|
||||
experiments,
|
||||
inspectorProxy,
|
||||
}: Options): NextHandleFunction {
|
||||
let shellPreparationPromise: Promise<DebuggerShellPreparationResult>;
|
||||
if (experiments.enableStandaloneFuseboxShell) {
|
||||
shellPreparationPromise =
|
||||
browserLauncher?.unstable_prepareFuseboxShell?.() ??
|
||||
Promise.resolve({code: 'not_implemented'});
|
||||
shellPreparationPromise = shellPreparationPromise.then(result => {
|
||||
eventReporter?.logEvent({
|
||||
type: 'fusebox_shell_preparation_attempt',
|
||||
result,
|
||||
});
|
||||
return result;
|
||||
});
|
||||
}
|
||||
return async (
|
||||
req: IncomingMessage,
|
||||
res: ServerResponse,
|
||||
@@ -83,7 +67,7 @@ export default function openDebuggerMiddleware({
|
||||
launchId?: string,
|
||||
telemetryInfo?: string,
|
||||
target?: string,
|
||||
panel?: string,
|
||||
landingView?: string,
|
||||
...
|
||||
} = parsedUrl.query;
|
||||
|
||||
@@ -168,28 +152,13 @@ export default function openDebuggerMiddleware({
|
||||
telemetryInfo: query.telemetryInfo,
|
||||
appId: target.appId,
|
||||
useFuseboxEntryPoint,
|
||||
panel: query.panel,
|
||||
landingView: query.landingView,
|
||||
},
|
||||
);
|
||||
let shouldUseStandaloneFuseboxShell =
|
||||
useFuseboxEntryPoint && experiments.enableStandaloneFuseboxShell;
|
||||
if (shouldUseStandaloneFuseboxShell) {
|
||||
const shellPreparationResult = await shellPreparationPromise;
|
||||
switch (shellPreparationResult.code) {
|
||||
case 'success':
|
||||
case 'not_implemented':
|
||||
break;
|
||||
case 'platform_not_supported':
|
||||
case 'possible_corruption':
|
||||
case 'likely_offline':
|
||||
case 'unexpected_error':
|
||||
shouldUseStandaloneFuseboxShell = false;
|
||||
break;
|
||||
default:
|
||||
(shellPreparationResult.code: empty);
|
||||
}
|
||||
}
|
||||
if (shouldUseStandaloneFuseboxShell) {
|
||||
if (
|
||||
useFuseboxEntryPoint &&
|
||||
experiments.enableStandaloneFuseboxShell
|
||||
) {
|
||||
const windowKey = [
|
||||
serverBaseUrl,
|
||||
target.webSocketDebuggerUrl,
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {DebuggerShellPreparationResult} from '@react-native/debugger-shell';
|
||||
|
||||
export type {DebuggerShellPreparationResult};
|
||||
|
||||
/**
|
||||
* An interface for integrators to provide a custom implementation for
|
||||
* opening URLs in a web browser.
|
||||
@@ -46,21 +42,5 @@ export interface BrowserLauncher {
|
||||
* the host of dev-middleware. Implementations are responsible for rewriting
|
||||
* this as necessary where the server is remote.
|
||||
*/
|
||||
+unstable_showFuseboxShell?: (
|
||||
url: string,
|
||||
windowKey: string,
|
||||
) => Promise<void>;
|
||||
|
||||
/**
|
||||
* Attempt to prepare the debugger shell for use and returns a coded result
|
||||
* that can be used to advise the user on how to proceed in case of failure.
|
||||
*
|
||||
* This function MAY be called multiple times or not at all. Implementers
|
||||
* SHOULD use the opportunity to prefetch and cache any expensive resources (e.g
|
||||
* platform-specific binaries needed in order to show the Fusebox shell). After a
|
||||
* successful call, subsequent calls SHOULD complete quickly. The implementation
|
||||
* SHOULD NOT return a rejecting promise in any case, and instead SHOULD report
|
||||
* errors via the returned result object.
|
||||
*/
|
||||
+unstable_prepareFuseboxShell?: () => Promise<DebuggerShellPreparationResult>;
|
||||
unstable_showFuseboxShell?: (url: string, windowKey: string) => Promise<void>;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {DebuggerShellPreparationResult} from './BrowserLauncher';
|
||||
|
||||
type SuccessResult<Props: {...} | void = {}> = {
|
||||
status: 'success',
|
||||
...Props,
|
||||
@@ -134,10 +132,6 @@ export type ReportableEvent =
|
||||
duration: number,
|
||||
...ConnectionUptime,
|
||||
...DebuggerSessionIDs,
|
||||
}
|
||||
| {
|
||||
type: 'fusebox_shell_preparation_attempt',
|
||||
result: DebuggerShellPreparationResult,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,9 @@ export type Experiments = $ReadOnly<{
|
||||
/**
|
||||
* Launch the Fusebox frontend in a standalone shell instead of a browser.
|
||||
* When this is enabled, we will use the optional unstable_showFuseboxShell
|
||||
* method on the BrowserLauncher, or throw an error if the method is missing.
|
||||
* method on the framework-provided BrowserLauncher, or throw an error if the
|
||||
* method is missing. Note that the default BrowserLauncher does *not*
|
||||
* implement unstable_showFuseboxShell.
|
||||
*/
|
||||
enableStandaloneFuseboxShell: boolean,
|
||||
}>;
|
||||
|
||||
@@ -8,12 +8,6 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {DebuggerShellPreparationResult} from '../';
|
||||
|
||||
const {
|
||||
unstable_prepareDebuggerShell,
|
||||
unstable_spawnDebuggerShellWithArgs,
|
||||
} = require('@react-native/debugger-shell');
|
||||
const {spawn} = require('child_process');
|
||||
const ChromeLauncher = require('chrome-launcher');
|
||||
const {Launcher: EdgeLauncher} = require('chromium-edge-launcher');
|
||||
@@ -68,25 +62,6 @@ const DefaultBrowserLauncher = {
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
async unstable_showFuseboxShell(
|
||||
url: string,
|
||||
windowKey: string,
|
||||
): Promise<void> {
|
||||
return await unstable_spawnDebuggerShellWithArgs(
|
||||
['--frontendUrl=' + url, '--windowKey=' + windowKey],
|
||||
{
|
||||
mode: 'detached',
|
||||
flavor: process.env.RNDT_DEV === '1' ? 'dev' : 'prebuilt',
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
async unstable_prepareFuseboxShell(): Promise<DebuggerShellPreparationResult> {
|
||||
return await unstable_prepareDebuggerShell(
|
||||
process.env.RNDT_DEV === '1' ? 'dev' : 'prebuilt',
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default DefaultBrowserLauncher;
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function getDevToolsFrontendUrl(
|
||||
/** Whether to use the modern `rn_fusebox.html` entry point. */
|
||||
useFuseboxEntryPoint?: boolean,
|
||||
appId?: string,
|
||||
panel?: string,
|
||||
landingView?: string,
|
||||
}>,
|
||||
): string {
|
||||
const wsParam = getWsParam({
|
||||
@@ -55,8 +55,8 @@ export default function getDevToolsFrontendUrl(
|
||||
if (options?.telemetryInfo != null && options.telemetryInfo !== '') {
|
||||
searchParams.append('telemetryInfo', options.telemetryInfo);
|
||||
}
|
||||
if (options?.panel != null && options.panel !== '') {
|
||||
searchParams.append('panel', options.panel);
|
||||
if (options?.landingView != null && options.landingView !== '') {
|
||||
searchParams.append('landingView', options.landingView);
|
||||
}
|
||||
|
||||
return appUrl + '?' + searchParams.toString();
|
||||
|
||||
+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)
|
||||
|
||||
+9
-9
@@ -34,15 +34,15 @@ abstract class BundleHermesCTask : DefaultTask() {
|
||||
|
||||
@get:InputFiles
|
||||
val sources: ConfigurableFileTree =
|
||||
project.fileTree(root) { fileTree ->
|
||||
fileTree.include("**/*.js")
|
||||
fileTree.include("**/*.jsx")
|
||||
fileTree.include("**/*.ts")
|
||||
fileTree.include("**/*.tsx")
|
||||
fileTree.exclude("**/android/**/*")
|
||||
fileTree.exclude("**/ios/**/*")
|
||||
fileTree.exclude("**/build/**/*")
|
||||
fileTree.exclude("**/node_modules/**/*")
|
||||
project.fileTree(root) {
|
||||
it.include("**/*.js")
|
||||
it.include("**/*.jsx")
|
||||
it.include("**/*.ts")
|
||||
it.include("**/*.tsx")
|
||||
it.exclude("**/android/**/*")
|
||||
it.exclude("**/ios/**/*")
|
||||
it.exclude("**/build/**/*")
|
||||
it.exclude("**/node_modules/**/*")
|
||||
}
|
||||
|
||||
@get:Input abstract val nodeExecutableAndArgs: ListProperty<String>
|
||||
|
||||
+27
-27
@@ -42,35 +42,35 @@ abstract class PreparePrefabHeadersTask : DefaultTask() {
|
||||
input.get().forEach { (libraryName, pathToPrefixCouples) ->
|
||||
val outputFolder: RegularFile = outputDir.file(libraryName).get()
|
||||
pathToPrefixCouples.forEach { (headerPath, headerPrefix) ->
|
||||
fs.copy { copySpec ->
|
||||
copySpec.from(headerPath)
|
||||
copySpec.include("**/*.h")
|
||||
copySpec.exclude("**/*.cpp")
|
||||
copySpec.exclude("**/*.txt")
|
||||
fs.copy {
|
||||
it.from(headerPath)
|
||||
it.include("**/*.h")
|
||||
it.exclude("**/*.cpp")
|
||||
it.exclude("**/*.txt")
|
||||
// We don't want to copy all the boost headers as they are 250Mb+
|
||||
copySpec.include("boost/config.hpp")
|
||||
copySpec.include("boost/config/**/*.hpp")
|
||||
copySpec.include("boost/core/*.hpp")
|
||||
copySpec.include("boost/detail/workaround.hpp")
|
||||
copySpec.include("boost/operators.hpp")
|
||||
copySpec.include("boost/preprocessor/**/*.hpp")
|
||||
it.include("boost/config.hpp")
|
||||
it.include("boost/config/**/*.hpp")
|
||||
it.include("boost/core/*.hpp")
|
||||
it.include("boost/detail/workaround.hpp")
|
||||
it.include("boost/operators.hpp")
|
||||
it.include("boost/preprocessor/**/*.hpp")
|
||||
// Headers needed for exposing rrc_text and rrc_textinput
|
||||
copySpec.include("boost/container_hash/**/*.hpp")
|
||||
copySpec.include("boost/detail/**/*.hpp")
|
||||
copySpec.include("boost/intrusive/**/*.hpp")
|
||||
copySpec.include("boost/iterator/**/*.hpp")
|
||||
copySpec.include("boost/move/**/*.hpp")
|
||||
copySpec.include("boost/mpl/**/*.hpp")
|
||||
copySpec.include("boost/mp11/**/*.hpp")
|
||||
copySpec.include("boost/describe/**/*.hpp")
|
||||
copySpec.include("boost/type_traits/**/*.hpp")
|
||||
copySpec.include("boost/utility/**/*.hpp")
|
||||
copySpec.include("boost/assert.hpp")
|
||||
copySpec.include("boost/static_assert.hpp")
|
||||
copySpec.include("boost/cstdint.hpp")
|
||||
copySpec.include("boost/utility.hpp")
|
||||
copySpec.include("boost/version.hpp")
|
||||
copySpec.into(File(outputFolder.asFile, headerPrefix))
|
||||
it.include("boost/container_hash/**/*.hpp")
|
||||
it.include("boost/detail/**/*.hpp")
|
||||
it.include("boost/intrusive/**/*.hpp")
|
||||
it.include("boost/iterator/**/*.hpp")
|
||||
it.include("boost/move/**/*.hpp")
|
||||
it.include("boost/mpl/**/*.hpp")
|
||||
it.include("boost/mp11/**/*.hpp")
|
||||
it.include("boost/describe/**/*.hpp")
|
||||
it.include("boost/type_traits/**/*.hpp")
|
||||
it.include("boost/utility/**/*.hpp")
|
||||
it.include("boost/assert.hpp")
|
||||
it.include("boost/static_assert.hpp")
|
||||
it.include("boost/cstdint.hpp")
|
||||
it.include("boost/utility.hpp")
|
||||
it.include("boost/version.hpp")
|
||||
it.into(File(outputFolder.asFile, headerPrefix))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -34,9 +34,9 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
|
||||
val inputFile = tempFolder.newFile("config.json")
|
||||
|
||||
val task =
|
||||
createTestTask<GenerateAutolinkingNewArchitecturesFileTask> { task ->
|
||||
task.generatedOutputDirectory.set(outputFolder)
|
||||
task.autolinkInputFile.set(inputFile)
|
||||
createTestTask<GenerateAutolinkingNewArchitecturesFileTask> {
|
||||
it.generatedOutputDirectory.set(outputFolder)
|
||||
it.autolinkInputFile.set(inputFile)
|
||||
}
|
||||
|
||||
assertThat(task.generatedOutputDirectory.get().asFile).isEqualTo(outputFolder)
|
||||
|
||||
+4
-4
@@ -198,10 +198,10 @@ class GenerateCodegenArtifactsTaskTest {
|
||||
@Test
|
||||
fun resolveTaskParameters_withMissingPackageJson_usesGradleOne() {
|
||||
val task =
|
||||
createTestTask<GenerateCodegenArtifactsTask> { task ->
|
||||
task.packageJsonFile.set(File(tempFolder.root, "package.json"))
|
||||
task.codegenJavaPackageName.set("com.example.test")
|
||||
task.libraryName.set("a-library-name-from-gradle")
|
||||
createTestTask<GenerateCodegenArtifactsTask> {
|
||||
it.packageJsonFile.set(File(tempFolder.root, "package.json"))
|
||||
it.codegenJavaPackageName.set("com.example.test")
|
||||
it.libraryName.set("a-library-name-from-gradle")
|
||||
}
|
||||
|
||||
val (libraryName, javaPackageName) = task.resolveTaskParameters()
|
||||
|
||||
+15
-15
@@ -58,11 +58,11 @@ class PrepareBoostTaskTest {
|
||||
val boostThirdPartyJniPath = tempFolder.newFolder("boostpath/jni")
|
||||
val output = tempFolder.newFolder("output")
|
||||
val task =
|
||||
createTestTask<PrepareBoostTask> { task ->
|
||||
task.boostPath.setFrom(boostpath)
|
||||
task.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
|
||||
task.boostVersion.set("1.0.0")
|
||||
task.outputDir.set(output)
|
||||
createTestTask<PrepareBoostTask> {
|
||||
it.boostPath.setFrom(boostpath)
|
||||
it.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
|
||||
it.boostVersion.set("1.0.0")
|
||||
it.outputDir.set(output)
|
||||
}
|
||||
File(boostpath, "asm/asm.S").apply {
|
||||
parentFile.mkdirs()
|
||||
@@ -79,11 +79,11 @@ class PrepareBoostTaskTest {
|
||||
val boostThirdPartyJniPath = tempFolder.newFolder("boostpath/jni")
|
||||
val output = tempFolder.newFolder("output")
|
||||
val task =
|
||||
createTestTask<PrepareBoostTask> { task ->
|
||||
task.boostPath.setFrom(boostpath)
|
||||
task.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
|
||||
task.boostVersion.set("1.0.0")
|
||||
task.outputDir.set(output)
|
||||
createTestTask<PrepareBoostTask> {
|
||||
it.boostPath.setFrom(boostpath)
|
||||
it.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
|
||||
it.boostVersion.set("1.0.0")
|
||||
it.outputDir.set(output)
|
||||
}
|
||||
File(boostpath, "boost_1.0.0/boost/config.hpp").apply {
|
||||
parentFile.mkdirs()
|
||||
@@ -100,11 +100,11 @@ class PrepareBoostTaskTest {
|
||||
val boostThirdPartyJniPath = tempFolder.newFolder("boostpath/jni")
|
||||
val output = tempFolder.newFolder("output")
|
||||
val task =
|
||||
createTestTask<PrepareBoostTask> { task ->
|
||||
task.boostPath.setFrom(boostpath)
|
||||
task.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
|
||||
task.boostVersion.set("1.0.0")
|
||||
task.outputDir.set(output)
|
||||
createTestTask<PrepareBoostTask> {
|
||||
it.boostPath.setFrom(boostpath)
|
||||
it.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
|
||||
it.boostVersion.set("1.0.0")
|
||||
it.outputDir.set(output)
|
||||
}
|
||||
File(boostpath, "boost/boost/config.hpp").apply {
|
||||
parentFile.mkdirs()
|
||||
|
||||
+5
-5
@@ -122,11 +122,11 @@ class PrepareGlogTaskTest {
|
||||
val glogThirdPartyJniPath = tempFolder.newFolder("glogpath/jni")
|
||||
val output = tempFolder.newFolder("output")
|
||||
val task =
|
||||
createTestTask<PrepareGlogTask> { task ->
|
||||
task.glogPath.setFrom(glogpath)
|
||||
task.glogThirdPartyJniPath.set(glogThirdPartyJniPath)
|
||||
task.glogVersion.set("1.0.0")
|
||||
task.outputDir.set(output)
|
||||
createTestTask<PrepareGlogTask> {
|
||||
it.glogPath.setFrom(glogpath)
|
||||
it.glogThirdPartyJniPath.set(glogThirdPartyJniPath)
|
||||
it.glogVersion.set("1.0.0")
|
||||
it.outputDir.set(output)
|
||||
}
|
||||
File(glogpath, "glog-1.0.0/src/logging.h.in").apply {
|
||||
parentFile.mkdirs()
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ internal fun createZip(dest: File, paths: List<String>) {
|
||||
val uri = URI.create("jar:file:$dest")
|
||||
|
||||
FileSystems.newFileSystem(uri, env).use { zipfs ->
|
||||
paths.forEach { path ->
|
||||
val zipEntryPath = zipfs.getPath(path)
|
||||
paths.forEach {
|
||||
val zipEntryPath = zipfs.getPath(it)
|
||||
val zipEntryFolder = zipEntryPath.subpath(0, zipEntryPath.nameCount - 1)
|
||||
Files.createDirectories(zipEntryFolder)
|
||||
Files.createFile(zipEntryPath)
|
||||
|
||||
@@ -47,7 +47,7 @@ it('refuses non-spec compliant colors', () => {
|
||||
expect(normalizeColor('rgb (0, 1, 2)')).toBe(null);
|
||||
expect(normalizeColor('rgba(0 0 0 0.0)')).toBe(null);
|
||||
expect(normalizeColor('hsv(0, 1, 2)')).toBe(null);
|
||||
// $FlowExpectedError[incompatible-type] - Intentionally malformed argument.
|
||||
// $FlowExpectedError - Intentionally malformed argument.
|
||||
expect(normalizeColor({r: 10, g: 10, b: 10})).toBe(null);
|
||||
expect(normalizeColor('hsl(1%, 2, 3)')).toBe(null);
|
||||
expect(normalizeColor('rgb(1%, 2%, 3%)')).toBe(null);
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ const transform /*: BabelTransformer['transform'] */ = ({
|
||||
|
||||
// The result from `transformFromAstSync` can be null (if the file is ignored)
|
||||
if (!result) {
|
||||
/* $FlowFixMe[incompatible-type] BabelTransformer specifies that the `ast` can never be null but
|
||||
/* $FlowFixMe BabelTransformer specifies that the `ast` can never be null but
|
||||
* the function returns here. Discovered when typing `BabelNode`. */
|
||||
return {ast: null};
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ export function formatNativeSpecErrorStore(
|
||||
export function formatDiffSet(summary: DiffSummary): FormattedDiffSummary {
|
||||
const summaryStatus = summary.status;
|
||||
if (summaryStatus === 'ok' || summaryStatus === 'patchable') {
|
||||
// $FlowFixMe[incompatible-type] I don't think we can ever get in this branch
|
||||
// $FlowFixMe I don't think we can ever get in this branch
|
||||
return summary;
|
||||
}
|
||||
const hasteModules = Object.keys(summary.incompatibilityReport);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
import AnimatedImplementation from './AnimatedImplementation';
|
||||
|
||||
export type {CompositeAnimation} from './AnimatedImplementation';
|
||||
export type {DecayAnimationConfig} from './animations/DecayAnimation';
|
||||
export type {SpringAnimationConfig} from './animations/SpringAnimation';
|
||||
export type {TimingAnimationConfig} from './animations/TimingAnimation';
|
||||
|
||||
@@ -54,8 +54,7 @@ const AnimatedScrollView: AnimatedComponentType<
|
||||
props.style != null
|
||||
) {
|
||||
return (
|
||||
// $FlowFixMe[incompatible-type] - It should return an Animated ScrollView but it returns a ScrollView with Animated props applied.
|
||||
// $FlowFixMe[incompatible-variance]
|
||||
// $FlowFixMe - It should return an Animated ScrollView but it returns a ScrollView with Animated props applied.
|
||||
<AnimatedScrollViewWithInvertedRefreshControl
|
||||
scrollEventThrottle={0.0001}
|
||||
{...props}
|
||||
|
||||
@@ -14,7 +14,7 @@ import SectionList, {type SectionListProps} from '../../Lists/SectionList';
|
||||
import createAnimatedComponent from '../createAnimatedComponent';
|
||||
import * as React from 'react';
|
||||
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe
|
||||
export default (createAnimatedComponent(SectionList): component<
|
||||
// $FlowExpectedError[unclear-type]
|
||||
ItemT = any,
|
||||
|
||||
@@ -17,7 +17,6 @@ type ValueListenerCallback = (state: {value: number, ...}) => mixed;
|
||||
|
||||
export type AnimatedNodeConfig = $ReadOnly<{
|
||||
debugID?: string,
|
||||
unstable_disableBatchingForNativeCreate?: boolean,
|
||||
}>;
|
||||
|
||||
let _uniqueId = 1;
|
||||
@@ -43,8 +42,6 @@ export default class AnimatedNode {
|
||||
if (__DEV__) {
|
||||
this.__debugID = config?.debugID;
|
||||
}
|
||||
this.__disableBatchingForNativeCreate =
|
||||
config?.unstable_disableBatchingForNativeCreate;
|
||||
}
|
||||
|
||||
__attach(): void {}
|
||||
@@ -68,7 +65,6 @@ export default class AnimatedNode {
|
||||
/* Methods and props used by native Animated impl */
|
||||
__isNative: boolean = false;
|
||||
__nativeTag: ?number = undefined;
|
||||
__disableBatchingForNativeCreate: ?boolean = undefined;
|
||||
|
||||
__makeNative(platformConfig: ?PlatformConfig): void {
|
||||
// Subclasses are expected to set `__isNative` to true before this.
|
||||
@@ -146,9 +142,6 @@ export default class AnimatedNode {
|
||||
if (this._platformConfig) {
|
||||
config.platformConfig = this._platformConfig;
|
||||
}
|
||||
if (this.__disableBatchingForNativeCreate) {
|
||||
config.disableBatchingForNativeCreate = true;
|
||||
}
|
||||
NativeAnimatedHelper.API.createAnimatedNode(nativeTag, config);
|
||||
}
|
||||
return nativeTag;
|
||||
|
||||
@@ -68,8 +68,7 @@ __attribute__((deprecated(
|
||||
/// The window object, used to render the UViewControllers
|
||||
@property (nonatomic, strong, nonnull) UIWindow *window;
|
||||
|
||||
@property (nonatomic, nullable) RCTBridge *bridge
|
||||
__attribute__((deprecated("The bridge is deprecated and will be removed when removing the legacy architecture.")));
|
||||
@property (nonatomic, nullable) RCTBridge *bridge;
|
||||
@property (nonatomic, strong, nullable) NSString *moduleName;
|
||||
@property (nonatomic, strong, nullable) NSDictionary *initialProps;
|
||||
@property (nonatomic, strong) RCTReactNativeFactory *reactNativeFactory;
|
||||
@@ -77,9 +76,7 @@ __attribute__((deprecated(
|
||||
/// If `automaticallyLoadReactNativeWindow` is set to `true`, the React Native window will be loaded automatically.
|
||||
@property (nonatomic, assign) BOOL automaticallyLoadReactNativeWindow;
|
||||
|
||||
@property (nonatomic, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter __attribute__((
|
||||
deprecated("The bridge adapter is deprecated and will be removed when removing the legacy architecture.")));
|
||||
;
|
||||
@property (nonatomic, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter;
|
||||
|
||||
- (RCTRootViewFactory *)rootViewFactory;
|
||||
|
||||
|
||||
@@ -40,20 +40,17 @@ std::unique_ptr<facebook::react::JSExecutorFactory> RCTAppSetupDefaultJsExecutor
|
||||
|
||||
std::unique_ptr<facebook::react::JSExecutorFactory> RCTAppSetupJsExecutorFactoryForOldArch(
|
||||
RCTBridge *bridge,
|
||||
const std::shared_ptr<facebook::react::RuntimeScheduler> &runtimeScheduler)
|
||||
__attribute__((deprecated(
|
||||
"RCTAppSetupJsExecutorFactoryForOldArch(RCTBridge *, RuntimeScheduler) is deprecated and will be removed when we remove the legacy architecture.")));
|
||||
;
|
||||
const std::shared_ptr<facebook::react::RuntimeScheduler> &runtimeScheduler);
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
RCT_EXTERN_C_BEGIN
|
||||
|
||||
void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) __attribute__((deprecated(
|
||||
"RCTAppSetupPrepareApp(UIApplication, BOOL) is deprecated and it's signature will change when we remove the legacy arch")));
|
||||
UIView *
|
||||
RCTAppSetupDefaultRootView(RCTBridge *bridge, NSString *moduleName, NSDictionary *initialProperties, BOOL fabricEnabled)
|
||||
__attribute__((deprecated(
|
||||
"RCTAppSetupDefaultRootView(RCTBridge *, NSString *, NSDictionary *, BOOL) is deprecated and it's signature will change when we remove the legacy arch")));
|
||||
void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled);
|
||||
UIView *RCTAppSetupDefaultRootView(
|
||||
RCTBridge *bridge,
|
||||
NSString *moduleName,
|
||||
NSDictionary *initialProperties,
|
||||
BOOL fabricEnabled);
|
||||
|
||||
RCT_EXTERN_C_END
|
||||
|
||||
@@ -10,29 +10,27 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated(
|
||||
"RCTArchConfiguratorProtocol is deprecated and will be removed when we remove the legacy architecture.")));
|
||||
@protocol RCTArchConfiguratorProtocol
|
||||
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off.
|
||||
///
|
||||
/// @note: This is required to be rendering on Fabric (i.e. on the New Architecture).
|
||||
/// @return: `true` if the Turbo Native Module are enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)turboModuleEnabled __attribute__((deprecated("This will be removed in a future version of React Native")));
|
||||
- (BOOL)turboModuleEnabled __attribute__((deprecated("Use RCTIsNewArchEnabled instead")));
|
||||
|
||||
/// This method controls whether the App will use the Fabric renderer of the New Architecture or not.
|
||||
///
|
||||
/// @return: `true` if the Fabric Renderer is enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)fabricEnabled __attribute__((deprecated("This will be removed in a future version of React Native")));
|
||||
- (BOOL)fabricEnabled __attribute__((deprecated("Use RCTIsNewArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native's new initialization layer is enabled.
|
||||
///
|
||||
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
|
||||
- (BOOL)bridgelessEnabled __attribute__((deprecated("This will be removed in a future version of React Native")));
|
||||
- (BOOL)bridgelessEnabled __attribute__((deprecated("Use RCTIsNewArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native uses new Architecture.
|
||||
///
|
||||
/// @return: `true` if the new architecture is enabled. Otherwise returns `false`.
|
||||
- (BOOL)newArchEnabled __attribute__((deprecated("This will be removed in a future version of React Native")));
|
||||
- (BOOL)newArchEnabled __attribute__((deprecated("Use RCTIsNewArchEnabled instead")));
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -56,10 +56,7 @@ typedef NS_ENUM(NSInteger, RCTReleaseLevel) { Canary, Experimental, Stable };
|
||||
*
|
||||
* @returns: a newly created instance of RCTBridge.
|
||||
*/
|
||||
- (RCTBridge *)createBridgeWithDelegate:(id<RCTBridgeDelegate>)delegate
|
||||
launchOptions:(NSDictionary *)launchOptions
|
||||
__attribute__((deprecated(
|
||||
"createBridgeWithDelegate:launchOptions: is deprecated and will be removed when removing the legacy architecture.")));
|
||||
- (RCTBridge *)createBridgeWithDelegate:(id<RCTBridgeDelegate>)delegate launchOptions:(NSDictionary *)launchOptions;
|
||||
|
||||
/**
|
||||
* It creates a `UIView` starting from a bridge, a module name and a set of initial properties.
|
||||
@@ -75,9 +72,7 @@ typedef NS_ENUM(NSInteger, RCTReleaseLevel) { Canary, Experimental, Stable };
|
||||
*/
|
||||
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
|
||||
moduleName:(NSString *)moduleName
|
||||
initProps:(NSDictionary *)initProps
|
||||
__attribute__((deprecated(
|
||||
"createRootViewWithBridge:moduleName:initProps is deprecated and will be removed when removing the legacy architecture.")));
|
||||
initProps:(NSDictionary *)initProps;
|
||||
|
||||
/// This method returns a map of Component Descriptors and Components classes that needs to be registered in the
|
||||
/// new renderer. The Component Descriptor is a string which represent the name used in JS to refer to the native
|
||||
@@ -106,13 +101,10 @@ typedef NS_ENUM(NSInteger, RCTReleaseLevel) { Canary, Experimental, Stable };
|
||||
initialProperties:(NSDictionary *_Nullable)initialProperties
|
||||
launchOptions:(NSDictionary *_Nullable)launchOptions;
|
||||
|
||||
@property (nonatomic, nullable) RCTBridge *bridge
|
||||
__attribute__((deprecated("The bridge is deprecated and will be removed when removing the legacy architecture.")));
|
||||
@property (nonatomic, nullable) RCTBridge *bridge;
|
||||
@property (nonatomic, strong, nonnull) RCTRootViewFactory *rootViewFactory;
|
||||
|
||||
@property (nonatomic, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter __attribute__((
|
||||
deprecated("The bridgeAdapter is deprecated and will be removed when removing the legacy architecture.")));
|
||||
;
|
||||
@property (nonatomic, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter;
|
||||
|
||||
@property (nonatomic, weak) id<RCTReactNativeFactoryDelegate> delegate;
|
||||
|
||||
|
||||
@@ -65,15 +65,14 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
newArchEnabled:(BOOL)newArchEnabled
|
||||
turboModuleEnabled:(BOOL)turboModuleEnabled
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled __deprecated;
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled NS_DESIGNATED_INITIALIZER __deprecated;
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
||||
newArchEnabled:(BOOL)newArchEnabled
|
||||
turboModuleEnabled:(BOOL)turboModuleEnabled
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled __deprecated;
|
||||
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
newArchEnabled:(BOOL)newArchEnabled NS_DESIGNATED_INITIALIZER;
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock newArchEnabled:(BOOL)newArchEnabled;
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL newArchEnabled:(BOOL)newArchEnabled;
|
||||
|
||||
|
||||
@@ -38,12 +38,18 @@
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL newArchEnabled:(BOOL)newArchEnabled
|
||||
{
|
||||
return [self initWithBundleURL:bundleURL];
|
||||
return [self initWithBundleURL:bundleURL
|
||||
newArchEnabled:newArchEnabled
|
||||
turboModuleEnabled:newArchEnabled
|
||||
bridgelessEnabled:newArchEnabled];
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock newArchEnabled:(BOOL)newArchEnabled
|
||||
{
|
||||
return [self initWithBundleURLBlock:bundleURLBlock];
|
||||
return [self initWithBundleURLBlock:bundleURLBlock
|
||||
newArchEnabled:newArchEnabled
|
||||
turboModuleEnabled:newArchEnabled
|
||||
bridgelessEnabled:newArchEnabled];
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
||||
@@ -51,9 +57,13 @@
|
||||
turboModuleEnabled:(BOOL)turboModuleEnabled
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled
|
||||
{
|
||||
return [self initWithBundleURLBlock:^{
|
||||
return bundleURL;
|
||||
}];
|
||||
return [self
|
||||
initWithBundleURLBlock:^{
|
||||
return bundleURL;
|
||||
}
|
||||
newArchEnabled:newArchEnabled
|
||||
turboModuleEnabled:turboModuleEnabled
|
||||
bridgelessEnabled:bridgelessEnabled];
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
@@ -70,24 +80,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_bundleURLBlock = bundleURLBlock;
|
||||
_fabricEnabled = YES;
|
||||
_turboModuleEnabled = YES;
|
||||
_bridgelessEnabled = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
||||
{
|
||||
return [self initWithBundleURLBlock:^{
|
||||
return bundleURL;
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
|
||||
@@ -194,8 +186,8 @@
|
||||
RCTTurboModuleManager *turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
|
||||
delegate:_turboModuleManagerDelegate
|
||||
jsInvoker:callInvoker];
|
||||
_contextContainer->erase(facebook::react::RuntimeSchedulerKey);
|
||||
_contextContainer->insert(facebook::react::RuntimeSchedulerKey, _runtimeScheduler);
|
||||
_contextContainer->erase("RuntimeScheduler");
|
||||
_contextContainer->insert("RuntimeScheduler", _runtimeScheduler);
|
||||
return RCTAppSetupDefaultJsExecutorFactory(bridge, turboModuleManager, _runtimeScheduler);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import {
|
||||
VScrollContentViewNativeComponent,
|
||||
VScrollViewNativeComponent,
|
||||
} from '../../../src/private/components/scrollview/VScrollViewNativeComponents';
|
||||
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
|
||||
import AnimatedImplementation from '../../Animated/AnimatedImplementation';
|
||||
import FrameRateLogger from '../../Interaction/FrameRateLogger';
|
||||
import {findNodeHandle} from '../../ReactNative/RendererProxy';
|
||||
@@ -1504,7 +1503,7 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
|
||||
keyboardNeverPersistTaps &&
|
||||
this._keyboardIsDismissible() &&
|
||||
e.target != null &&
|
||||
// $FlowFixMe[incompatible-type] Error supressed during the migration of HostInstance to ReactNativeElement
|
||||
// $FlowFixMe Error supressed during the migration of HostInstance to ReactNativeElement
|
||||
!TextInputState.isTextInput(e.target)
|
||||
) {
|
||||
return true;
|
||||
@@ -1753,11 +1752,8 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
|
||||
|
||||
const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;
|
||||
|
||||
const {
|
||||
experimental_endDraggingSensitivityMultiplier,
|
||||
maintainVisibleContentPosition,
|
||||
...otherProps
|
||||
} = this.props;
|
||||
const {experimental_endDraggingSensitivityMultiplier, ...otherProps} =
|
||||
this.props;
|
||||
const props = {
|
||||
...otherProps,
|
||||
alwaysBounceHorizontal,
|
||||
@@ -1810,10 +1806,6 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
|
||||
this.props.snapToInterval != null ||
|
||||
this.props.snapToOffsets != null,
|
||||
}),
|
||||
maintainVisibleContentPosition:
|
||||
ReactNativeFeatureFlags.disableMaintainVisibleContentPosition()
|
||||
? undefined
|
||||
: this.props.maintainVisibleContentPosition,
|
||||
};
|
||||
|
||||
const {decelerationRate} = this.props;
|
||||
|
||||
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)}',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -677,9 +677,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
flattenedStyle.paddingVertical == null &&
|
||||
flattenedStyle.paddingTop == null));
|
||||
|
||||
const _accessibilityElementsHidden =
|
||||
props['aria-hidden'] ?? props.accessibilityElementsHidden;
|
||||
|
||||
textInput = (
|
||||
<RCTTextInputView
|
||||
// Figure out imperative + forward refs.
|
||||
@@ -689,7 +686,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
|
||||
accessibilityLabel={_accessibilityLabel}
|
||||
accessibilityState={_accessibilityState}
|
||||
accessibilityElementsHidden={_accessibilityElementsHidden}
|
||||
accessible={accessible}
|
||||
submitBehavior={submitBehavior}
|
||||
caretHidden={caretHidden}
|
||||
@@ -718,10 +714,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
const autoCapitalize = props.autoCapitalize || 'sentences';
|
||||
const _accessibilityLabelledBy =
|
||||
props?.['aria-labelledby'] ?? props?.accessibilityLabelledBy;
|
||||
const _importantForAccessibility =
|
||||
props['aria-hidden'] === true
|
||||
? ('no-hide-descendants' as const)
|
||||
: undefined;
|
||||
const placeholder = props.placeholder ?? '';
|
||||
let children = props.children;
|
||||
const childCount = React.Children.count(children);
|
||||
@@ -767,7 +759,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
children={children}
|
||||
disableFullscreenUI={props.disableFullscreenUI}
|
||||
focusable={tabIndex !== undefined ? !tabIndex : focusable}
|
||||
importantForAccessibility={_importantForAccessibility}
|
||||
mostRecentEventCount={mostRecentEventCount}
|
||||
nativeID={id ?? props.nativeID}
|
||||
numberOfLines={props.rows ?? props.numberOfLines}
|
||||
|
||||
@@ -88,7 +88,7 @@ function focusTextInput(textField: ?HostInstance) {
|
||||
if (textField != null) {
|
||||
const fieldCanBeFocused =
|
||||
currentlyFocusedInputRef !== textField &&
|
||||
// $FlowFixMe[prop-missing] - `currentProps` is missing in `NativeMethods`
|
||||
// $FlowFixMe - `currentProps` is missing in `NativeMethods`
|
||||
textField.currentProps?.editable !== false;
|
||||
|
||||
if (!fieldCanBeFocused) {
|
||||
|
||||
+1
-2
@@ -123,7 +123,7 @@ jest.unmock('../TextInput');
|
||||
throw new Error('Expected `textInputElement` to be non-null');
|
||||
}
|
||||
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe
|
||||
textInputElement.currentProps = textInputElement.props;
|
||||
expect(textInputElement.isFocused()).toBe(false);
|
||||
|
||||
@@ -432,7 +432,6 @@ jest.unmock('../TextInput');
|
||||
|
||||
expect(instance.toJSON()).toMatchInlineSnapshot(`
|
||||
<RCTSinglelineTextInputView
|
||||
accessibilityElementsHidden={true}
|
||||
accessibilityLabel="label"
|
||||
accessibilityState={
|
||||
Object {
|
||||
|
||||
@@ -339,30 +339,18 @@ describe('<View>', () => {
|
||||
});
|
||||
|
||||
describe('accessibilityElementsHidden', () => {
|
||||
it("is an iOS-only prop and ignored by Fantom (Android)'s BaseViewConfig", () => {
|
||||
it('is not propagated to mounting layer, it is iOS only prop', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<View accessibilityElementsHidden={true} collapsable={false} />,
|
||||
);
|
||||
root.render(<View accessibilityElementsHidden={true} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(<rn-view />);
|
||||
});
|
||||
});
|
||||
|
||||
describe('aria-hidden', () => {
|
||||
it('is mapped to importantForAccessibility', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<View aria-hidden={true} collapsable={false} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-view importantForAccessibility="no-hide-descendants" />,
|
||||
);
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({props: ['accessibilityElementsHidden']})
|
||||
.toJSX(),
|
||||
).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -477,10 +477,8 @@ if (!NativeTiming) {
|
||||
ExportedJSTimers = ({
|
||||
callReactNativeMicrotasks: JSTimers.callReactNativeMicrotasks,
|
||||
queueReactNativeMicrotask: JSTimers.queueReactNativeMicrotask,
|
||||
// $FlowFixMe[incompatible-variance]
|
||||
}: typeof JSTimers);
|
||||
} else {
|
||||
// $FlowFixMe[incompatible-variance]
|
||||
ExportedJSTimers = JSTimers;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,17 +4,19 @@
|
||||
* 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
|
||||
* @flow strict
|
||||
* @format
|
||||
*/
|
||||
|
||||
import setUpPerformanceModern from '../../src/private/setup/setUpPerformanceModern';
|
||||
import NativePerformance from '../../src/private/webapis/performance/specs/NativePerformance';
|
||||
|
||||
// In case if the native implementation of the Performance API is available, use it,
|
||||
// otherwise fall back to the legacy/default one, which only defines 'Performance.now()'
|
||||
if (NativePerformance) {
|
||||
setUpPerformanceModern();
|
||||
const Performance =
|
||||
require('../../src/private/webapis/performance/Performance').default;
|
||||
// $FlowExpectedError[cannot-write]
|
||||
global.performance = new Performance();
|
||||
} else {
|
||||
if (!global.performance) {
|
||||
// $FlowExpectedError[cannot-write]
|
||||
|
||||
@@ -148,7 +148,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInImage()) {
|
||||
'aria-checked': ariaChecked,
|
||||
'aria-disabled': ariaDisabled,
|
||||
'aria-expanded': ariaExpanded,
|
||||
'aria-hidden': ariaHidden,
|
||||
'aria-label': ariaLabel,
|
||||
'aria-selected': ariaSelected,
|
||||
accessibilityLabel,
|
||||
@@ -303,10 +302,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInImage()) {
|
||||
};
|
||||
}
|
||||
|
||||
if (ariaHidden === true) {
|
||||
nativeProps.importantForAccessibility = 'no-hide-descendants';
|
||||
}
|
||||
|
||||
const flattenedStyle_ = flattenStyle<ImageStyleProp>(style);
|
||||
const objectFit_ = convertObjectFitToResizeMode(flattenedStyle_?.objectFit);
|
||||
const resizeMode_ =
|
||||
@@ -392,7 +387,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInImage()) {
|
||||
// in order to have a better alignment between platforms in the future.
|
||||
src: sources,
|
||||
source: sources,
|
||||
/* $FlowFixMe[prop-missing](>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
headers: (source?.[0]?.headers || source?.headers: ?{[string]: string}),
|
||||
defaultSource: defaultSource ? defaultSource.uri : null,
|
||||
@@ -411,10 +406,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInImage()) {
|
||||
expanded: props['aria-expanded'] ?? props.accessibilityState?.expanded,
|
||||
selected: props['aria-selected'] ?? props.accessibilityState?.selected,
|
||||
},
|
||||
importantForAccessibility:
|
||||
props['aria-hidden'] === true
|
||||
? ('no-hide-descendants' as const)
|
||||
: props.importantForAccessibility,
|
||||
};
|
||||
|
||||
const flattenedStyle = flattenStyle<ImageStyleProp>(style);
|
||||
|
||||
@@ -153,7 +153,6 @@ let BaseImage: AbstractImageIOS = ({
|
||||
'aria-disabled': ariaDisabled,
|
||||
'aria-expanded': ariaExpanded,
|
||||
'aria-selected': ariaSelected,
|
||||
'aria-hidden': ariaHidden,
|
||||
src,
|
||||
...restProps
|
||||
} = props;
|
||||
@@ -165,10 +164,6 @@ let BaseImage: AbstractImageIOS = ({
|
||||
expanded: ariaExpanded ?? props.accessibilityState?.expanded,
|
||||
selected: ariaSelected ?? props.accessibilityState?.selected,
|
||||
};
|
||||
|
||||
// In order for `aria-hidden` to work on iOS we must set `accessible` to false (`accessibilityElementsHidden` is not enough).
|
||||
const accessible =
|
||||
ariaHidden !== true && (props.alt !== undefined ? true : props.accessible);
|
||||
const accessibilityLabel = props['aria-label'] ?? props.accessibilityLabel;
|
||||
|
||||
const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
|
||||
@@ -180,7 +175,7 @@ let BaseImage: AbstractImageIOS = ({
|
||||
<ImageViewNativeComponent
|
||||
accessibilityState={_accessibilityState}
|
||||
{...restProps}
|
||||
accessible={accessible}
|
||||
accessible={props.alt !== undefined ? true : props.accessible}
|
||||
accessibilityLabel={accessibilityLabel ?? props.alt}
|
||||
ref={actualRef}
|
||||
style={style}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTImageShadowView : RCTShadowView
|
||||
|
||||
@end
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
@class RCTBridge;
|
||||
@class RCTImageSource;
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTImageView : RCTView
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTImageViewManager : RCTViewManager
|
||||
|
||||
@end
|
||||
|
||||
@@ -597,20 +597,6 @@ describe('<Image>', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('aria-hidden', () => {
|
||||
it('is is passed as importantForAccessibility', () => {
|
||||
const root = Fantom.createRoot();
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Image aria-hidden={true} />);
|
||||
});
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({props: ['importantForAccessibility']})
|
||||
.toJSX(),
|
||||
).toEqual(<rn-image importantForAccessibility="no-hide-descendants" />);
|
||||
});
|
||||
});
|
||||
|
||||
component TestComponent(testID?: ?string, ...props: AccessibilityProps) {
|
||||
return <Image {...props} testID={testID} source={LOGO_SOURCE} />;
|
||||
}
|
||||
|
||||
+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';
|
||||
|
||||
@@ -36,7 +36,7 @@ export function testBadDataWithTypicalItem(): React.Node {
|
||||
key: 1,
|
||||
},
|
||||
];
|
||||
// $FlowExpectedError[incompatible-type] - bad title type 6, should be string
|
||||
// $FlowExpectedError - bad title type 6, should be string
|
||||
return <FlatList renderItem={renderMyListItem} data={data} />;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export function testMissingFieldWithTypicalItem(): React.Node {
|
||||
key: 1,
|
||||
},
|
||||
];
|
||||
// $FlowExpectedError[incompatible-type] - missing title
|
||||
// $FlowExpectedError - missing title
|
||||
return <FlatList renderItem={renderMyListItem} data={data} />;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export function testGoodDataWithBadCustomRenderItemFunction(): React.Node {
|
||||
renderItem={info => (
|
||||
<span>
|
||||
{
|
||||
// $FlowExpectedError[prop-missing] - bad widgetCount type 6, should be Object
|
||||
// $FlowExpectedError - bad widgetCount type 6, should be Object
|
||||
info.item.widget.missingProp
|
||||
}
|
||||
</span>
|
||||
@@ -80,26 +80,22 @@ export function testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
|
||||
},
|
||||
];
|
||||
return [
|
||||
// $FlowExpectedError[incompatible-type] - title should be inside `item`
|
||||
// $FlowExpectedError[incompatible-exact]
|
||||
// $FlowExpectedError - title should be inside `item`
|
||||
<FlatList renderItem={(info: {title: string}) => <span />} data={data} />,
|
||||
<FlatList
|
||||
// $FlowExpectedError[incompatible-type] - bad index type string, should be number
|
||||
// $FlowExpectedError[incompatible-exact]
|
||||
// $FlowExpectedError[unclear-type]
|
||||
// $FlowExpectedError - bad index type string, should be number
|
||||
renderItem={(info: {item: any, index: string}) => <span />}
|
||||
data={data}
|
||||
/>,
|
||||
<FlatList
|
||||
// $FlowExpectedError[incompatible-type] - bad index type string, should be number
|
||||
// $FlowExpectedError[incompatible-exact]
|
||||
// $FlowExpectedError - bad title type number, should be string
|
||||
renderItem={(info: {item: {title: number}}) => <span />}
|
||||
// $FlowExpectedError[incompatible-type] - bad title type number, should be string
|
||||
// $FlowExpectedError - bad title type number, should be string
|
||||
data={data}
|
||||
/>,
|
||||
// EverythingIsFine
|
||||
<FlatList
|
||||
// $FlowExpectedError[incompatible-type] - bad title type number, should be string
|
||||
// $FlowExpectedError - bad title type number, should be string
|
||||
renderItem={(info: {item: {title: string, ...}, ...}) => <span />}
|
||||
data={data}
|
||||
/>,
|
||||
@@ -108,11 +104,11 @@ export function testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
|
||||
|
||||
export function testOtherBadProps(): $ReadOnlyArray<React.Node> {
|
||||
return [
|
||||
// $FlowExpectedError[incompatible-type] - bad numColumns type "lots"
|
||||
// $FlowExpectedError - bad numColumns type "lots"
|
||||
<FlatList renderItem={renderMyListItem} data={[]} numColumns="lots" />,
|
||||
// $FlowExpectedError[incompatible-type] - bad windowSize type "big"
|
||||
// $FlowExpectedError - bad windowSize type "big"
|
||||
<FlatList renderItem={renderMyListItem} data={[]} windowSize="big" />,
|
||||
// $FlowExpectedError[incompatible-type] - missing `data` prop
|
||||
// $FlowExpectedError - missing `data` prop
|
||||
<FlatList renderItem={renderMyListItem} />,
|
||||
];
|
||||
}
|
||||
|
||||
+6
-6
@@ -55,13 +55,12 @@ export function testBadRenderItemFunction(): $ReadOnlyArray<React.Node> {
|
||||
];
|
||||
return [
|
||||
<SectionList
|
||||
// $FlowExpectedError[incompatible-type] - title should be inside `item`
|
||||
// $FlowExpectedError - title should be inside `item`
|
||||
renderItem={(info: {title: string, ...}) => <span />}
|
||||
sections={sections}
|
||||
/>,
|
||||
<SectionList
|
||||
// $FlowExpectedError[incompatible-type] - bad index type string, should be number
|
||||
// $FlowExpectedError[incompatible-exact]
|
||||
// $FlowExpectedError - bad index type string, should be number
|
||||
renderItem={(info: {index: string}) => <span />}
|
||||
sections={sections}
|
||||
/>,
|
||||
@@ -79,14 +78,14 @@ export function testBadInheritedDefaultProp(): React.MixedElement {
|
||||
<SectionList
|
||||
renderItem={renderMyListItem}
|
||||
sections={sections}
|
||||
// $FlowExpectedError[incompatible-type] - bad windowSize type "big"
|
||||
// $FlowExpectedError - bad windowSize type "big"
|
||||
windowSize="big"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function testMissingData(): React.MixedElement {
|
||||
// $FlowExpectedError[incompatible-type] - missing `sections` prop
|
||||
// $FlowExpectedError - missing `sections` prop
|
||||
return <SectionList renderItem={renderMyListItem} />;
|
||||
}
|
||||
|
||||
@@ -102,6 +101,7 @@ export function testBadSectionsShape(): React.MixedElement {
|
||||
],
|
||||
},
|
||||
];
|
||||
// $FlowExpectedError - section missing `data` field
|
||||
return <SectionList renderItem={renderMyListItem} sections={sections} />;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ export function testBadSectionsMetadata(): React.MixedElement {
|
||||
<SectionList
|
||||
renderSectionHeader={renderMyHeader}
|
||||
renderItem={renderMyListItem}
|
||||
/* $FlowExpectedError[incompatible-type] - section has bad meta data `fooNumber` field of
|
||||
/* $FlowExpectedError - section has bad meta data `fooNumber` field of
|
||||
* type string */
|
||||
sections={sections}
|
||||
/>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Vendored
+2
-2
@@ -58,12 +58,12 @@ export default class ReactFabricHostComponent implements NativeMethods {
|
||||
}
|
||||
|
||||
blur() {
|
||||
// $FlowFixMe[incompatible-type] - Error supressed during the migration of HostInstance to ReactNativeElement
|
||||
// $FlowFixMe - Error supressed during the migration of HostInstance to ReactNativeElement
|
||||
TextInputState.blurTextInput(this);
|
||||
}
|
||||
|
||||
focus() {
|
||||
// $FlowFixMe[incompatible-type] - Error supressed during the migration of HostInstance to ReactNativeElement
|
||||
// $FlowFixMe - Error supressed during the migration of HostInstance to ReactNativeElement
|
||||
TextInputState.focusTextInput(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,14 +47,14 @@ const getMethod: (<MethodName: $Keys<ReactFabricType>>(
|
||||
) => ReactNativeType[MethodName]) = (getRenderer, methodName) => {
|
||||
let cachedImpl;
|
||||
|
||||
// $FlowExpectedError[incompatible-type]
|
||||
// $FlowExpectedError
|
||||
return function (arg1, arg2, arg3, arg4, arg5, arg6) {
|
||||
if (cachedImpl == null) {
|
||||
// $FlowExpectedError[prop-missing]
|
||||
// $FlowExpectedError
|
||||
cachedImpl = getRenderer()[methodName];
|
||||
}
|
||||
|
||||
// $FlowExpectedError[extra-arg]
|
||||
// $FlowExpectedError
|
||||
return cachedImpl(arg1, arg2, arg3, arg4, arg5);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -76,7 +76,6 @@ export default function renderApplication<Props: Object>(
|
||||
if (useOffscreen && displayMode != null) {
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe[missing-export]
|
||||
const Activity: ActivityType = React.unstable_Activity;
|
||||
|
||||
renderable = (
|
||||
|
||||
+22
-7
@@ -17,7 +17,13 @@ export interface StyleSheetProperties {
|
||||
type Falsy = undefined | null | false | '';
|
||||
interface RecursiveArray<T>
|
||||
extends Array<T | ReadonlyArray<T> | RecursiveArray<T>> {}
|
||||
export type StyleProp<T> = T | RecursiveArray<T | Falsy> | Falsy;
|
||||
/** Keep a brand of 'T' so that calls to `StyleSheet.flatten` can take `RegisteredStyle<T>` and return `T`. */
|
||||
type RegisteredStyle<T> = number & {__registeredStyleBrand: T};
|
||||
export type StyleProp<T> =
|
||||
| T
|
||||
| RegisteredStyle<T>
|
||||
| RecursiveArray<T | RegisteredStyle<T> | Falsy>
|
||||
| Falsy;
|
||||
|
||||
type OpaqueColorValue = symbol & {__TYPE__: 'Color'};
|
||||
export type ColorValue = string | OpaqueColorValue;
|
||||
@@ -121,15 +127,24 @@ export namespace StyleSheet {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
|
||||
* used to create a customized entry in a `StyleSheet`, e.g.:
|
||||
*
|
||||
* const styles = StyleSheet.create({
|
||||
* wrapper: {
|
||||
* ...StyleSheet.absoluteFillObject,
|
||||
* top: 10,
|
||||
* backgroundColor: 'transparent',
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export const absoluteFillObject: AbsoluteFillStyle;
|
||||
|
||||
/**
|
||||
* A very common pattern is to create overlays with position absolute and zero positioning,
|
||||
* so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
|
||||
* styles.
|
||||
*/
|
||||
export const absoluteFill: AbsoluteFillStyle;
|
||||
|
||||
/**
|
||||
* @deprecated Use `StyleSheet.absoluteFill`.
|
||||
*/
|
||||
export const absoluteFillObject: AbsoluteFillStyle;
|
||||
export const absoluteFill: RegisteredStyle<AbsoluteFillStyle>;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,13 @@ if (hairlineWidth === 0) {
|
||||
hairlineWidth = 1 / PixelRatio.get();
|
||||
}
|
||||
|
||||
const absoluteFill = {
|
||||
const absoluteFill: {
|
||||
+bottom: 0,
|
||||
+left: 0,
|
||||
+position: 'absolute',
|
||||
+right: 0,
|
||||
+top: 0,
|
||||
} = {
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
right: 0,
|
||||
@@ -102,7 +108,7 @@ export default {
|
||||
* so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
|
||||
* styles.
|
||||
*/
|
||||
absoluteFill,
|
||||
absoluteFill: (absoluteFill: any), // TODO: This should be updated after we fix downstream Flow sites.
|
||||
|
||||
/**
|
||||
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
|
||||
|
||||
@@ -13,14 +13,6 @@ import type {____Styles_Internal} from './StyleSheetTypes';
|
||||
import composeStyles from '../../src/private/styles/composeStyles';
|
||||
import flattenStyle from './flattenStyle';
|
||||
|
||||
type AbsoluteFillStyle = $ReadOnly<{
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
}>;
|
||||
|
||||
/**
|
||||
* This is defined as the width of a thin line on the platform. It can be
|
||||
* used as the thickness of a border or division between two elements.
|
||||
@@ -45,12 +37,27 @@ declare export const hairlineWidth: number;
|
||||
* so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
|
||||
* styles.
|
||||
*/
|
||||
declare export const absoluteFill: AbsoluteFillStyle;
|
||||
declare export const absoluteFill: any;
|
||||
|
||||
/**
|
||||
* @deprecated Use `StyleSheet.absoluteFill`.
|
||||
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
|
||||
* used to create a customized entry in a `StyleSheet`, e.g.:
|
||||
*
|
||||
* const styles = StyleSheet.create({
|
||||
* wrapper: {
|
||||
* ...StyleSheet.absoluteFillObject,
|
||||
* top: 10,
|
||||
* backgroundColor: 'transparent',
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
declare export const absoluteFillObject: AbsoluteFillStyle;
|
||||
declare export const absoluteFillObject: {
|
||||
+bottom: 0,
|
||||
+left: 0,
|
||||
+position: 'absolute',
|
||||
+right: 0,
|
||||
+top: 0,
|
||||
};
|
||||
|
||||
/**
|
||||
* Combines two styles such that style2 will override any styles in style1.
|
||||
|
||||
+8
-4
@@ -37,13 +37,17 @@ export function testGoodCompose() {
|
||||
}
|
||||
|
||||
export function testBadCompose() {
|
||||
// $FlowExpectedError[incompatible-type] - Incompatible type.
|
||||
// $FlowExpectedError - Incompatible type.
|
||||
(StyleSheet.compose(textStyle, textStyle): ImageStyleProp);
|
||||
|
||||
// $FlowExpectedError[incompatible-type] - Incompatible type.
|
||||
(StyleSheet.compose([textStyle], null): ImageStyleProp);
|
||||
// $FlowExpectedError - Incompatible type.
|
||||
(StyleSheet.compose(
|
||||
// $FlowExpectedError - Incompatible type.
|
||||
[textStyle],
|
||||
null,
|
||||
): ImageStyleProp);
|
||||
|
||||
// $FlowExpectedError[incompatible-type] - Incompatible type.
|
||||
// $FlowExpectedError - Incompatible type.
|
||||
(StyleSheet.compose(
|
||||
Math.random() < 0.5 ? textStyle : null,
|
||||
null,
|
||||
|
||||
@@ -69,9 +69,9 @@ export default function processFilter(
|
||||
|
||||
if (amount != null) {
|
||||
const filterFunction = {};
|
||||
// $FlowFixMe[prop-missing] The key will be the correct one but flow can't see that.
|
||||
// $FlowFixMe The key will be the correct one but flow can't see that.
|
||||
filterFunction[camelizedName] = amount;
|
||||
// $FlowFixMe[incompatible-type] The key will be the correct one but flow can't see that.
|
||||
// $FlowFixMe The key will be the correct one but flow can't see that.
|
||||
result.push(filterFunction);
|
||||
} else {
|
||||
// If any primitive is invalid then apply none of the filters. This is how
|
||||
@@ -85,7 +85,7 @@ export default function processFilter(
|
||||
for (const filterFunction of filter) {
|
||||
const [filterName, filterValue] = Object.entries(filterFunction)[0];
|
||||
if (filterName === 'dropShadow') {
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe
|
||||
const dropShadow = parseDropShadow(filterValue);
|
||||
if (dropShadow == null) {
|
||||
return [];
|
||||
@@ -96,9 +96,9 @@ export default function processFilter(
|
||||
|
||||
if (amount != null) {
|
||||
const resultObject = {};
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe
|
||||
resultObject[filterName] = amount;
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe
|
||||
result.push(resultObject);
|
||||
} else {
|
||||
// If any primitive is invalid then apply none of the filters. This is how
|
||||
|
||||
@@ -13,10 +13,8 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString *const RCTBaseTextShadowViewEmbeddedShadowViewAttributeName
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")));
|
||||
extern NSString *const RCTBaseTextShadowViewEmbeddedShadowViewAttributeName;
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTBaseTextShadowView : RCTShadowView {
|
||||
@protected
|
||||
NSAttributedString *_Nullable cachedAttributedText;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTBaseTextViewManager : RCTViewManager
|
||||
|
||||
@end
|
||||
|
||||
@@ -15,18 +15,15 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString *const RCTTextAttributesIsHighlightedAttributeName
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")));
|
||||
extern NSString *const RCTTextAttributesTagAttributeName
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")));
|
||||
extern NSString *const RCTTextAttributesIsHighlightedAttributeName;
|
||||
extern NSString *const RCTTextAttributesTagAttributeName;
|
||||
|
||||
/**
|
||||
* Represents knowledge about all supported *text* attributes
|
||||
* assigned to some text component such as <Text>, <VirtualText>,
|
||||
* and <TextInput>.
|
||||
*/
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTTextAttributes : NSObject<NSCopying>
|
||||
@interface RCTTextAttributes : NSObject <NSCopying>
|
||||
|
||||
// Color
|
||||
@property (nonatomic, strong, nullable) UIColor *foregroundColor;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTRawTextShadowView : RCTShadowView
|
||||
|
||||
@property (nonatomic, copy, nullable) NSString *text;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTRawTextViewManager : RCTViewManager
|
||||
|
||||
@end
|
||||
|
||||
-26
@@ -51,7 +51,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
'aria-checked': ariaChecked,
|
||||
'aria-disabled': ariaDisabled,
|
||||
'aria-expanded': ariaExpanded,
|
||||
'aria-hidden': ariaHidden,
|
||||
'aria-label': ariaLabel,
|
||||
'aria-selected': ariaSelected,
|
||||
children,
|
||||
@@ -127,13 +126,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
_accessibilityState.disabled = _disabled;
|
||||
}
|
||||
|
||||
if (ariaHidden !== undefined) {
|
||||
processedProps.accessibilityElementsHidden = ariaHidden;
|
||||
if (ariaHidden === true) {
|
||||
processedProps.importantForAccessibility = 'no-hide-descendants';
|
||||
}
|
||||
}
|
||||
|
||||
const _accessible = Platform.select({
|
||||
ios: accessible !== false,
|
||||
android:
|
||||
@@ -314,8 +306,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
) = ({
|
||||
ref: forwardedRef,
|
||||
accessible,
|
||||
accessibilityElementsHidden,
|
||||
importantForAccessibility,
|
||||
accessibilityLabel,
|
||||
accessibilityState,
|
||||
allowFontScaling,
|
||||
@@ -323,7 +313,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
'aria-checked': ariaChecked,
|
||||
'aria-disabled': ariaDisabled,
|
||||
'aria-expanded': ariaExpanded,
|
||||
'aria-hidden': ariaHidden,
|
||||
'aria-label': ariaLabel,
|
||||
'aria-selected': ariaSelected,
|
||||
children,
|
||||
@@ -385,13 +374,6 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
const _accessibilityStateDisabled = _accessibilityState?.disabled;
|
||||
const _disabled = disabled ?? _accessibilityStateDisabled;
|
||||
|
||||
let _accessibilityElementsHidden =
|
||||
ariaHidden ?? accessibilityElementsHidden;
|
||||
let _importantForAccessibility = importantForAccessibility;
|
||||
if (ariaHidden === true) {
|
||||
_importantForAccessibility = 'no-hide-descendants';
|
||||
}
|
||||
|
||||
const isPressable =
|
||||
(onPress != null ||
|
||||
onLongPress != null ||
|
||||
@@ -460,10 +442,8 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
ref={forwardedRef}
|
||||
textProps={{
|
||||
...restProps,
|
||||
accessibilityElementsHidden: _accessibilityElementsHidden,
|
||||
accessibilityLabel: _accessibilityLabel,
|
||||
accessibilityState: _accessibilityState,
|
||||
importantForAccessibility: _importantForAccessibility,
|
||||
nativeID: _nativeID,
|
||||
numberOfLines: _numberOfLines,
|
||||
selectable: _selectable,
|
||||
@@ -493,10 +473,8 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
return (
|
||||
<NativeVirtualText
|
||||
{...restProps}
|
||||
accessibilityElementsHidden={_accessibilityElementsHidden}
|
||||
accessibilityLabel={_accessibilityLabel}
|
||||
accessibilityState={_accessibilityState}
|
||||
importantForAccessibility={_importantForAccessibility}
|
||||
nativeID={_nativeID}
|
||||
numberOfLines={_numberOfLines}
|
||||
ref={forwardedRef}
|
||||
@@ -536,14 +514,12 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
ref={forwardedRef}
|
||||
textProps={{
|
||||
...restProps,
|
||||
accessibilityElementsHidden: _accessibilityElementsHidden,
|
||||
accessibilityLabel: _accessibilityLabel,
|
||||
accessibilityState: _accessibilityState,
|
||||
accessible: _accessible,
|
||||
allowFontScaling: allowFontScaling !== false,
|
||||
disabled: _disabled,
|
||||
ellipsizeMode: ellipsizeMode ?? 'tail',
|
||||
importantForAccessibility: _importantForAccessibility,
|
||||
nativeID: _nativeID,
|
||||
numberOfLines: _numberOfLines,
|
||||
selectable: _selectable,
|
||||
@@ -571,14 +547,12 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) {
|
||||
nativeText = (
|
||||
<NativeText
|
||||
{...restProps}
|
||||
accessibilityElementsHidden={_accessibilityElementsHidden}
|
||||
accessibilityLabel={_accessibilityLabel}
|
||||
accessibilityState={_accessibilityState}
|
||||
accessible={_accessible}
|
||||
allowFontScaling={allowFontScaling !== false}
|
||||
disabled={_disabled}
|
||||
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
||||
importantForAccessibility={_importantForAccessibility}
|
||||
nativeID={_nativeID}
|
||||
numberOfLines={_numberOfLines}
|
||||
ref={forwardedRef}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTTextShadowView : RCTBaseTextShadowView
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTTextView : UIView
|
||||
|
||||
@property (nonatomic, assign) BOOL selectable;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#import "RCTBaseTextViewManager.h"
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTTextViewManager : RCTBaseTextViewManager
|
||||
|
||||
@end
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTMultilineTextInputView : RCTBaseTextInputView
|
||||
|
||||
@end
|
||||
|
||||
-1
@@ -11,7 +11,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTMultilineTextInputViewManager : RCTBaseTextInputViewManager
|
||||
|
||||
@end
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTBaseTextInputShadowView : RCTBaseTextShadowView
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTBaseTextInputView : RCTView<RCTBackedTextInputDelegate>
|
||||
@interface RCTBaseTextInputView : RCTView <RCTBackedTextInputDelegate>
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTBaseTextInputViewManager : RCTBaseTextViewManager
|
||||
|
||||
@end
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#ifndef RCT_FIT_RM_OLD_COMPONENT
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTInputAccessoryShadowView : RCTShadowView
|
||||
|
||||
@end
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
@class RCTBridge;
|
||||
@class RCTInputAccessoryViewContent;
|
||||
|
||||
__attribute__((deprecated("This API will be removed along with the legacy architecture.")))
|
||||
@interface RCTInputAccessoryView : UIView
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user