Commit Graph

17 Commits

Author SHA1 Message Date
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
Tim Yung 1977dd6596 RN: Sort Pragmas in Headers (#51554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51554

Sorts pragma directives file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264593

fbshipit-source-id: 9e4b253dd0fc94dc2fc469d7114b93a8aae305f4
2025-05-22 21:18:53 -07:00
Dawid Małecki ddcab831b1 Migrate already root exported deep imports in rn-tester. (#50958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50958

In rn-tester package there are many react-native deep imports which will be deprecated in the future. It is a starter for migrating rn-tester to using root imports instead. Only deep imports that are already root exported are changed. This diff avoids using `CodegenTypes` as it causes build errors and will be resolved in next stages.

Besides import changes, `PointerEvent` type is now also exported from the root.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73656526

fbshipit-source-id: 5814a3d9c6a04b1236581dbbe291cd109e2c71c0
2025-04-28 07:24:46 -07:00
Sam Zhou 722f5ba786 Remove global React$ type references (#49276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49276

This diff replaces the remaining `React$` global types in the codebase, in preparation for their removal in Flow.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69322418

fbshipit-source-id: 058a2489ce8e6bf59df2ec4e61e9708f63561671
2025-02-07 18:01:43 -08:00
Dawid Małecki f36bfe5dfa Remove redundant {||} syntax (#48686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
2025-01-15 07:07:01 -08:00
Nicola Corti 13900d75b8 Remove replaceAll from RNTester sample code (#48099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48099

This is currently breaking the Sample Module screen on RN-Tester. Let's remove it.

Changelog:
[Internal] [Changed] - Remove replaceAll from RNTester sample code

Reviewed By: cipolleschi

Differential Revision: D66764656

fbshipit-source-id: acd123374d23b37977d5506f70f29da7f5d6311f
2024-12-05 09:54:47 -08:00
Tim Yung c9ea05552f RN: Fix lint/sort-imports Errors (#47109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47109

Fixes the `lint/sort-imports` errors that are now surfaced after fixing the lint configuration.

For a couple files, I added lint suppressions instead because the unsorted import ordering is important due to interleaved calls with side effects.

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D64569485

fbshipit-source-id: 26415d792e2b9efe08c05d1436f723faae549882
2024-10-18 04:07:02 -07:00
Peter Abbondanzo 09682b5109 Fix dark mode text (#46898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46898

Replaces *many* `Text` component usages with `RNTesterText`: a thin wrapper around `Text` that applies color based on the color scheme chosen by the user. It makes text legible for dark mode across 41 different example files. This changes intentionally do not touch a few larger component sites that expand beyond RNTester, like `Animated` and `NewAppScreen`

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64053464

fbshipit-source-id: 9516fef2afe1b364eb38e85e3a2dbb5c434e44db
2024-10-10 11:02:18 -07:00
Nicola Corti d01f1b3214 Add support for handling com.facebook.react.bridge.Dynamic as parameter type in TurboModules (#45944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45944

This diff adds support having (Legacy) Native Modules with functions with parameters of type `Dynamic`.
This is currently blocking some libraries making it harder for them to migrate to New Architecture.

I've implemented it by adding a `DynamicNative` implementation of `Dynamic` which holds a reference of
the payload as a `folly::dynamic`.

Changelog:
[Android] [Added] - Add support for handling `com.facebook.react.bridge.Dynamic` as parameter type in TurboModules

Reviewed By: mdvacca, cipolleschi

Differential Revision: D60966684

fbshipit-source-id: 2e63bc53ede5277a9c12f1b19f05f6099f5f35f9
2024-08-12 12:56:38 -07:00
Sam Zhou 41f525ccae Pre-suppress unsafe string key access errors in xplat/js (#44221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44221

This diff pre-suppresses errors of the following pattern, to prepare for the next Flow release.

```
declare const obj: {foo: string};
declare const key: string;
obj[key]; // error: invalid-computed-prop
```

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D56477899

fbshipit-source-id: 5676b8685bd3157a519fe433cfce0fa28e003502
2024-04-23 11:36:14 -07:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Ramanpreet Nara 04852fd6fc Interop example: Make argument to getRootTag deterministic (#40947)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40947

This shows up as this.context shows up as 1 sometimes. Let's just hard-code this to 11, to make the test more reliable.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D50253990

fbshipit-source-id: 1da75e5e5f3226676f9af67fc329a70079eed59e
2023-10-13 16:53:38 -07:00
Ramanpreet Nara de1fb8f7fd Sort object properties in interop test
Summary:
It looks like objects properties aren't guaranteed to have a stable order. Sort them, before we serializae and print them to the screen in the interop test. This should reduce interop test flakyness.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D50148860

fbshipit-source-id: a6ed1433d4dd35cafa5c9f7d09c4cca194c31d81
2023-10-11 19:03:01 -07:00
Ramanpreet Nara 271ce7edbc Fix and re-introduce interop test (#39690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39690

This diff re-introduces the test for the TurboModule interop layer.

This test was originally reverted in D49200360, because it was broken.

***New:*** This test runs in Bridgeless mode, with the interop layer enabled. (Catalyst is now native mobileconfig ready).

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D49208528

fbshipit-source-id: 3109d7826e7024fd7a1074321d4aab8f3a489609
2023-09-27 10:18:50 -07:00
Ramanpreet Nara 145659241a Introduce SampleLegacyModule example in RNTester (#38539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38539

We will use this example to:
- Showcase legacy module support in the TurboModule system in RNTester
- E2E test legacy module support in the TurboModule system

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D47529295

fbshipit-source-id: b98e315741bed7740c36997d706f48e375b0c815
2023-08-21 17:58:46 -07:00
Ramanpreet Nara 99e332e5b2 Introduce jest-e2e test for TurboModule Interop (#38206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38206

This test will ensure that the TurboModule interop layer works in Catalyst.

It will navigate to the sample legacy module screen, and ensure that all methods work.

Steps:
1. Open up Catalyst
2. Navigate to the Legacy Native Module example
3. Click "Run all tests"
4. Validate that all tests match expectations.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D46917689

fbshipit-source-id: 071f9324fa3719648c1a390bde4ba00a4e687e44
2023-07-11 11:42:43 -07:00
Ramanpreet Nara a1b64b7f15 Introduce SampleLegacyModule example in RNTester (#38008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38008

Introduce a legacy module (+ example) in RNTester.

In the future, SampleLegacyModule will be used to:
- Showcase the TurboModule interop layer in RNTester, once Bridgeless mode is ready
- E2E Test the TurboModule interop layer.

The TurboModule interop layer is just an extension to the TurboModule system that allows the system to create legacy modules. Unlike regular TurboModules, these legacy modules don't need codegen for JavaScript -> native method dispatch.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D46874160

fbshipit-source-id: f9810d0bdb3bd0c0a74099fcb6f74ca547977a53
2023-06-21 18:30:09 -07:00