Compare commits

..
Author SHA1 Message Date
Blake Friedman 3ab6be778d CLI start working without rnc/cli-server-api
When decoupling the community-cli-plugin from the
@react-native-community/cli-server-api (#45311), a middleware stub was
created to allow a runtime stub to be used in this case. This middleware
should be used so as not to break when the optional cli-server-api
dependency isn't present.

Changelog: [General][Fix] - Fix npm react-native start when
cli-server-api isn't installed

Testing: Forced a runtime exception simulating the package not being
dependent and was able to build rn-tester.
2024-11-06 11:02:29 +00:00
Riccardo CipolleschiandFacebook GitHub Bot f94ca27986 Add job to test libraries on nightlies (#47409)
Summary:
We want to test libraries against React Native nightlies to check when we introduce breakig change

## Changelog:
[Internal] - Add CI tests for libraries

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

Test Plan: GHA - https://github.com/facebook/react-native/actions/runs/11700016815/job/32583153239?pr=47409

Reviewed By: cortinico

Differential Revision: D65530787

Pulled By: cipolleschi

fbshipit-source-id: ef4d13c30995f119715ef4f12ea51eaa65152518
2024-11-06 02:32:16 -08:00
David VaccaandFacebook GitHub Bot fddf7aaad1 Migrate ReactHorizontalScrollContainerViewManager to use ViewManagerInterface (#47395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47395

Migrate ReactHorizontalScrollContainerViewManager to use ViewManagerInterface

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428646

fbshipit-source-id: 7e36f3642ac31aa747c2b7f21c251173516fffad
2024-11-06 00:01:07 -08:00
David VaccaandFacebook GitHub Bot bed778fa5a Migrate ReactUnimplementedViewManager to use ViewManagerInterface (#47392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47392

Migrate ReactUnimplementedViewManager to use ViewManagerInterface

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428644

fbshipit-source-id: 011d06b6cb06c4fcc5e072b625b943ec6b7f1a62
2024-11-06 00:01:07 -08:00
David VaccaandFacebook GitHub Bot b4a24a163c Migrate DebuggingOverlayManager to use ViewManagerDelegate (#47393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47393

Migrate DebuggingOverlayManager to use ViewManagerDelegate

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428645

fbshipit-source-id: 9cf6932a209935b6e85b7d8870a7aa610c45aded
2024-11-06 00:01:07 -08:00
David VaccaandFacebook GitHub Bot 496b0a8729 Migrate ReactVirtualTextShadowNode to kotlin and make it internal (#47434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47434

Migrate ReactVirtualTextShadowNode to kotlin and make it internal

changelog: [Android][Breaking] Reduce visibility of ReactVirtualTextShadowNode to internal

Reviewed By: shwanton

Differential Revision: D65493927

fbshipit-source-id: 2b5997d000b5dc489ba93edb226455ef0855b98b
2024-11-05 21:44:38 -08:00
David VaccaandFacebook GitHub Bot 4a119c4c3a Migrate ReactVirtualTextViewManager to kotlin and reduce visibility tointernal (#47402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47402

Migrate ReactVirtualTextViewManager to kotlin and reduce visibility tointernal

changelog: [Android][Breaking] Reduce visibility of ReactVirtualTextViewManager to internal

Reviewed By: cortinico

Differential Revision: D65462051

fbshipit-source-id: fa6daef4e557d527d594616ca032ebf0180cbba2
2024-11-05 21:44:38 -08:00
David VaccaandFacebook GitHub Bot 5c3c1524dd Exclude $$PropSetter classes from public API (#47432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47432

In this diff we are excluding the $$PropSetter classes from public API, we do this by adding the UnstableReactNativeAPI annotation on all $$PropSetter classes

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65488026

fbshipit-source-id: 9f1bbe7b25fa69c0a40f6cb0ff38a8ae6ee8d97d
2024-11-05 21:44:38 -08:00
Phillip PanandFacebook GitHub Bot b7ec7523cc clean up contextContainer->insert("ReactNativeConfig") from oss (#47350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47350

Changelog: [Internal]

we don't need any of these now since no one is calling `contextContainer_->at<std::shared_ptr>("ReactNativeConfig")` anymore

Reviewed By: NickGerleman

Differential Revision: D65304976

fbshipit-source-id: 5f835ab9ac429aa1942cc8d9669812c1ac994238
2024-11-05 17:43:18 -08:00
Nicola CortiandFacebook GitHub Bot 39dfbadd5d Stable API - Make classes in com.facebook.react.views.safeareaview internal (#47375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47375

This makes the following class internal:
- ReactSafeAreaView
- ReactSafeAreaViewManager

Those classes should have not been exposed in the first place. Marked as breaking but no
meaningful usages are available in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.views.safeareaview.ReactSafeAreaView

Changelog:
[Android] [Breaking] - Stable API - Make classes in `com.facebook.react.views.safeareaview` internal

Reviewed By: javache

Differential Revision: D65422197

fbshipit-source-id: d245155c7c92a408cfbb2a7a0015a73fd1d9f9b8
2024-11-05 16:38:17 -08:00
Ramanpreet NaraandFacebook GitHub Bot ef6b6f315c earlyjs: Attach js build to all errors (#46868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46868

jsBuild prasing was done at the js level.

But, for the c++ pipeline, we have to parse the js build in native.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63927093

fbshipit-source-id: ce7ee46714ee0e72e450003330dbca78acb264a3
2024-11-05 16:15:09 -08:00
Soe LynnandFacebook GitHub Bot 120a12f01a Convert [bridge_ reload] to RCTReloadCommand (#47400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47400

Changelog [Internal]:

Convert `[bridge_ reload]` to RCTReloadCommand

Reviewed By: cipolleschi

Differential Revision: D65455862

fbshipit-source-id: 5d5e504cc0b4151a2fb4c86c08e84dbd7040ed68
2024-11-05 15:45:22 -08:00
Yedidya FeldblumandFacebook GitHub Bot 2dcffef5c4 let Pointer be nothrow-move-constructible (#47331)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47331

Reviewed By: Gownta

Differential Revision: D65271354

fbshipit-source-id: cd3ff9db94f2ad332afd68dae438c404f8807f70
2024-11-05 15:44:57 -08:00
Nicola CortiandFacebook GitHub Bot a72c35f98c Stable API - Make VibrationModule internal (#47414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47414

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.vibration.VibrationModule

Changelog:
[Android] [Breaking] - Stable API - Make ClipboardModule internal

Reviewed By: mdvacca

Differential Revision: D65479292

fbshipit-source-id: 383790e6432c3c8c6f47289d2156099d263cc8ca
2024-11-05 15:41:41 -08:00
Nicola CortiandFacebook GitHub Bot c4f58d2452 Update messages for @react-native-bot (#47428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47428

This changes the messages that the bot is printing.
I've moved from using a table to using GitHub's admonitions that
renders nicely are are more informative.

Changelog:
[Internal] [Changed] - Update messages for react-native-bot

Reviewed By: mdvacca

Differential Revision: D65485633

fbshipit-source-id: f43f7bd75280bfd0aceab48b2517306c1057b778
2024-11-05 14:33:29 -08:00
Nicola CortiandFacebook GitHub Bot d2a91617da Prevent @react-native-bot from double posting on missing reproducer (#47427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47427

I've noticed that react-native-bot posts twice once we can't find a reproducer.
(see here: https://github.com/facebook/react-native/issues/47421)

This fixes it by letting it post only once.

Changelog:
[Internal] [Changed] - Prevent react-native-bot from double posting on missing reproducer

Reviewed By: mdvacca

Differential Revision: D65485634

fbshipit-source-id: dbe9b1311aef246dead6d9b922c1256363e894f7
2024-11-05 14:33:29 -08:00
Nicola CortiandFacebook GitHub Bot bbe714e487 Undo a breaking change on ReactViewGroup constructor (#47423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47423

cipolleschi found out that we broke the `ReactViewGroup` constructor when making this class Nullsafe.

Specifically now users would need to pass a `Context` and not a `Context?` as libraries will break (and this will break a lot of them).
So I'm undoing this change by annotating this parameter as Nullable.

Changelog:
[Android] [Changed] - Undo a breaking change on ReactViewGroup constructor

Reviewed By: tdn120

Differential Revision: D65483379

fbshipit-source-id: 43f7bcab5f10b1b8b5601de1dab314d7bbb1eefe
2024-11-05 13:59:31 -08:00
David VaccaandFacebook GitHub Bot 72bd840dd3 Deprecate BridgelessCatalystInstance class (#47385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47385

BridgelessCatalystInstance class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.

changelog: [Android][Changed] Deprecate BridgelessCatalystInstance class

Reviewed By: cortinico

Differential Revision: D65430789

fbshipit-source-id: 011b372c93c39862d5821713aa8f673084b52c2a
2024-11-05 12:34:51 -08:00
Soe LynnandFacebook GitHub Bot 2168dca4ac Fix warning for adjustImageWhenDisabled (#47401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47401

Changelog [Internal]:

Replace deprecated `adjustImageWhenDisabled` with `UIButtonConfiguration`

Reviewed By: cipolleschi

Differential Revision: D65457771

fbshipit-source-id: ffb5b4fc629ba671cb6fec1dc333bf693e4be8ea
2024-11-05 12:11:51 -08:00
Mateo GuzmánandFacebook GitHub Bot d8cfd98070 feat(image): support for resizeMode and objectFit value of 'none' (#47110)
Summary:
As part of https://github.com/facebook/react-native/issues/34425, `objectFit` value of `'none'` needs to be supported for the Image component.

In order to support this, a new value must also be added to support the equivalent in `resizeMode`. With this new value, the image will not be resized at all and keeping it in the initial position within a container (see in the screenshots).

In this PR the support is added for both Fabric and Paper.

## Changelog:

[GENERAL] [ADDED] - image `resizeMode` and `objectFit` support for `'none'`.

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

Test Plan:
Using the `rn-tester`, there is a new image example for both `resizeMode` and `objectFit`.

See below the results for both Android and iOS:

<details>
<summary>Fabric screenshots</summary>

**Android:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Screenshot_1729232899](https://github.com/user-attachments/assets/ea765afc-9f85-4ac3-96ab-229b3f1def20) | ![Screenshot_1729232912](https://github.com/user-attachments/assets/75033e76-5faa-438d-81b1-4bf8436f9ef2) |

**iOS:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 08 16 37](https://github.com/user-attachments/assets/ade02ba9-4792-4760-aada-6ea56b591801) | ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 08 16 55](https://github.com/user-attachments/assets/abf68db9-841a-4ee5-b5db-64fe84a69089) |

</details>

<details>
<summary>Paper screenshots</summary>

**Android:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Screenshot_1729286528](https://github.com/user-attachments/assets/88e89191-d70a-4013-8380-2ecefd9532b4) | ![Screenshot_1729286542](https://github.com/user-attachments/assets/43d84ae0-2ed3-47ad-a725-ac6aea0b3245) |

**iOS:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 22 21 22](https://github.com/user-attachments/assets/e14a81de-3a69-4e73-8c85-ec08ac30b04f) | ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 22 21 16](https://github.com/user-attachments/assets/595f9f5e-96a6-4f6b-9614-f6c236837ba8) |

</details>

Reviewed By: fabriziocucci

Differential Revision: D65420002

Pulled By: javache

fbshipit-source-id: df3bc8fc931b88cde5fe51d89685bf327e30ed9f
2024-11-05 11:36:27 -08:00
Nicola CortiandFacebook GitHub Bot d7d5de9f96 Stable API - Make NativeModulePerfLogger internal (#47415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47415

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.reactperflogger.NativeModulePerfLogger

Changelog:
[Android] [Breaking] - Stable API - Make NativeModulePerfLogger internal

Reviewed By: mdvacca

Differential Revision: D65479550

fbshipit-source-id: 545c33e2c526e396084af65fc19314f59c8a74f8
2024-11-05 11:35:12 -08:00
Alan LeeandFacebook GitHub Bot d1fb01cd85 Make FrescoBasedReactTextInlineImageViewManager Nullsafe (#47425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47425

Make FrescoBasedReactTextInlineImageViewManager Nullsafe.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65456481

fbshipit-source-id: c841494ba933be149a2124a461d6a5011ce7d993
2024-11-05 11:31:37 -08:00
Nick GerlemanandFacebook GitHub Bot 19b0acf754 Minor display: contents optimizations (#47358)
Summary:
X-link: https://github.com/facebook/yoga/pull/1736

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

`LayoutableChildren<yoga::Node>::Iterator` showed up to a surprising extent on a recent trace. Part of this was during pixel grid rounding, which does full tree traversal (we should fix that...), where the iterator is the first thing to read from the node.

I ran Yoga microbenchmark with Yoga compiled with `-O2`, where we saw a regression of synthetic performance by ~10%, but it turns out this build also had ASAN and some other heavy bits enabled, so the real impact was quite lower (~6%).

I was able to make some optimizations in the meantime against that, which still show some minor wins, reducing that overhead to ~4% in the properly optimized build (and a bit more before that). This is still measurable on the beefy server, and the code is a bit cleaner, so let's commit these!

Note that, in real scenarios, measure functions may dominate layout time, so display: contents does not mean end-to-end 4% regression, even after this change.

This change makes a few different optimizations
1. Removes redundant copies
2. Removes redundant index keeping
3. Mark which branches are likely vs unlikely
4. Shrink iterator size from 6 pointers to 3 pointers
5. Avoid usage in pixel grid rounding (so we don't need to have cache read for style)

In "Huge nested layout" example

| Before display: contents support | After display: contents support | After optimizations |
| 9.77ms | 10.39ms | 10.17ms |

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D65336148

fbshipit-source-id: 01c592771ed7accf2d87dddd5a3a9e0225098b56
2024-11-05 11:28:37 -08:00
Luna WeiandFacebook GitHub Bot 06071c68d5 Remove experimental types (#47405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47405

Changelog: [Internal] - With New Architecture out, delete experimental type definition and move types back to relevant definition files

Reviewed By: cortinico, jorge-cab

Differential Revision: D65462903

fbshipit-source-id: bd7fc5bb689eb054b3a30ec7b388e0f455ff1c93
2024-11-05 10:24:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot ba41228a66 Back out "Add png extension only if file exist when load local image" (#47417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47417

Backing out this change as it was breaking an internal app. I'll reland this next week when I have more time.

## Changelog:
[iOS][Changed] - Revert fix that checks whether an image is present on disk.

## Facebook:
This is breaking twilight.

Differential Revision: D65479912

fbshipit-source-id: dcd5ac5f3d98ba2f10b9519f09d3eb1fd454da61
2024-11-05 10:06:35 -08:00
Luna WeiandFacebook GitHub Bot f489944051 Convert PanResponder example into functional component (#47381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47381

Convert PanResponder example into functional component

Changelog: [Internal] Update PanResponder example to functional component

Reviewed By: lyahdav

Differential Revision: D65430973

fbshipit-source-id: 0db09ce12a8c59ec74beaf2ee10326c984fa682c
2024-11-05 09:30:30 -08:00
Nicola CortiandFacebook GitHub Bot 8c50bf0beb Stable API - Make DevLoadingModule internal (#47368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47368

This class should be internal and has no meaningful usages outside of React Native.
See https://github.com/search?type=code&q=%22DevLoadingModule%3A%3Aclass%22

So technically breaking but I expect no impact for OSS at all.

Changelog:
[Android] [Breaking] - Make `DevLoadingModule` internal

Reviewed By: javache

Differential Revision: D64725164

fbshipit-source-id: 5f39e609c611662c71cc08bffa195f7bea5db5bd
2024-11-05 07:35:36 -08:00
Nicola CortiandFacebook GitHub Bot 287e200332 Stable API - Convert to Kotlin and make internal NotThreadSafeViewHierarchyUpdateDebugListener (#47371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47371

This interface should have not been exposed in the first place.
I'm converting it to Kotlin + making it `internal`.
I found no meaningful usage in OSS so I expect no breakages.

Changelog:
[Android] [Breaking] - Stable API - Convert to Kotlin and make internal `NotThreadSafeViewHierarchyUpdateDebugListener`

Reviewed By: javache

Differential Revision: D65420912

fbshipit-source-id: 5afdb013f588a5698b4e7467a7f1096c24d1733e
2024-11-05 04:11:48 -08:00
84 changed files with 45179 additions and 62308 deletions
@@ -0,0 +1,44 @@
name: test-library-on-nightly
description: Tests a library on a nightly
inputs:
library-npm-package:
description: The library npm package to add
required: true
platform:
description: whether we want to build for iOS or Android
required: true
runs:
using: composite
steps:
- name: Create new app
shell: bash
run: |
cd /tmp
npx @react-native-community/cli init RNApp --skip-install --version nightly
- name: Add library
shell: bash
run: |
cd /tmp/RNApp
yarn add ${{ inputs.library-npm-package }}
- name: Build iOS
shell: bash
if: ${{ inputs.platform == 'ios' }}
run: |
cd /tmp/RNApp/ios
bundle install
bundle exec pod install
cd ..
yarn ios
- name: Setup Java for Android
if: ${{ inputs.platform == 'android' }}
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Build Android
shell: bash
if: ${{ inputs.platform == 'android' }}
run: |
cd /tmp/RNApp/android
./gradlew assembleDebug
+29 -41
View File
@@ -48,96 +48,84 @@ module.exports = async (github, context, labelWithContext) => {
switch (labelWithContext.label) {
case 'Type: Invalid':
await addComment(
`| :warning: | Issue is Invalid |\n` +
`| --- | --- |\n` +
`| :information_source: | This issue doesn't match any of the expected types for this repository - closing. |`,
`> [!CAUTION]` +
`> **Invalid issue**: This issue is not valid, either is not a bug in React Native, it doesn't match any of the issue template, or we can't help further with this.`,
);
await closeIssue();
return;
case 'Type: Question':
await addComment(
`| :warning: | Issue is a Question |\n` +
`| --- | --- |\n` +
`| :information_source: | We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/). |`,
);
await closeIssue();
return;
case 'Type: Docs':
await addComment(
`| :warning: | Documentation Issue |\n` +
`| --- | --- |\n` +
`| :information_source: | Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository. |`,
`> [!NOTE]` +
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
);
await closeIssue();
return;
case 'Resolution: For Stack Overflow':
await addComment(
`| :warning: | Issue is a Question |\n` +
`| --- | --- |\n` +
`| :information_source: | We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question. |`,
`> [!NOTE]` +
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
);
await closeIssue();
return;
case 'Type: Docs':
await addComment(
`> [!NOTE]` +
`> **Docs issue**: This issue looks like an issue related to our docs. Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository.`,
);
await closeIssue();
return;
case 'Type: Expo':
await addComment(
`| :warning: | Issue is Related to Expo |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open. |`,
`> [!NOTE]` +
`> **Expo related**: It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.`,
);
await closeIssue();
return;
case 'Needs: Issue Template':
await addComment(
`| :warning: | Missing Required Fields |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?template=bug_report.md). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one. |`,
`> [!WARNING]` +
`> **Missing issue template**: It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A&projects=&template=bug_report.yml). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.`,
);
await requestAuthorFeedback();
return;
case 'Needs: Environment Info':
await addComment(
`| :warning: | Missing Environment Information |\n` +
`| --- | --- |\n` +
`| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console. |`,
`> [!WARNING]` +
`> **Missing info**: It looks like your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console.`,
);
await requestAuthorFeedback();
return;
case 'Newer Patch Available':
await addComment(
`| :warning: | Newer Version of React Native is Available! |\n` +
`| --- | --- |\n` +
`| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |`,
`> [!TIP]` +
`> **Newer version available**: You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.`,
);
return;
case 'Needs: Version Info':
await addComment(
`| :warning: | Add or Reformat Version Info |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2 |`,
`> [!WARNING]` +
`> **Could not parse version**: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.`,
);
await requestAuthorFeedback();
return;
case 'Needs: Repro':
await addComment(
`| :warning: | Missing Reproducible Example |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul> |`,
`> [!WARNING]` +
`> **Missing reproducer**: We could not detect a reproducible example in your issue report. Please provide either: <br/><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/upgrade related: a project using our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li><li>Otherwise send us a Pull Request with the [RNTesterPlayground.js](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Playground/RNTesterPlayground.js) edited to reproduce your bug.</li></ul>`,
);
await requestAuthorFeedback();
return;
case 'Type: Unsupported Version':
await addComment(
`| :warning: | Unsupported Version of React Native |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
`> [!WARNING]` +
`> **Unsupported version**: It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
);
await requestAuthorFeedback();
return;
case 'Type: Too Old Version':
await addComment(
`| :warning: | Too Old Version of React Native |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
`> [!CAUTION]` +
`> **Too old version**: It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
);
await closeIssue();
return;
+1 -25
View File
@@ -9,11 +9,6 @@
const NEEDS_REPRO_LABEL = 'Needs: Repro';
const NEEDS_AUTHOR_FEEDBACK_LABEL = 'Needs: Author Feedback';
const NEEDS_REPRO_HEADER = 'Missing Reproducible Example';
const NEEDS_REPRO_MESSAGE =
`| :warning: | Missing Reproducible Example |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate). A reproducer needs to be in a GitHub repository under your username.</li></ul> |`;
const SKIP_ISSUES_OLDER_THAN = '2023-07-01T00:00:00Z';
module.exports = async (github, context) => {
@@ -25,7 +20,6 @@ module.exports = async (github, context) => {
const issue = await github.rest.issues.get(issueData);
const comments = await github.rest.issues.listComments(issueData);
const author = issue.data.user.login;
const issueDate = issue.data.created_at;
@@ -43,10 +37,6 @@ module.exports = async (github, context) => {
return;
}
const botComment = comments.data.find(comment =>
comment.body.includes(NEEDS_REPRO_HEADER),
);
const entities = [issue.data, ...comments.data];
// Look for Snack or a GH repo associated with the user that added an issue or comment
@@ -74,25 +64,11 @@ module.exports = async (github, context) => {
throw error;
}
}
if (!botComment) return;
await github.rest.issues.deleteComment({
...issueData,
comment_id: botComment.id,
});
} else {
await github.rest.issues.addLabels({
...issueData,
labels: [NEEDS_REPRO_LABEL, NEEDS_AUTHOR_FEEDBACK_LABEL],
});
if (botComment) return;
await github.rest.issues.createComment({
...issueData,
body: NEEDS_REPRO_MESSAGE,
});
}
};
@@ -101,7 +77,7 @@ function containsPattern(body, pattern) {
return body.search(regexp) !== -1;
}
// Prevents the bot from responding when maintainer has changed Needs: Repro the label
// Prevents the bot from responding when maintainer has changed the 'Needs: Repro' label
async function hasMaintainerChangedLabel(github, issueData, author) {
const timeline = await github.rest.issues.listEventsForTimeline(issueData);
@@ -10,11 +10,6 @@
module.exports = async (github, context) => {
const issue = context.payload.issue;
// Ignore issues using upgrade template (they use a special label)
if (issue.labels.find(label => label.name === 'Type: Upgrade Issue')) {
return;
}
const issueVersionUnparsed =
getReactNativeVersionFromIssueBodyIfExists(issue);
const issueVersion = parseVersionFromString(issueVersionUnparsed);
+2
View File
@@ -24,3 +24,5 @@ jobs:
else
echo 'Nightly Worked, All Good!'
fi
- name: Test Libraries
uses: ./.github/workflows/test-libraries-on-nightlies.yml
@@ -0,0 +1,75 @@
name: Test Libraries on Nightlies
on:
workflow_call:
jobs:
test-library-on-nightly-android:
name: "[Android] ${{ matrix.library }}"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
library: [
"react-native-async-storage",
"react-native-blob-util",
"@react-native-clipboard/clipboard",
"@react-native-community/datetimepicker",
"react-native-gesture-handler",
"react-native-image-picker",
"react-native-linear-gradient",
"@react-native-masked-view/masked-view",
"react-native-maps",
"@react-native-community/netinfo",
"react-native-reanimated",
"react-native-svg",
"react-native-video",
"react-native-webview",
"react-native-mmkv",
"react-native-screens",
"react-native-pager-view",
"@react-native-community/slider"
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test ${{ inputs.library-name }}
uses: ./.github/actions/test-library-on-nightly
with:
library-npm-package: ${{ matrix.library }}
platform: android
test-library-on-nightly-ios:
name: "[iOS] ${{ matrix.library }}"
runs-on: macos-13-large
continue-on-error: true
strategy:
matrix:
library: [
"react-native-async-storage",
"react-native-blob-util",
"@react-native-clipboard/clipboard",
"@react-native-community/datetimepicker",
"react-native-gesture-handler",
"react-native-image-picker",
"react-native-linear-gradient",
"@react-native-masked-view/masked-view",
"react-native-maps",
"@react-native-community/netinfo",
"react-native-reanimated",
"react-native-svg",
"react-native-video",
"react-native-webview",
"react-native-mmkv",
"react-native-screens",
"react-native-pager-view",
"@react-native-community/slider"
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test ${{ inputs.library-name }}
uses: ./.github/actions/test-library-on-nightly
with:
library-npm-package: ${{ matrix.library }}
platform: ios
+5 -2
View File
@@ -93,13 +93,16 @@
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.24.0",
"react": "18.3.1",
"react-test-renderer": "18.3.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"typescript": "5.0.4",
"ws": "^6.2.3"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
}
}
@@ -22,7 +22,7 @@ import attachKeyHandlers from './attachKeyHandlers';
import {
createDevServerMiddleware,
indexPageMiddleware,
} from '@react-native-community/cli-server-api';
} from './middleware';
import {createDevMiddleware} from '@react-native/dev-middleware';
import chalk from 'chalk';
import Metro from 'metro';
+2 -2
View File
@@ -12,7 +12,7 @@
"test": "jest"
},
"dependencies": {
"react": "18.3.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "1000.0.0"
},
"devDependencies": {
@@ -28,7 +28,7 @@
"eslint": "^8.19.0",
"jest": "^29.6.3",
"listr2": "^8.2.1",
"react-test-renderer": "18.3.1",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"rxjs": "^7.8.1"
},
"engines": {
@@ -26,7 +26,6 @@
#import <React/RCTFabricSurface.h>
#import <React/RCTSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
#import <ReactCommon/RCTContextContainerHandling.h>
#if USE_HERMES
#import <ReactCommon/RCTHermesInstance.h>
#else
@@ -35,7 +34,6 @@
#import <ReactCommon/RCTHost+Internal.h>
#import <ReactCommon/RCTHost.h>
#import <ReactCommon/RCTTurboModuleManager.h>
#import <react/config/ReactNativeConfig.h>
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
#import <react/runtime/JSRuntimeFactory.h>
@@ -99,13 +97,8 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
@end
@interface RCTRootViewFactory () <RCTContextContainerHandling> {
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
facebook::react::ContextContainer::Shared _contextContainer;
}
@end
@interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
facebook::react::ContextContainer::Shared _contextContainer;
std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
}
@end
@@ -124,8 +117,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
_configuration = configuration;
_hostDelegate = hostdelegate;
_contextContainer = std::make_shared<const facebook::react::ContextContainer>();
_reactNativeConfig = std::make_shared<const facebook::react::EmptyReactNativeConfig>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_turboModuleManagerDelegate = turboModuleManagerDelegate;
}
return self;
@@ -281,7 +272,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
[reactHost setBundleURLProvider:^NSURL *() {
return [weakSelf bundleURL];
}];
[reactHost setContextContainerHandler:self];
[reactHost start];
return reactHost;
}
@@ -289,18 +279,12 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
- (std::shared_ptr<facebook::react::JSRuntimeFactory>)createJSRuntimeFactory
{
#if USE_HERMES
return std::make_shared<facebook::react::RCTHermesInstance>(
_reactNativeConfig, nullptr, /* allocInOldGenBeforeTTI */ false);
return std::make_shared<facebook::react::RCTHermesInstance>(nullptr, nullptr, /* allocInOldGenBeforeTTI */ false);
#else
return std::make_shared<facebook::react::RCTJscInstance>();
#endif
}
- (void)didCreateContextContainer:(std::shared_ptr<facebook::react::ContextContainer>)contextContainer
{
contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
}
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
if (_configuration.extraModulesForBridge != nil) {
@@ -211,4 +211,11 @@ export interface ViewProps
* Used to reference react managed views from native code.
*/
nativeID?: string | undefined;
/**
* Contols whether this view, and its transitive children, are laid in a way
* consistent with web browsers ('strict'), or consistent with existing
* React Native code which may rely on incorrect behavior ('classic').
*/
experimental_layoutConformance?: 'strict' | 'classic' | undefined;
}
+2
View File
@@ -200,6 +200,8 @@ export interface ImagePropsBase
* 'center': Scale the image down so that it is completely visible,
* if bigger than the area of the view.
* The image will not be scaled up.
*
* 'none': Do not resize the image. The image will be displayed at its intrinsic size.
*/
resizeMode?: ImageResizeMode | undefined;
+2 -1
View File
@@ -19,6 +19,7 @@ import type {
} from '../StyleSheet/StyleSheet';
import type {LayoutEvent, SyntheticEvent} from '../Types/CoreEventTypes';
import typeof Image from './Image';
import type {ImageResizeMode} from './ImageResizeMode';
import type {ImageSource} from './ImageSource';
import type {ElementRef, Node, RefSetter} from 'react';
@@ -234,7 +235,7 @@ export type ImageProps = $ReadOnly<{|
*
* See https://reactnative.dev/docs/image#resizemode
*/
resizeMode?: ?('cover' | 'contain' | 'stretch' | 'repeat' | 'center'),
resizeMode?: ?ImageResizeMode,
/**
* A unique identifier for this element to be used in UI Automation
+8 -1
View File
@@ -12,7 +12,8 @@ export type ImageResizeMode =
| 'contain'
| 'stretch'
| 'repeat'
| 'center';
| 'center'
| 'none';
/**
* @see ImageResizeMode.js
@@ -46,4 +47,10 @@ export interface ImageResizeModeStatic {
* image will keep it's size and aspect ratio.
*/
repeat: ImageResizeMode;
/**
* none - The image will be displayed at its intrinsic size, which means the
* image will not be scaled up or down.
*/
none: ImageResizeMode;
}
+4 -1
View File
@@ -33,4 +33,7 @@ export type ImageResizeMode =
// Resize by stretching it to fill the entire frame of the view without
// clipping. This may change the aspect ratio of the image, distorting it.
| 'stretch';
| 'stretch'
// The image will not be resized at all.
| 'none';
+6 -3
View File
@@ -8,15 +8,18 @@
* @format
*/
type ResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
import type {ImageResizeMode} from './ImageResizeMode';
const objectFitMap: {[string]: ResizeMode} = {
const objectFitMap: {[string]: ImageResizeMode} = {
contain: 'contain',
cover: 'cover',
fill: 'stretch',
'scale-down': 'contain',
none: 'none',
};
export function convertObjectFitToResizeMode(objectFit: ?string): ?ResizeMode {
export function convertObjectFitToResizeMode(
objectFit: ?string,
): ?ImageResizeMode {
return objectFit != null ? objectFitMap[objectFit] : undefined;
}
@@ -477,10 +477,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
// Add missing png extension
if (request.URL.fileURL && request.URL.pathExtension.length == 0) {
NSURL *pngRequestURL = [request.URL URLByAppendingPathExtension:@"png"];
if ([[NSFileManager defaultManager] fileExistsAtPath:pngRequestURL.path]) {
mutableRequest.URL = pngRequestURL;
}
mutableRequest.URL = [request.URL URLByAppendingPathExtension:@"png"];
}
if (_redirectDelegate != nil) {
mutableRequest.URL = [_redirectDelegate redirectAssetsURL:mutableRequest.URL];
@@ -85,6 +85,7 @@ CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize, CGFloat destScale, RCTR
switch (resizeMode) {
case RCTResizeModeStretch:
case RCTResizeModeRepeat:
case RCTResizeModeNone:
return (CGRect){CGPointZero, RCTCeilSize(destSize, destScale)};
@@ -249,6 +250,7 @@ BOOL RCTUpscalingRequired(
case RCTResizeModeRepeat:
case RCTResizeModeCenter:
case RCTResizeModeNone:
return NO;
}
@@ -13,6 +13,7 @@ typedef NS_ENUM(NSInteger, RCTResizeMode) {
RCTResizeModeStretch = UIViewContentModeScaleToFill,
RCTResizeModeCenter = UIViewContentModeCenter,
RCTResizeModeRepeat = -1, // Use negative values to avoid conflicts with iOS enum values.
RCTResizeModeNone = UIViewContentModeTopLeft,
};
static inline RCTResizeMode RCTResizeModeFromUIViewContentMode(UIViewContentMode mode)
@@ -30,12 +31,14 @@ static inline RCTResizeMode RCTResizeModeFromUIViewContentMode(UIViewContentMode
case UIViewContentModeCenter:
return RCTResizeModeCenter;
break;
case UIViewContentModeTopLeft:
return RCTResizeModeNone;
break;
case UIViewContentModeRedraw:
case UIViewContentModeTop:
case UIViewContentModeBottom:
case UIViewContentModeLeft:
case UIViewContentModeRight:
case UIViewContentModeTopLeft:
case UIViewContentModeTopRight:
case UIViewContentModeBottomLeft:
case UIViewContentModeBottomRight:
@@ -17,6 +17,7 @@ RCT_ENUM_CONVERTER(
@"stretch" : @(RCTResizeModeStretch),
@"center" : @(RCTResizeModeCenter),
@"repeat" : @(RCTResizeModeRepeat),
@"none" : @(RCTResizeModeNone),
}),
RCTResizeModeStretch,
integerValue)
@@ -80,7 +80,7 @@ describe('LogBox', () => {
expect(mockWarn).not.toBeCalled();
expect(console.error).toBeCalledTimes(1);
expect(console.error.mock.calls[0]).toEqual([
'Warning: Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.%s',
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.%s',
'\n\nCheck the render method of `DoesNotUseKey`.',
'',
expect.stringMatching('at DoesNotUseKey'),
@@ -94,7 +94,7 @@ describe('LogBox', () => {
componentStackType: 'stack',
message: {
content:
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://reactjs.org/link/warning-keys for more information.',
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.',
substitutions: [
{length: 45, offset: 62},
{length: 0, offset: 107},
@@ -106,7 +106,7 @@ describe('LogBox', () => {
// We also interpolate the string before passing to the underlying console method.
expect(mockError.mock.calls[0]).toEqual([
expect.stringMatching(
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://reactjs.org/link/warning-keys for more information.\n at ',
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.\n at ',
),
]);
});
@@ -134,7 +134,7 @@ describe('LogBox', () => {
expect(mockWarn).not.toBeCalled();
expect(console.error).toBeCalledTimes(1);
expect(console.error.mock.calls[0]).toEqual([
'Warning: Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s',
'Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s',
'invalid',
expect.stringMatching('at FragmentWithProp'),
]);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -434,6 +434,12 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
cursor?: CursorValue | undefined;
boxShadow?: ReadonlyArray<BoxShadowValue> | string | undefined;
filter?: ReadonlyArray<FilterFunction> | string | undefined;
mixBlendMode?: BlendMode | undefined;
experimental_backgroundImage?:
| ReadonlyArray<GradientValue>
| string
| undefined;
}
export type FontVariant =
@@ -562,6 +568,6 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
overlayColor?: ColorValue | undefined;
tintColor?: ColorValue | undefined;
opacity?: AnimatableNumericValue | undefined;
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined;
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none' | undefined;
cursor?: CursorValue | undefined;
}
@@ -11,6 +11,7 @@
'use strict';
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
import type {ImageResizeMode} from './../Image/ImageResizeMode';
import type {
____DangerouslyImpreciseStyle_InternalOverrides,
____ImageStyle_InternalOverrides,
@@ -941,8 +942,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
export type ____ImageStyle_InternalCore = $ReadOnly<{
...$Exact<____ViewStyle_Internal>,
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
resizeMode?: ImageResizeMode,
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -954,8 +955,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
...$Exact<____TextStyle_Internal>,
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
resizeMode?: ImageResizeMode,
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -4869,7 +4869,7 @@ export type ImageProps = $ReadOnly<{|
| \\"strict-origin-when-cross-origin\\"
| \\"unsafe-url\\"
),
resizeMode?: ?(\\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\"),
resizeMode?: ?ImageResizeMode,
testID?: ?string,
tintColor?: ColorValue,
src?: ?string,
@@ -4892,7 +4892,8 @@ exports[`public API should not change unintentionally Libraries/Image/ImageResiz
| \\"contain\\"
| \\"cover\\"
| \\"repeat\\"
| \\"stretch\\";
| \\"stretch\\"
| \\"none\\";
"
`;
@@ -4989,10 +4990,9 @@ export type { ImageProps } from \\"./ImageProps\\";
`;
exports[`public API should not change unintentionally Libraries/Image/ImageUtils.js 1`] = `
"type ResizeMode = \\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\";
declare export function convertObjectFitToResizeMode(
"declare export function convertObjectFitToResizeMode(
objectFit: ?string
): ?ResizeMode;
): ?ImageResizeMode;
"
`;
@@ -8261,8 +8261,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
}>;
export type ____ImageStyle_InternalCore = $ReadOnly<{
...$Exact<____ViewStyle_Internal>,
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
resizeMode?: ImageResizeMode,
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -8272,8 +8272,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
}>;
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
...$Exact<____TextStyle_Internal>,
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
resizeMode?: ImageResizeMode,
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -207,7 +207,7 @@ class RCTBridgeHostTargetDelegate : public facebook::react::jsinspector_modern::
void onReload(const PageReloadRequest &request) override
{
RCTAssertMainQueue();
[bridge_ reload];
RCTTriggerReloadCommandListeners(@"Reloading due to PageReloadRequest from DevTools.");
}
void onSetPausedInDebuggerMessage(const OverlaySetPausedInDebuggerMessageRequest &request) override
@@ -19,6 +19,9 @@ NS_ASSUME_NONNULL_BEGIN
stack:(nullable NSArray *)stack
exceptionId:(NSNumber *)exceptionId
extraDataAsJSON:(nullable NSString *)extraDataAsJSON;
@optional
- (NSDictionary<NSString *, id> *)decorateJSExceptionData:(NSDictionary<NSString *, id> *)exceptionData;
@end
@interface RCTExceptionsManager : NSObject <RCTBridgeModule>
@@ -83,6 +83,7 @@ RCT_EXPORT_MODULE()
}
}
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
RCT_EXPORT_METHOD(reportSoftException
: (NSString *)message stack
: (NSArray<NSDictionary *> *)stack exceptionId
@@ -91,6 +92,7 @@ RCT_EXPORT_METHOD(reportSoftException
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
}
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
RCT_EXPORT_METHOD(reportFatalException
: (NSString *)message stack
: (NSArray<NSDictionary *> *)stack exceptionId
@@ -103,15 +105,24 @@ RCT_EXPORT_METHOD(dismissRedbox) {}
RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData &)data)
{
NSString *message = data.message();
double exceptionId = data.id_();
NSMutableDictionary<NSString *, id> *mutableErrorData = [NSMutableDictionary new];
mutableErrorData[@"message"] = data.message();
if (data.originalMessage()) {
mutableErrorData[@"originalMessage"] = data.originalMessage();
}
if (data.name()) {
mutableErrorData[@"name"] = data.name();
}
if (data.componentStack()) {
mutableErrorData[@"componentStack"] = data.componentStack();
}
// Reserialize data.stack() into an array of untyped dictionaries.
// TODO: (moti) T53588496 Replace `(NSArray<NSDictionary *> *)stack` in
// reportFatalException etc with a typed interface.
NSMutableArray<NSDictionary *> *stackArray = [NSMutableArray<NSDictionary *> new];
NSMutableArray<NSDictionary<NSString *, id> *> *stackArray = [NSMutableArray<NSDictionary<NSString *, id> *> new];
for (auto frame : data.stack()) {
NSMutableDictionary *frameDict = [NSMutableDictionary new];
NSMutableDictionary<NSString *, id> *frameDict = [NSMutableDictionary new];
if (frame.column().has_value()) {
frameDict[@"column"] = @(frame.column().value());
}
@@ -126,13 +137,28 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
[stackArray addObject:frameDict];
}
NSDictionary *extraData = (NSDictionary *)data.extraData();
NSString *extraDataAsJSON = RCTJSONStringify(extraData, NULL);
mutableErrorData[@"stack"] = stackArray;
mutableErrorData[@"id"] = @(data.id_());
mutableErrorData[@"isFatal"] = @(data.isFatal());
if (data.isFatal()) {
[self reportFatal:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
if (data.extraData()) {
mutableErrorData[@"extraData"] = data.extraData();
}
NSDictionary<NSString *, id> *errorData = mutableErrorData;
if ([_delegate respondsToSelector:@selector(decorateJSExceptionData:)]) {
errorData = [_delegate decorateJSExceptionData:errorData];
}
NSString *extraDataAsJSON = RCTJSONStringify(errorData[@"extraData"], NULL);
NSString *message = errorData[@"message"];
NSArray<NSDictionary<NSString *, id> *> *stack = errorData[@"stack"];
double exceptionId = [errorData[@"id"] doubleValue];
if (errorData[@"isFatal"]) {
[self reportFatal:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
} else {
[self reportSoft:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
}
}
@@ -56,7 +56,11 @@
UIButton *resumeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[resumeButton setImage:[UIImage systemImageNamed:@"forward.frame.fill"] forState:UIControlStateNormal];
resumeButton.tintColor = [UIColor colorWithRed:0.37 green:0.37 blue:0.37 alpha:1];
resumeButton.adjustsImageWhenDisabled = NO;
resumeButton.configurationUpdateHandler = ^(UIButton *button) {
button.imageView.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
};
resumeButton.enabled = NO;
[NSLayoutConstraint activateConstraints:@[
[resumeButton.widthAnchor constraintEqualToConstant:48],
@@ -956,6 +956,7 @@ public class com/facebook/react/bridge/JavaOnlyMap : com/facebook/react/bridge/R
public fun putMap (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public fun putNull (Ljava/lang/String;)V
public fun putString (Ljava/lang/String;Ljava/lang/String;)V
public fun remove (Ljava/lang/String;)V
public fun toHashMap ()Ljava/util/HashMap;
public fun toString ()Ljava/lang/String;
}
@@ -3303,17 +3304,6 @@ public final class com/facebook/react/modules/deviceinfo/DeviceInfoModule : com/
public fun onHostResume ()V
}
public final class com/facebook/react/modules/devloading/DevLoadingModule : com/facebook/fbreact/specs/NativeDevLoadingViewSpec {
public static final field Companion Lcom/facebook/react/modules/devloading/DevLoadingModule$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun hide ()V
public fun showMessage (Ljava/lang/String;Ljava/lang/Double;Ljava/lang/Double;)V
}
public final class com/facebook/react/modules/devloading/DevLoadingModule$Companion {
}
public class com/facebook/react/modules/dialog/AlertFragment : androidx/fragment/app/DialogFragment, android/content/DialogInterface$OnClickListener {
public fun <init> ()V
public fun <init> (Lcom/facebook/react/modules/dialog/DialogModule$AlertFragmentListener;Landroid/os/Bundle;)V
@@ -3673,18 +3663,6 @@ public final class com/facebook/react/modules/toast/ToastModule : com/facebook/f
public final class com/facebook/react/modules/toast/ToastModule$Companion {
}
public final class com/facebook/react/modules/vibration/VibrationModule : com/facebook/fbreact/specs/NativeVibrationSpec {
public static final field Companion Lcom/facebook/react/modules/vibration/VibrationModule$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun cancel ()V
public fun vibrate (D)V
public fun vibrateByPattern (Lcom/facebook/react/bridge/ReadableArray;D)V
}
public final class com/facebook/react/modules/vibration/VibrationModule$Companion {
}
public final class com/facebook/react/modules/websocket/WebSocketModule : com/facebook/fbreact/specs/NativeWebSocketModuleSpec {
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun addListener (Ljava/lang/String;)V
@@ -3774,22 +3752,6 @@ public abstract interface class com/facebook/react/packagerconnection/Responder
public abstract fun respond (Ljava/lang/Object;)V
}
public abstract class com/facebook/react/reactperflogger/NativeModulePerfLogger {
protected fun <init> ()V
protected abstract fun initHybrid ()Lcom/facebook/jni/HybridData;
protected final fun maybeLoadOtherSoLibraries ()V
public abstract fun moduleCreateCacheHit (Ljava/lang/String;I)V
public abstract fun moduleCreateConstructEnd (Ljava/lang/String;I)V
public abstract fun moduleCreateConstructStart (Ljava/lang/String;I)V
public abstract fun moduleCreateEnd (Ljava/lang/String;I)V
public abstract fun moduleCreateFail (Ljava/lang/String;I)V
public abstract fun moduleCreateSetUpEnd (Ljava/lang/String;I)V
public abstract fun moduleCreateSetUpStart (Ljava/lang/String;I)V
public abstract fun moduleCreateStart (Ljava/lang/String;I)V
public abstract fun moduleDataCreateEnd (Ljava/lang/String;I)V
public abstract fun moduleDataCreateStart (Ljava/lang/String;I)V
}
public abstract class com/facebook/react/runtime/BindingsInstaller {
public fun <init> (Lcom/facebook/jni/HybridData;)V
}
@@ -4296,13 +4258,6 @@ public class com/facebook/react/uimanager/LayoutShadowNode : com/facebook/react/
public fun setWidth (Lcom/facebook/react/bridge/Dynamic;)V
}
public class com/facebook/react/uimanager/LayoutShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public fun setProperty (Lcom/facebook/react/uimanager/LayoutShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/uimanager/LengthPercentage {
public static final field Companion Lcom/facebook/react/uimanager/LengthPercentage$Companion;
public fun <init> ()V
@@ -4956,13 +4911,6 @@ public class com/facebook/react/uimanager/ReactShadowNodeImpl : com/facebook/rea
public final fun updateProperties (Lcom/facebook/react/uimanager/ReactStylesDiffMap;)V
}
public class com/facebook/react/uimanager/ReactShadowNodeImpl$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNodeImpl;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface annotation class com/facebook/react/uimanager/ReactStage : java/lang/annotation/Annotation {
public static final field BRIDGE_DID_LOAD I
public static final field MODULE_DID_LOAD I
@@ -5016,13 +4964,6 @@ public final class com/facebook/react/uimanager/RootViewManager : com/facebook/r
public fun getName ()Ljava/lang/String;
}
public class com/facebook/react/uimanager/RootViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public fun setProperty (Lcom/facebook/react/uimanager/RootViewManager;Landroid/view/ViewGroup;Ljava/lang/String;Ljava/lang/Object;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/uimanager/RootViewManager$Companion {
}
@@ -5658,11 +5599,6 @@ public final class com/facebook/react/uimanager/common/ViewUtil {
public static final fun isRootTag (I)Z
}
public abstract interface class com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener {
public abstract fun onViewHierarchyUpdateEnqueued ()V
public abstract fun onViewHierarchyUpdateFinished ()V
}
public abstract interface class com/facebook/react/uimanager/events/BatchEventDispatchedListener {
public abstract fun onBatchEventDispatched ()V
}
@@ -6399,24 +6335,24 @@ public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlay :
public final fun setTraceUpdates (Ljava/util/List;)V
}
public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager : com/facebook/react/uimanager/SimpleViewManager {
public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager : com/facebook/react/uimanager/SimpleViewManager, com/facebook/react/viewmanagers/DebuggingOverlayManagerInterface {
public static final field Companion Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlayManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun clearElementsHighlights (Landroid/view/View;)V
public fun clearElementsHighlights (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;)V
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;
public fun getDelegate ()Lcom/facebook/react/uimanager/ViewManagerDelegate;
public fun getName ()Ljava/lang/String;
public synthetic fun highlightElements (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public fun highlightElements (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun highlightTraceUpdates (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public fun highlightTraceUpdates (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun receiveCommand (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
}
public class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlayManager;Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager$Companion {
}
@@ -6478,13 +6414,6 @@ public final class com/facebook/react/views/drawer/ReactDrawerLayoutManager : co
public fun setStatusBarBackgroundColor (Lcom/facebook/react/views/drawer/ReactDrawerLayout;Ljava/lang/Integer;)V
}
public class com/facebook/react/views/drawer/ReactDrawerLayoutManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager;Lcom/facebook/react/views/drawer/ReactDrawerLayout;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/drawer/ReactDrawerLayoutManager$Companion {
}
@@ -6646,13 +6575,6 @@ public final class com/facebook/react/views/image/ReactImageManager : com/facebo
public final fun setTintColor (Lcom/facebook/react/views/image/ReactImageView;Ljava/lang/Integer;)V
}
public class com/facebook/react/views/image/ReactImageManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/image/ReactImageManager;Lcom/facebook/react/views/image/ReactImageView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/image/ReactImageManager$Companion {
}
@@ -6734,13 +6656,6 @@ public final class com/facebook/react/views/imagehelper/ResourceDrawableIdHelper
public final fun getInstance ()Lcom/facebook/react/views/imagehelper/ResourceDrawableIdHelper;
}
public class com/facebook/react/views/modal/ModalHostShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/modal/ModalHostShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/modal/ReactModalHostManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/ModalHostViewManagerInterface {
public static final field Companion Lcom/facebook/react/views/modal/ReactModalHostManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
@@ -6775,13 +6690,6 @@ public final class com/facebook/react/views/modal/ReactModalHostManager : com/fa
public fun updateState (Lcom/facebook/react/views/modal/ReactModalHostView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/modal/ReactModalHostManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/modal/ReactModalHostManager;Lcom/facebook/react/views/modal/ReactModalHostView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/modal/ReactModalHostManager$Companion {
}
@@ -6847,13 +6755,6 @@ public final class com/facebook/react/views/progressbar/ProgressBarShadowNode :
public final fun setStyle (Ljava/lang/String;)V
}
public class com/facebook/react/views/progressbar/ProgressBarShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/progressbar/ProgressBarShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/progressbar/ReactProgressBarViewManager : com/facebook/react/uimanager/BaseViewManager, com/facebook/react/viewmanagers/AndroidProgressBarManagerInterface {
public static final field Companion Lcom/facebook/react/views/progressbar/ReactProgressBarViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
@@ -6883,52 +6784,10 @@ public final class com/facebook/react/views/progressbar/ReactProgressBarViewMana
public fun updateExtraData (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/Object;)V
}
public class com/facebook/react/views/progressbar/ReactProgressBarViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/progressbar/ReactProgressBarViewManager;Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/progressbar/ReactProgressBarViewManager$Companion {
public final fun createProgressBar (Landroid/content/Context;I)Landroid/widget/ProgressBar;
}
public final class com/facebook/react/views/safeareaview/ReactSafeAreaView : android/view/ViewGroup {
public fun <init> (Lcom/facebook/react/uimanager/ThemedReactContext;)V
public final fun getReactContext ()Lcom/facebook/react/uimanager/ThemedReactContext;
}
public final class com/facebook/react/views/safeareaview/ReactSafeAreaViewManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/SafeAreaViewManagerInterface {
public static final field Companion Lcom/facebook/react/views/safeareaview/ReactSafeAreaViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/LayoutShadowNode;
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public fun getShadowNodeClass ()Ljava/lang/Class;
public synthetic fun updateState (Landroid/view/View;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
public fun updateState (Lcom/facebook/react/views/safeareaview/ReactSafeAreaView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/safeareaview/ReactSafeAreaViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/safeareaview/ReactSafeAreaViewManager;Lcom/facebook/react/views/safeareaview/ReactSafeAreaView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/safeareaview/ReactSafeAreaViewManager$Companion {
}
public class com/facebook/react/views/safeareaview/ReactSafeAreaViewShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/safeareaview/ReactSafeAreaViewShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/scroll/FpsListener {
public abstract fun disable (Ljava/lang/String;)V
public abstract fun enable (Ljava/lang/String;)V
@@ -6942,21 +6801,16 @@ public final class com/facebook/react/views/scroll/OnScrollDispatchHelper {
public final fun onScrollChanged (II)Z
}
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager : com/facebook/react/views/view/ReactViewManager {
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager : com/facebook/react/views/view/ReactViewManager, com/facebook/react/viewmanagers/AndroidHorizontalScrollContentViewManagerInterface {
public static final field Companion Lcom/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun createViewInstance (ILcom/facebook/react/uimanager/ThemedReactContext;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Landroid/view/View;
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Lcom/facebook/react/views/view/ReactViewGroup;
public fun getDelegate ()Lcom/facebook/react/uimanager/ViewManagerDelegate;
public fun getName ()Ljava/lang/String;
}
public class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager;Lcom/facebook/react/views/view/ReactViewGroup;Ljava/lang/String;Ljava/lang/Object;)V
public synthetic fun setRemoveClippedSubviews (Landroid/view/View;Z)V
}
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion {
@@ -7088,13 +6942,6 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager :
public fun updateState (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/scroll/ReactHorizontalScrollViewManager;Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/scroll/ReactScrollView : android/widget/ScrollView, android/view/View$OnLayoutChangeListener, android/view/ViewGroup$OnHierarchyChangeListener, com/facebook/react/uimanager/ReactClippingViewGroup, com/facebook/react/uimanager/ReactOverflowViewWithInset, com/facebook/react/views/scroll/ReactScrollViewHelper$HasFlingAnimator, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollEventThrottle, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollState, com/facebook/react/views/scroll/ReactScrollViewHelper$HasSmoothScroll, com/facebook/react/views/scroll/ReactScrollViewHelper$HasStateWrapper {
public fun <init> (Landroid/content/Context;)V
public fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;)V
@@ -7336,13 +7183,6 @@ public class com/facebook/react/views/scroll/ReactScrollViewManager : com/facebo
public fun updateState (Lcom/facebook/react/views/scroll/ReactScrollView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/scroll/ReactScrollViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/scroll/ReactScrollViewManager;Lcom/facebook/react/views/scroll/ReactScrollView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/scroll/ScrollEvent : com/facebook/react/uimanager/events/Event {
public static final field Companion Lcom/facebook/react/views/scroll/ScrollEvent$Companion;
public fun canCoalesce ()Z
@@ -7416,13 +7256,6 @@ public class com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager : c
public fun setSize (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Ljava/lang/String;)V
}
public class com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager;Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/switchview/ReactSwitchManager : com/facebook/react/uimanager/SimpleViewManager, com/facebook/react/viewmanagers/AndroidSwitchManagerInterface {
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
@@ -7462,20 +7295,6 @@ public class com/facebook/react/views/switchview/ReactSwitchManager : com/facebo
public fun setValue (Lcom/facebook/react/views/switchview/ReactSwitch;Z)V
}
public class com/facebook/react/views/switchview/ReactSwitchManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/switchview/ReactSwitchManager;Lcom/facebook/react/views/switchview/ReactSwitch;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/switchview/ReactSwitchManager$ReactSwitchShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/switchview/ReactSwitchManager$ReactSwitchShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/text/DefaultStyleValuesUtil {
public static final field INSTANCE Lcom/facebook/react/views/text/DefaultStyleValuesUtil;
public static final fun getDefaultTextColor (Landroid/content/Context;)Landroid/content/res/ColorStateList;
@@ -7575,13 +7394,6 @@ public class com/facebook/react/views/text/ReactRawTextManager : com/facebook/re
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactRawTextManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactRawTextManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactRawTextShadowNode : com/facebook/react/uimanager/ReactShadowNodeImpl {
public fun <init> ()V
public fun getText ()Ljava/lang/String;
@@ -7590,13 +7402,6 @@ public class com/facebook/react/views/text/ReactRawTextShadowNode : com/facebook
public fun toString ()Ljava/lang/String;
}
public class com/facebook/react/views/text/ReactRawTextShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactRawTextShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract class com/facebook/react/views/text/ReactTextAnchorViewManager : com/facebook/react/uimanager/BaseViewManager {
public fun <init> ()V
public fun setAccessible (Lcom/facebook/react/views/text/ReactTextView;Z)V
@@ -7631,13 +7436,6 @@ public class com/facebook/react/views/text/ReactTextShadowNode : com/facebook/re
public fun setShouldNotifyOnTextLayout (Z)V
}
public class com/facebook/react/views/text/ReactTextShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactTextShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactTextUpdate {
public fun <init> (Landroid/text/Spannable;IZFFFFI)V
public fun <init> (Landroid/text/Spannable;IZFFFFIII)V
@@ -7721,13 +7519,6 @@ public class com/facebook/react/views/text/ReactTextViewManager : com/facebook/r
public fun updateState (Lcom/facebook/react/views/text/ReactTextView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/text/ReactTextViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactTextViewManager;Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/text/ReactTextViewManagerCallback {
public abstract fun onPostProcessSpannable (Landroid/text/Spannable;)V
}
@@ -7740,35 +7531,6 @@ public class com/facebook/react/views/text/ReactTypefaceUtils {
public static fun parseFontWeight (Ljava/lang/String;)I
}
public class com/facebook/react/views/text/ReactVirtualTextShadowNode : com/facebook/react/views/text/ReactBaseTextShadowNode {
public fun <init> ()V
public fun isVirtual ()Z
}
public class com/facebook/react/views/text/ReactVirtualTextShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactVirtualTextShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactVirtualTextViewManager : com/facebook/react/uimanager/BaseViewManager {
public fun <init> ()V
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
public fun createShadowNodeInstance ()Lcom/facebook/react/views/text/ReactVirtualTextShadowNode;
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public fun getShadowNodeClass ()Ljava/lang/Class;
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactVirtualTextViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactVirtualTextViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/TextAttributeProps {
public static final field TA_KEY_ACCESSIBILITY_ROLE S
public static final field TA_KEY_ALIGNMENT S
@@ -7925,13 +7687,6 @@ public final class com/facebook/react/views/text/TextTransform : java/lang/Enum
public static fun values ()[Lcom/facebook/react/views/text/TextTransform;
}
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager : com/facebook/react/uimanager/BaseViewManager {
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
@@ -7944,13 +7699,6 @@ public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInl
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/textinput/ContentSizeWatcher {
public abstract fun onLayout ()V
}
@@ -8138,20 +7886,6 @@ public class com/facebook/react/views/textinput/ReactTextInputManager : com/face
public fun updateState (Lcom/facebook/react/views/textinput/ReactEditText;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/textinput/ReactTextInputManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/textinput/ReactTextInputManager;Lcom/facebook/react/views/textinput/ReactEditText;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/textinput/ReactTextInputShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/textinput/ReactTextInputShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/textinput/ScrollWatcher {
public abstract fun onScrollChanged (IIII)V
}
@@ -8288,13 +8022,6 @@ public class com/facebook/react/views/view/ReactViewManager : com/facebook/react
protected fun setTransformProperty (Lcom/facebook/react/views/view/ReactViewGroup;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableArray;)V
}
public class com/facebook/react/views/view/ReactViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/view/ReactViewManager;Lcom/facebook/react/views/view/ReactViewGroup;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/view/ReactViewManager$Companion {
}
@@ -8,8 +8,10 @@ android.useAndroidX=true
react.internal.disableJavaVersionAlignment=true
# Binary Compatibility Validator properties
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig,\
com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager$$PropsSetter
# We ignore:
# - BuildConfig classes because they are generated and not part of the public API
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig
binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\
com.facebook.fbreact,\
@@ -246,6 +246,10 @@ public class JavaOnlyMap implements ReadableMap, WritableMap {
return mBackingMap.toString();
}
public void remove(@NonNull String key) {
mBackingMap.remove(key);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -18,7 +18,7 @@ import com.facebook.react.module.annotations.ReactModule
/** [NativeModule] that allows JS to show dev loading view. */
@ReactModule(name = NativeDevLoadingViewSpec.NAME)
public class DevLoadingModule(reactContext: ReactApplicationContext) :
internal class DevLoadingModule(reactContext: ReactApplicationContext) :
NativeDevLoadingViewSpec(reactContext) {
private val jsExceptionHandler: JSExceptionHandler? = reactContext.jsExceptionHandler
@@ -20,10 +20,10 @@ import com.facebook.react.module.annotations.ReactModule
@SuppressLint("MissingPermission")
@ReactModule(name = NativeVibrationSpec.NAME)
public class VibrationModule(reactContext: ReactApplicationContext) :
internal class VibrationModule(reactContext: ReactApplicationContext) :
NativeVibrationSpec(reactContext) {
public override fun vibrate(durationDouble: Double) {
override fun vibrate(durationDouble: Double) {
val duration = durationDouble.toInt()
val v = getVibrator() ?: return
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -33,7 +33,7 @@ public class VibrationModule(reactContext: ReactApplicationContext) :
}
}
public override fun vibrateByPattern(pattern: ReadableArray, repeatDouble: Double) {
override fun vibrateByPattern(pattern: ReadableArray, repeatDouble: Double) {
val repeat = repeatDouble.toInt()
val v = getVibrator() ?: return
val patternLong = LongArray(pattern.size())
@@ -47,7 +47,7 @@ public class VibrationModule(reactContext: ReactApplicationContext) :
}
}
public override fun cancel() {
override fun cancel() {
getVibrator()?.cancel()
}
@@ -62,7 +62,7 @@ public class VibrationModule(reactContext: ReactApplicationContext) :
getReactApplicationContext().getSystemService(Context.VIBRATOR_SERVICE) as Vibrator?
}
public companion object {
public const val NAME: String = NativeVibrationSpec.NAME
companion object {
const val NAME: String = NativeVibrationSpec.NAME
}
}
@@ -19,6 +19,7 @@ import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.annotations.ReactPropGroup;
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
@@ -268,6 +269,7 @@ public class ReactPropertyProcessor extends ProcessorBase {
TypeSpec holderClass =
TypeSpec.classBuilder(holderClassName)
.addSuperinterface(superType)
.addAnnotation(UnstableReactNativeAPI.class)
.addModifiers(PUBLIC)
.addMethod(generateSetPropertySpec(classInfo, properties))
.addMethod(getMethods)
@@ -9,7 +9,7 @@ package com.facebook.react.reactperflogger
import com.facebook.jni.HybridData
public abstract class NativeModulePerfLogger protected constructor() {
internal abstract class NativeModulePerfLogger protected constructor() {
@Suppress("NoHungarianNotation") private val mHybridData: HybridData
@@ -20,25 +20,25 @@ public abstract class NativeModulePerfLogger protected constructor() {
protected abstract fun initHybrid(): HybridData
public abstract fun moduleDataCreateStart(moduleName: String, id: Int)
abstract fun moduleDataCreateStart(moduleName: String, id: Int)
public abstract fun moduleDataCreateEnd(moduleName: String, id: Int)
abstract fun moduleDataCreateEnd(moduleName: String, id: Int)
public abstract fun moduleCreateStart(moduleName: String, id: Int)
abstract fun moduleCreateStart(moduleName: String, id: Int)
public abstract fun moduleCreateCacheHit(moduleName: String, id: Int)
abstract fun moduleCreateCacheHit(moduleName: String, id: Int)
public abstract fun moduleCreateConstructStart(moduleName: String, id: Int)
abstract fun moduleCreateConstructStart(moduleName: String, id: Int)
public abstract fun moduleCreateConstructEnd(moduleName: String, id: Int)
abstract fun moduleCreateConstructEnd(moduleName: String, id: Int)
public abstract fun moduleCreateSetUpStart(moduleName: String, id: Int)
abstract fun moduleCreateSetUpStart(moduleName: String, id: Int)
public abstract fun moduleCreateSetUpEnd(moduleName: String, id: Int)
abstract fun moduleCreateSetUpEnd(moduleName: String, id: Int)
public abstract fun moduleCreateEnd(moduleName: String, id: Int)
abstract fun moduleCreateEnd(moduleName: String, id: Int)
public abstract fun moduleCreateFail(moduleName: String, id: Int)
abstract fun moduleCreateFail(moduleName: String, id: Int)
/** Subclasses will override this method to load their own SO libraries. */
@Synchronized
@@ -21,14 +21,15 @@ import com.facebook.react.bridge.RuntimeExecutor
import com.facebook.react.bridge.RuntimeScheduler
import com.facebook.react.bridge.UIManager
import com.facebook.react.bridge.queue.ReactQueueConfiguration
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.common.annotations.VisibleForTesting
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModuleRegistry
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
import com.facebook.react.turbomodule.core.interfaces.NativeMethodCallInvokerHolder
@DoNotStrip
@DeprecatedInNewArchitecture
@Deprecated(
message =
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : CatalystInstance {
override fun handleMemoryPressure(level: Int) {
@@ -147,23 +148,23 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
throw UnsupportedOperationException("Unimplemented method 'setGlobalVariable'")
}
@DeprecatedInNewArchitecture(
@Deprecated(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
override fun setTurboModuleRegistry(turboModuleRegistry: TurboModuleRegistry) {
throw UnsupportedOperationException("Unimplemented method 'setTurboModuleRegistry'")
}
@DeprecatedInNewArchitecture(
@Deprecated(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
override fun setFabricUIManager(fabricUIManager: UIManager) {
throw UnsupportedOperationException("Unimplemented method 'setFabricUIManager'")
}
@DeprecatedInNewArchitecture(
@Deprecated(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
override fun getFabricUIManager(): UIManager {
throw UnsupportedOperationException("Unimplemented method 'getFabricUIManager'")
}
@@ -774,6 +774,8 @@ public class UIImplementation {
mViewManagers.invalidate();
}
// NOTE: When converted to Kotlin this method should be `internal` due to
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
public void setViewHierarchyUpdateDebugListener(
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
mOperationsQueue.setViewHierarchyUpdateDebugListener(listener);
@@ -687,6 +687,8 @@ public class UIManagerModule extends ReactContextBaseJavaModule
}
}
// NOTE: When converted to Kotlin this method should be `internal` due to
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
public void setViewHierarchyUpdateDebugListener(
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
mUIImplementation.setViewHierarchyUpdateDebugListener(listener);
@@ -609,6 +609,8 @@ public class UIViewOperationQueue {
return mNativeViewHierarchyManager;
}
// NOTE: When converted to Kotlin this method should be `internal` due to
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
public void setViewHierarchyUpdateDebugListener(
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
mViewHierarchyUpdateDebugListener = listener;
@@ -5,26 +5,22 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager.debug;
package com.facebook.react.uimanager.debug
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
/**
* A listener that is notified about view hierarchy update events. This listener should only be used
* for debug purposes and should not affect application state.
*
* <p>NB: while onViewHierarchyUpdateFinished will always be called from the UI thread, there are no
* NB: while [onViewHierarchyUpdateFinished] will always be called from the UI thread, there are no
* guarantees what thread onViewHierarchyUpdateEnqueued is called on.
*/
@DeprecatedInNewArchitecture
public interface NotThreadSafeViewHierarchyUpdateDebugListener {
/**
* Called when {@link UIManagerModule} enqueues a UI batch to be dispatched to the main thread.
*/
void onViewHierarchyUpdateEnqueued();
internal interface NotThreadSafeViewHierarchyUpdateDebugListener {
/** Called when `UIManagerModule` enqueues a UI batch to be dispatched to the main thread. */
fun onViewHierarchyUpdateEnqueued()
/** Called from the main thread after a UI batch has been applied to all root views. */
void onViewHierarchyUpdateFinished();
fun onViewHierarchyUpdateFinished()
}
@@ -17,108 +17,24 @@ import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.PixelUtil.dpToPx
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.viewmanagers.DebuggingOverlayManagerDelegate
import com.facebook.react.viewmanagers.DebuggingOverlayManagerInterface
@ReactModule(name = DebuggingOverlayManager.REACT_CLASS)
public class DebuggingOverlayManager : SimpleViewManager<DebuggingOverlay>() {
public class DebuggingOverlayManager :
SimpleViewManager<DebuggingOverlay>(), DebuggingOverlayManagerInterface<DebuggingOverlay> {
private val delegate: ViewManagerDelegate<DebuggingOverlay> =
DebuggingOverlayManagerDelegate(this)
public override fun getDelegate(): ViewManagerDelegate<DebuggingOverlay> = delegate
override fun receiveCommand(view: DebuggingOverlay, commandId: String, args: ReadableArray?) {
when (commandId) {
"highlightTraceUpdates" -> {
if (args == null) {
return
}
val providedTraceUpdates = args.getArray(0)
val formattedTraceUpdates = mutableListOf<TraceUpdate>()
var successfullyParsedPayload = true
for (i in 0 until providedTraceUpdates.size()) {
val traceUpdate = providedTraceUpdates.getMap(i)
val serializedRectangle = traceUpdate.getMap("rectangle")
if (serializedRectangle == null) {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field is" +
" null"))
successfullyParsedPayload = false
break
}
val id = traceUpdate.getInt("id")
val color = traceUpdate.getInt("color")
try {
val left = serializedRectangle.getDouble("x").toFloat()
val top = serializedRectangle.getDouble("y").toFloat()
val right = (left + serializedRectangle.getDouble("width")).toFloat()
val bottom = (top + serializedRectangle.getDouble("height")).toFloat()
val rectangle = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
formattedTraceUpdates.add(TraceUpdate(id, rectangle, color))
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field should" +
" have x, y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setTraceUpdates(formattedTraceUpdates)
}
}
"highlightElements" -> {
if (args == null) {
return
}
val providedElements = args.getArray(0)
val elementsRectangles = mutableListOf<RectF>()
var successfullyParsedPayload = true
for (i in 0 until providedElements.size()) {
val element = providedElements.getMap(i)
try {
val left = element.getDouble("x").toFloat()
val top = element.getDouble("y").toFloat()
val right = (left + element.getDouble("width")).toFloat()
val bottom = (top + element.getDouble("height")).toFloat()
val rect = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
elementsRectangles.add(rect)
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting elements: every element should have x," +
" y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setHighlightedElementsRectangles(elementsRectangles)
}
}
"clearElementsHighlights" -> {
view.clearElementsHighlights()
}
"highlightTraceUpdates" -> highlightTraceUpdates(view, args)
"highlightElements" -> highlightElements(view, args)
"clearElementsHighlights" -> clearElementsHighlights(view)
else -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
@@ -127,6 +43,105 @@ public class DebuggingOverlayManager : SimpleViewManager<DebuggingOverlay>() {
}
}
public override fun highlightTraceUpdates(view: DebuggingOverlay, args: ReadableArray?): Unit {
if (args == null) {
return
}
val providedTraceUpdates = args.getArray(0)
val formattedTraceUpdates = mutableListOf<TraceUpdate>()
var successfullyParsedPayload = true
for (i in 0 until providedTraceUpdates.size()) {
val traceUpdate = providedTraceUpdates.getMap(i)
val serializedRectangle = traceUpdate.getMap("rectangle")
if (serializedRectangle == null) {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field is null"))
successfullyParsedPayload = false
break
}
val id = traceUpdate.getInt("id")
val color = traceUpdate.getInt("color")
try {
val left = serializedRectangle.getDouble("x").toFloat()
val top = serializedRectangle.getDouble("y").toFloat()
val right = (left + serializedRectangle.getDouble("width")).toFloat()
val bottom = (top + serializedRectangle.getDouble("height")).toFloat()
val rectangle = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
formattedTraceUpdates.add(TraceUpdate(id, rectangle, color))
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field should" +
" have x, y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setTraceUpdates(formattedTraceUpdates)
}
}
public override fun highlightElements(view: DebuggingOverlay, args: ReadableArray?): Unit {
if (args == null) {
return
}
val providedElements = args.getArray(0)
val elementsRectangles = mutableListOf<RectF>()
var successfullyParsedPayload = true
for (i in 0 until providedElements.size()) {
val element = providedElements.getMap(i)
try {
val left = element.getDouble("x").toFloat()
val top = element.getDouble("y").toFloat()
val right = (left + element.getDouble("width")).toFloat()
val bottom = (top + element.getDouble("height")).toFloat()
val rect = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
elementsRectangles.add(rect)
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting elements: every element should have x," +
" y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setHighlightedElementsRectangles(elementsRectangles)
}
}
public override fun clearElementsHighlights(view: DebuggingOverlay): Unit {
view.clearElementsHighlights()
}
public override fun createViewInstance(context: ThemedReactContext): DebuggingOverlay {
return DebuggingOverlay(context)
}
@@ -19,6 +19,7 @@ public object ImageResizeMode {
private const val RESIZE_MODE_STRETCH = "stretch"
private const val RESIZE_MODE_CENTER = "center"
private const val RESIZE_MODE_REPEAT = "repeat"
private const val RESIZE_MODE_NONE = "none"
/** Converts JS resize modes into `ScalingUtils.ScaleType`. See `ImageResizeMode.js`. */
@JvmStatic
@@ -30,6 +31,7 @@ public object ImageResizeMode {
RESIZE_MODE_CENTER -> return ScalingUtils.ScaleType.CENTER_INSIDE
// Handled via a combination of ScaleType and TileMode
RESIZE_MODE_REPEAT -> return ScaleTypeStartInside.INSTANCE
RESIZE_MODE_NONE -> return ScaleTypeStartInside.INSTANCE
}
if (resizeModeValue != null) {
@@ -45,7 +47,8 @@ public object ImageResizeMode {
if (RESIZE_MODE_CONTAIN == resizeModeValue ||
RESIZE_MODE_COVER == resizeModeValue ||
RESIZE_MODE_STRETCH == resizeModeValue ||
RESIZE_MODE_CENTER == resizeModeValue) {
RESIZE_MODE_CENTER == resizeModeValue ||
RESIZE_MODE_NONE == resizeModeValue) {
return TileMode.CLAMP
}
if (RESIZE_MODE_REPEAT == resizeModeValue) {
@@ -20,7 +20,7 @@ import com.facebook.react.uimanager.StateWrapper
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.UIManagerModule
public class ReactSafeAreaView(public val reactContext: ThemedReactContext) :
internal class ReactSafeAreaView(public val reactContext: ThemedReactContext) :
ViewGroup(reactContext) {
internal var stateWrapper: StateWrapper? = null
@@ -19,7 +19,7 @@ import com.facebook.react.viewmanagers.SafeAreaViewManagerInterface
/** View manager for [ReactSafeAreaView] components. */
@ReactModule(name = ReactSafeAreaViewManager.REACT_CLASS)
public class ReactSafeAreaViewManager() :
internal class ReactSafeAreaViewManager() :
ViewGroupManager<ReactSafeAreaView>(), SafeAreaViewManagerInterface<ReactSafeAreaView> {
private val delegate: ViewManagerDelegate<ReactSafeAreaView> = SafeAreaViewManagerDelegate(this)
@@ -45,7 +45,7 @@ public class ReactSafeAreaViewManager() :
return null
}
public companion object {
public const val REACT_CLASS: String = "RCTSafeAreaView"
internal companion object {
const val REACT_CLASS: String = "RCTSafeAreaView"
}
}
@@ -11,16 +11,25 @@ import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.ReactStylesDiffMap
import com.facebook.react.uimanager.StateWrapper
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.common.UIManagerType
import com.facebook.react.uimanager.common.ViewUtil
import com.facebook.react.viewmanagers.AndroidHorizontalScrollContentViewManagerDelegate
import com.facebook.react.viewmanagers.AndroidHorizontalScrollContentViewManagerInterface
import com.facebook.react.views.view.ReactViewGroup
import com.facebook.react.views.view.ReactViewManager
/** View manager for {@link ReactHorizontalScrollContainerView} components. */
@ReactModule(name = ReactHorizontalScrollContainerViewManager.REACT_CLASS)
public class ReactHorizontalScrollContainerViewManager : ReactViewManager() {
public class ReactHorizontalScrollContainerViewManager :
ReactViewManager(), AndroidHorizontalScrollContentViewManagerInterface<ReactViewGroup> {
override public fun getName(): String = REACT_CLASS
private val delegate: ViewManagerDelegate<ReactViewGroup> =
AndroidHorizontalScrollContentViewManagerDelegate(this)
public override fun getDelegate(): ViewManagerDelegate<ReactViewGroup> = delegate
protected override fun createViewInstance(
reactTag: Int,
context: ThemedReactContext,
@@ -5,15 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.text;
package com.facebook.react.views.text
/** A virtual text node. */
public class ReactVirtualTextShadowNode extends ReactBaseTextShadowNode {
internal class ReactVirtualTextShadowNode : ReactBaseTextShadowNode() {
@Override
public boolean isVirtual() {
return true;
}
public ReactVirtualTextShadowNode() {}
override fun isVirtual(): Boolean = true
}
@@ -1,47 +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.
*/
package com.facebook.react.views.text;
import android.view.View;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
/**
* Manages raw text nodes. Since they are used only as a virtual nodes any type of native view
* operation will throw an {@link IllegalStateException}
*/
@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)
public class ReactVirtualTextViewManager extends BaseViewManager<View, ReactVirtualTextShadowNode> {
@VisibleForTesting public static final String REACT_CLASS = "RCTVirtualText";
@Override
public String getName() {
return REACT_CLASS;
}
@Override
public View createViewInstance(ThemedReactContext context) {
throw new IllegalStateException("Attempt to create a native view for RCTVirtualText");
}
@Override
public void updateExtraData(View view, Object extraData) {}
@Override
public Class<ReactVirtualTextShadowNode> getShadowNodeClass() {
return ReactVirtualTextShadowNode.class;
}
@Override
public ReactVirtualTextShadowNode createShadowNodeInstance() {
return new ReactVirtualTextShadowNode();
}
}
@@ -0,0 +1,38 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.text
import android.view.View
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.BaseViewManager
import com.facebook.react.uimanager.ThemedReactContext
/**
* Manages raw text nodes. Since they are used only as a virtual nodes any type of native view
* operation will throw an [IllegalStateException]
*/
@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)
internal class ReactVirtualTextViewManager : BaseViewManager<View, ReactVirtualTextShadowNode>() {
public override fun getName(): String = REACT_CLASS
protected override fun createViewInstance(context: ThemedReactContext): View {
throw IllegalStateException("Attempt to create a native view for RCTVirtualText")
}
public override fun updateExtraData(view: View, extraData: Any): Unit {}
public override fun getShadowNodeClass(): Class<ReactVirtualTextShadowNode> =
ReactVirtualTextShadowNode::class.java
override fun createShadowNodeInstance(): ReactVirtualTextShadowNode = ReactVirtualTextShadowNode()
internal companion object {
public const val REACT_CLASS: String = "RCTVirtualText"
}
}
@@ -11,6 +11,7 @@ import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.controller.AbstractDraweeControllerBuilder;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
@@ -19,6 +20,7 @@ import com.facebook.react.uimanager.ThemedReactContext;
* Manages Images embedded in Text nodes using Fresco. Since they are used only as a virtual nodes
* any type of native view operation will throw an {@link IllegalStateException}.
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
@ReactModule(name = FrescoBasedReactTextInlineImageViewManager.REACT_CLASS)
public class FrescoBasedReactTextInlineImageViewManager
extends BaseViewManager<View, FrescoBasedReactTextInlineImageShadowNode> {
@@ -13,7 +13,7 @@ import android.view.Gravity
import android.widget.LinearLayout
import androidx.appcompat.widget.AppCompatTextView
public class ReactUnimplementedView(context: Context) : LinearLayout(context) {
internal class ReactUnimplementedView(context: Context) : LinearLayout(context) {
private val textView: AppCompatTextView
@@ -31,7 +31,7 @@ public class ReactUnimplementedView(context: Context) : LinearLayout(context) {
addView(textView)
}
public fun setName(name: String) {
internal fun setName(name: String) {
textView.setText("'$name' is not Fabric compatible yet.")
}
}
@@ -10,11 +10,21 @@ package com.facebook.react.views.unimplementedview
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewGroupManager
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.UnimplementedNativeViewManagerDelegate
import com.facebook.react.viewmanagers.UnimplementedNativeViewManagerInterface
/** ViewManager for [ReactUnimplementedView] to represent a component that is not yet supported. */
@ReactModule(name = ReactUnimplementedViewManager.REACT_CLASS)
internal class ReactUnimplementedViewManager : ViewGroupManager<ReactUnimplementedView>() {
internal class ReactUnimplementedViewManager :
ViewGroupManager<ReactUnimplementedView>(),
UnimplementedNativeViewManagerInterface<ReactUnimplementedView> {
private val delegate: ViewManagerDelegate<ReactUnimplementedView> =
UnimplementedNativeViewManagerDelegate(this)
public override fun getDelegate(): ViewManagerDelegate<ReactUnimplementedView> = delegate
protected override fun createViewInstance(
reactContext: ThemedReactContext
@@ -23,8 +33,8 @@ internal class ReactUnimplementedViewManager : ViewGroupManager<ReactUnimplement
public override fun getName(): String = REACT_CLASS
@ReactProp(name = "name")
public fun setName(view: ReactUnimplementedView, name: String) {
view.setName(name)
public override fun setName(view: ReactUnimplementedView, name: String?): Unit {
view.setName(name ?: "<null component name>")
}
internal companion object {
@@ -143,7 +143,13 @@ public class ReactViewGroup extends ViewGroup
private float mBackfaceOpacity;
private String mBackfaceVisibility;
public ReactViewGroup(Context context) {
/**
* Creates a new `ReactViewGroup` instance.
*
* @param context A {@link Context} instance. It's Nullable to not break compatibility with OSS
* users (could be made non-null in the future but requires proper comms).
*/
public ReactViewGroup(@Nullable Context context) {
super(context);
initView();
}
@@ -473,7 +473,6 @@ void FabricUIManagerBinding::installFabricUIManager(
globalJavaUiManager);
};
contextContainer->insert("ReactNativeConfig", config);
contextContainer->insert("FabricUIManager", globalJavaUiManager);
// Keep reference to config object and cache some feature flags here
@@ -71,6 +71,7 @@ class BridgelessReactContextTest {
assertThat(bridgelessReactContext.getFabricUIManager()).isEqualTo(fabricUiManager)
}
@Suppress("DEPRECATION")
@Test
fun getCatalystInstanceTest() {
assertThat(bridgelessReactContext.getCatalystInstance())
@@ -28,6 +28,8 @@ class ImageResizeModeTest {
.isEqualTo(ScalingUtils.ScaleType.FIT_XY)
Assertions.assertThat(ImageResizeMode.toScaleType("center"))
.isEqualTo(ScalingUtils.ScaleType.CENTER_INSIDE)
Assertions.assertThat(ImageResizeMode.toScaleType("none"))
.isEqualTo(ScaleTypeStartInside.INSTANCE)
// No resizeMode set
Assertions.assertThat(ImageResizeMode.defaultValue())
@@ -78,6 +78,43 @@ class SetFalseOnDestruct {
}
};
void logErrorWhileReporting(
std::string message,
jsi::JSError& error,
jsi::JSError& originalError) {
LOG(ERROR) << "JsErrorHandler::" << message << std::endl
<< "Js error message: " << error.getMessage() << std::endl
<< "Original js error message: " << originalError.getMessage()
<< std::endl;
}
jsi::Value getBundleMetadata(jsi::Runtime& runtime, jsi::JSError& error) {
auto jsGetBundleMetadataValue =
runtime.global().getProperty(runtime, "__getBundleMetadata");
if (!jsGetBundleMetadataValue.isObject() ||
!jsGetBundleMetadataValue.asObject(runtime).isFunction(runtime)) {
return jsi::Value::null();
}
auto jsGetBundleMetadataValueFn =
jsGetBundleMetadataValue.asObject(runtime).asFunction(runtime);
try {
auto bundleMetadataValue = jsGetBundleMetadataValueFn.call(runtime);
if (bundleMetadataValue.isObject()) {
return bundleMetadataValue;
}
return bundleMetadataValue;
} catch (jsi::JSError& ex) {
logErrorWhileReporting(
"getBundleMetadata(): Error raised while calling __getBundleMetadata(). Returning null.",
ex,
error);
}
return jsi::Value::null();
}
} // namespace
namespace facebook::react {
@@ -199,12 +236,11 @@ void JsErrorHandler::handleError(
try {
handleJSError(runtime, error, isFatal);
return;
} catch (jsi::JSError& e) {
LOG(ERROR)
<< "JsErrorHandler: Failed to report js error using js pipeline. Using C++ pipeline instead."
<< std::endl
<< "Reporting failure: " << e.getMessage() << std::endl
<< "Original js error: " << error.getMessage() << std::endl;
} catch (jsi::JSError& ex) {
logErrorWhileReporting(
"handleError(): Error raised while reporting using js pipeline. Using c++ pipeline instead.",
ex,
error);
}
}
@@ -249,8 +285,14 @@ void JsErrorHandler::handleErrorWithCppPipeline(
objectAssign(runtime, extraData, extraDataValue.asObject(runtime));
}
auto isDEV =
isTruthy(runtime, runtime.global().getProperty(runtime, "__DEV__"));
extraData.setProperty(runtime, "jsEngine", jsEngineValue);
extraData.setProperty(runtime, "rawStack", error.getStack());
extraData.setProperty(runtime, "__DEV__", isDEV);
extraData.setProperty(
runtime, "bundleMetadata", getBundleMetadata(runtime, error));
auto cause = errorObj.getProperty(runtime, "cause");
if (cause.isObject()) {
@@ -324,7 +366,14 @@ void JsErrorHandler::handleErrorWithCppPipeline(
data.setProperty(runtime, "preventDefault", preventDefault);
for (auto& errorListener : _errorListeners) {
errorListener(runtime, jsi::Value(runtime, data));
try {
errorListener(runtime, jsi::Value(runtime, data));
} catch (jsi::JSError& ex) {
logErrorWhileReporting(
"handleErrorWithCppPipeline(): Error raised inside an error listener. Executing next listener.",
ex,
error);
}
}
if (*shouldPreventDefault) {
@@ -258,7 +258,7 @@ std::u16string Runtime::utf16(const String& str) {
return convertUTF8ToUTF16(utf8Str);
}
Pointer& Pointer::operator=(Pointer&& other) {
Pointer& Pointer::operator=(Pointer&& other) noexcept {
if (ptr_) {
ptr_->invalidate();
}
@@ -418,7 +418,7 @@ class JSI_EXPORT Runtime {
// Base class for pointer-storing types.
class JSI_EXPORT Pointer {
protected:
explicit Pointer(Pointer&& other) : ptr_(other.ptr_) {
explicit Pointer(Pointer&& other) noexcept : ptr_(other.ptr_) {
other.ptr_ = nullptr;
}
@@ -428,7 +428,7 @@ class JSI_EXPORT Pointer {
}
}
Pointer& operator=(Pointer&& other);
Pointer& operator=(Pointer&& other) noexcept;
friend class Runtime;
friend class Value;
@@ -148,6 +148,8 @@ inline void fromRawValue(
result = ImageResizeMode::Center;
} else if (stringValue == "repeat") {
result = ImageResizeMode::Repeat;
} else if (stringValue == "none") {
result = ImageResizeMode::None;
} else {
LOG(ERROR) << "Unsupported ImageResizeMode value: " << stringValue;
react_native_expect(false);
@@ -168,6 +170,8 @@ inline std::string toString(const ImageResizeMode& value) {
return "center";
case ImageResizeMode::Repeat:
return "repeat";
case ImageResizeMode::None:
return "none";
}
}
@@ -26,6 +26,8 @@ inline static UIViewContentMode RCTContentModeFromImageResizeMode(facebook::reac
// Repeat resize mode is handled by the UIImage. Use scale to fill
// so the repeated image fills the UIImageView.
return UIViewContentModeScaleToFill;
case facebook::react::ImageResizeMode::None:
return UIViewContentModeTopLeft;
}
}
@@ -42,6 +44,8 @@ inline std::string toString(const facebook::react::ImageResizeMode &value)
return "center";
case facebook::react::ImageResizeMode::Repeat:
return "repeat";
case facebook::react::ImageResizeMode::None:
return "none";
}
}
@@ -47,6 +47,7 @@ enum class ImageResizeMode {
Stretch,
Center,
Repeat,
None,
};
class ImageErrorInfo {
@@ -15,4 +15,6 @@
- (void)setBundleURLProvider:(RCTHostBundleURLProvider)bundleURLProvider;
- (void)setContextContainerHandler:(id<RCTContextContainerHandling>)contextContainerHandler;
@property (nonatomic, readonly) RCTBundleManager *bundleManager;
@end
@@ -273,6 +273,11 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho
return [_instance surfacePresenter];
}
- (RCTBundleManager *)bundleManager
{
return _bundleManager;
}
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args
{
[_instance callFunctionOnJSModule:moduleName method:method args:args];
@@ -540,7 +540,7 @@ static float computeFlexBasisForChildren(
const uint32_t generationCount) {
float totalOuterFlexBasis = 0.0f;
YGNodeRef singleFlexChild = nullptr;
const auto& children = node->getLayoutChildren();
auto children = node->getLayoutChildren();
SizingMode sizingModeMainDim =
isRow(mainAxis) ? widthSizingMode : heightSizingMode;
// If there is only one child with flexGrow + flexShrink it means we can set
@@ -29,8 +29,7 @@ FlexLine calculateFlexLine(
float totalFlexGrowFactors = 0.0f;
float totalFlexShrinkScaledFactors = 0.0f;
size_t numberOfAutoMargins = 0;
size_t endOfLineIndex = iterator.index();
size_t firstElementInLineIndex = iterator.index();
yoga::Node* firstElementInLine = nullptr;
float sizeConsumedIncludingMinConstraint = 0;
const Direction direction = node->resolveDirection(ownerDirection);
@@ -40,19 +39,19 @@ FlexLine calculateFlexLine(
const float gap =
node->style().computeGapForAxis(mainAxis, availableInnerMainDim);
const auto childrenEnd = node->getLayoutChildren().end();
// Add items to the current line until it's full or we run out of items.
for (; iterator != node->getLayoutChildren().end();
iterator++, endOfLineIndex = iterator.index()) {
for (; iterator != childrenEnd; iterator++) {
auto child = *iterator;
if (child->style().display() == Display::None ||
child->style().positionType() == PositionType::Absolute) {
if (firstElementInLineIndex == endOfLineIndex) {
// We haven't found the first contributing element in the line yet.
firstElementInLineIndex++;
}
continue;
}
if (firstElementInLine == nullptr) {
firstElementInLine = child;
}
if (child->style().flexStartMarginIsAuto(mainAxis, ownerDirection)) {
numberOfAutoMargins++;
}
@@ -60,13 +59,11 @@ FlexLine calculateFlexLine(
numberOfAutoMargins++;
}
const bool isFirstElementInLine =
(endOfLineIndex - firstElementInLineIndex) == 0;
child->setLineIndex(lineCount);
const float childMarginMainAxis =
child->style().computeMarginForAxis(mainAxis, availableInnerWidth);
const float childLeadingGapMainAxis = isFirstElementInLine ? 0.0f : gap;
const float childLeadingGapMainAxis =
child == firstElementInLine ? 0.0f : gap;
const float flexBasisWithMinAndMaxConstraints =
boundAxisWithinMinAndMax(
child,
@@ -117,7 +114,6 @@ FlexLine calculateFlexLine(
return FlexLine{
.itemsInFlow = std::move(itemsInFlow),
.sizeConsumed = sizeConsumed,
.endOfLineIndex = endOfLineIndex,
.numberOfAutoMargins = numberOfAutoMargins,
.layout = FlexLineRunningLayout{
totalFlexGrowFactors,
@@ -49,9 +49,6 @@ struct FlexLine {
// the flexible children.
const float sizeConsumed{0.0f};
// The index of the first item beyond the current line.
const size_t endOfLineIndex{0};
// Number of edges along the line flow with an auto margin.
const size_t numberOfAutoMargins{0};
@@ -124,7 +124,7 @@ void roundLayoutResultsToPixelGrid(
Dimension::Height);
}
for (yoga::Node* child : node->getLayoutChildren()) {
for (yoga::Node* child : node->getChildren()) {
roundLayoutResultsToPixelGrid(child, absoluteNodeLeft, absoluteNodeTop);
}
}
@@ -4,10 +4,12 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <cstdint>
#include <vector>
#include <forward_list>
#include <utility>
#include <yoga/enums/Display.h>
@@ -18,7 +20,6 @@ class Node;
template <typename T>
class LayoutableChildren {
public:
using Backtrack = std::vector<std::pair<const T*, size_t>>;
struct Iterator {
using iterator_category = std::input_iterator_tag;
using difference_type = std::ptrdiff_t;
@@ -30,10 +31,6 @@ class LayoutableChildren {
Iterator(const T* node, size_t childIndex)
: node_(node), childIndex_(childIndex) {}
Iterator(const T* node, size_t childIndex, Backtrack&& backtrack)
: node_(node),
childIndex_(childIndex),
backtrack_(std::move(backtrack)) {}
T* operator*() const {
return node_->getChild(childIndex_);
@@ -41,7 +38,6 @@ class LayoutableChildren {
Iterator& operator++() {
next();
currentNodeIndex_++;
return *this;
}
@@ -51,10 +47,6 @@ class LayoutableChildren {
return tmp;
}
size_t index() const {
return currentNodeIndex_;
}
friend bool operator==(const Iterator& a, const Iterator& b) {
return a.node_ == b.node_ && a.childIndex_ == b.childIndex_;
}
@@ -68,16 +60,16 @@ class LayoutableChildren {
if (childIndex_ + 1 >= node_->getChildCount()) {
// if the current node has no more children, try to backtrack and
// visit its successor
if (backtrack_.empty()) {
if (backtrack_.empty()) [[likely]] {
// if there are no nodes to backtrack to, the last node has been
// visited
*this = Iterator{};
} else {
// pop and restore the latest backtrack entry
const auto back = backtrack_.back();
backtrack_.pop_back();
const auto& back = backtrack_.front();
node_ = back.first;
childIndex_ = back.second;
backtrack_.pop_front();
// go to the next node
next();
@@ -87,7 +79,10 @@ class LayoutableChildren {
++childIndex_;
// skip all display: contents nodes, possibly going deeper into the
// tree
skipContentsNodes();
if (node_->getChild(childIndex_)->style().display() ==
Display::Contents) [[unlikely]] {
skipContentsNodes();
}
}
}
@@ -99,7 +94,7 @@ class LayoutableChildren {
// if it has display: contents set, it shouldn't be returned but its
// children should in its place push the current node and child index
// so that the current state can be restored when backtracking
backtrack_.push_back({node_, childIndex_});
backtrack_.push_front({node_, childIndex_});
// traverse the child
node_ = currentNode;
childIndex_ = 0;
@@ -117,8 +112,7 @@ class LayoutableChildren {
const T* node_{nullptr};
size_t childIndex_{0};
size_t currentNodeIndex_{0};
Backtrack backtrack_;
std::forward_list<std::pair<const T*, size_t>> backtrack_;
friend LayoutableChildren;
};
@@ -133,7 +127,10 @@ class LayoutableChildren {
Iterator begin() const {
if (node_->getChildCount() > 0) {
auto result = Iterator(node_, 0);
result.skipContentsNodes();
if (node_->getChild(0)->style().display() == Display::Contents)
[[unlikely]] {
result.skipContentsNodes();
}
return result;
} else {
return Iterator{};
+2 -2
View File
@@ -99,7 +99,7 @@
},
"peerDependencies": {
"@types/react": "^18.2.6",
"react": "^18.2.0"
"react": "^19.0.0-rc-fb9a90fa48-20240614"
},
"peerDependenciesMeta": {
"@types/react": {
@@ -138,7 +138,7 @@
"react-devtools-core": "^6.0.1",
"react-refresh": "^0.14.0",
"regenerator-runtime": "^0.13.2",
"scheduler": "0.24.0-canary-efb381bbf-20230505",
"scheduler": "0.25.0-rc-fb9a90fa48-20240614",
"semver": "^7.1.3",
"stacktrace-parser": "^0.1.10",
"whatwg-fetch": "^3.0.0",
@@ -40,15 +40,27 @@ class NewArchitectureTests < Test::Unit::TestCase
assert_equal(installer.aggregate_targets[0].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.aggregate_targets[1].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.pods_project.targets[1].received_resolved_build_setting_parameters, [ReceivedCommonResolvedBuildSettings.new("CLANG_CXX_LANGUAGE_STANDARD", true)])
assert_equal(Pod::UI.collected_messages, ["Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path.xcproj", "Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path2.xcproj"])
end
def test_setClangCxxLanguageStandardIfNeeded_whenReactCoreIsNotPresent
installer = prepare_mocked_installer_without_react_core
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
assert_equal(installer.aggregate_targets[0].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], nil)
assert_equal(installer.aggregate_targets[1].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], nil)
assert_equal(installer.pods_project.targets[0].received_resolved_build_setting_parameters, [])
assert_equal(Pod::UI.collected_messages, [])
end
def test_setClangCxxLanguageStandardIfNeeded_whenThereAreDifferentValuesForLanguageStandard_takesTheFirstValue
installer = prepare_mocked_installer_with_react_core_and_different_language_standards
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
assert_equal(installer.aggregate_targets[0].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.aggregate_targets[1].user_project.build_configurations[0].build_settings["CLANG_CXX_LANGUAGE_STANDARD"], "c++20")
assert_equal(installer.pods_project.targets[1].received_resolved_build_setting_parameters, [ReceivedCommonResolvedBuildSettings.new("CLANG_CXX_LANGUAGE_STANDARD", true)])
assert_equal(Pod::UI.collected_messages, ["Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path.xcproj", "Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /test/path2.xcproj"])
end
@@ -701,6 +701,9 @@ class UtilsTests < Test::Unit::TestCase
# Assert
assert_equal(FileMock.exist_invocation_params, ["/.xcode.env", "/.xcode.env.local"])
assert_equal($collected_commands[0], "echo 'export NODE_BINARY=$(command -v node)' > /.xcode.env")
assert_true($collected_commands[1].start_with? "echo 'export NODE_BINARY=")
assert_true($collected_commands[1].end_with? "' > /.xcode.env.local")
end
# ============================ #
-59
View File
@@ -1,59 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
/**
* These are types for things that are present for New Architecture enabled apps
* which is currently considered experimental.
*
* To load the types declared here in an actual project, there are three ways.
*
* 1. If your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react-native/types/experimental"` to the `"types"` array.
*
* 2. Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react-native/types/experimental'
* ```
*
* 3. It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react-native/types/experimental" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
*/
import {
GradientValue,
BlendMode,
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
export {};
declare module '.' {
export interface ViewProps {
/**
* Contols whether this view, and its transitive children, are laid in a way
* consistent with web browsers ('strict'), or consistent with existing
* React Native code which may rely on incorrect behavior ('classic').
*/
experimental_layoutConformance?: 'strict' | 'classic' | undefined;
}
export interface ViewStyle {
mixBlendMode?: BlendMode | undefined;
experimental_backgroundImage?:
| ReadonlyArray<GradientValue>
| string
| undefined;
}
}
@@ -825,6 +825,9 @@ const styles = StyleSheet.create({
objectFitScaleDown: {
objectFit: 'scale-down',
},
objectFitNone: {
objectFit: 'none',
},
imageInBundle: {
borderColor: 'yellow',
borderWidth: 4,
@@ -1466,6 +1469,17 @@ exports.examples = [
/>
</View>
</View>
<View style={styles.horizontal}>
<View>
<RNTesterText style={styles.resizeModeText}>
None
</RNTesterText>
<Image
style={[styles.resizeMode, styles.objectFitNone]}
source={image}
/>
</View>
</View>
</View>
);
})}
@@ -1537,6 +1551,18 @@ exports.examples = [
/>
</View>
</View>
<View style={styles.horizontal}>
<View>
<RNTesterText style={styles.resizeModeText}>
None
</RNTesterText>
<Image
style={styles.resizeMode}
resizeMode="none"
source={image}
/>
</View>
</View>
</View>
);
})}
@@ -10,125 +10,69 @@
'use strict';
import type {
GestureState,
PanResponderInstance,
} from 'react-native/Libraries/Interaction/PanResponder';
import type {PressEvent} from 'react-native/Libraries/Types/CoreEventTypes';
const RNTesterPage = require('../../components/RNTesterPage');
const React = require('react');
const {PanResponder, StyleSheet, View} = require('react-native');
import * as React from 'react';
import {useMemo, useRef, useState} from 'react';
import {PanResponder, StyleSheet, View} from 'react-native';
const CIRCLE_SIZE = 80;
type Props = $ReadOnly<{||}>;
type State = {|
left: number,
top: number,
pressed: boolean,
|};
class PanResponderExample extends React.Component<Props, State> {
_previousLeft: number = 20;
_previousTop: number = 84;
circle: ?React.ElementRef<typeof View> = null;
state: State = {
left: 20,
top: 84,
pressed: false,
};
_handleStartShouldSetPanResponder = (
event: PressEvent,
gestureState: GestureState,
): boolean => {
// Should we become active when the user presses down on the circle?
return true;
};
_handleMoveShouldSetPanResponder = (
event: PressEvent,
gestureState: GestureState,
): boolean => {
// Should we become active when the user moves a touch over the circle?
return true;
};
_handlePanResponderGrant = (
event: PressEvent,
gestureState: GestureState,
) => {
this.setState({
pressed: true,
});
};
_handlePanResponderMove = (event: PressEvent, gestureState: GestureState) => {
this.setState({
left: this._previousLeft + gestureState.dx,
top: this._previousTop + gestureState.dy,
});
};
_handlePanResponderEnd = (event: PressEvent, gestureState: GestureState) => {
this.setState({
pressed: false,
});
this._previousLeft += gestureState.dx;
this._previousTop += gestureState.dy;
};
_panResponder: PanResponderInstance = PanResponder.create({
onStartShouldSetPanResponder: this._handleStartShouldSetPanResponder,
onMoveShouldSetPanResponder: this._handleMoveShouldSetPanResponder,
onPanResponderGrant: this._handlePanResponderGrant,
onPanResponderMove: this._handlePanResponderMove,
onPanResponderRelease: this._handlePanResponderEnd,
onPanResponderTerminate: this._handlePanResponderEnd,
});
render(): React.Node {
return (
<RNTesterPage noScroll={true} title="Basic gesture handling">
<View style={styles.container}>
<View
ref={circle => {
this.circle = circle;
}}
style={[
styles.circle,
{
transform: [
{translateX: this.state.left},
{translateY: this.state.top},
],
backgroundColor: this.state.pressed ? 'blue' : 'green',
},
]}
{...this._panResponder.panHandlers}
/>
</View>
</RNTesterPage>
);
}
function PanResponderExample() {
const [position, setPosition] = useState({left: 20, top: 84});
const [pressed, setPressed] = useState(false);
const circleRef = useRef<?React.ElementRef<typeof View>>(null);
const panResponder = useMemo(
() =>
PanResponder.create({
onStartShouldSetPanResponder: () => true,
onMoveShouldSetPanResponder: () => true,
onPanResponderGrant: () => {
setPressed(true);
},
onPanResponderMove: (evt, gestureState) => {
setPosition({
left: position.left + gestureState.dx,
top: position.top + gestureState.dy,
});
},
onPanResponderRelease: () => {
setPressed(false);
},
}),
[position],
);
return (
<View style={styles.container}>
<View
ref={circleRef}
style={[
styles.circle,
{
transform: [
{translateX: position.left},
{translateY: position.top},
],
backgroundColor: pressed ? 'blue' : 'green',
},
]}
{...panResponder.panHandlers}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
height: 500,
},
circle: {
width: CIRCLE_SIZE,
height: CIRCLE_SIZE,
backgroundColor: 'green',
borderRadius: CIRCLE_SIZE / 2,
position: 'absolute',
left: 0,
top: 0,
},
container: {
flex: 1,
height: 500,
},
});
exports.title = 'PanResponder Sample';
@@ -139,6 +83,7 @@ exports.description =
exports.examples = [
{
title: 'Basic gesture handling',
description: 'Press and drag circle around',
render(): React.MixedElement {
return <PanResponderExample />;
},
+1 -1
View File
@@ -34,7 +34,7 @@
"nullthrows": "^1.1.1"
},
"peerDependencies": {
"react": "18.3.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "*"
},
"codegenConfig": {
+1 -1
View File
@@ -24,7 +24,7 @@
"nullthrows": "^1.1.1"
},
"devDependencies": {
"react-test-renderer": "18.3.1"
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614"
},
"peerDependencies": {
"@types/react": "^18.2.6",
@@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"dependencies": {
"react": "18.3.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "1000.0.0"
},
"devDependencies": {
+19 -54
View File
@@ -6283,7 +6283,7 @@ logkitty@^0.7.1:
dayjs "^1.8.15"
yargs "^15.1.0"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
loose-envify@^1.0.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -7366,54 +7366,28 @@ react-devtools-core@^6.0.1:
shell-quote "^1.6.1"
ws "^7"
"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.0.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
react-is@^16.13.1, react-is@^16.8.4:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
react-is@^17.0.1:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
react-is@^18.3.1:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e"
integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==
react-is@19.0.0-rc-fb9a90fa48-20240614, react-is@^16.13.1, react-is@^16.8.4, react-is@^17.0.1, react-is@^18.0.0:
version "19.0.0-rc-fb9a90fa48-20240614"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-19.0.0-rc-fb9a90fa48-20240614.tgz#6987893799abdedf2e9929e31541cb6d7dc8285a"
integrity sha512-60qI7v1B9RhmZwjTCnAgzcuABOQsIH20vTbETQPaze96s1lY2lSawv9dvXAfF8Z1MIqOppWSKLNOshF0WsZ3OA==
react-refresh@^0.14.0:
version "0.14.2"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.2.tgz#3833da01ce32da470f1f936b9d477da5c7028bf9"
integrity sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==
react-shallow-renderer@^16.15.0:
version "16.15.0"
resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.15.0.tgz#48fb2cf9b23d23cde96708fe5273a7d3446f4457"
integrity sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==
react-test-renderer@19.0.0-rc-fb9a90fa48-20240614:
version "19.0.0-rc-fb9a90fa48-20240614"
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-19.0.0-rc-fb9a90fa48-20240614.tgz#6657b3d05a533afad5ea0516f9ed29cadf72334f"
integrity sha512-cV3mGgsKTJCB8f4tZxWIp0ot4PMgx791XTkwpapf06ZlUk5BCP3C1CbIqRXcKeiQODvFJClZX26TFTPAklTq7A==
dependencies:
object-assign "^4.1.1"
react-is "^16.12.0 || ^17.0.0 || ^18.0.0"
react-is "19.0.0-rc-fb9a90fa48-20240614"
scheduler "0.25.0-rc-fb9a90fa48-20240614"
react-test-renderer@18.3.1:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-18.3.1.tgz#e693608a1f96283400d4a3afead6893f958b80b4"
integrity sha512-KkAgygexHUkQqtvvx/otwxtuFu5cVjfzTCtjXLH9boS19/Nbtg84zS7wIQn39G8IlrhThBpQsMKkq5ZHZIYFXA==
dependencies:
react-is "^18.3.1"
react-shallow-renderer "^16.15.0"
scheduler "^0.23.2"
react@18.3.1:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
dependencies:
loose-envify "^1.1.0"
react@19.0.0-rc-fb9a90fa48-20240614:
version "19.0.0-rc-fb9a90fa48-20240614"
resolved "https://registry.yarnpkg.com/react/-/react-19.0.0-rc-fb9a90fa48-20240614.tgz#90eb43a0b005e8cc3cbf0d801c14816d01df1b08"
integrity sha512-nvE3Gy+IOIfH/DXhkyxFVQSrITarFcQz4+shzC/McxQXEUSonpw2oDy/Wi9hdDtV3hlP12VYuDL95iiBREedNQ==
readable-stream@^2.0.6, readable-stream@~2.3.6:
version "2.3.8"
@@ -7763,19 +7737,10 @@ safe-regex-test@^1.0.3:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
scheduler@0.24.0-canary-efb381bbf-20230505:
version "0.24.0-canary-efb381bbf-20230505"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.24.0-canary-efb381bbf-20230505.tgz#5dddc60e29f91cd7f8b983d7ce4a99c2202d178f"
integrity sha512-ABvovCDe/k9IluqSh4/ISoq8tIJnW8euVAWYt5j/bg6dRnqwQwiGO1F/V4AyK96NGF/FB04FhOUDuWj8IKfABA==
dependencies:
loose-envify "^1.1.0"
scheduler@^0.23.2:
version "0.23.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3"
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
dependencies:
loose-envify "^1.1.0"
scheduler@0.25.0-rc-fb9a90fa48-20240614:
version "0.25.0-rc-fb9a90fa48-20240614"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0-rc-fb9a90fa48-20240614.tgz#9ee11063b7c0f47aef3fea53d9f1be3f13794dce"
integrity sha512-HHqQ/SqbeiDfXXVKgNxTpbQTD4n7IUb4hZATvHjp03jr3TF7igehCyHdOjeYTrzIseLO93cTTfSb5f4qWcirMQ==
selfsigned@^2.4.1:
version "2.4.1"