Compare commits

...
Author SHA1 Message Date
Christian Falch f217bce77a [ios][prebuilt] fixed using continue in loop
Instead of returning when creating the list of header files from our podspecs, we now call `continue`. This is a bug that causes all subsequent globs in the header file list to be omitted after the first omitted glob.
2025-07-08 16:38:43 +02:00
Christian Falch e2087457f8 [ios][prebuild] add support for USE_FRAMEWORKS
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.

This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.

In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.

Testing:
- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.
2025-07-08 16:35:14 +02:00
Alex Hunt fc5e33b582 Reorganise shared script utils (#52473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473

Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77873875

fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
2025-07-08 06:10:36 -07:00
Pieter De Baets 6dfe59e1df Fix missing bundle errors not correctly reported on Android (#52441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52441

When an error is thrown using `handleHostException` from within the (immediate) execution of a `Task`, the `Task` will capture the error. If those errors are never consumed, the error is just silently swallowed. Instead we should make sure that this is raised outside of the context of a `Task` so the error correctly bubbles up and crashes the app (in release).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D77798248

fbshipit-source-id: 41803aba0cace0e364a235501cf34bb946e7ff51
2025-07-08 05:58:56 -07:00
Moti Zilberman db65cb70de Fix typo in new app screen
Summary:
TSIA

bypass-github-export-checks

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D77928389

fbshipit-source-id: 038d11bed3fbbb96c97b7e2c5727e91973de9078
2025-07-08 05:48:00 -07:00
Mateo Guzmán a0e11904d6 Clean up unnecessary test setup for Android tests (#52471)
Summary:
This came out of https://github.com/facebook/react-native/issues/52457 as I had to fix some tests and realised there is a lot of setup that could be shadow and other things that are not needed at all.

## Changelog:

[INTERNAL] - Clean up unnecessary test setup for Android tests

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

Test Plan:
```sh
yarn test-android
```

Reviewed By: cortinico

Differential Revision: D77926887

Pulled By: javache

fbshipit-source-id: ff493d87633fcb4c4194b50cd374ad2e8acda974
2025-07-08 05:31:11 -07:00
Pieter De Baets 120a417320 Cleanup react-native-codegen DEFS (#52468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52468

* Re-enable tests
* Simplify logic to avoid bypasses for arc focus

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77143018

fbshipit-source-id: 06ec43ce5149a139db78d38630191b01bc520461
2025-07-08 04:53:51 -07:00
Rubén Norte 5a79ece192 Use structuredClone to copy detail field in performance.mark and performance.measure (#52483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52483

Changelog: [internal]

This is a small refinement for `performance.mark` and `performance.measure` to use `structuredClone` to copy the value of the `detail` field, instead of assigning it by reference.

This still doesn't completely fix the semantics of `performance.mark` and `performance.measure`, as the entries returned by those methods aren't referentially equal to the entries reported by `PerformanceObserver` (and the latter don't have the `detail` field yet).

Reviewed By: huntie

Differential Revision: D77863037

fbshipit-source-id: 54d959612ecd560250e49bb0887bb12112a0142f
2025-07-08 04:40:49 -07:00
Ruslan Lesiutin f000116197 Fix Timestamps conversion for Custom Tracks (#52479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52479

# Changelog: [Internal]

The previous cast is incorrect.

Reviewed By: javache

Differential Revision: D77894512

fbshipit-source-id: 67e6b9a4ed43020a343a2a9b5d702509c34ae41a
2025-07-08 04:34:14 -07:00
Vitali Zaidman 5cf4d0899f Update debugger-frontend from 51a91a2...844f225 (#52486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52486

Changelog: [Internal] - Update `react-native/debugger-frontend` from 51a91a2...844f225

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/51a91a2ad62e7f585912ed314a350a72de84d6ed...844f225009e6445d088ed0e431d1fc430325ed95).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [844f22500](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-08T10:16:09+01:00 | [Track when the stack trace symbolication succeeds (#187)](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) |
| [ffa6bb6af](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-07T16:21:55+01:00 | [parse "empty url" and "address at" frames as non-hyperlinked text (#188)](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) |

Reviewed By: robhogan

Differential Revision: D77926362

fbshipit-source-id: cbcf8b17cd175400d3d027ce2e8ebefa497f5d79
2025-07-08 04:15:32 -07:00
Marco Wang 68650badd2 Pre-suppress errors for null_void for xplat js (#52480)
Summary:
Changelog: [Internal]

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

Reviewed By: SamChou19815

Differential Revision: D77890434

fbshipit-source-id: cc0571e0ff1c7cec3fff8614f688d46e46970cc4
2025-07-07 20:35:08 -07:00
Luna Wei 5ec8e60581 Refactor VirtualView target structure on Android (#52476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52476

Changelog: [Internal] - Refactor package structure on Android to prepare for experimental VirtualView so that non-view related objects go under `virtual` and the native view goes under `view`.
This breaks dependency circles for experimental VirtualView in upcoming change.

Reviewed By: yungsters

Differential Revision: D77335426

fbshipit-source-id: 3b978e9cc5ad376c71aebc039cfc74d2515d2cfa
2025-07-07 16:00:13 -07:00
Alex Hunt 918f02dcc3 Consolidate JS API scripts under scripts/js-api/, update docs (#52469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52469

Organise `scripts/build-types/` and `scripts/diff-api-snapshot/` into a single grouping `scripts/js-api/` parent dir — matching the newly relocated `scripts/cxx-api/`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77865488

fbshipit-source-id: 33754d9275e65c3bda686294f18d855221ec7bff
2025-07-07 15:04:37 -07:00
Alex Hunt 5fe782a800 Move cxx-api scripts under scripts/, add README (#52467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52467

Moves the WIP `cxx-public-api` project under `scripts/cxx-api/`, add minimal README docs.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77865490

fbshipit-source-id: ce49845386c468ee7422b864c49f2a8c9eed5a70
2025-07-07 15:04:37 -07:00
Christoph Purrer abfb9cbd40 Update outdated ReactNativeCPP.api (#52475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52475

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77887914

fbshipit-source-id: 1431205eff716bac86610750103df729553d22b9
2025-07-07 14:50:58 -07:00
Pieter De Baets 3bf5cb3d0e Deprecate MessageQueueThreadPerfStats (#52470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52470

These metrics are not actively consumed and are highly noisy.

Changelog: [Android][Removed] Deprecated MessageQueueThreadPerfStats API and replaced with stub.

Reviewed By: cortinico

Differential Revision: D77867087

fbshipit-source-id: 8bf7423ad60cb3bb21a5dbe94771d5a71832633d
2025-07-07 11:29:01 -07:00
Christoph Purrer ead669ade3 Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray (#52443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52443

Changelog: [General][Breaking] Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray

Those are not used anymore

Reviewed By: cortinico

Differential Revision: D77771186

fbshipit-source-id: e1f5e34238567241b4204d58ff85fd9067e321df
2025-07-07 11:04:01 -07:00
Nicola Corti 625f69f284 @DeprecatedInNewArchitecture -> @Deprecated (#52399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399

I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.

Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes

Reviewed By: mdvacca

Differential Revision: D77736713

fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
2025-07-07 10:20:43 -07:00
Christoph Purrer 06034554e4 Remove SampleTurboCxxModule example (#52442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52442

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

It is not included in any RNTester app at this time

Reviewed By: cortinico

Differential Revision: D77771111

fbshipit-source-id: a4fe1d13fd0224babc46f54b921a036f7b237a48
2025-07-07 09:37:37 -07:00
Samuel Susla 298ec6ca5d Deprecate ShadowNode::ListOfWeak and replace with std::vector<std::weak_ptr<const ShadowNode>> (#52401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52401

changelog: [internal]

- Mark ShadowNode::ListOfWeak as deprecated with appropriate deprecation message
- Replace all usages of ShadowNode::ListOfWeak with std::vector<std::weak_ptr<const ShadowNode>>
- Updated primitives.h and ReactNativeCPP.api to use the explicit type instead of the alias

This change continues the effort to remove type aliases in favor of explicit standard library types for better code clarity and maintainability.

Reviewed By: christophpurrer

Differential Revision: D77652083

fbshipit-source-id: 79cad019e039c19f661346604ff49a44a4af7a79
2025-07-07 09:29:57 -07:00
Christoph Purrer c1200718a0 Move RuntimeExecutor after copying it into BufferedRuntimeExecutor (#52404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52404

Changelog: [Internal]

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h#L23

is a copy-able type (it will be copied when passed into the BufferedRuntimeExecutor constructor).

Hence we can `std::move` it in the `BufferedRuntimeExecutor` constructor

Reviewed By: javache

Differential Revision: D77758211

fbshipit-source-id: 634b1cd0e1ed4d27a013ad8927b2123dc6977ad8
2025-07-07 08:59:56 -07:00
Rubén Norte a3933e6878 Remove legacy tests for Performance API (#52465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52465

Changelog: [internal]

Now that we have enough coverage for the Performance API in Fantom, Jest tests where most of the API is mocked are redundant and useless, so this removes them (and the mock).

Reviewed By: huntie

Differential Revision: D77860888

fbshipit-source-id: 7dbd1a8a43b056a3b34e4e37d578be9ccb521824
2025-07-07 06:42:23 -07:00
Rubén Norte 9f8179afa7 Add tests for durationThreshold option for PerformanceObserver (#52464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52464

Changelog: [internal]

This adds tests for the `durationThreshold` option for `PerformanceObserver.prototype.observe`.

Reviewed By: huntie

Differential Revision: D77860882

fbshipit-source-id: 1e56391166523d2c4f837f758bc367b58fe8e82e
2025-07-07 06:42:23 -07:00
Rubén Norte e6bff3f1fe Add tests for performance.eventCounts (#52463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52463

Changelog: [internal]

This adds Fantom tests for `performance.eventCounts`.

Reviewed By: huntie

Differential Revision: D77860881

fbshipit-source-id: 26b9ef56b9c610cbad7011bc0adde27251fda909
2025-07-07 06:42:23 -07:00
Rubén Norte feeef97554 Expand tests for the performance API (#52462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52462

Changelog: [internal]

This adds a few more tests for `performance.getEntries`, `performance.getEntriesByName` and `performance.getEntriesByType`.

Reviewed By: huntie

Differential Revision: D77801746

fbshipit-source-id: 42f80c4e2b787c455b149ee38d071511181532b0
2025-07-07 06:42:23 -07:00
Rubén Norte 9005d93e32 Optimize performance.mark and performance.measure (#52429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52429

Changelog: [internal]

This implements a significant optimization for `performance.mark` and `performance.measure`. After these changes, they take 1/3 of the time they took before.

We've seen these methods show up too often in traces (in the Hermes sampling profiler) so this should significantly reduce their overhead.

I found out that most of the time spent in `performance.mark` and `performance.measure` was creating the `PerformanceMark` and `PerformanceMeasure` instances returned by those methods. I applied the same playbook I did for `ReactNativeElement` (avoiding private fields and `super()` calls, which yielded these wins.

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1678.19 ± 0.73%'    | '1633.00'           | '607139 ± 0.01%'           | '612370'                  | 595882  |
| 1       | 'mark (with custom startTime)'                            | '1920.23 ± 1.30%'    | '1843.00'           | '538217 ± 0.01%'           | '542594'                  | 520772  |
| 2       | 'measure (with start and end timestamps)'                 | '2651.72 ± 0.94%'    | '2554.00'           | '388312 ± 0.02%'           | '391543'                  | 377114  |
| 3       | 'measure (with mark names)'                               | '2815.84 ± 0.75%'    | '2744.00'           | '362303 ± 0.02%'           | '364431'                  | 355134  |
| 4       | 'clearMarks'                                              | '743.82 ± 0.06%'     | '731.00'            | '1363190 ± 0.01%'          | '1367989'                 | 1344417 |
| 5       | 'clearMeasures'                                           | '776.69 ± 0.07%'     | '761.00'            | '1306563 ± 0.01%'          | '1314060'                 | 1287512 |
| 6       | 'mark + clearMarks'                                       | '2043.97 ± 1.26%'    | '1973.00'           | '504750 ± 0.01%'           | '506842'                  | 489801  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '3048.39 ± 0.87%'    | '2965.00'           | '335285 ± 0.02%'           | '337268'                  | 328042  |
| 8       | 'measure + clearMeasures (with mark names)'               | '3132.75 ± 0.80%'    | '3065.00'           | '324365 ± 0.02%'           | '326264'                  | 319209  |

Reviewed By: huntie

Differential Revision: D77790874

fbshipit-source-id: baf7aca07d281fef4373956d125c63f006fab592
2025-07-07 06:42:23 -07:00
Rubén Norte 74c03b67e3 Fix bugs in performance.mark and performance.measure (#52430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52430

Changelog: [internal]

(This is marked as internal because this API hasn't been marked as stable yet).

This fixes multiple bugs and missing features in `performance.mark` and `performance.measure`. See re-enabled tests to see the specific behaviors.

Validated that performance isn't regressed by this change using the existing benchmark for `Performance` (`Performance-benchmark-itest`):

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5557.96 ± 0.34%'    | '5459.00'           | '182114 ± 0.02%'           | '183184'                  | 179922  |
| 1       | 'mark (with custom startTime)'                            | '5664.54 ± 1.71%'    | '5518.00'           | '180296 ± 0.02%'           | '181225'                  | 176537  |
| 2       | 'measure (with start and end timestamps)'                 | '6653.62 ± 0.94%'    | '6530.00'           | '152296 ± 0.02%'           | '153139'                  | 150295  |
| 3       | 'measure (with mark names)'                               | '6903.37 ± 0.42%'    | '6790.00'           | '146429 ± 0.02%'           | '147275'                  | 144857  |
| 4       | 'clearMarks'                                              | '782.98 ± 0.04%'     | '771.00'            | '1287735 ± 0.01%'          | '1297017'                 | 1277173 |
| 5       | 'clearMeasures'                                           | '792.24 ± 0.03%'     | '781.00'            | '1270847 ± 0.01%'          | '1280410'                 | 1262238 |
| 6       | 'mark + clearMarks'                                       | '5883.69 ± 0.52%'    | '5759.00'           | '172863 ± 0.02%'           | '173641'                  | 169962  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7222.22 ± 0.68%'    | '7021.00'           | '141204 ± 0.02%'           | '142430'                  | 138462  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7234.53 ± 0.34%'    | '7121.00'           | '139600 ± 0.02%'           | '140430'                  | 138227  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

Reviewed By: huntie

Differential Revision: D77795990

fbshipit-source-id: 97895065ca63f87f1f66710cf7bce97e1255a142
2025-07-07 06:42:23 -07:00
Rubén Norte 34201d8387 Fix Flow types for performance.measure (#52431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52431

Changelog: [internal]

`performance.measure` supports passing mark names as `start` and `end` options, so this fixes the Flow type before fixing the actual implementation.

It also makes it so you can't specify both `end` and `duration`, enforced by the type system.

Reviewed By: huntie

Differential Revision: D77795991

fbshipit-source-id: e89f509c7efc2fa49d17d79bc19bc1d14e007871
2025-07-07 06:42:23 -07:00
Rubén Norte 2edda6d967 Add basic Fantom tests for performance.mark and performance.measure (#52432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52432

Changelog: [internal]

This creates a battery of tests for `performance.mark` and `performance.measure`. For this, it was necessary to add a new method in the native module to mock the current time.

Many of the tests are currently failing, as the API doesn't support all the options or behaviors defined in the spec. They're skipped here and will be re-enabled and fixed in a following diff.

Reviewed By: huntie

Differential Revision: D77795989

fbshipit-source-id: 3ebf18c8ac336df1fb43003a55a4678b52e8982d
2025-07-07 06:42:23 -07:00
Samuel Susla 1c51d6684b Deprecate ShadowNode::ListOfShared and migrate to std::vector<std::shared_ptr<const ShadowNode>> (#52402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52402

changelog: [internal]

Mark ShadowNode::ListOfShared as deprecated and replace most usages throughout the React Native renderer codebase with the explicit std::vector<std::shared_ptr<const ShadowNode>> type. This improves code clarity by making the container type explicit rather than relying on a type alias.

Reviewed By: christophpurrer

Differential Revision: D77651676

fbshipit-source-id: 8c4bd9b8cbbe467384b947ef9e7a4524f2053e36
2025-07-07 06:15:29 -07:00
szymonrybczak 9d63098520 chore: bump @react-native-community/cli* devDependencies to 20.0.0-alpha (#52460)
Summary:
Upgrade `react-native-community/cli` to version 20.

## Changelog:

[INTERNAL] [CHANGED] - Upgrade react-native-community/cli to v20

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

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D77860027

Pulled By: cortinico

fbshipit-source-id: 3eb3942b38091b4216628b94cdf1449838daa8d3
2025-07-07 05:17:07 -07:00
Alex Hunt 9d4d8dcb02 Move BugReporting module out of open source repo (#52425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52425

Changelog:
[General][Breaking] - All `react-native/Libraries/BugReporting` APIs have been removed

Reviewed By: javache

Differential Revision: D77014767

fbshipit-source-id: a074fb952948a58259be66033e1f85e04bacf2de
2025-07-07 05:08:57 -07:00
Alex Hunt caff37df5a Remove internal calls to BugReporting (#52374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52374

Precursor to removing `BugReporting` from React Native's internals.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77014724

fbshipit-source-id: 91cd38fe6c39656573fecdeff18162073df2fb42
2025-07-07 05:08:57 -07:00
Christoph Purrer 7998914471 Remove outdated SampleTurboCxxModuleLegacyImpl (#52412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52412

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

It is not included in any RNTester app at this time

Reviewed By: cortinico

Differential Revision: D77770455

fbshipit-source-id: 987c9f2b9ab4145a2f6a724aad12d8473957dbe8
2025-07-06 22:35:20 -07:00
Christoph Purrer 94aca598c7 Remove unused #include <ReactCommon/TurboModuleUtils.h> (#52411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52411

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D77770244

fbshipit-source-id: a300e377f8c6e52256ae04813c1372799cf5af59
2025-07-06 21:21:48 -07:00
Christoph Purrer 5e650d0105 Remove more unused #includes (#52389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52389

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77706943

fbshipit-source-id: b8662737699ec0857845cfded49302ee9e93b78e
2025-07-06 20:56:16 -07:00
Christoph Purrer 9d5033afb0 Delete non C++ Turbo Module SampleCxxModule (#52407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52407

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

Reviewed By: javache

Differential Revision: D77765443

fbshipit-source-id: 112fef4c1a7e1c567f3c1d471728a1dfc926adc6
2025-07-06 19:54:06 -07:00
Christoph Purrer e8709355dc C++ Turbo Module > Allow Promise<void> types (#52388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52388

Changelog: [Internal]

Similar to `AsyncCallback<>` (the foundation of `AsyncPromise`) we should allow `void` Promise types in C++ such as `AsyncPromise<>`

Reviewed By: rbergerjr

Differential Revision: D77712020

fbshipit-source-id: d7360df5cc1b77f1e03e5fb73b0b468f6e3a415b
2025-07-06 19:53:51 -07:00
generatedunixname89002005287564 255977a7b9 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/utils (#52444)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52444

Reviewed By: dtolnay

Differential Revision: D77782134

fbshipit-source-id: 99989d45926a0eabcc6e19e12dce396a473e14ce
2025-07-06 13:33:29 -07:00
generatedunixname89002005287564 8531015941 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon [A] (#52437)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52437

Reviewed By: cortinico

Differential Revision: D77790078

fbshipit-source-id: 3188cce596ffa382ca3a9bd27cd0aba8580bbb76
2025-07-06 13:30:04 -07:00
generatedunixname89002005287564 4e62558e43 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon [B] (#52434)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52434

Reviewed By: cortinico

Differential Revision: D77790202

fbshipit-source-id: 35b5bb46e8056cddf874b05bf511754878f0e1fc
2025-07-06 12:32:42 -07:00
Rob Hogan 5cdea3c295 Remove last use of Metro deep imports (#52456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52456

Remove the last use of a Metro deep import in preparation for making all deep imports semver-private.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77450110

fbshipit-source-id: de7aa9c1f6b0d281fe8a6c3bd95e721c5bb58c63
2025-07-06 05:33:25 -07:00
Rob Hogan 083644647e Update to Metro ^0.82.5 (#52454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52454

Bump Metro minimum from 0.82.4 to 0.82.5

Release notes: https://github.com/facebook/metro/releases/tag/v0.82.5

Changelog: [General][Changed] Bump Metro to ^0.82.5

Reviewed By: huntie

Differential Revision: D77450102

fbshipit-source-id: 7b0fdcbeb63d8021996ca82f98773145179c8a50
2025-07-06 04:30:38 -07:00
Alex Hunt 987e3f8c00 Make NetworkingModule handlers internal (#52438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52438

Motivation: After some investigation, these make sense as private APIs, and we intend to modify `UriHandler` slightly in order to report blob response body payloads via CDP for Network debugging.

Changelog:
[Android][Removed] - Internalize `NetworkingModule`'s `UriHandler`, `RequestBodyHandler`, and `ResponseHandler` APIs

Reviewed By: cortinico

Differential Revision: D77799144

fbshipit-source-id: 20c36f52a900830091a253ab9917832c30b31d31
2025-07-05 09:07:22 -07:00
Nick Lefever 27723c70b7 Clean up prop diffing gen (#52436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52436

Reordered the different property types in the switch/case to group similar outputs together.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77799101

fbshipit-source-id: 5b7c6d188e9ffa0f1e41f44f82f438afeda04d74
2025-07-05 06:19:23 -07:00
generatedunixname89002005287564 dcd430721f Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/reactperflogger/reactperflogger [A] (#52433)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52433

Reviewed By: cortinico

Differential Revision: D77789924

fbshipit-source-id: 017ab5456bf25f40cd4b283d0405498f6e1e2e00
2025-07-04 16:20:30 -07:00
generatedunixname89002005287564 22ccf8a6f5 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/reactperflogger/reactperflogger [B] (#52435)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52435

Reviewed By: cortinico

Differential Revision: D77789998

fbshipit-source-id: 9ac93f890c9df245a105b71369dc91501deb78a4
2025-07-04 15:38:07 -07:00
Ruslan Lesiutin c302902b1d upgrade[react-devtools]: 6.1.5 (#52440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52440

# Changelog:
[General] [Changed] - Bumped React DevTools to 6.1.5

Reviewed By: huntie

Differential Revision: D77799615

fbshipit-source-id: aa010176f6378f6306e8a2a45fad7afe002a609c
2025-07-04 14:26:08 -07:00
Sam Zhou 0666885f6a Deploy 0.275.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77800436

fbshipit-source-id: ff5a6a629c950959678d6a6311cda053f6b5dd4c
2025-07-04 11:55:28 -07:00
Nicola Corti efdf73983c Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean) (#52439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52439

Users should not be passing true/false values for the 3 params in the `load()` method. The app template already uses the no param overload.
I'm deprecating it so it can go in 0.81.

Changelog:
[Android] [Changed] - Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean)

Reviewed By: rubennorte

Differential Revision: D77739268

fbshipit-source-id: c901d1ed2e9623b0fa39f4e2d79f25404c284b8d
2025-07-04 10:33:18 -07:00
Ruslan Lesiutin 377baa2ef6 Update debugger-frontend from 35c4630...51a91a2
Summary:
Changelog: [Internal] - Update `react-native/debugger-frontend` from 35c4630...51a91a2

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/35c4630bd58bbcbc6f4c54c084b4e52994dc4940...51a91a2ad62e7f585912ed314a350a72de84d6ed).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [51a91a2ad](https://github.com/facebook/react-native-devtools-frontend/commit/51a91a2ad) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-07-04T14:04:02+01:00 | [bump: react-devtools@6.1.4 (#189)](https://github.com/facebook/react-native-devtools-frontend/commit/51a91a2ad) |
| [761b96907](https://github.com/facebook/react-native-devtools-frontend/commit/761b96907) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-04T12:55:39+01:00 | [fixed missing new line before string error causes (#186)](https://github.com/facebook/react-native-devtools-frontend/commit/761b96907) |
| [7774c38db](https://github.com/facebook/react-native-devtools-frontend/commit/7774c38db) | Alex Hunt (hello@alexhunt.dev) | 2025-06-30T13:20:49+01:00 | [Disable request initiator panel in NetworkItemView (#185)](https://github.com/facebook/react-native-devtools-frontend/commit/7774c38db) |

Reviewed By: huntie

Differential Revision: D77795834

fbshipit-source-id: 3c30f8e87593687415538902734b09b3144b70a4
2025-07-04 08:09:12 -07:00
Ruslan Lesiutin c9e44fbcf2 upgrade[react-devtools]: 6.1.4 (#52426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52426

# Changelog:
[General] [Changed] - Bumped React DevTools to 6.1.4

Reviewed By: huntie

Differential Revision: D77794756

fbshipit-source-id: 4b8a795a809f5e72e8753d65435c97212e38dd8a
2025-07-04 08:09:12 -07:00
Alex Hunt f753158da4 Add JS implementation for PerformanceResourceTiming (#52427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52427

Adds and wires up a minimal implementation of `PerformanceResourceTiming` on the JS side. This materialises D74245441 in user space.

When all feature flags are enabled, network requests can now be observed from JS via `PerformanceObserver`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D75062713

fbshipit-source-id: 06523e70f57feaaa53432ef21fa92676d1e90360
2025-07-04 07:07:20 -07:00
Ian Childs d2b55ad1ba Use build instead of targets in check-api.sh (#52424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52424

This makes sure the output is actually materialized.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D77793365

fbshipit-source-id: 5505abd0f4c2994f4ced1c27a506d9199f9454ca
2025-07-04 06:17:14 -07:00
Alex Hunt 962a7dda44 Expose unstable_TextAncestorContext API (#52368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52368

Motivated by https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13497461.

Also align naming for internal usages.

Changelog:
[General][Added] - Expose `unstable_TextAncestorContext` API

Reviewed By: NickGerleman

Differential Revision: D77141176

fbshipit-source-id: d9a57d923994188f5ce7e0608ea28fdca98db860
2025-07-04 06:09:38 -07:00
Samuel Susla bc4bce61df remove uses of ShadowNode::Shared from ShadowNode.cpp (#52422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52422

changelog: [internal]

In https://github.com/facebook/react-native/pull/52393 not all uses of ShadowNode::Shared were removed. Github CI fails if a deprecated API is used. Let's remove the last uses.

Reviewed By: cortinico

Differential Revision: D77790411

fbshipit-source-id: 6fbbbffaa784de1f0939d1032dc7ea6586f2ce7d
2025-07-04 04:49:12 -07:00
Mohamed Salama b4dcc9831e Revert D77547628: Fix Dimensions window values on Android < 15
Differential Revision:
D77547628

Original commit changeset: 9d841f642d5b

Original Phabricator Diff: D77547628

fbshipit-source-id: 80ee528740eb4b39816e7873939d74e29d64caec
2025-07-04 04:19:27 -07:00
Nicola Corti 2d0aa1a747 Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes
Summary:
reverting Refactor ViewManagerInterfaces codegen to generate kotlin classes because of warning in OSS, we will reland after 0.81 cut

Changelog: [Android][Breaking] - Revert of Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: lenaic, mlord93

Differential Revision: D77759777

fbshipit-source-id: c24b216b231cdc53296d8c9fca8d789d80daa596
2025-07-04 02:48:42 -07:00
346 changed files with 4176 additions and 4169 deletions
+1 -1
View File
@@ -104,4 +104,4 @@ untyped-import
untyped-type-import
[version]
^0.274.2
^0.275.0
@@ -17,7 +17,7 @@ runs:
env:
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
run: |
node ./scripts/diff-api-snapshot \
node ./scripts/js-api/diff-api-snapshot \
${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
> $SCRATCH_DIR/output.json
+1 -1
View File
@@ -32,7 +32,7 @@ if (process.env.FBSOURCE_ENV === '1') {
require('@fb-tools/babel-register');
} else {
// Register Babel to allow local packages to be loaded from source
require('../scripts/babel-register').registerForMonorepo();
require('../scripts/shared/babelRegister').registerForMonorepo();
}
const transformer = require('@react-native/metro-babel-transformer');
+8 -5
View File
@@ -8,14 +8,16 @@
"android": "yarn --cwd packages/rn-tester android",
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
"build": "node ./scripts/build/build.js",
"build-types": "node ./scripts/build-types",
"build-types": "node ./scripts/js-api/build-types",
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
"clean": "node ./scripts/build/clean.js",
"cxx-api-build": "node ./scripts/cxx-api/public-api.js",
"flow-check": "flow check",
"flow": "flow",
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
"format": "npm run prettier && npm run clang-format",
"featureflags": "yarn --cwd packages/react-native featureflags",
"js-api-diff": "node ./scripts/js-api/diff-api-snapshot",
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
"lint-markdown": "markdownlint-cli2 2>&1",
"lint": "eslint --max-warnings 0 .",
@@ -78,10 +80,11 @@
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.29.1",
"flow-bin": "^0.274.2",
"flow-bin": "^0.275.0",
"glob": "^7.1.1",
"hermes-eslint": "0.29.1",
"hermes-transform": "0.29.1",
"ini": "^5.0.0",
"inquirer": "^7.1.0",
"jest": "^29.7.0",
"jest-config": "^29.7.0",
@@ -90,9 +93,9 @@
"jest-snapshot": "^29.7.0",
"markdownlint-cli2": "^0.17.2",
"markdownlint-rule-relative-links": "^3.0.0",
"metro-babel-register": "^0.82.4",
"metro-memory-fs": "^0.82.4",
"metro-transform-plugins": "^0.82.4",
"metro-babel-register": "^0.82.5",
"metro-memory-fs": "^0.82.5",
"metro-transform-plugins": "^0.82.5",
"micromatch": "^4.0.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
+4 -4
View File
@@ -25,13 +25,13 @@
"@react-native/dev-middleware": "0.81.0-main",
"debug": "^4.4.0",
"invariant": "^2.2.4",
"metro": "^0.82.4",
"metro-config": "^0.82.4",
"metro-core": "^0.82.4",
"metro": "^0.82.5",
"metro-config": "^0.82.5",
"metro-core": "^0.82.5",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.82.4"
"metro-resolver": "^0.82.5"
},
"peerDependencies": {
"@react-native-community/cli": "*",
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
@@ -13,7 +13,7 @@ export type * from './version.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../../scripts/babel-register').registerForMonorepo();
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./version.flow');
+2 -2
View File
@@ -1,5 +1,5 @@
@generated SignedSource<<634e06e29a06ec6a22c087e7f8b01796>>
Git revision: 35c4630bd58bbcbc6f4c54c084b4e52994dc4940
@generated SignedSource<<1ce3fb7dd23581737fedaf58528fe575>>
Git revision: 844f225009e6445d088ed0e431d1fc430325ed95
Built with --nohooks: false
Is local checkout: false
Remote URL: https://github.com/facebook/react-native-devtools-frontend
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!Boolean(process.env.BUILD_EXCLUDE_BABEL_REGISTER)) {
require('../../../../scripts/babel-register').registerForMonorepo();
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../../scripts/babel-register').registerForMonorepo();
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
}
export * from './index.flow';
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
export * from './index.flow';
@@ -148,6 +148,7 @@ abstract class GeneratePackageListTask : DefaultTask() {
{{ packageImports }}
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -233,6 +233,7 @@ class GeneratePackageListTaskTest {
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -311,7 +312,8 @@ class GeneratePackageListTaskTest {
import com.facebook.react.aPackage;
// @react-native/another-package
import com.facebook.react.anotherPackage;
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
+2 -2
View File
@@ -28,7 +28,7 @@
"dependencies": {
"@react-native/js-polyfills": "0.81.0-main",
"@react-native/metro-babel-transformer": "0.81.0-main",
"metro-config": "^0.82.4",
"metro-runtime": "^0.82.4"
"metro-config": "^0.82.5",
"metro-runtime": "^0.82.5"
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/babel-register').registerForMonorepo();
require('../../../scripts/shared/babelRegister').registerForMonorepo();
}
module.exports = require('./index.flow');
+1 -1
View File
@@ -65,7 +65,7 @@ const Links: Array<{
},
{
title: 'Community',
description: 'Expore & get help',
description: 'Explore & get help',
url: 'https://reactnative.dev/community/overview',
},
{
@@ -2,7 +2,7 @@
exports[`GeneratePropsJavaInterface can generate for 'ArrayPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -11,26 +11,27 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ArrayPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setNames(view: T, value: ReadableArray?): Unit
public fun setDisableds(view: T, value: ReadableArray?): Unit
public fun setProgress(view: T, value: ReadableArray?): Unit
public fun setRadii(view: T, value: ReadableArray?): Unit
public fun setColors(view: T, value: ReadableArray?): Unit
public fun setSrcs(view: T, value: ReadableArray?): Unit
public fun setPoints(view: T, value: ReadableArray?): Unit
public fun setEdgeInsets(view: T, value: ReadableArray?): Unit
public fun setDimensions(view: T, value: ReadableArray?): Unit
public fun setSizes(view: T, value: ReadableArray?): Unit
public fun setObject(view: T, value: ReadableArray?): Unit
public fun setArrayOfObjects(view: T, value: ReadableArray?): Unit
public fun setArrayOfMixed(view: T, value: ReadableArray?): Unit
public interface ArrayPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setNames(T view, @Nullable ReadableArray value);
void setDisableds(T view, @Nullable ReadableArray value);
void setProgress(T view, @Nullable ReadableArray value);
void setRadii(T view, @Nullable ReadableArray value);
void setColors(T view, @Nullable ReadableArray value);
void setSrcs(T view, @Nullable ReadableArray value);
void setPoints(T view, @Nullable ReadableArray value);
void setEdgeInsets(T view, @Nullable ReadableArray value);
void setDimensions(T view, @Nullable ReadableArray value);
void setSizes(T view, @Nullable ReadableArray value);
void setObject(T view, @Nullable ReadableArray value);
void setArrayOfObjects(T view, @Nullable ReadableArray value);
void setArrayOfMixed(T view, @Nullable ReadableArray value);
}
",
}
@@ -38,7 +39,7 @@ public interface ArrayPropsNativeComponentViewManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate for 'BooleanPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -47,14 +48,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface BooleanPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public fun setDisabledNullable(view: T, value: Boolean?): Unit
public interface BooleanPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
void setDisabledNullable(T view, @Nullable Boolean value);
}
",
}
@@ -62,7 +64,7 @@ public interface BooleanPropNativeComponentViewManagerInterface<T: View>: ViewMa
exports[`GeneratePropsJavaInterface can generate for 'ColorPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -71,13 +73,14 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ColorPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setTintColor(view: T, value: Int?): Unit
public interface ColorPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setTintColor(T view, @Nullable Integer value);
}
",
}
@@ -85,7 +88,7 @@ public interface ColorPropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'DimensionPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/DimensionPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/DimensionPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -94,14 +97,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
import com.facebook.yoga.YogaValue;
public interface DimensionPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setMarginBack(view: T, value: YogaValue?): Unit
public interface DimensionPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMarginBack(T view, @Nullable YogaValue value);
}
",
}
@@ -109,7 +113,7 @@ public interface DimensionPropNativeComponentViewManagerInterface<T: View>: View
exports[`GeneratePropsJavaInterface can generate for 'EdgeInsetsPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EdgeInsetsPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EdgeInsetsPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -118,12 +122,12 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EdgeInsetsPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface EdgeInsetsPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
}
",
@@ -132,7 +136,7 @@ public interface EdgeInsetsPropNativeComponentViewManagerInterface<T: View>: Vie
exports[`GeneratePropsJavaInterface can generate for 'EnumPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EnumPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EnumPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -141,14 +145,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EnumPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setAlignment(view: T, value: String?): Unit
public fun setIntervals(view: T, value: Int?): Unit
public interface EnumPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setAlignment(T view, @Nullable String value);
void setIntervals(T view, @Nullable Integer value);
}
",
}
@@ -156,7 +161,7 @@ public interface EnumPropNativeComponentViewManagerInterface<T: View>: ViewManag
exports[`GeneratePropsJavaInterface can generate for 'EventNestedObjectPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EventNestedObjectPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EventNestedObjectPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -165,13 +170,13 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EventNestedObjectPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface EventNestedObjectPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -179,7 +184,7 @@ public interface EventNestedObjectPropsNativeComponentViewManagerInterface<T: Vi
exports[`GeneratePropsJavaInterface can generate for 'EventPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EventPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EventPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -188,13 +193,13 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EventPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface EventPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -202,7 +207,7 @@ public interface EventPropsNativeComponentViewManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate for 'FloatPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/FloatPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/FloatPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -211,19 +216,20 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface FloatPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setBlurRadius(view: T, value: Float): Unit
public fun setBlurRadius2(view: T, value: Float): Unit
public fun setBlurRadius3(view: T, value: Float): Unit
public fun setBlurRadius4(view: T, value: Float): Unit
public fun setBlurRadius5(view: T, value: Float): Unit
public fun setBlurRadius6(view: T, value: Float): Unit
public fun setBlurRadiusNullable(view: T, value: Float?): Unit
public interface FloatPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setBlurRadius(T view, float value);
void setBlurRadius2(T view, float value);
void setBlurRadius3(T view, float value);
void setBlurRadius4(T view, float value);
void setBlurRadius5(T view, float value);
void setBlurRadius6(T view, float value);
void setBlurRadiusNullable(T view, @Nullable Float value);
}
",
}
@@ -231,7 +237,7 @@ public interface FloatPropsNativeComponentViewManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate for 'ImagePropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -240,14 +246,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ImagePropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setThumbImage(view: T, value: ReadableMap?): Unit
public interface ImagePropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setThumbImage(T view, @Nullable ReadableMap value);
}
",
}
@@ -255,7 +262,7 @@ public interface ImagePropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'IntegerPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -264,15 +271,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface IntegerPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setProgress1(view: T, value: Int): Unit
public fun setProgress2(view: T, value: Int): Unit
public fun setProgress3(view: T, value: Int): Unit
public interface IntegerPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setProgress1(T view, int value);
void setProgress2(T view, int value);
void setProgress3(T view, int value);
}
",
}
@@ -280,7 +287,7 @@ public interface IntegerPropNativeComponentViewManagerInterface<T: View>: ViewMa
exports[`GeneratePropsJavaInterface can generate for 'InterfaceOnlyNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/InterfaceOnlyNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -289,13 +296,14 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface InterfaceOnlyNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setTitle(view: T, value: String?): Unit
public interface InterfaceOnlyNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setTitle(T view, @Nullable String value);
}
",
}
@@ -303,7 +311,7 @@ public interface InterfaceOnlyNativeComponentViewManagerInterface<T: View>: View
exports[`GeneratePropsJavaInterface can generate for 'MixedPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/MixedPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/MixedPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -312,14 +320,14 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MixedPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setMixedProp(view: T, value: Dynamic): Unit
public interface MixedPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMixedProp(T view, Dynamic value);
}
",
}
@@ -327,7 +335,7 @@ public interface MixedPropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'MultiNativePropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/MultiNativePropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/MultiNativePropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -336,17 +344,18 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MultiNativePropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setThumbImage(view: T, value: ReadableMap?): Unit
public fun setColor(view: T, value: Int?): Unit
public fun setThumbTintColor(view: T, value: Int?): Unit
public fun setPoint(view: T, value: ReadableMap?): Unit
public interface MultiNativePropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setThumbImage(T view, @Nullable ReadableMap value);
void setColor(T view, @Nullable Integer value);
void setThumbTintColor(T view, @Nullable Integer value);
void setPoint(T view, @Nullable ReadableMap value);
}
",
}
@@ -354,7 +363,7 @@ public interface MultiNativePropNativeComponentViewManagerInterface<T: View>: Vi
exports[`GeneratePropsJavaInterface can generate for 'NoPropsNoEventsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/NoPropsNoEventsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/NoPropsNoEventsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -363,12 +372,12 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface NoPropsNoEventsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface NoPropsNoEventsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
}
",
@@ -377,7 +386,7 @@ public interface NoPropsNoEventsNativeComponentViewManagerInterface<T: View>: Vi
exports[`GeneratePropsJavaInterface can generate for 'ObjectPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ObjectPropsNativeComponentManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ObjectPropsNativeComponentManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -386,16 +395,17 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ObjectPropsNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setObjectProp(view: T, value: ReadableMap?): Unit
public fun setObjectArrayProp(view: T, value: ReadableMap?): Unit
public fun setObjectPrimitiveRequiredProp(view: T, value: ReadableMap?): Unit
public interface ObjectPropsNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setObjectProp(T view, @Nullable ReadableMap value);
void setObjectArrayProp(T view, @Nullable ReadableMap value);
void setObjectPrimitiveRequiredProp(T view, @Nullable ReadableMap value);
}
",
}
@@ -403,7 +413,7 @@ public interface ObjectPropsNativeComponentManagerInterface<T: View>: ViewManage
exports[`GeneratePropsJavaInterface can generate for 'PointPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/PointPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/PointPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -412,14 +422,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface PointPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setStartPoint(view: T, value: ReadableMap?): Unit
public interface PointPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setStartPoint(T view, @Nullable ReadableMap value);
}
",
}
@@ -427,7 +438,7 @@ public interface PointPropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'StringPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/StringPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/StringPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -436,14 +447,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface StringPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setPlaceholder(view: T, value: String?): Unit
public fun setDefaultValue(view: T, value: String?): Unit
public interface StringPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setPlaceholder(T view, @Nullable String value);
void setDefaultValue(T view, @Nullable String value);
}
",
}
@@ -2,7 +2,7 @@
exports[`GeneratePropsJavaInterface can generate for 'ArrayPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -11,26 +11,27 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ArrayPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setNames(view: T, value: ReadableArray?): Unit
public fun setDisableds(view: T, value: ReadableArray?): Unit
public fun setProgress(view: T, value: ReadableArray?): Unit
public fun setRadii(view: T, value: ReadableArray?): Unit
public fun setColors(view: T, value: ReadableArray?): Unit
public fun setSrcs(view: T, value: ReadableArray?): Unit
public fun setPoints(view: T, value: ReadableArray?): Unit
public fun setEdgeInsets(view: T, value: ReadableArray?): Unit
public fun setDimensions(view: T, value: ReadableArray?): Unit
public fun setSizes(view: T, value: ReadableArray?): Unit
public fun setObject(view: T, value: ReadableArray?): Unit
public fun setArrayOfObjects(view: T, value: ReadableArray?): Unit
public fun setArrayOfMixed(view: T, value: ReadableArray?): Unit
public interface ArrayPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setNames(T view, @Nullable ReadableArray value);
void setDisableds(T view, @Nullable ReadableArray value);
void setProgress(T view, @Nullable ReadableArray value);
void setRadii(T view, @Nullable ReadableArray value);
void setColors(T view, @Nullable ReadableArray value);
void setSrcs(T view, @Nullable ReadableArray value);
void setPoints(T view, @Nullable ReadableArray value);
void setEdgeInsets(T view, @Nullable ReadableArray value);
void setDimensions(T view, @Nullable ReadableArray value);
void setSizes(T view, @Nullable ReadableArray value);
void setObject(T view, @Nullable ReadableArray value);
void setArrayOfObjects(T view, @Nullable ReadableArray value);
void setArrayOfMixed(T view, @Nullable ReadableArray value);
}
",
}
@@ -38,7 +39,7 @@ public interface ArrayPropsNativeComponentViewManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate for 'BooleanPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -47,14 +48,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface BooleanPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public fun setDisabledNullable(view: T, value: Boolean?): Unit
public interface BooleanPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
void setDisabledNullable(T view, @Nullable Boolean value);
}
",
}
@@ -62,7 +64,7 @@ public interface BooleanPropNativeComponentViewManagerInterface<T: View>: ViewMa
exports[`GeneratePropsJavaInterface can generate for 'ColorPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -71,13 +73,14 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ColorPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setTintColor(view: T, value: Int?): Unit
public interface ColorPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setTintColor(T view, @Nullable Integer value);
}
",
}
@@ -85,7 +88,7 @@ public interface ColorPropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'DimensionPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/DimensionPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/DimensionPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -94,14 +97,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
import com.facebook.yoga.YogaValue;
public interface DimensionPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setMarginBack(view: T, value: YogaValue?): Unit
public interface DimensionPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMarginBack(T view, @Nullable YogaValue value);
}
",
}
@@ -109,7 +113,7 @@ public interface DimensionPropNativeComponentViewManagerInterface<T: View>: View
exports[`GeneratePropsJavaInterface can generate for 'EdgeInsetsPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EdgeInsetsPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EdgeInsetsPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -118,12 +122,12 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EdgeInsetsPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface EdgeInsetsPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
}
",
@@ -132,7 +136,7 @@ public interface EdgeInsetsPropNativeComponentViewManagerInterface<T: View>: Vie
exports[`GeneratePropsJavaInterface can generate for 'EnumPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EnumPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EnumPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -141,14 +145,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EnumPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setAlignment(view: T, value: String?): Unit
public fun setIntervals(view: T, value: Int?): Unit
public interface EnumPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setAlignment(T view, @Nullable String value);
void setIntervals(T view, @Nullable Integer value);
}
",
}
@@ -156,7 +161,7 @@ public interface EnumPropNativeComponentViewManagerInterface<T: View>: ViewManag
exports[`GeneratePropsJavaInterface can generate for 'EventNestedObjectPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EventNestedObjectPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EventNestedObjectPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -165,13 +170,13 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EventNestedObjectPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface EventNestedObjectPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -179,7 +184,7 @@ public interface EventNestedObjectPropsNativeComponentViewManagerInterface<T: Vi
exports[`GeneratePropsJavaInterface can generate for 'EventPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/EventPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/EventPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -188,13 +193,13 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EventPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface EventPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -202,7 +207,7 @@ public interface EventPropsNativeComponentViewManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate for 'FloatPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/FloatPropsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/FloatPropsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -211,19 +216,20 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface FloatPropsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setBlurRadius(view: T, value: Float): Unit
public fun setBlurRadius2(view: T, value: Float): Unit
public fun setBlurRadius3(view: T, value: Float): Unit
public fun setBlurRadius4(view: T, value: Float): Unit
public fun setBlurRadius5(view: T, value: Float): Unit
public fun setBlurRadius6(view: T, value: Float): Unit
public fun setBlurRadiusNullable(view: T, value: Float?): Unit
public interface FloatPropsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setBlurRadius(T view, float value);
void setBlurRadius2(T view, float value);
void setBlurRadius3(T view, float value);
void setBlurRadius4(T view, float value);
void setBlurRadius5(T view, float value);
void setBlurRadius6(T view, float value);
void setBlurRadiusNullable(T view, @Nullable Float value);
}
",
}
@@ -231,7 +237,7 @@ public interface FloatPropsNativeComponentViewManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate for 'ImagePropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -240,14 +246,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ImagePropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setThumbImage(view: T, value: ReadableMap?): Unit
public interface ImagePropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setThumbImage(T view, @Nullable ReadableMap value);
}
",
}
@@ -255,7 +262,7 @@ public interface ImagePropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'IntegerPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -264,15 +271,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface IntegerPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setProgress1(view: T, value: Int): Unit
public fun setProgress2(view: T, value: Int): Unit
public fun setProgress3(view: T, value: Int): Unit
public interface IntegerPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setProgress1(T view, int value);
void setProgress2(T view, int value);
void setProgress3(T view, int value);
}
",
}
@@ -280,7 +287,7 @@ public interface IntegerPropNativeComponentViewManagerInterface<T: View>: ViewMa
exports[`GeneratePropsJavaInterface can generate for 'InterfaceOnlyNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/InterfaceOnlyNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -289,13 +296,14 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface InterfaceOnlyNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setTitle(view: T, value: String?): Unit
public interface InterfaceOnlyNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setTitle(T view, @Nullable String value);
}
",
}
@@ -303,7 +311,7 @@ public interface InterfaceOnlyNativeComponentViewManagerInterface<T: View>: View
exports[`GeneratePropsJavaInterface can generate for 'MixedPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/MixedPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/MixedPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -312,14 +320,14 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MixedPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setMixedProp(view: T, value: Dynamic): Unit
public interface MixedPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMixedProp(T view, Dynamic value);
}
",
}
@@ -327,7 +335,7 @@ public interface MixedPropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'MultiNativePropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/MultiNativePropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/MultiNativePropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -336,17 +344,18 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MultiNativePropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setThumbImage(view: T, value: ReadableMap?): Unit
public fun setColor(view: T, value: Int?): Unit
public fun setThumbTintColor(view: T, value: Int?): Unit
public fun setPoint(view: T, value: ReadableMap?): Unit
public interface MultiNativePropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setThumbImage(T view, @Nullable ReadableMap value);
void setColor(T view, @Nullable Integer value);
void setThumbTintColor(T view, @Nullable Integer value);
void setPoint(T view, @Nullable ReadableMap value);
}
",
}
@@ -354,7 +363,7 @@ public interface MultiNativePropNativeComponentViewManagerInterface<T: View>: Vi
exports[`GeneratePropsJavaInterface can generate for 'NoPropsNoEventsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/NoPropsNoEventsNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/NoPropsNoEventsNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -363,12 +372,12 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface NoPropsNoEventsNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface NoPropsNoEventsNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
}
",
@@ -377,7 +386,7 @@ public interface NoPropsNoEventsNativeComponentViewManagerInterface<T: View>: Vi
exports[`GeneratePropsJavaInterface can generate for 'ObjectPropsNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/ObjectPropsNativeComponentManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/ObjectPropsNativeComponentManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -386,16 +395,17 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ObjectPropsNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setObjectProp(view: T, value: ReadableMap?): Unit
public fun setObjectArrayProp(view: T, value: ReadableMap?): Unit
public fun setObjectPrimitiveRequiredProp(view: T, value: ReadableMap?): Unit
public interface ObjectPropsNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setObjectProp(T view, @Nullable ReadableMap value);
void setObjectArrayProp(T view, @Nullable ReadableMap value);
void setObjectPrimitiveRequiredProp(T view, @Nullable ReadableMap value);
}
",
}
@@ -403,7 +413,7 @@ public interface ObjectPropsNativeComponentManagerInterface<T: View>: ViewManage
exports[`GeneratePropsJavaInterface can generate for 'PointPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/PointPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/PointPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -412,14 +422,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface PointPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setStartPoint(view: T, value: ReadableMap?): Unit
public interface PointPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setStartPoint(T view, @Nullable ReadableMap value);
}
",
}
@@ -427,7 +438,7 @@ public interface PointPropNativeComponentViewManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate for 'StringPropNativeComponent.js' 1`] = `
Object {
"java/com/facebook/react/viewmanagers/StringPropNativeComponentViewManagerInterface.kt": "/**
"java/com/facebook/react/viewmanagers/StringPropNativeComponentViewManagerInterface.java": "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -436,14 +447,15 @@ Object {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface StringPropNativeComponentViewManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setPlaceholder(view: T, value: String?): Unit
public fun setDefaultValue(view: T, value: String?): Unit
public interface StringPropNativeComponentViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setPlaceholder(T view, @Nullable String value);
void setDefaultValue(T view, @Nullable String value);
}
",
}
@@ -85,6 +85,7 @@ function generatePropsDiffString(
case 'StringTypeAnnotation':
case 'Int32TypeAnnotation':
case 'BooleanTypeAnnotation':
case 'MixedTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = ${prop.name};
@@ -94,6 +95,14 @@ function generatePropsDiffString(
return `
if ((${prop.name} != oldProps->${prop.name}) && !(std::isnan(${prop.name}) && std::isnan(oldProps->${prop.name}))) {
result["${prop.name}"] = ${prop.name};
}`;
case 'ArrayTypeAnnotation':
case 'ObjectTypeAnnotation':
case 'StringEnumTypeAnnotation':
case 'Int32EnumTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
@@ -103,6 +112,9 @@ function generatePropsDiffString(
result["${prop.name}"] = *${prop.name};
}`;
case 'ImageSourcePrimitive':
case 'PointPrimitive':
case 'EdgeInsetsPrimitive':
case 'DimensionPrimitive':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
@@ -112,52 +124,11 @@ function generatePropsDiffString(
throw new Error(
'ImageRequestPrimitive should not be used in Props',
);
case 'PointPrimitive':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'EdgeInsetsPrimitive':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'DimensionPrimitive':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
default:
(typeAnnotation.name: empty);
throw new Error('Received unknown ReservedPropTypeAnnotation');
}
case 'ArrayTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'ObjectTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'StringEnumTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'Int32EnumTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'MixedTypeAnnotation':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = ${prop.name};
}`;
default:
// TODO: Implement diffProps for complex types
return '';
}
})
@@ -48,15 +48,19 @@ const FileTemplate = ({
* ${'@'}generated by codegen project: GeneratePropsJavaInterface.js
*/
package ${packageName}
package ${packageName};
${imports}
public interface ${className}<T: ${extendClasses}>: ViewManagerWithGeneratedInterface {
public interface ${className}<T extends ${extendClasses}> extends ViewManagerWithGeneratedInterface {
${methods}
}
`;
function addNullable(imports: Set<string>) {
imports.add('import androidx.annotation.Nullable;');
}
function getJavaValueForProp(
prop: NamedShape<PropTypeAnnotation>,
imports: Set<string>,
@@ -66,52 +70,65 @@ function getJavaValueForProp(
switch (typeAnnotation.type) {
case 'BooleanTypeAnnotation':
if (typeAnnotation.default === null) {
return 'value: Boolean?';
addNullable(imports);
return '@Nullable Boolean value';
} else {
return 'value: Boolean';
return 'boolean value';
}
case 'StringTypeAnnotation':
return 'value: String?';
addNullable(imports);
return '@Nullable String value';
case 'Int32TypeAnnotation':
return 'value: Int';
return 'int value';
case 'DoubleTypeAnnotation':
return 'value: Double';
return 'double value';
case 'FloatTypeAnnotation':
if (typeAnnotation.default === null) {
return 'value: Float?';
addNullable(imports);
return '@Nullable Float value';
} else {
return 'value: Float';
return 'float value';
}
case 'ReservedPropTypeAnnotation':
switch (typeAnnotation.name) {
case 'ColorPrimitive':
return 'value: Int?';
addNullable(imports);
return '@Nullable Integer value';
case 'ImageSourcePrimitive':
return 'value: ReadableMap?';
addNullable(imports);
return '@Nullable ReadableMap value';
case 'ImageRequestPrimitive':
return 'value: ReadableMap?';
addNullable(imports);
return '@Nullable ReadableMap value';
case 'PointPrimitive':
return 'value: ReadableMap?';
addNullable(imports);
return '@Nullable ReadableMap value';
case 'EdgeInsetsPrimitive':
return 'value: ReadableMap?';
addNullable(imports);
return '@Nullable ReadableMap value';
case 'DimensionPrimitive':
return 'value: YogaValue?';
addNullable(imports);
return '@Nullable YogaValue value';
default:
(typeAnnotation.name: empty);
throw new Error('Received unknown ReservedPropTypeAnnotation');
}
case 'ArrayTypeAnnotation': {
return 'value: ReadableArray?';
addNullable(imports);
return '@Nullable ReadableArray value';
}
case 'ObjectTypeAnnotation': {
return 'value: ReadableMap?';
addNullable(imports);
return '@Nullable ReadableMap value';
}
case 'StringEnumTypeAnnotation':
return 'value: String?';
addNullable(imports);
return '@Nullable String value';
case 'Int32EnumTypeAnnotation':
return 'value: Int?';
addNullable(imports);
return '@Nullable Integer value';
case 'MixedTypeAnnotation':
return 'value: Dynamic';
return 'Dynamic value';
default:
(typeAnnotation: empty);
throw new Error('Received invalid typeAnnotation');
@@ -125,9 +142,9 @@ function generatePropsString(component: ComponentShape, imports: Set<string>) {
return component.props
.map(prop => {
return `public fun set${toSafeJavaString(
return `void set${toSafeJavaString(
prop.name,
)}(view: T, ${getJavaValueForProp(prop, imports)}): Unit`;
)}(T view, ${getJavaValueForProp(prop, imports)});`;
})
.join('\n' + ' ');
}
@@ -139,19 +156,19 @@ function getCommandArgJavaType(param: NamedShape<CommandParamTypeAnnotation>) {
case 'ReservedTypeAnnotation':
switch (typeAnnotation.name) {
case 'RootTag':
return 'Double';
return 'double';
default:
(typeAnnotation.name: empty);
throw new Error(`Receieved invalid type: ${typeAnnotation.name}`);
}
case 'BooleanTypeAnnotation':
return 'Boolean';
return 'boolean';
case 'DoubleTypeAnnotation':
return 'Double';
return 'double';
case 'FloatTypeAnnotation':
return 'Float';
return 'float';
case 'Int32TypeAnnotation':
return 'Int';
return 'int';
case 'StringTypeAnnotation':
return 'String';
case 'ArrayTypeAnnotation':
@@ -167,11 +184,11 @@ function getCommandArguments(
componentName: string,
): string {
return [
'view: T',
'T view',
...command.typeAnnotation.params.map(param => {
const commandArgJavaType = getCommandArgJavaType(param);
return `${param.name}: ${commandArgJavaType}`;
return `${commandArgJavaType} ${param.name}`;
}),
].join(', ');
}
@@ -184,10 +201,10 @@ function generateCommandsString(
.map(command => {
const safeJavaName = toSafeJavaString(command.name, false);
return `public fun ${safeJavaName}(${getCommandArguments(
return `void ${safeJavaName}(${getCommandArguments(
command,
componentName,
)}): Unit`;
)});`;
})
.join('\n' + ' ');
}
@@ -270,7 +287,7 @@ module.exports = {
.trimRight(),
});
files.set(`${outputDir}/${className}.kt`, replacedTemplate);
files.set(`${outputDir}/${className}.java`, replacedTemplate);
});
});
@@ -65,15 +65,15 @@ const TestTemplate = ({
propValue: string,
}) => `
TEST(${componentName}_${testName}, etc) {
auto propParser = RawPropsParser();
RawPropsParser propParser{};
propParser.prepare<${componentName}>();
auto const &sourceProps = ${componentName}();
auto const &rawProps = RawProps(folly::dynamic::object("${propName}", ${propValue}));
${componentName} sourceProps{};
RawProps rawProps(folly::dynamic::object("${propName}", ${propValue}));
ContextContainer contextContainer{};
PropsParserContext parserContext{-1, contextContainer};
rawProps.parse(propParser, parserContext);
rawProps.parse(propParser);
${componentName}(parserContext, sourceProps, rawProps);
}
`;
@@ -2,7 +2,7 @@
exports[`GeneratePropsJavaInterface can generate fixture ARRAY_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -11,26 +11,27 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ArrayPropsNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setNames(view: T, value: ReadableArray?): Unit
public fun setDisableds(view: T, value: ReadableArray?): Unit
public fun setProgress(view: T, value: ReadableArray?): Unit
public fun setRadii(view: T, value: ReadableArray?): Unit
public fun setColors(view: T, value: ReadableArray?): Unit
public fun setSrcs(view: T, value: ReadableArray?): Unit
public fun setPoints(view: T, value: ReadableArray?): Unit
public fun setDimensions(view: T, value: ReadableArray?): Unit
public fun setSizes(view: T, value: ReadableArray?): Unit
public fun setObject(view: T, value: ReadableArray?): Unit
public fun setArray(view: T, value: ReadableArray?): Unit
public fun setArrayOfArrayOfObject(view: T, value: ReadableArray?): Unit
public fun setArrayOfMixed(view: T, value: ReadableArray?): Unit
public interface ArrayPropsNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setNames(T view, @Nullable ReadableArray value);
void setDisableds(T view, @Nullable ReadableArray value);
void setProgress(T view, @Nullable ReadableArray value);
void setRadii(T view, @Nullable ReadableArray value);
void setColors(T view, @Nullable ReadableArray value);
void setSrcs(T view, @Nullable ReadableArray value);
void setPoints(T view, @Nullable ReadableArray value);
void setDimensions(T view, @Nullable ReadableArray value);
void setSizes(T view, @Nullable ReadableArray value);
void setObject(T view, @Nullable ReadableArray value);
void setArray(T view, @Nullable ReadableArray value);
void setArrayOfArrayOfObject(T view, @Nullable ReadableArray value);
void setArrayOfMixed(T view, @Nullable ReadableArray value);
}
",
}
@@ -38,7 +39,7 @@ public interface ArrayPropsNativeComponentManagerInterface<T: View>: ViewManager
exports[`GeneratePropsJavaInterface can generate fixture ARRAY_PROPS_WITH_NESTED_OBJECT 1`] = `
Map {
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/ArrayPropsNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -47,14 +48,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ArrayPropsNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setNativePrimitives(view: T, value: ReadableArray?): Unit
public interface ArrayPropsNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setNativePrimitives(T view, @Nullable ReadableArray value);
}
",
}
@@ -62,7 +64,7 @@ public interface ArrayPropsNativeComponentManagerInterface<T: View>: ViewManager
exports[`GeneratePropsJavaInterface can generate fixture BOOLEAN_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/BooleanPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -71,13 +73,13 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface BooleanPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface BooleanPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -85,7 +87,7 @@ public interface BooleanPropNativeComponentManagerInterface<T: View>: ViewManage
exports[`GeneratePropsJavaInterface can generate fixture COLOR_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/ColorPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -94,13 +96,14 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ColorPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setTintColor(view: T, value: Int?): Unit
public interface ColorPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setTintColor(T view, @Nullable Integer value);
}
",
}
@@ -108,7 +111,7 @@ public interface ColorPropNativeComponentManagerInterface<T: View>: ViewManagerW
exports[`GeneratePropsJavaInterface can generate fixture COMMANDS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -117,16 +120,16 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface CommandNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface CommandNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
public fun flashScrollIndicators(view: T): Unit
public fun allTypes(view: T, x: Int, y: Float, z: Double, message: String, animated: Boolean, locations: ReadableArray): Unit
void flashScrollIndicators(T view);
void allTypes(T view, int x, float y, double z, String message, boolean animated, ReadableArray locations);
}
",
}
@@ -134,7 +137,7 @@ public interface CommandNativeComponentManagerInterface<T: View>: ViewManagerWit
exports[`GeneratePropsJavaInterface can generate fixture COMMANDS_AND_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/CommandNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -143,17 +146,18 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface CommandNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setAccessibilityHint(view: T, value: String?): Unit
public fun handleRootTag(view: T, rootTag: Double): Unit
public fun hotspotUpdate(view: T, x: Int, y: Int): Unit
public fun addItems(view: T, items: ReadableArray): Unit
public interface CommandNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setAccessibilityHint(T view, @Nullable String value);
void handleRootTag(T view, double rootTag);
void hotspotUpdate(T view, int x, int y);
void addItems(T view, ReadableArray items);
}
",
}
@@ -161,7 +165,7 @@ public interface CommandNativeComponentManagerInterface<T: View>: ViewManagerWit
exports[`GeneratePropsJavaInterface can generate fixture DIMENSION_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/DimensionPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/DimensionPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -170,14 +174,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
import com.facebook.yoga.YogaValue;
public interface DimensionPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setMarginBack(view: T, value: YogaValue?): Unit
public interface DimensionPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMarginBack(T view, @Nullable YogaValue value);
}
",
}
@@ -185,7 +190,7 @@ public interface DimensionPropNativeComponentManagerInterface<T: View>: ViewMana
exports[`GeneratePropsJavaInterface can generate fixture DOUBLE_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/DoublePropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/DoublePropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -194,18 +199,18 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface DoublePropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setBlurRadius(view: T, value: Double): Unit
public fun setBlurRadius2(view: T, value: Double): Unit
public fun setBlurRadius3(view: T, value: Double): Unit
public fun setBlurRadius4(view: T, value: Double): Unit
public fun setBlurRadius5(view: T, value: Double): Unit
public fun setBlurRadius6(view: T, value: Double): Unit
public interface DoublePropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setBlurRadius(T view, double value);
void setBlurRadius2(T view, double value);
void setBlurRadius3(T view, double value);
void setBlurRadius4(T view, double value);
void setBlurRadius5(T view, double value);
void setBlurRadius6(T view, double value);
}
",
}
@@ -213,7 +218,7 @@ public interface DoublePropNativeComponentManagerInterface<T: View>: ViewManager
exports[`GeneratePropsJavaInterface can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/EventsNestedObjectNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/EventsNestedObjectNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -222,13 +227,13 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EventsNestedObjectNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface EventsNestedObjectNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -236,7 +241,7 @@ public interface EventsNestedObjectNativeComponentManagerInterface<T: View>: Vie
exports[`GeneratePropsJavaInterface can generate fixture EVENT_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/EventsNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/EventsNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -245,13 +250,13 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface EventsNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface EventsNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -259,7 +264,7 @@ public interface EventsNativeComponentManagerInterface<T: View>: ViewManagerWith
exports[`GeneratePropsJavaInterface can generate fixture EVENTS_WITH_PAPER_NAME 1`] = `
Map {
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -268,12 +273,12 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface InterfaceOnlyComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface InterfaceOnlyComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
}
",
@@ -286,7 +291,7 @@ exports[`GeneratePropsJavaInterface can generate fixture EXCLUDE_ANDROID_IOS 1`]
exports[`GeneratePropsJavaInterface can generate fixture EXCLUDE_IOS_TWO_COMPONENTS_DIFFERENT_FILES 1`] = `
Map {
"java/com/facebook/react/viewmanagers/ExcludedIosComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/ExcludedIosComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -295,16 +300,16 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ExcludedIosComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface ExcludedIosComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
}
",
"java/com/facebook/react/viewmanagers/MultiFileIncludedNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/MultiFileIncludedNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -313,13 +318,13 @@ public interface ExcludedIosComponentManagerInterface<T: View>: ViewManagerWithG
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MultiFileIncludedNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface MultiFileIncludedNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -327,7 +332,7 @@ public interface MultiFileIncludedNativeComponentManagerInterface<T: View>: View
exports[`GeneratePropsJavaInterface can generate fixture FLOAT_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/FloatPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/FloatPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -336,18 +341,18 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface FloatPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setBlurRadius(view: T, value: Float): Unit
public fun setBlurRadius2(view: T, value: Float): Unit
public fun setBlurRadius3(view: T, value: Float): Unit
public fun setBlurRadius4(view: T, value: Float): Unit
public fun setBlurRadius5(view: T, value: Float): Unit
public fun setBlurRadius6(view: T, value: Float): Unit
public interface FloatPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setBlurRadius(T view, float value);
void setBlurRadius2(T view, float value);
void setBlurRadius3(T view, float value);
void setBlurRadius4(T view, float value);
void setBlurRadius5(T view, float value);
void setBlurRadius6(T view, float value);
}
",
}
@@ -355,7 +360,7 @@ public interface FloatPropNativeComponentManagerInterface<T: View>: ViewManagerW
exports[`GeneratePropsJavaInterface can generate fixture IMAGE_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/ImagePropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -364,14 +369,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ImagePropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setThumbImage(view: T, value: ReadableMap?): Unit
public interface ImagePropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setThumbImage(T view, @Nullable ReadableMap value);
}
",
}
@@ -379,7 +385,7 @@ public interface ImagePropNativeComponentManagerInterface<T: View>: ViewManagerW
exports[`GeneratePropsJavaInterface can generate fixture INSETS_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/InsetsPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/InsetsPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -388,14 +394,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface InsetsPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setContentInset(view: T, value: ReadableMap?): Unit
public interface InsetsPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setContentInset(T view, @Nullable ReadableMap value);
}
",
}
@@ -403,7 +410,7 @@ public interface InsetsPropNativeComponentManagerInterface<T: View>: ViewManager
exports[`GeneratePropsJavaInterface can generate fixture INT32_ENUM_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/Int32EnumPropsNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/Int32EnumPropsNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -412,13 +419,14 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface Int32EnumPropsNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setMaxInterval(view: T, value: Int?): Unit
public interface Int32EnumPropsNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMaxInterval(T view, @Nullable Integer value);
}
",
}
@@ -426,7 +434,7 @@ public interface Int32EnumPropsNativeComponentManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate fixture INTEGER_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/IntegerPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -435,15 +443,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface IntegerPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setProgress1(view: T, value: Int): Unit
public fun setProgress2(view: T, value: Int): Unit
public fun setProgress3(view: T, value: Int): Unit
public interface IntegerPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setProgress1(T view, int value);
void setProgress2(T view, int value);
void setProgress3(T view, int value);
}
",
}
@@ -451,7 +459,7 @@ public interface IntegerPropNativeComponentManagerInterface<T: View>: ViewManage
exports[`GeneratePropsJavaInterface can generate fixture INTERFACE_ONLY 1`] = `
Map {
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/InterfaceOnlyComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -460,13 +468,14 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface InterfaceOnlyComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setAccessibilityHint(view: T, value: String?): Unit
public interface InterfaceOnlyComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setAccessibilityHint(T view, @Nullable String value);
}
",
}
@@ -474,7 +483,7 @@ public interface InterfaceOnlyComponentManagerInterface<T: View>: ViewManagerWit
exports[`GeneratePropsJavaInterface can generate fixture MIXED_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/MixedPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/MixedPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -483,14 +492,14 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MixedPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setMixedProp(view: T, value: Dynamic): Unit
public interface MixedPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setMixedProp(T view, Dynamic value);
}
",
}
@@ -498,7 +507,7 @@ public interface MixedPropNativeComponentManagerInterface<T: View>: ViewManagerW
exports[`GeneratePropsJavaInterface can generate fixture MULTI_NATIVE_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/ImageColorPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/ImageColorPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -507,17 +516,18 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ImageColorPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setThumbImage(view: T, value: ReadableMap?): Unit
public fun setColor(view: T, value: Int?): Unit
public fun setThumbTintColor(view: T, value: Int?): Unit
public fun setPoint(view: T, value: ReadableMap?): Unit
public interface ImageColorPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setThumbImage(T view, @Nullable ReadableMap value);
void setColor(T view, @Nullable Integer value);
void setThumbTintColor(T view, @Nullable Integer value);
void setPoint(T view, @Nullable ReadableMap value);
}
",
}
@@ -525,7 +535,7 @@ public interface ImageColorPropNativeComponentManagerInterface<T: View>: ViewMan
exports[`GeneratePropsJavaInterface can generate fixture NO_PROPS_NO_EVENTS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/NoPropsNoEventsComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/NoPropsNoEventsComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -534,12 +544,12 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface NoPropsNoEventsComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public interface NoPropsNoEventsComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
// No props
}
",
@@ -548,7 +558,7 @@ public interface NoPropsNoEventsComponentManagerInterface<T: View>: ViewManagerW
exports[`GeneratePropsJavaInterface can generate fixture OBJECT_PROPS 1`] = `
Map {
"java/com/facebook/react/viewmanagers/ObjectPropsManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/ObjectPropsManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -557,14 +567,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface ObjectPropsManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setObjectProp(view: T, value: ReadableMap?): Unit
public interface ObjectPropsManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setObjectProp(T view, @Nullable ReadableMap value);
}
",
}
@@ -572,7 +583,7 @@ public interface ObjectPropsManagerInterface<T: View>: ViewManagerWithGeneratedI
exports[`GeneratePropsJavaInterface can generate fixture POINT_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/PointPropNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/PointPropNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -581,14 +592,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface PointPropNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setStartPoint(view: T, value: ReadableMap?): Unit
public interface PointPropNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setStartPoint(T view, @Nullable ReadableMap value);
}
",
}
@@ -596,7 +608,7 @@ public interface PointPropNativeComponentManagerInterface<T: View>: ViewManagerW
exports[`GeneratePropsJavaInterface can generate fixture STRING_ENUM_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/StringEnumPropsNativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/StringEnumPropsNativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -605,13 +617,14 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface StringEnumPropsNativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setAlignment(view: T, value: String?): Unit
public interface StringEnumPropsNativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setAlignment(T view, @Nullable String value);
}
",
}
@@ -619,7 +632,7 @@ public interface StringEnumPropsNativeComponentManagerInterface<T: View>: ViewMa
exports[`GeneratePropsJavaInterface can generate fixture STRING_PROP 1`] = `
Map {
"java/com/facebook/react/viewmanagers/StringPropComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/StringPropComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -628,14 +641,15 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface StringPropComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setAccessibilityHint(view: T, value: String?): Unit
public fun setAccessibilityRole(view: T, value: String?): Unit
public interface StringPropComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setAccessibilityHint(T view, @Nullable String value);
void setAccessibilityRole(T view, @Nullable String value);
}
",
}
@@ -643,7 +657,7 @@ public interface StringPropComponentManagerInterface<T: View>: ViewManagerWithGe
exports[`GeneratePropsJavaInterface can generate fixture TWO_COMPONENTS_DIFFERENT_FILES 1`] = `
Map {
"java/com/facebook/react/viewmanagers/MultiFile1NativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/MultiFile1NativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -652,16 +666,16 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MultiFile1NativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface MultiFile1NativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
"java/com/facebook/react/viewmanagers/MultiFile2NativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/MultiFile2NativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -670,13 +684,13 @@ public interface MultiFile1NativeComponentManagerInterface<T: View>: ViewManager
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MultiFile2NativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface MultiFile2NativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -684,7 +698,7 @@ public interface MultiFile2NativeComponentManagerInterface<T: View>: ViewManager
exports[`GeneratePropsJavaInterface can generate fixture TWO_COMPONENTS_SAME_FILE 1`] = `
Map {
"java/com/facebook/react/viewmanagers/MultiComponent1NativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/MultiComponent1NativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -693,16 +707,16 @@ Map {
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MultiComponent1NativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface MultiComponent1NativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
"java/com/facebook/react/viewmanagers/MultiComponent2NativeComponentManagerInterface.kt" => "/**
"java/com/facebook/react/viewmanagers/MultiComponent2NativeComponentManagerInterface.java" => "/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
@@ -711,13 +725,13 @@ public interface MultiComponent1NativeComponentManagerInterface<T: View>: ViewMa
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers
package com.facebook.react.viewmanagers;
import android.view.View;
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
public interface MultiComponent2NativeComponentManagerInterface<T: View>: ViewManagerWithGeneratedInterface {
public fun setDisabled(view: T, value: Boolean): Unit
public interface MultiComponent2NativeComponentManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
void setDisabled(T view, boolean value);
}
",
}
@@ -12,7 +12,9 @@ import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
@Suppress("DEPRECATION")
public class OSSLibraryExamplePackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
listOf(NativeSampleModule(reactContext))
@@ -84,4 +84,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -55,4 +55,5 @@ Pod::Spec.new do |s|
end
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -1,140 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';
import NativeRedBox from '../NativeModules/specs/NativeRedBox';
import {type EventSubscription} from '../vendor/emitter/EventEmitter';
import NativeBugReporting from './NativeBugReporting';
type ExtraData = {[key: string]: string, ...};
type SourceCallback = () => string;
type DebugData = {
extras: ExtraData,
files: ExtraData,
...
};
function defaultExtras() {
BugReporting.addFileSource('react_hierarchy.txt', () =>
require('./dumpReactTree').default(),
);
}
/**
* A simple class for collecting bug report data. Components can add sources that will be queried when a bug report
* is created via `collectExtraData`. For example, a list component might add a source that provides the list of rows
* that are currently visible on screen. Components should also remember to call `remove()` on the object that is
* returned by `addSource` when they are unmounted.
*/
class BugReporting {
static _extraSources: Map<string, SourceCallback> = new Map();
static _fileSources: Map<string, SourceCallback> = new Map();
static _subscription: ?EventSubscription = null;
static _redboxSubscription: ?EventSubscription = null;
static _maybeInit() {
if (!BugReporting._subscription) {
BugReporting._subscription = RCTDeviceEventEmitter.addListener(
'collectBugExtraData',
// $FlowFixMe[method-unbinding]
BugReporting.collectExtraData,
null,
);
defaultExtras();
}
if (!BugReporting._redboxSubscription) {
BugReporting._redboxSubscription = RCTDeviceEventEmitter.addListener(
'collectRedBoxExtraData',
// $FlowFixMe[method-unbinding]
BugReporting.collectExtraData,
null,
);
}
}
/**
* Maps a string key to a simple callback that should return a string payload to be attached
* to a bug report. Source callbacks are called when `collectExtraData` is called.
*
* Returns an object to remove the source when the component unmounts.
*
* Conflicts trample with a warning.
*/
static addSource(
key: string,
callback: SourceCallback,
): {remove: () => void, ...} {
return this._addSource(key, callback, BugReporting._extraSources);
}
/**
* Maps a string key to a simple callback that should return a string payload to be attached
* to a bug report. Source callbacks are called when `collectExtraData` is called.
*
* Returns an object to remove the source when the component unmounts.
*
* Conflicts trample with a warning.
*/
static addFileSource(
key: string,
callback: SourceCallback,
): {remove: () => void, ...} {
return this._addSource(key, callback, BugReporting._fileSources);
}
static _addSource(
key: string,
callback: SourceCallback,
source: Map<string, SourceCallback>,
): {remove: () => void, ...} {
BugReporting._maybeInit();
if (source.has(key)) {
console.warn(
`BugReporting.add* called multiple times for same key '${key}'`,
);
}
source.set(key, callback);
return {
remove: () => {
source.delete(key);
},
};
}
/**
* This can be called from a native bug reporting flow, or from JS code.
*
* If available, this will call `NativeModules.BugReporting.setExtraData(extraData)`
* after collecting `extraData`.
*/
static collectExtraData(): DebugData {
const extraData: ExtraData = {};
for (const [key, callback] of BugReporting._extraSources) {
extraData[key] = callback();
}
const fileData: ExtraData = {};
for (const [key, callback] of BugReporting._fileSources) {
fileData[key] = callback();
}
if (NativeBugReporting != null && NativeBugReporting.setExtraData != null) {
NativeBugReporting.setExtraData(extraData, fileData);
}
if (NativeRedBox != null && NativeRedBox.setExtraData != null) {
NativeRedBox.setExtraData(extraData, 'From BugReporting.js');
}
return {extras: extraData, files: fileData};
}
}
export default BugReporting;
@@ -1,14 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
export * from '../../src/private/specs_DEPRECATED/modules/NativeBugReporting';
import NativeBugReporting from '../../src/private/specs_DEPRECATED/modules/NativeBugReporting';
export default NativeBugReporting;
@@ -1,151 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
'use strict';
/*
const getReactData = require('getReactData').default;
const INDENTATION_SIZE = 2;
const MAX_DEPTH = 2;
const MAX_STRING_LENGTH = 50;
*/
/**
* Dump all React Native root views and their content. This function tries
* it best to get the content but ultimately relies on implementation details
* of React and will fail in future versions.
*/
function dumpReactTree(): string {
try {
return getReactTree();
} catch (e) {
return 'Failed to dump react tree: ' + e;
}
}
function getReactTree() {
// TODO(sema): Reenable tree dumps using the Fiber tree structure. #15945684
return (
'React tree dumps have been temporarily disabled while React is ' +
'upgraded to Fiber.'
);
/*
let output = '';
const rootIds = Object.getOwnPropertyNames(ReactNativeMount._instancesByContainerID);
for (const rootId of rootIds) {
const instance = ReactNativeMount._instancesByContainerID[rootId];
output += `============ Root ID: ${rootId} ============\n`;
output += dumpNode(instance, 0);
output += `============ End root ID: ${rootId} ============\n`;
}
return output;
*/
}
/*
function dumpNode(node: Object, indentation: number) {
const data = getReactData(node);
if (data.nodeType === 'Text') {
return indent(indentation) + data.text + '\n';
} else if (data.nodeType === 'Empty') {
return '';
}
let output = indent(indentation) + `<${data.name}`;
if (data.nodeType === 'Composite') {
for (const propName of Object.getOwnPropertyNames(data.props || {})) {
if (isNormalProp(propName)) {
try {
const value = convertValue(data.props[propName]);
if (value) {
output += ` ${propName}=${value}`;
}
} catch (e) {
const message = `[Failed to get property: ${e}]`;
output += ` ${propName}=${message}`;
}
}
}
}
let childOutput = '';
for (const child of data.children || []) {
childOutput += dumpNode(child, indentation + 1);
}
if (childOutput) {
output += '>\n' + childOutput + indent(indentation) + `</${data.name}>\n`;
} else {
output += ' />\n';
}
return output;
}
function isNormalProp(name: string): boolean {
switch (name) {
case 'children':
case 'key':
case 'ref':
return false;
default:
return true;
}
}
function convertObject(object: Object, depth: number) {
if (depth >= MAX_DEPTH) {
return '[...omitted]';
}
let output = '{';
let first = true;
for (const key of Object.getOwnPropertyNames(object)) {
if (!first) {
output += ', ';
}
output += `${key}: ${convertValue(object[key], depth + 1)}`;
first = false;
}
return output + '}';
}
function convertValue(value, depth = 0): ?string {
if (!value) {
return null;
}
switch (typeof value) {
case 'string':
return JSON.stringify(possiblyEllipsis(value).replace('\n', '\\n'));
case 'boolean':
case 'number':
return JSON.stringify(value);
case 'function':
return '[function]';
case 'object':
return convertObject(value, depth);
default:
return null;
}
}
function possiblyEllipsis(value: string) {
if (value.length > MAX_STRING_LENGTH) {
return value.slice(0, MAX_STRING_LENGTH) + '...';
} else {
return value;
}
}
function indent(size: number) {
return ' '.repeat(size * INDENTATION_SIZE);
}
*/
export default dumpReactTree;
@@ -1,187 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
/**
* Convert a react internal instance to a sanitized data object.
*
* This is shamelessly stolen from react-devtools:
* https://github.com/facebook/react-devtools/blob/HEAD/backend/getData.js
*/
function getData(element: Object): Object {
let children = null;
let props = null;
let state = null;
let context = null;
let updater = null;
let name = null;
let type = null;
let text = null;
let publicInstance = null;
let nodeType = 'Native';
// If the parent is a native node without rendered children, but with
// multiple string children, then the `element` that gets passed in here is
// a plain value -- a string or number.
if (typeof element !== 'object') {
nodeType = 'Text';
text = element + '';
} else if (
element._currentElement === null ||
element._currentElement === false
) {
nodeType = 'Empty';
} else if (element._renderedComponent) {
nodeType = 'NativeWrapper';
children = [element._renderedComponent];
props = element._instance.props;
state = element._instance.state;
context = element._instance.context;
if (context && Object.keys(context).length === 0) {
context = null;
}
} else if (element._renderedChildren) {
children = childrenList(element._renderedChildren);
} else if (element._currentElement && element._currentElement.props) {
// This is a native node without rendered children -- meaning the children
// prop is just a string or (in the case of the <option>) a list of
// strings & numbers.
children = element._currentElement.props.children;
}
if (!props && element._currentElement && element._currentElement.props) {
props = element._currentElement.props;
}
// != used deliberately here to catch undefined and null
if (element._currentElement != null) {
type = element._currentElement.type;
if (typeof type === 'string') {
name = type;
} else if (element.getName) {
nodeType = 'Composite';
name = element.getName();
// 0.14 top-level wrapper
// TODO(jared): The backend should just act as if these don't exist.
if (
element._renderedComponent &&
element._currentElement.props ===
element._renderedComponent._currentElement
) {
nodeType = 'Wrapper';
}
if (name === null) {
name = 'No display name';
}
} else if (element._stringText) {
nodeType = 'Text';
text = element._stringText;
} else {
name = type.displayName || type.name || 'Unknown';
}
}
if (element._instance) {
const inst = element._instance;
updater = {
setState: inst.setState && inst.setState.bind(inst),
forceUpdate: inst.forceUpdate && inst.forceUpdate.bind(inst),
setInProps: inst.forceUpdate && setInProps.bind(null, element),
setInState: inst.forceUpdate && setInState.bind(null, inst),
setInContext: inst.forceUpdate && setInContext.bind(null, inst),
};
publicInstance = inst;
// TODO: React ART currently falls in this bucket, but this doesn't
// actually make sense and we should clean this up after stabilizing our
// API for backends
if (inst._renderedChildren) {
children = childrenList(inst._renderedChildren);
}
}
return {
nodeType,
type,
name,
props,
state,
context,
children,
text,
updater,
publicInstance,
};
}
function setInProps(
internalInst: any,
path: Array<string | number>,
value: any,
) {
const element = internalInst._currentElement;
internalInst._currentElement = {
...element,
props: copyWithSet(element.props, path, value),
};
internalInst._instance.forceUpdate();
}
function setInState(inst: any, path: Array<string | number>, value: any) {
setIn(inst.state, path, value);
inst.forceUpdate();
}
function setInContext(inst: any, path: Array<string | number>, value: any) {
setIn(inst.context, path, value);
inst.forceUpdate();
}
function setIn(obj: Object, path: Array<string | number>, value: any) {
const last = path.pop();
const parent = path.reduce((obj_, attr) => (obj_ ? obj_[attr] : null), obj);
if (parent) {
parent[last] = value;
}
}
function childrenList(children: any) {
const res = [];
for (const name in children) {
res.push(children[name]);
}
return res;
}
function copyWithSetImpl(
obj: any | Array<any>,
path: Array<string | number>,
idx: number,
value: any,
): any {
if (idx >= path.length) {
return value;
}
const key = path[idx];
const updated = Array.isArray(obj) ? obj.slice() : {...obj};
// $FlowFixMe[incompatible-use] number or string is fine here
updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
return updated;
}
function copyWithSet(
obj: Object | Array<any>,
path: Array<string | number>,
value: any,
): Object | Array<any> {
return copyWithSetImpl(obj, path, 0, value);
}
export default getData;
@@ -55,7 +55,7 @@ import usePressability from '../../Pressability/usePressability';
import flattenStyle from '../../StyleSheet/flattenStyle';
import StyleSheet, {type TextStyleProp} from '../../StyleSheet/StyleSheet';
import Text from '../../Text/Text';
import TextAncestor from '../../Text/TextAncestor';
import TextAncestorContext from '../../Text/TextAncestorContext';
import Platform from '../../Utilities/Platform';
import useMergeRefs from '../../Utilities/useMergeRefs';
import TextInputState from './TextInputState';
@@ -775,9 +775,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
/>
);
}
return (
<TextAncestor.Provider value={true}>{textInput}</TextAncestor.Provider>
);
return <TextAncestorContext value={true}>{textInput}</TextAncestorContext>;
}
const enterKeyHintToReturnTypeMap = {
+5 -3
View File
@@ -11,7 +11,7 @@
import type {ViewProps} from './ViewPropTypes';
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
import TextAncestor from '../../Text/TextAncestor';
import TextAncestorContext from '../../Text/TextAncestorContext';
import ViewNativeComponent from './ViewNativeComponent';
import * as React from 'react';
import {use} from 'react';
@@ -27,7 +27,7 @@ export default component View(
ref?: React.RefSetter<React.ElementRef<typeof ViewNativeComponent>>,
...props: ViewProps
) {
const hasTextAncestor = use(TextAncestor);
const hasTextAncestor = use(TextAncestorContext);
let actualView;
if (ReactNativeFeatureFlags.reduceDefaultPropsInView()) {
@@ -207,7 +207,9 @@ export default component View(
}
if (hasTextAncestor) {
return <TextAncestor value={false}>{actualView}</TextAncestor>;
return (
<TextAncestorContext value={false}>{actualView}</TextAncestorContext>
);
}
return actualView;
}
@@ -16,7 +16,7 @@ import type {AbstractImageAndroid, ImageAndroid} from './ImageTypes.flow';
import flattenStyle from '../StyleSheet/flattenStyle';
import StyleSheet from '../StyleSheet/StyleSheet';
import TextAncestor from '../Text/TextAncestor';
import TextAncestorContext from '../Text/TextAncestorContext';
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
import {
unstable_getImageComponentDecorator,
@@ -222,7 +222,7 @@ let BaseImage: AbstractImageAndroid = ({
}
: nativeProps;
return (
<TextAncestor.Consumer>
<TextAncestorContext.Consumer>
{hasTextAncestor => {
if (hasTextAncestor) {
return (
@@ -245,7 +245,7 @@ let BaseImage: AbstractImageAndroid = ({
/>
);
}}
</TextAncestor.Consumer>
</TextAncestorContext.Consumer>
);
}}
</ImageAnalyticsTagContext.Consumer>
@@ -53,4 +53,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -50,4 +50,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-featureflags")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -52,4 +52,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -22,7 +22,6 @@ import type {
WrapperComponentProvider,
} from './AppRegistry.flow';
import BugReporting from '../BugReporting/BugReporting';
import createPerformanceLogger from '../Utilities/createPerformanceLogger';
import SceneTracker from '../Utilities/SceneTracker';
import {coerceDisplayMode} from './DisplayMode';
@@ -36,7 +35,6 @@ type TaskCanceller = () => void;
type TaskCancelProvider = () => TaskCanceller;
const runnables: Runnables = {};
let runCount = 1;
const sections: Runnables = {};
const taskProviders: Map<string, TaskProvider> = new Map();
const taskCancelProviders: Map<string, TaskCancelProvider> = new Map();
@@ -167,10 +165,6 @@ export function runApplication(
const logParams = __DEV__ ? ` with ${JSON.stringify(appParameters)}` : '';
const msg = `Running "${appKey}"${logParams}`;
console.log(msg);
BugReporting.addSource(
'AppRegistry.runApplication' + runCount++,
() => msg,
);
}
invariant(
runnables[appKey],
@@ -199,10 +193,6 @@ export function setSurfaceProps(
'" with ' +
JSON.stringify(appParameters);
console.log(msg);
BugReporting.addSource(
'AppRegistry.setSurfaceProps' + runCount++,
() => msg,
);
}
invariant(
runnables[appKey],
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -19,6 +19,8 @@ function processAspectRatio(aspectRatio?: number | string): ?number {
if (typeof aspectRatio !== 'string') {
if (__DEV__) {
invariant(
/* $FlowFixMe[constant-condition] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
!aspectRatio,
'aspectRatio must either be a number, a ratio string or `auto`. You passed: %s',
aspectRatio,
+2
View File
@@ -226,3 +226,5 @@ export interface TextProps
declare class TextComponent extends React.Component<TextProps> {}
declare const TextBase: Constructor<NativeMethods> & typeof TextComponent;
export class Text extends TextBase {}
export const unstable_TextAncestorContext: React.Context<boolean>;
+4 -6
View File
@@ -19,7 +19,7 @@ import usePressability from '../Pressability/usePressability';
import flattenStyle from '../StyleSheet/flattenStyle';
import processColor from '../StyleSheet/processColor';
import Platform from '../Utilities/Platform';
import TextAncestor from './TextAncestor';
import TextAncestorContext from './TextAncestorContext';
import {NativeText, NativeVirtualText} from './TextNativeComponent';
import * as React from 'react';
import {useContext, useMemo, useState} from 'react';
@@ -169,7 +169,7 @@ const TextImpl: component(
const _nativeID = id ?? nativeID;
const hasTextAncestor = useContext(TextAncestor);
const hasTextAncestor = useContext(TextAncestorContext);
if (hasTextAncestor) {
if (isPressable) {
return (
@@ -302,7 +302,7 @@ const TextImpl: component(
}
// If the children do not contain a JSX element it would not be possible to have a
// nested `Text` component so we can skip adding the `TextAncestor` context wrapper
// nested `Text` component so we can skip adding the `TextAncestorContext` context wrapper
// which has a performance overhead. Since we do this for performance reasons we need
// to keep the check simple to avoid regressing overall perf. For this reason the
// `children.length` constant is set to `3`, this should be a reasonable tradeoff
@@ -322,9 +322,7 @@ const TextImpl: component(
return nativeText;
}
return (
<TextAncestor.Provider value={true}>{nativeText}</TextAncestor.Provider>
);
return <TextAncestorContext value={true}>{nativeText}</TextAncestorContext>;
};
TextImpl.displayName = 'Text';
+3 -10
View File
@@ -8,16 +8,9 @@
* @format
*/
'use strict';
// Compatibility module for ReactStrictDOMTextAncestorContext.native.js.flow (react-strict-dom)
// TODO(huntie): Delete after we've fixed this cross-repo reference
import * as React from 'react';
import {createContext} from 'react';
import TextAncestorContext from './TextAncestorContext';
/**
* Whether the current element is the descendant of a <Text> element.
*/
const TextAncestorContext: React.Context<boolean> = createContext(false);
if (__DEV__) {
TextAncestorContext.displayName = 'TextAncestorContext';
}
export default TextAncestorContext;
@@ -0,0 +1,23 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
'use strict';
import * as React from 'react';
import {createContext} from 'react';
/**
* Whether the current element is the descendant of a <Text> element.
*/
const TextAncestorContext: React.Context<boolean> = createContext(false);
if (__DEV__) {
TextAncestorContext.displayName = 'TextAncestorContext';
}
export default TextAncestorContext;
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
+1 -1
View File
@@ -178,7 +178,7 @@ let reactCxxReact = RNTarget(
name: .reactCxxReact,
path: "ReactCommon/cxxreact",
searchPaths: [CallInvokerPath],
excludedPaths: ["tests", "SampleCXXModule.cpp"],
excludedPaths: ["tests"],
dependencies: [.reactNativeDependencies, .jsi, .reactPerfLogger, .logger, .reactDebug, .reactJsInspector]
)
+1 -4
View File
@@ -83,10 +83,6 @@ Pod::Spec.new do |s|
ss.exclude_files = exclude_files
ss.private_header_files = "React/Cxx*/*.h"
# Include prebuilt if we're not building from source
if !ReactNativeCoreUtils.build_rncore_from_source()
ss.dependency "React-Core-prebuilt", version
end
end
s.subspec "DevSupport" do |ss|
@@ -137,4 +133,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -63,4 +63,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -61,6 +61,7 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
s.subspec "components" do |ss|
ss.source_files = podspec_sources("FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{m,mm,cpp,h}", "FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{h}")
@@ -97,6 +97,7 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
s.test_spec 'Tests' do |test_spec|
test_spec.source_files = podspec_sources("Tests/**/*.{mm}", "")
@@ -68,4 +68,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -353,7 +353,7 @@ public abstract class com/facebook/react/ReactNativeHost {
}
public abstract interface class com/facebook/react/ReactPackage {
public abstract fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public abstract fun createViewManagers (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public fun getModule (Ljava/lang/String;Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/NativeModule;
}
@@ -1561,28 +1561,26 @@ public abstract interface class com/facebook/react/bridge/queue/MessageQueueThre
public abstract fun assertIsOnThread ()V
public abstract fun assertIsOnThread (Ljava/lang/String;)V
public abstract fun callOnQueue (Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;
public abstract fun getPerfStats ()Lcom/facebook/react/bridge/queue/MessageQueueThreadPerfStats;
public fun getPerfStats ()Lcom/facebook/react/bridge/queue/MessageQueueThreadPerfStats;
public abstract fun isIdle ()Z
public abstract fun isOnThread ()Z
public abstract fun quitSynchronous ()V
public abstract fun resetPerfStats ()V
public fun resetPerfStats ()V
public abstract fun runOnQueue (Ljava/lang/Runnable;)Z
}
public final class com/facebook/react/bridge/queue/MessageQueueThreadImpl : com/facebook/react/bridge/queue/MessageQueueThread {
public static final field Companion Lcom/facebook/react/bridge/queue/MessageQueueThreadImpl$Companion;
public synthetic fun <init> (Ljava/lang/String;Landroid/os/Looper;Lcom/facebook/react/bridge/queue/QueueThreadExceptionHandler;Lcom/facebook/react/bridge/queue/MessageQueueThreadPerfStats;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ljava/lang/String;Landroid/os/Looper;Lcom/facebook/react/bridge/queue/QueueThreadExceptionHandler;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun assertIsOnThread ()V
public fun assertIsOnThread (Ljava/lang/String;)V
public fun callOnQueue (Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;
public static final fun create (Lcom/facebook/react/bridge/queue/MessageQueueThreadSpec;Lcom/facebook/react/bridge/queue/QueueThreadExceptionHandler;)Lcom/facebook/react/bridge/queue/MessageQueueThreadImpl;
public final fun getLooper ()Landroid/os/Looper;
public final fun getName ()Ljava/lang/String;
public fun getPerfStats ()Lcom/facebook/react/bridge/queue/MessageQueueThreadPerfStats;
public fun isIdle ()Z
public fun isOnThread ()Z
public fun quitSynchronous ()V
public fun resetPerfStats ()V
public fun runOnQueue (Ljava/lang/Runnable;)Z
}
@@ -1867,6 +1865,8 @@ public final class com/facebook/react/defaults/DefaultNewArchitectureEntryPoint
public static final fun load (Z)V
public static final fun load (ZZ)V
public static final fun load (ZZZ)V
public static synthetic fun load$default (ZILjava/lang/Object;)V
public static synthetic fun load$default (ZZILjava/lang/Object;)V
public static synthetic fun load$default (ZZZILjava/lang/Object;)V
public final fun setReleaseLevel (Lcom/facebook/react/common/ReleaseLevel;)V
}
@@ -2887,16 +2887,10 @@ public final class com/facebook/react/modules/network/NetworkingModule : com/fac
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/util/List;)V
public fun abortRequest (D)V
public fun addListener (Ljava/lang/String;)V
public final fun addRequestBodyHandler (Lcom/facebook/react/modules/network/NetworkingModule$RequestBodyHandler;)V
public final fun addResponseHandler (Lcom/facebook/react/modules/network/NetworkingModule$ResponseHandler;)V
public final fun addUriHandler (Lcom/facebook/react/modules/network/NetworkingModule$UriHandler;)V
public fun clearCookies (Lcom/facebook/react/bridge/Callback;)V
public fun initialize ()V
public fun invalidate ()V
public fun removeListeners (D)V
public final fun removeRequestBodyHandler (Lcom/facebook/react/modules/network/NetworkingModule$RequestBodyHandler;)V
public final fun removeResponseHandler (Lcom/facebook/react/modules/network/NetworkingModule$ResponseHandler;)V
public final fun removeUriHandler (Lcom/facebook/react/modules/network/NetworkingModule$UriHandler;)V
public fun sendRequest (Ljava/lang/String;Ljava/lang/String;DLcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableMap;Ljava/lang/String;ZDZ)V
public final fun sendRequestInternal (Ljava/lang/String;Ljava/lang/String;ILcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableMap;Ljava/lang/String;ZIZ)V
public static final fun setCustomClientBuilder (Lcom/facebook/react/modules/network/CustomClientBuilder;)V
@@ -2909,21 +2903,6 @@ public final class com/facebook/react/modules/network/NetworkingModule$Companion
public abstract interface class com/facebook/react/modules/network/NetworkingModule$CustomClientBuilder : com/facebook/react/modules/network/CustomClientBuilder {
}
public abstract interface class com/facebook/react/modules/network/NetworkingModule$RequestBodyHandler {
public abstract fun supports (Lcom/facebook/react/bridge/ReadableMap;)Z
public abstract fun toRequestBody (Lcom/facebook/react/bridge/ReadableMap;Ljava/lang/String;)Lokhttp3/RequestBody;
}
public abstract interface class com/facebook/react/modules/network/NetworkingModule$ResponseHandler {
public abstract fun supports (Ljava/lang/String;)Z
public abstract fun toResponseData (Lokhttp3/ResponseBody;)Lcom/facebook/react/bridge/WritableMap;
}
public abstract interface class com/facebook/react/modules/network/NetworkingModule$UriHandler {
public abstract fun fetch (Landroid/net/Uri;)Lcom/facebook/react/bridge/WritableMap;
public abstract fun supports (Landroid/net/Uri;Ljava/lang/String;)Z
}
public abstract interface class com/facebook/react/modules/network/OkHttpClientFactory {
public abstract fun createNewNetworkModuleClient ()Lokhttp3/OkHttpClient;
}
@@ -618,7 +618,6 @@ dependencies {
api(libs.androidx.autofill)
api(libs.androidx.swiperefreshlayout)
api(libs.androidx.tracing)
api(libs.androidx.window)
api(libs.fbjni)
api(libs.fresco)
@@ -22,6 +22,7 @@ import javax.inject.Provider
/** Abstract class that supports lazy loading of NativeModules by default. */
public abstract class BaseReactPackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
throw UnsupportedOperationException(
"createNativeModules method is not supported. Use getModule() method instead.")
@@ -112,6 +112,7 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
* simply have a different mechanism for storing a `ReactNativeHost`, e.g. as a static field
* somewhere.
*/
@Suppress("DEPRECATION")
protected val reactNativeHost: ReactNativeHost
get() = (application as ReactApplication).reactNativeHost
@@ -92,6 +92,8 @@ public abstract class LazyReactPackage : ReactPackage {
* @param reactContext react application context that can be used to create modules
* @return A [List]<[NativeModule]> to register
*/
@Suppress("DEPRECATION")
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
buildList {
for (holder in getNativeModules(reactContext)) {
@@ -18,20 +18,22 @@ import android.view.KeyEvent;
import android.view.Window;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.interfaces.fabric.ReactSurface;
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags;
import com.facebook.react.modules.core.PermissionListener;
import com.facebook.react.views.view.WindowUtilKt;
import com.facebook.systrace.Systrace;
import java.util.Objects;
/**
* Delegate class for {@link ReactActivity}. You can subclass this to provide custom implementations
* for e.g. {@link #getReactNativeHost()}, if your Application class doesn't implement {@link
* ReactApplication}.
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ReactActivityDelegate {
private final @Nullable Activity mActivity;
@@ -86,8 +88,11 @@ public class ReactActivityDelegate {
* ReactApplication#getReactNativeHost()}. Override this method if your application class does not
* implement {@code ReactApplication} or you simply have a different mechanism for storing a
* {@code ReactNativeHost}, e.g. as a static field somewhere.
*
* @deprecated "Do not access {@link ReactNativeHost} directly. This class is going away in the
* New Architecture. You should access {@link ReactHost} instead."
*/
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
@Deprecated
protected ReactNativeHost getReactNativeHost() {
return ((ReactApplication) getPlainActivity().getApplication()).getReactNativeHost();
}
@@ -107,16 +112,21 @@ public class ReactActivityDelegate {
return mReactDelegate;
}
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
/**
* @deprecated @deprecated "Do not access {@link ReactInstanceManager} directly. This class is
* going away in the New Architecture. You should access {@link ReactHost} instead."
* @noinspection deprecation
*/
public ReactInstanceManager getReactInstanceManager() {
return mReactDelegate.getReactInstanceManager();
return Objects.requireNonNull(mReactDelegate).getReactInstanceManager();
}
@Nullable
public String getMainComponentName() {
return mMainComponentName;
}
public void onCreate(Bundle savedInstanceState) {
public void onCreate(@Nullable Bundle savedInstanceState) {
Systrace.traceSection(
Systrace.TRACE_TAG_REACT,
"ReactActivityDelegate.onCreate::init",
@@ -147,6 +157,7 @@ public class ReactActivityDelegate {
launchOptions,
isFabricEnabled()) {
@Override
@Nullable
protected ReactRootView createRootView() {
ReactRootView rootView = ReactActivityDelegate.this.createRootView();
if (rootView == null) {
@@ -162,31 +173,29 @@ public class ReactActivityDelegate {
});
}
protected void loadApp(String appKey) {
mReactDelegate.loadApp(appKey);
protected void loadApp(@Nullable String appKey) {
Objects.requireNonNull(mReactDelegate).loadApp(Objects.requireNonNull(appKey));
getPlainActivity().setContentView(mReactDelegate.getReactRootView());
}
public void setReactSurface(ReactSurface reactSurface) {
mReactDelegate.setReactSurface(reactSurface);
Objects.requireNonNull(mReactDelegate).setReactSurface(reactSurface);
}
public void setReactRootView(ReactRootView reactRootView) {
mReactDelegate.setReactRootView(reactRootView);
Objects.requireNonNull(mReactDelegate).setReactRootView(reactRootView);
}
public void onUserLeaveHint() {
if (mReactDelegate != null) {
mReactDelegate.onUserLeaveHint();
}
Objects.requireNonNull(mReactDelegate).onUserLeaveHint();
}
public void onPause() {
mReactDelegate.onHostPause();
Objects.requireNonNull(mReactDelegate).onHostPause();
}
public void onResume() {
mReactDelegate.onHostResume();
Objects.requireNonNull(mReactDelegate).onHostResume();
if (mPermissionsCallback != null) {
mPermissionsCallback.invoke();
@@ -195,43 +204,43 @@ public class ReactActivityDelegate {
}
public void onDestroy() {
mReactDelegate.onHostDestroy();
Objects.requireNonNull(mReactDelegate).onHostDestroy();
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mReactDelegate.onActivityResult(requestCode, resultCode, data, true);
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Objects.requireNonNull(mReactDelegate).onActivityResult(requestCode, resultCode, data, true);
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
return mReactDelegate.onKeyDown(keyCode, event);
return Objects.requireNonNull(mReactDelegate).onKeyDown(keyCode, event);
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
return mReactDelegate.shouldShowDevMenuOrReload(keyCode, event);
return Objects.requireNonNull(mReactDelegate).shouldShowDevMenuOrReload(keyCode, event);
}
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
return mReactDelegate.onKeyLongPress(keyCode);
return Objects.requireNonNull(mReactDelegate).onKeyLongPress(keyCode);
}
public boolean onBackPressed() {
return mReactDelegate.onBackPressed();
return Objects.requireNonNull(mReactDelegate).onBackPressed();
}
public boolean onNewIntent(Intent intent) {
return mReactDelegate.onNewIntent(intent);
public boolean onNewIntent(@Nullable Intent intent) {
return Objects.requireNonNull(mReactDelegate).onNewIntent(Objects.requireNonNull(intent));
}
public void onWindowFocusChanged(boolean hasFocus) {
mReactDelegate.onWindowFocusChanged(hasFocus);
Objects.requireNonNull(mReactDelegate).onWindowFocusChanged(hasFocus);
}
public void onConfigurationChanged(Configuration newConfig) {
mReactDelegate.onConfigurationChanged(newConfig);
Objects.requireNonNull(mReactDelegate).onConfigurationChanged(newConfig);
}
public void requestPermissions(
String[] permissions, int requestCode, PermissionListener listener) {
String[] permissions, int requestCode, @Nullable PermissionListener listener) {
mPermissionListener = listener;
getPlainActivity().requestPermissions(permissions, requestCode);
}
@@ -267,7 +276,7 @@ public class ReactActivityDelegate {
* context will no longer be valid.
*/
public @Nullable ReactContext getCurrentReactContext() {
return mReactDelegate.getCurrentReactContext();
return Objects.requireNonNull(mReactDelegate).getCurrentReactContext();
}
/**
@@ -10,6 +10,10 @@ package com.facebook.react
/** Interface that represents an instance of a React Native application */
public interface ReactApplication {
/** Get the default [ReactNativeHost] for this app. */
@Suppress("DEPRECATION")
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
public val reactNativeHost: ReactNativeHost
/**
@@ -14,7 +14,6 @@ import android.os.Bundle
import android.view.KeyEvent
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.devsupport.DoubleTapReloadRecognizer
import com.facebook.react.devsupport.ReleaseDevSupportManager
import com.facebook.react.devsupport.interfaces.DevSupportManager
@@ -26,12 +25,17 @@ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
* A delegate for handling React Application support. This delegate is unaware whether it is used in
* an [Activity] or a [android.app.Fragment].
*/
@Suppress("DEPRECATION")
public open class ReactDelegate {
private val activity: Activity
private var internalReactRootView: ReactRootView? = null
private val mainComponentName: String?
private var launchOptions: Bundle?
private var doubleTapReloadRecognizer: DoubleTapReloadRecognizer?
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
private var reactNativeHost: ReactNativeHost? = null
public var reactHost: ReactHost? = null
private set
@@ -380,7 +384,8 @@ public open class ReactDelegate {
return false
}
@DeprecatedInNewArchitecture(message = "Use reactHost")
@Deprecated(
"Do not access [ReactInstanceManager] directly. This class is going away in the New Architecture. You should use [ReactHost] instead.")
public fun getReactInstanceManager(): ReactInstanceManager {
val nonNullReactNativeHost =
checkNotNull(reactNativeHost) {
@@ -58,6 +58,10 @@ public open class ReactFragment : Fragment(), PermissionAwareActivity {
* method if your application class does not implement `ReactApplication` or you simply have a
* different mechanism for storing a `ReactNativeHost`, e.g. as a static field somewhere.
*/
@Suppress("DEPRECATION")
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
protected open val reactNativeHost: ReactNativeHost?
get() = (activity?.application as ReactApplication?)?.reactNativeHost
@@ -10,6 +10,7 @@ package com.facebook.react;
import android.app.Application;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.JSExceptionHandler;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.bridge.ReactMarker;
@@ -18,7 +19,6 @@ import com.facebook.react.bridge.UIManagerProvider;
import com.facebook.react.common.LifecycleState;
import com.facebook.react.common.SurfaceDelegate;
import com.facebook.react.common.SurfaceDelegateFactory;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.internal.LegacyArchitecture;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
@@ -32,12 +32,12 @@ import java.util.List;
/**
* Simple class that holds an instance of {@link ReactInstanceManager}. This can be used in your
* {@link Application class} (see {@link ReactApplication}), or as a static field.
*
* @deprecated This class will be replaced by com.facebook.react.ReactHost in the New Architecture.
*/
@DeprecatedInNewArchitecture(
message =
"This class will be replaced by com.facebook.react.ReactHost in the new architecture of"
+ " React Native.")
@Deprecated
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Nullsafe(Nullsafe.Mode.LOCAL)
public abstract class ReactNativeHost {
static {
@@ -10,7 +10,6 @@ package com.facebook.react
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.UIManager
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.common.annotations.StableReactNativeAPI
import com.facebook.react.uimanager.ViewManager
@@ -34,8 +33,9 @@ public interface ReactPackage {
* @return list of native modules to register with the newly created catalyst instance This method
* is deprecated in the new Architecture of React Native.
*/
@DeprecatedInNewArchitecture(message = "Migrate to BaseReactPackage and implement getModule")
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule>
@Deprecated(message = "Migrate to [BaseReactPackage] and implement [getModule] instead.")
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
emptyList()
/** @return a list of view managers that should be registered with [UIManager] */
public fun createViewManagers(
@@ -28,6 +28,7 @@ internal object ReactPackageHelper {
FLog.d(
ReactConstants.TAG,
"${reactPackage.javaClass.simpleName} is not a LazyReactPackage, falling back to old version.")
@Suppress("DEPRECATION")
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
return Iterable {
object : Iterator<ModuleHolder> {
@@ -83,6 +83,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
if (shouldSupportLegacyPackages()) {
// TODO(T145105887): Output warnings that ReactPackage was used
@Suppress("DEPRECATION")
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
val moduleMap: MutableMap<String, NativeModule> = mutableMapOf()
@@ -94,6 +95,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
val moduleName = reactModule?.name ?: module.name
@Suppress("DEPRECATION")
val moduleInfo: ReactModuleInfo =
if (reactModule != null)
ReactModuleInfo(
@@ -16,7 +16,6 @@ import com.facebook.infer.annotation.Nullsafe;
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.StableReactNativeAPI;
import com.facebook.react.common.build.ReactBuildConfig;
import java.util.Map;
@@ -72,7 +71,6 @@ public abstract class BaseJavaModule implements NativeModule {
/**
* @return a map of constants this module exports to JS. Supports JSON types.
*/
@DeprecatedInNewArchitecture()
public @Nullable Map<String, Object> getConstants() {
return null;
}
@@ -14,11 +14,11 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.FrameworkAPI;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.common.annotations.VisibleForTesting;
@@ -27,16 +27,21 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
import java.util.Collection;
import java.util.Objects;
/**
* This is the bridge-specific concrete subclass of ReactContext. ReactContext has many methods that
* delegate to the react instance. This subclass implements those methods, by delegating to the
* CatalystInstance. If you need to create a ReactContext within an "bridge context", please create
* BridgeReactContext.
*
* @deprecated This class is deprecated in the New Architecture and will be replaced by {@link
* com.facebook.react.runtime.BridgelessReactContext}
*/
@DeprecatedInNewArchitecture
@VisibleForTesting
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Deprecated
@Nullsafe(Nullsafe.Mode.LOCAL)
public class BridgeReactContext extends ReactApplicationContext {
static {
LegacyArchitectureLogger.assertLegacyArchitecture(
@@ -119,6 +124,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.hasNativeModule(nativeModuleInterface);
}
@@ -127,6 +133,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModules();
}
@@ -139,6 +146,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModule(nativeModuleInterface);
}
@@ -147,6 +155,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModule(moduleName);
}
@@ -210,8 +219,7 @@ public class BridgeReactContext extends ReactApplicationContext {
@Override
public void handleException(Exception e) {
boolean catalystInstanceVariableExists = mCatalystInstance != null;
boolean isCatalystInstanceAlive =
catalystInstanceVariableExists && !mCatalystInstance.isDestroyed();
boolean isCatalystInstanceAlive = mCatalystInstance != null && !mCatalystInstance.isDestroyed();
boolean hasExceptionHandler = getJSExceptionHandler() != null;
if (isCatalystInstanceAlive && hasExceptionHandler) {
@@ -268,18 +276,19 @@ public class BridgeReactContext extends ReactApplicationContext {
return null;
}
@DeprecatedInNewArchitecture(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not"
+ " encouraged usage.")
/**
* Get the UIManager for Fabric from the CatalystInstance.
*
* @return The UIManager when CatalystInstance is active.
* @deprecated Do not use this method. Instead use {@link
* com.facebook.react.uimanager.UIManagerHelper} method {@code getUIManager} to get the
* UIManager instance from the current ReactContext.
*/
@Override
@Deprecated
public @Nullable UIManager getFabricUIManager() {
return mCatalystInstance.getFabricUIManager();
//noinspection deprecation
return Objects.requireNonNull(mCatalystInstance).getFabricUIManager();
}
/**
@@ -32,6 +32,8 @@ protected constructor(
// do nothing
}
@Deprecated(
"The method canOverrideExistingModule is not used in the New Architecture and will be removed in a future release.")
override fun canOverrideExistingModule(): Boolean = false
override fun invalidate() {
@@ -53,6 +53,7 @@ public class ModuleHolder {
public constructor(nativeModule: NativeModule) {
name = nativeModule.name
@Suppress("DEPRECATION")
reactModuleInfo =
ReactModuleInfo(
nativeModule.name,
@@ -9,7 +9,6 @@ package com.facebook.react.bridge;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.StableReactNativeAPI;
import javax.annotation.Nonnull;
@@ -50,8 +49,11 @@ public interface NativeModule {
* of a different package (such as the core one). Trying to override without returning true from
* this method is considered an error and will throw an exception during initialization. By
* default all modules return false.
*
* @deprecated The method canOverrideExistingModule is not used in the New Architecture and will
* be removed in a future release.
*/
@DeprecatedInNewArchitecture()
@Deprecated
default boolean canOverrideExistingModule() {
return false;
}
@@ -108,14 +108,8 @@ public abstract class ReactContext extends ContextWrapper {
mInteropModuleRegistry = new InteropModuleRegistry();
}
public void resetPerfStats() {
if (mNativeModulesMessageQueueThread != null) {
mNativeModulesMessageQueueThread.resetPerfStats();
}
if (mJSMessageQueueThread != null) {
mJSMessageQueueThread.resetPerfStats();
}
}
@Deprecated(since = "MessageQueueThread perf stats are no longer collected")
public void resetPerfStats() {}
public void setJSExceptionHandler(@Nullable JSExceptionHandler jSExceptionHandler) {
mJSExceptionHandler = jSExceptionHandler;
@@ -55,13 +55,16 @@ public interface MessageQueueThread {
* Returns the perf counters taken when the framework was started. This method is intended to be
* used for instrumentation purposes.
*/
public fun getPerfStats(): MessageQueueThreadPerfStats?
@Deprecated("MessageQueueThread perf stats are no longer collected")
@Suppress("DEPRECATION")
public fun getPerfStats(): MessageQueueThreadPerfStats? = null
/**
* Resets the perf counters. This is useful if the RN threads are being re-used. This method is
* intended to be used for instrumentation purposes.
*/
public fun resetPerfStats()
@Deprecated("MessageQueueThread perf stats are no longer collected")
public fun resetPerfStats(): Unit = Unit
/**
* Resets the perf counters. This is useful if the RN threads are being re-used. This method is
@@ -9,8 +9,6 @@ package com.facebook.react.bridge.queue
import android.os.Looper
import android.os.Process
import android.os.SystemClock
import android.util.Pair
import com.facebook.common.logging.FLog
import com.facebook.proguard.annotations.DoNotStripAny
import com.facebook.react.bridge.AssertionException
@@ -29,7 +27,6 @@ private constructor(
public val name: String,
public val looper: Looper,
exceptionHandler: QueueThreadExceptionHandler,
private val stats: MessageQueueThreadPerfStats? = null
) : MessageQueueThread {
private val handler = MessageQueueThreadHandler(looper, exceptionHandler)
private val assertionErrorMessage = "Expected to be called from the '$name' thread!"
@@ -105,27 +102,9 @@ private constructor(
}
}
override fun getPerfStats(): MessageQueueThreadPerfStats? = stats
override fun resetPerfStats() {
assignToPerfStats(stats, -1, -1)
runOnQueue {
val wallTime = SystemClock.uptimeMillis()
val cpuTime = SystemClock.currentThreadTimeMillis()
assignToPerfStats(stats, wallTime, cpuTime)
}
}
public override fun isIdle(): Boolean = looper.queue.isIdle
public companion object {
private fun assignToPerfStats(stats: MessageQueueThreadPerfStats?, wall: Long, cpu: Long) {
stats?.let { s ->
s.wallTime = wall
s.cpuTime = cpu
}
}
@JvmStatic
@Throws(RuntimeException::class)
public fun create(
@@ -160,27 +139,23 @@ private constructor(
stackSize: Long,
exceptionHandler: QueueThreadExceptionHandler
): MessageQueueThreadImpl {
val dataFuture = SimpleSettableFuture<Pair<Looper?, MessageQueueThreadPerfStats>>()
val looperFuture = SimpleSettableFuture<Looper?>()
val bgThread =
Thread(
null,
{
Process.setThreadPriority(Process.THREAD_PRIORITY_DISPLAY)
Looper.prepare()
val stats = MessageQueueThreadPerfStats()
val wallTime = SystemClock.uptimeMillis()
val cpuTime = SystemClock.currentThreadTimeMillis()
assignToPerfStats(stats, wallTime, cpuTime)
dataFuture.set(Pair(Looper.myLooper(), stats))
looperFuture.set(Looper.myLooper())
Looper.loop()
},
"mqt_$name",
stackSize)
bgThread.start()
val pair = dataFuture.getOrThrow()
val looper = pair?.first ?: throw RuntimeException("Looper not found for thread")
return MessageQueueThreadImpl(name, looper, exceptionHandler, pair.second)
val looper =
looperFuture.getOrThrow() ?: throw RuntimeException("Looper not found for thread")
return MessageQueueThreadImpl(name, looper, exceptionHandler)
}
}
}
@@ -8,6 +8,7 @@
package com.facebook.react.bridge.queue
/** This class holds perf counters' values at the beginning of an RN startup. */
@Deprecated("MessageQueueThread perf stats are no longer collected")
public class MessageQueueThreadPerfStats {
@JvmField public var wallTime: Long = 0
@JvmField public var cpuTime: Long = 0
@@ -26,6 +26,7 @@ private constructor(
public const val DEFAULT_STACK_SIZE_BYTES: Long = 0
@JvmStatic
@Deprecated("Use newBackgroundThreadSpec")
public fun newUIBackgroundTreadSpec(name: String): MessageQueueThreadSpec =
MessageQueueThreadSpec(ThreadType.NEW_BACKGROUND, name)
@@ -1,16 +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.common.annotations
/**
* Annotates a method or class that will be deprecated once the NewArchitecture is fully released in
* OSS.
*/
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
internal annotation class DeprecatedInNewArchitecture(val message: String = "")
@@ -33,8 +33,47 @@ public object DefaultNewArchitectureEntryPoint {
public var releaseLevel: ReleaseLevel = ReleaseLevel.STABLE
/**
* Loads the React Native New Architecture entry point with the default configuration.
*
* This will load the app with TurboModules, Fabric and Bridgeless by default.
*/
@JvmStatic
@JvmOverloads
public fun load() {
load(turboModulesEnabled = true, fabricEnabled = true, bridgelessEnabled = true)
}
@JvmStatic
@Deprecated(
message =
"Loading the entry point with different flags for Fabric, TurboModule and Bridgeless is deprecated." +
"Please use load() instead when loading the New Architecture.",
replaceWith = ReplaceWith("load()"))
public fun load(
turboModulesEnabled: Boolean = true,
) {
load(turboModulesEnabled, fabricEnabled = true, bridgelessEnabled = true)
}
@JvmStatic
@Deprecated(
message =
"Loading the entry point with different flags for Fabric, TurboModule and Bridgeless is deprecated." +
"Please use load() instead when loading the New Architecture.",
replaceWith = ReplaceWith("load()"))
public fun load(
turboModulesEnabled: Boolean = true,
fabricEnabled: Boolean = true,
) {
load(turboModulesEnabled, fabricEnabled, bridgelessEnabled = true)
}
@JvmStatic
@Deprecated(
message =
"Loading the entry point with different flags for Fabric, TurboModule and Bridgeless is deprecated." +
"Please use load() instead when loading the New Architecture.",
replaceWith = ReplaceWith("load()"))
public fun load(
turboModulesEnabled: Boolean = true,
fabricEnabled: Boolean = true,
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.defaults
import android.content.Context
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.defaults
import android.app.Application
@@ -53,7 +53,7 @@ public class BlobProvider : ContentProvider() {
var blobModule: BlobModule? = null
val context = context?.applicationContext
if (context is ReactApplication) {
val host = (context as ReactApplication).reactNativeHost
@Suppress("DEPRECATION") val host = (context as ReactApplication).reactNativeHost
val reactContext =
host.reactInstanceManager.currentReactContext
?: throw RuntimeException("No ReactContext associated with BlobProvider")
@@ -57,7 +57,7 @@ public class NetworkingModule(
* Allows to implement a custom fetching process for specific URIs. It is the handler's job to
* fetch the URI and return the JS body payload.
*/
public interface UriHandler {
internal interface UriHandler {
/** Returns if the handler should be used for an URI. */
public fun supports(uri: Uri, responseType: String): Boolean
@@ -66,7 +66,7 @@ public class NetworkingModule(
}
/** Allows adding custom handling to build the [RequestBody] from the JS body payload. */
public interface RequestBodyHandler {
internal interface RequestBodyHandler {
/** Returns if the handler should be used for a JS body payload. */
public fun supports(map: ReadableMap): Boolean
@@ -75,7 +75,7 @@ public class NetworkingModule(
}
/** Allows adding custom handling to build the JS body payload from the [ResponseBody]. */
public interface ResponseHandler {
internal interface ResponseHandler {
/** Returns if the handler should be used for a response type. */
public fun supports(responseType: String): Boolean
@@ -180,27 +180,27 @@ public class NetworkingModule(
uriHandlers.clear()
}
public fun addUriHandler(handler: UriHandler): Unit {
internal fun addUriHandler(handler: UriHandler): Unit {
uriHandlers.add(handler)
}
public fun addRequestBodyHandler(handler: RequestBodyHandler): Unit {
internal fun addRequestBodyHandler(handler: RequestBodyHandler): Unit {
requestBodyHandlers.add(handler)
}
public fun addResponseHandler(handler: ResponseHandler): Unit {
internal fun addResponseHandler(handler: ResponseHandler): Unit {
responseHandlers.add(handler)
}
public fun removeUriHandler(handler: UriHandler): Unit {
internal fun removeUriHandler(handler: UriHandler): Unit {
uriHandlers.remove(handler)
}
public fun removeRequestBodyHandler(handler: RequestBodyHandler): Unit {
internal fun removeRequestBodyHandler(handler: RequestBodyHandler): Unit {
requestBodyHandlers.remove(handler)
}
public fun removeResponseHandler(handler: ResponseHandler): Unit {
internal fun removeResponseHandler(handler: ResponseHandler): Unit {
responseHandlers.remove(handler)
}
@@ -829,13 +829,6 @@ public class ReactHostImpl(
null
},
executor)
.continueWith({ task: Task<Void> ->
// TODO: validate whether errors during startup go through here?
if (task.isFaulted()) {
handleHostException(checkNotNull(task.getError()))
}
null
})
private fun getOrCreateReactContext(): BridgelessReactContext {
val method = "getOrCreateReactContext()"
@@ -952,9 +945,14 @@ public class ReactHostImpl(
},
bgExecutor)
val lifecycleUpdateTask = { task: Task<CreationResult> ->
val lifecycleUpdateTask = task@{ task: Task<CreationResult> ->
if (task.isFaulted()) {
// handleHostException may throw, so move it outside of the task scheduler
uiExecutor.execute { handleHostException(checkNotNull(task.getError())) }
return@task
}
val result = checkNotNull(task.getResult())
val reactInstance = result.instance
val reactContext = result.context
val isReloading = result.isReloading
val isManagerResumed = reactLifecycleStateManager.lifecycleState == LifecycleState.RESUMED
@@ -991,10 +989,9 @@ public class ReactHostImpl(
for (listener in reactInstanceEventListeners) {
listener.onReactContextInitialized(reactContext)
}
reactInstance
}
creationTask.onSuccess(lifecycleUpdateTask, uiExecutor)
creationTask.continueWith(lifecycleUpdateTask, uiExecutor)
creationTask.onSuccess({ task -> checkNotNull(task.getResult()).instance })
}
}
@@ -13,10 +13,8 @@ import android.util.DisplayMetrics
import android.view.WindowManager
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.window.layout.WindowMetricsCalculator
import com.facebook.react.bridge.WritableMap
import com.facebook.react.bridge.WritableNativeMap
import com.facebook.react.views.view.isEdgeToEdgeFeatureFlagOn
/**
* Holds an instance of the current DisplayMetrics so we don't have to thread it through all the
@@ -64,19 +62,9 @@ public object DisplayMetricsHolder {
@JvmStatic
public fun initDisplayMetrics(context: Context) {
val displayMetrics = context.resources.displayMetrics
val windowDisplayMetrics = DisplayMetrics()
windowDisplayMetrics = displayMetrics
val screenDisplayMetrics = DisplayMetrics()
windowDisplayMetrics.setTo(displayMetrics)
screenDisplayMetrics.setTo(displayMetrics)
if (isEdgeToEdgeFeatureFlagOn) {
WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(context).let {
windowDisplayMetrics.widthPixels = it.bounds.width()
windowDisplayMetrics.heightPixels = it.bounds.height()
}
}
val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
// Get the real display metrics if we are using API level 17 or higher.
// The real metrics include system decor elements (e.g. soft menu bar).
@@ -84,8 +72,6 @@ public object DisplayMetricsHolder {
// See:
// http://developer.android.com/reference/android/view/Display.html#getRealMetrics(android.util.DisplayMetrics)
@Suppress("DEPRECATION") wm.defaultDisplay.getRealMetrics(screenDisplayMetrics)
DisplayMetricsHolder.windowDisplayMetrics = windowDisplayMetrics
DisplayMetricsHolder.screenDisplayMetrics = screenDisplayMetrics
}
@@ -10,7 +10,6 @@ package com.facebook.react.uimanager
import android.view.View
import com.facebook.common.logging.FLog
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.uimanager.ViewManagersPropertyCache.PropSetter
import java.util.HashMap
@@ -70,8 +69,8 @@ public object ViewManagerPropertyUpdater {
}
}
@DeprecatedInNewArchitecture
@JvmStatic
@Deprecated("Use ViewManager#updateProperties to update a view's properties")
public fun <T : ReactShadowNode<T>> updateProps(node: T, props: ReactStylesDiffMap) {
val setter = findNodeSetter(node.javaClass)
val iterator = props.backingMap.entryIterator
@@ -8,12 +8,10 @@
package com.facebook.react.uimanager.common
import androidx.annotation.IntDef
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
@Retention(AnnotationRetention.SOURCE)
@Suppress("DEPRECATION")
@IntDef(UIManagerType.DEFAULT, UIManagerType.LEGACY, UIManagerType.FABRIC)
@DeprecatedInNewArchitecture
public annotation class UIManagerType {
public companion object {
@Deprecated(
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.virtualview
package com.facebook.react.views.virtual
internal enum class VirtualViewMode(val value: Int) {
Visible(0),
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.virtualview
package com.facebook.react.views.virtual
import android.graphics.Rect
import androidx.annotation.VisibleForTesting
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.virtualview
package com.facebook.react.views.virtual
/**
* Represents the the render state of children in the most recent commit.
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.virtualview
package com.facebook.react.views.virtual.view
import android.content.Context
import android.graphics.Rect
@@ -24,6 +24,8 @@ import com.facebook.react.views.scroll.ReactScrollView
import com.facebook.react.views.scroll.ReactScrollViewHelper
import com.facebook.react.views.scroll.ScrollEventType
import com.facebook.react.views.view.ReactViewGroup
import com.facebook.react.views.virtual.VirtualViewMode
import com.facebook.react.views.virtual.VirtualViewRenderState
import com.facebook.systrace.Systrace
internal class ReactVirtualView(context: Context) :
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.virtualview
package com.facebook.react.views.virtual.view
import android.graphics.Rect
import androidx.annotation.VisibleForTesting
@@ -19,6 +19,9 @@ import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.viewmanagers.VirtualViewManagerDelegate
import com.facebook.react.viewmanagers.VirtualViewManagerInterface
import com.facebook.react.views.virtual.VirtualViewMode
import com.facebook.react.views.virtual.VirtualViewModeChangeEvent
import com.facebook.react.views.virtual.VirtualViewRenderState
@ReactModule(name = ReactVirtualViewManager.REACT_CLASS)
internal class ReactVirtualViewManager :
@@ -18,11 +18,9 @@ import android.view.WindowManager
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.BridgeReactContext
import com.facebook.react.bridge.CatalystInstance
import com.facebook.react.bridge.JavaOnlyArray
import com.facebook.react.bridge.JavaOnlyMap
import com.facebook.react.bridge.ReactTestHelper
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
import com.facebook.react.common.SystemClock
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
import com.facebook.react.uimanager.DisplayMetricsHolder
@@ -30,14 +28,12 @@ import com.facebook.react.uimanager.UIManagerModule
import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.uimanager.events.RCTEventEmitter
import com.facebook.react.uimanager.events.TouchEvent
import com.facebook.testutils.shadows.ShadowArguments
import java.util.Date
import org.assertj.core.api.Assertions.*
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.MockedStatic
import org.mockito.Mockito.mockStatic
import org.mockito.kotlin.KArgumentCaptor
import org.mockito.kotlin.any
import org.mockito.kotlin.argumentCaptor
@@ -52,16 +48,15 @@ import org.mockito.kotlin.whenever
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
@Config(shadows = [ShadowArguments::class])
@RunWith(RobolectricTestRunner::class)
class RootViewTest {
private lateinit var reactContext: BridgeReactContext
private lateinit var catalystInstanceMock: CatalystInstance
private lateinit var arguments: MockedStatic<Arguments>
private lateinit var systemClock: MockedStatic<SystemClock>
private lateinit var downEventCaptor: KArgumentCaptor<TouchEvent>
private lateinit var downActionTouchesArgCaptor: KArgumentCaptor<WritableArray>
@@ -72,14 +67,6 @@ class RootViewTest {
fun setUp() {
ReactNativeFeatureFlagsForTests.setUp()
arguments = mockStatic(Arguments::class.java)
arguments.`when`<WritableArray> { Arguments.createArray() }.thenAnswer { JavaOnlyArray() }
arguments.`when`<WritableMap> { Arguments.createMap() }.thenAnswer { JavaOnlyMap() }
val ts = SystemClock.uptimeMillis()
systemClock = mockStatic(SystemClock::class.java)
systemClock.`when`<Long> { SystemClock.uptimeMillis() }.thenReturn(ts)
catalystInstanceMock = ReactTestHelper.createMockCatalystInstance()
reactContext = spy(BridgeReactContext(RuntimeEnvironment.getApplication()))
reactContext.initializeWithInstance(catalystInstanceMock)
@@ -96,12 +83,6 @@ class RootViewTest {
upActionTouchesArgCaptor = argumentCaptor()
}
@After
fun tearDown() {
systemClock.close()
arguments.close()
}
@Test
fun testTouchEmitter() {
val instanceManager: ReactInstanceManager = mock()
@@ -10,23 +10,20 @@
package com.facebook.react.animated
import android.annotation.SuppressLint
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.Callback
import com.facebook.react.bridge.CatalystInstance
import com.facebook.react.bridge.JavaOnlyArray
import com.facebook.react.bridge.JavaOnlyMap
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.UIManagerModule
import com.facebook.react.uimanager.events.Event
import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.uimanager.events.RCTEventEmitter
import com.facebook.testutils.shadows.ShadowArguments
import kotlin.collections.Map
import kotlin.math.abs
import org.assertj.core.api.Assertions.assertThat
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -34,8 +31,6 @@ import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatchers.any
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.ArgumentMatchers.eq
import org.mockito.MockedStatic
import org.mockito.Mockito.mockStatic
import org.mockito.kotlin.atMost
import org.mockito.kotlin.mock
import org.mockito.kotlin.reset
@@ -44,8 +39,10 @@ import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyNoMoreInteractions
import org.mockito.kotlin.whenever
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
/** Tests the animated nodes graph traversal algorithm from {@link NativeAnimatedNodesManager}. */
@Config(shadows = [ShadowArguments::class])
@RunWith(RobolectricTestRunner::class)
class NativeAnimatedNodeTraversalTest {
@@ -55,7 +52,6 @@ class NativeAnimatedNodeTraversalTest {
private lateinit var uiManagerMock: UIManagerModule
private lateinit var eventDispatcherMock: EventDispatcher
private lateinit var nativeAnimatedNodesManager: NativeAnimatedNodesManager
private lateinit var arguments: MockedStatic<Arguments>
private fun nextFrameTime(): Long {
frameTimeNanos += FRAME_LEN_NANOS
@@ -64,10 +60,6 @@ class NativeAnimatedNodeTraversalTest {
@Before
fun setUp() {
arguments = mockStatic(Arguments::class.java)
arguments.`when`<WritableArray> { Arguments.createArray() }.thenAnswer { JavaOnlyArray() }
arguments.`when`<WritableMap> { Arguments.createMap() }.thenAnswer { JavaOnlyMap() }
frameTimeNanos = INITIAL_FRAME_TIME_NANOS
reactApplicationContextMock = mock<ReactApplicationContext>()
@@ -113,11 +105,6 @@ class NativeAnimatedNodeTraversalTest {
nativeAnimatedNodesManager = NativeAnimatedNodesManager(reactApplicationContextMock)
}
@After
fun tearDown() {
arguments.close()
}
/**
* Generates a simple animated nodes graph and attaches the props node to a given {@param viewTag}
* Parameter {@param opacity} is used as a initial value for the "opacity" attribute.
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.fabric
import com.facebook.react.bridge.BridgeReactContext
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
@file:Suppress("DEPRECATION")
package com.facebook.react.fabric
import com.facebook.react.ReactRootView
@@ -11,12 +11,10 @@ import android.util.DisplayMetrics
import android.view.MotionEvent
import android.view.MotionEvent.PointerCoords
import android.view.MotionEvent.PointerProperties
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.JavaOnlyArray
import com.facebook.react.bridge.JavaOnlyMap
import com.facebook.react.bridge.ReactTestHelper
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
import com.facebook.react.modules.core.ReactChoreographer
@@ -26,6 +24,7 @@ import com.facebook.react.uimanager.events.FabricEventDispatcher
import com.facebook.react.uimanager.events.TouchEvent
import com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper
import com.facebook.react.uimanager.events.TouchEventType
import com.facebook.testutils.shadows.ShadowArguments
import com.facebook.testutils.shadows.ShadowSoLoader
import org.assertj.core.api.Assertions.assertThat
import org.junit.After
@@ -34,8 +33,6 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatchers.*
import org.mockito.MockedStatic
import org.mockito.Mockito.mockStatic
import org.mockito.kotlin.mock
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
@@ -43,7 +40,7 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(shadows = [ShadowSoLoader::class])
@Config(shadows = [ShadowSoLoader::class, ShadowArguments::class])
class TouchEventDispatchTest {
private val touchEventCoalescingKeyHelper = TouchEventCoalescingKeyHelper()
@@ -460,16 +457,12 @@ class TouchEventDispatchTest {
private lateinit var eventDispatcher: EventDispatcher
private lateinit var eventEmitter: FabricEventEmitter
private lateinit var arguments: MockedStatic<Arguments>
private var reactChoreographerOriginal: ReactChoreographer? = null
@Before
fun setUp() {
ReactNativeFeatureFlagsForTests.setUp()
arguments = mockStatic(Arguments::class.java)
arguments.`when`<WritableArray> { Arguments.createArray() }.thenAnswer { JavaOnlyArray() }
arguments.`when`<WritableMap> { Arguments.createMap() }.thenAnswer { JavaOnlyMap() }
val metrics = DisplayMetrics()
metrics.xdpi = 1f
metrics.ydpi = 1f
@@ -488,7 +481,6 @@ class TouchEventDispatchTest {
@After
fun tearDown() {
arguments.close()
ReactChoreographer.overrideInstanceForTest(reactChoreographerOriginal)
}
@@ -9,49 +9,39 @@ package com.facebook.react.modules.appstate
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.Callback
import com.facebook.react.bridge.JavaOnlyArray
import com.facebook.react.bridge.JavaOnlyMap
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
import com.facebook.testutils.shadows.ShadowArguments
import org.assertj.core.api.Assertions.assertThat
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.MockedStatic
import org.mockito.Mockito.mockStatic
import org.mockito.kotlin.any
import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@Config(shadows = [ShadowArguments::class])
@RunWith(RobolectricTestRunner::class)
class AppStateModuleTest {
private lateinit var appStateModule: AppStateModule
private lateinit var reactContext: ReactApplicationContext
private lateinit var arguments: MockedStatic<Arguments>
@Before
fun setUp() {
reactContext = mock()
appStateModule = AppStateModule(reactContext)
arguments = mockStatic(Arguments::class.java)
arguments.`when`<WritableArray>(Arguments::createArray).thenAnswer { JavaOnlyArray() }
arguments.`when`<WritableMap>(Arguments::createMap).thenAnswer { JavaOnlyMap() }
// we check whether we have an active react instance before emitting an event,
// therefore for the tests we need this returning `true`.
whenever(reactContext.hasActiveReactInstance()).thenReturn(true)
}
@After
fun tearDown() {
arguments.close()
}
@Test
fun testGetCurrentAppState() {
val successCallbackMock: Callback = mock()
@@ -8,11 +8,9 @@
package com.facebook.react.modules.blob
import android.net.Uri
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.JavaOnlyArray
import com.facebook.react.bridge.JavaOnlyMap
import com.facebook.react.bridge.ReactTestHelper
import com.facebook.react.bridge.WritableMap
import java.nio.ByteBuffer
import java.util.UUID
import kotlin.random.Random
@@ -21,8 +19,6 @@ import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.MockedStatic
import org.mockito.Mockito.mockStatic
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@@ -32,13 +28,9 @@ class BlobModuleTest {
private lateinit var bytes: ByteArray
private lateinit var blobId: String
private lateinit var blobModule: BlobModule
private lateinit var arguments: MockedStatic<Arguments>
@Before
fun prepareModules() {
arguments = mockStatic(Arguments::class.java)
arguments.`when`<WritableMap> { Arguments.createMap() }.thenAnswer { JavaOnlyMap() }
bytes = ByteArray(120)
Random.Default.nextBytes(bytes)
@@ -49,7 +41,6 @@ class BlobModuleTest {
@After
fun cleanUp() {
blobModule.remove(blobId)
arguments.close()
}
@Test

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