Commit Graph

122 Commits

Author SHA1 Message Date
Tim Yung 84de8a075e RN: Delete @oncall Annotations (#51416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51416

Deletes `oncall` annotations from the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74902524

fbshipit-source-id: 32a6a5b2ff27281792d572f151e2b094d9a79029
2025-05-17 16:18:05 -07:00
Jakub Piasecki b3c110b0b2 Add a lint rule preventing named type imports from React (#50776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50776

Changelog: [Internal]

Adds a lint rule that prevents the use of named imports when importing types from React. `flow-api-translator` relies on the `React` namespace being used when generating TypeScript definitions based on Flow.

Reviewed By: huntie

Differential Revision: D73170799

fbshipit-source-id: 96d014b016c7cec8d3b266447dc7a185d2b1da26
2025-04-17 05:39:22 -07:00
Rubén Norte 748183ded0 ] Clean up feature flag to enable paint time reporting in Event Timing API (#50698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50698

Changelog: [internal]

This cleans up the flag to enable paint time reporting for Event Timing API entries, as this reporting fixes a bug and we've verified is stable/performant enough.

Reviewed By: rshest

Differential Revision: D72960337

fbshipit-source-id: 976810382208b9403c01c80324b540570bbc0e42
2025-04-14 07:12:00 -07:00
Rubén Norte 3839861dbe Clean up feature flag fixMountingCoordinatorReportedPendingTransactionsOnAndroid (#50632)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50632

Changelog: [internal]

This cleans up the `fixMountingCoordinatorReportedPendingTransactionsOnAndroid` feature flag that is no longer necessary.

Reviewed By: javache

Differential Revision: D72561255

fbshipit-source-id: 0942122832ce40cacc273265e4c95b5fe251dbe6
2025-04-11 04:02:33 -07:00
Rubén Norte 7aa0499e11 Clean up feature flag to enable LongTasks API
Summary:
Changelog: [internal]

(This is "internal" because the `PerformanceObserver` API isn't stable yet).

This cleans up the feature flag to enable the LongTasks API to the availability of the API itself isn't gated behind this specific one.

Reviewed By: rshest

Differential Revision: D72784109

fbshipit-source-id: 8ca45d66cebbd80729829c928bebb13f4a38b7ab
2025-04-10 07:39:52 -07:00
Rubén Norte 150b1ccaba Clean up enableUIConsistency feature flag (#50484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50484

Changelog: [internal]

This cleans up the `enableUIConsistency` feature flag (shipping the feature) after we verified it was stable and performance in production.

Reviewed By: yungsters

Differential Revision: D72387602

fbshipit-source-id: 11d225d962f7e3a47e858d039b7fd5c70a6cadfd
2025-04-04 05:38:29 -07:00
Dawid Małecki 0615b056e6 Add lint rule preventing importing React as default (#50432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50432

This diff adds lint rule to keep React imports consistent across the react native repo. There is a fix suggestion in case if only React is imported.

Changelog:
[internal]

Reviewed By: NickGerleman

Differential Revision: D72244838

fbshipit-source-id: b783d6320520d76c2e5d5ce5c5b7c2a4548d50fe
2025-04-02 06:59:33 -07:00
Dawid Małecki 321efa9448 Add lint rule preventing "Node" imports from react and migrate "Node" types to use React namespace in react-native (#50030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50030

In Flow importing Node from react is equivalent importing ReactNode in Typescript. During translation Node is not translated to ReactNode but React.Node is translated to React.ReactNode. The easiest solution is to migrate all "Node" types to "React.Node"  so that the translation is correct. To make sure that everyone follow the lint rule is added that checks for Node imports from react.

Changelog:
[Internal] - Added lint rule preventing "Node" imports from react and migrated "Node" types to use React namespace in react-native

Reviewed By: javache, huntie

Differential Revision: D71189533

fbshipit-source-id: baea8feb46be3dc30b6e58bcefe140655ec0530a
2025-03-17 06:47:23 -07:00
Rubén Norte cc761e42c8 Clean up "enablePreciseSchedulingForPremountItemsOnAndroid" feature flag (#49841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49841

Changelog: [internal]

This effectively reverts D62962341 / https://github.com/facebook/react-native/pull/46563 as the experiments didn't provide the expected wins and we don't have bandwidth to iterate on this.

Reviewed By: rshest

Differential Revision: D70622429

fbshipit-source-id: c53c9437448c0a7be8f5b4f04d6369efbd99105a
2025-03-05 10:02:36 -08:00
Iwo Plaza d98116aa44 Migrate Libraries/Utilities/Platform to use export syntax (#49306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49306

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Libraries/Utilities/Platform.*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/Platform` with `require` syntax needs to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69404025

fbshipit-source-id: f21501ca5b7e8e6a9e3e501781ed36e7d2bfd4a4
2025-02-13 11:58:41 -08:00
Dawid Małecki 5c2153784d Create lint rule preventing uses of CommonJS exports (#49079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49079

The rule disallows using CommonJS exports in react-native and assets/registry package.

## Changelog:
[Internal] - Created a lint rule that prevents using CommonJS exports

Reviewed By: huntie

Differential Revision: D68951212

fbshipit-source-id: 1c9a1581af951d2a876b348981f0e5a81c99109a
2025-01-31 07:13:54 -08:00
Blake Friedman a8cf53fcd1 Add messaging to phabricator (#48470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48470

This introduces:
- `validate_rn_cpp_api`: run a shell script that fails if the user changes the C++ API.  Importantly it produces an artifact with details to share with the user: `message`.
- `message` has to be extracted from `stdout`, which **get_user_message** does if the `validate_rn_cpp_api` action is not successful (**warning**).
- The then users `comment_to_signalhub` to share this as a warning to the user (until we're confident this entire stack is very stable, at which time we'll block).

The provides 2 classes of warning:
1. vanilla you've change the API,
2. you've change the API and haven't included the correct changelog.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67776215

fbshipit-source-id: 4ac7451c8ecef62ba968710ec41804ba42153976
2025-01-07 03:41:42 -08:00
Blake Friedman af000b7aaa Remove forward declarations (#48461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48461

Remove forward class or struct declarations.

Changelog: [Internal]

```
$ sl log --stat tools/api/ReactNativeCPP.api
 xplat/js/react-native-github/tools/api/ReactNativeCPP.api |  637
 1 files changed, 96 insertions(+), 541 deletions(-)
```

Reviewed By: cipolleschi

Differential Revision: D67763260

fbshipit-source-id: 396314be9cb6153f6cff1348aa596d4a5b61fbe7
2025-01-03 13:18:48 -08:00
Blake Friedman 6d85c7c476 Avoid adding stdlib (#48468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48468

Clang will add this code by default at the preprocessor phase. I'd observed a difference in output on sandcastle where it didn't include `stdlib` by default.

This stops `stdlib` being included locally.  **It isn't important wrt tracking user API changes.**

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67793848

fbshipit-source-id: 0c88aee05a78e2410b308fe10c48db2552b8a148
2025-01-03 10:30:00 -08:00
Blake Friedman 9542b1af55 Starlark needs hg instead of sl (#48460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48460

We can only specify `hg` as a dependency, so have to use it in our shell script.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67718641

fbshipit-source-id: 557d980a9b6c3dbcd2621481d39a24b47075a3f9
2025-01-03 10:30:00 -08:00
Blake Friedman 5f54386a66 Add a BUCK target (#48457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48457

Adding CI support will require executing through buck.  Sandboxing means the package has to be well-formed to work, so this cleans up some earlier mess.

- yarn workspace
- check-api.sh to configure the environment correctly when running form sandcastle
- explicity dependencies in our package.json

This is the first step

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67726588

fbshipit-source-id: 7f8605695e323ef332550820b23b85d3af5f4d69
2025-01-03 10:30:00 -08:00
Blake Friedman 4f30b94a0d Add snapshot of ObjC/PP API (#48456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48456

This is the current output of running the api snapshotting tool.  I've also shown some test examples that show how trivial changes affect the API file.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67713415

fbshipit-source-id: f68c7e15b0d1e26878e39f22f49e64cdd7340df2
2025-01-03 10:30:00 -08:00
Blake Friedman 3a7aed6ed8 Follow-ups to issues earlier in the stack (#48455)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48455

This is a followup to earlier issues in the stack.

Two fixes here:
1. Make the paths more consistent esp. from the config, so everything is working out of react-native-github.
2. Just declare `__cpluscplus`, as we don't seem to care about the value in our code.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67716883

fbshipit-source-id: 359c33210d6b66bb0d75724a177587a7d5f837b2
2025-01-02 15:58:04 -08:00
Blake Friedman 27ef13174c Add simple Objective-C/CPP api tracking (#48449)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48449

This is the simplest possible way to track changes to our public CPP / Objective-C API.

This is going to be really noisy, and there's a good chance it's not complete.

The tooling is also incomplete, as it just runs the preprocessor (then does some funky work to undo noise generated by the preprocessor).  If we want more control over this, we're going to have to jump into the guts of each of our build targets (and tooling) OR more clearer layout the repo to separate public and private header files to our users.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67713408

fbshipit-source-id: 9578179bbc4d9be2f07d040b01f8a3ef105d7034
2025-01-02 15:58:04 -08:00
Tim Yung 892ce1b980 RN: Fix sort-imports Lint Configuration (#47104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47104

In https://github.com/facebook/react-native/pull/46082, the lint configuration for `lint/sort-imports` was accidentally removed.

This has happened on more than one occasion in the past. In order to prevent this from happening again in the future, I'm also adding a Jest integration test to verify that this lint rule is enabled in the `eslintrc.js` configuration.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D64547410

fbshipit-source-id: ec4f14aff140691b644189dfa3116a3d39285f80
2024-10-17 17:06:20 -07:00
Chang Yan d8a0d30e70 Build and sync lint/sort-imports from WWW (#44824)
Summary:
X-link: https://github.com/facebook/relay/pull/4708

X-link: https://github.com/facebook/metro/pull/1285

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

Run the build script based on the commit in D58271034.

Changelog: [Internal]

NOTE: Test plan and summary intentionally obfuscated because it's exported to an external github pull request, but trust me.

Reviewed By: yungsters

Differential Revision: D58271323

fbshipit-source-id: be19c63d630281b9f6feca00b24f45d000e07089
2024-06-07 10:01:49 -07:00
Moti Zilberman 5df1940225 Update sort-imports lint rule to latest (#41841)
Summary:
@public

TSIA

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

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51946720

fbshipit-source-id: 28b55c3555b4757f13b896068c5b43ac761fc5cf
2023-12-08 11:07:55 -08: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
Gijs Weterings 67c1a806e6 Flow strictify xplat/js/react-native-github where possible (#41051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41051

Strictifies flow to flow strict-local in files where doing that doesn't cause new flow errors.

Changelog: Internal

Reviewed By: yungsters

Differential Revision: D50369011

fbshipit-source-id: b4a5a26b839b7327a3178e6f5b35246dea365a38
2023-10-18 05:36:33 -07:00
Tim Yung ffc9ff066a RN: Enforce Manifest Constraints w/ ESLint (#39064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39064

Creates a new lint rule that enforces the following constraints:

- `react-native/monorepo` cannot have `dependencies`.
- `react-native` cannot have `devDependencies`.

This also includes a lengthy comment in the rule definition explaining why these constraints exist, so that future contributors can make an informed decision when reconsidering these constraints.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D48448633

fbshipit-source-id: 26b0d74b9120ddfd2a6a72bb91f86a98c8d679ef
2023-08-18 07:48:56 -07:00
Pranav Yadav 8a49754cda Refactor: JS substr() is deprecated, using slice() instead (#37136)
Summary:
Fixes: https://github.com/facebook/react-native/issues/37135

- `substr()` is not part of the core JS since ~2018
- No wonder why no one noticed this :)
- Though its supported by modern browsers, its deprecated
- Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr

### Why `slice()` and not `substring()`?
> Beacuse I like pizza ;) jk

The reason, that I'm not using the most obvious alternative `substring()` is;
- It _swaps the args_ passed, when; `startIndex > endIndex` —which I think is not a property of _good_ fn
  and also does not reflects the same in it's name.
- It _doesn't support negative args_, which I think reduces flexibility to work with it.
- It could lead to more bugs in most of the cases.

### Refecrences:
- Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring#differences_between_substring_and_slice
- Ref. for `slice()`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
- Ref. for `substring()`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring

## Changelog:

[GENERAL][FIXED] - Refactor: `substr()` is deprecated, using `slice()` instead across RN codebase

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

Test Plan: - `yarn lint && yarn flow && yarn test-ci` --> _should be green_

Reviewed By: christophpurrer

Differential Revision: D45477910

Pulled By: jacdebug

fbshipit-source-id: 96a80893477599b9a549918924157627b9b0c3f4
2023-05-02 11:28:56 -07:00
Nicola Corti 7d7f48da41 Remove Buck OSS 1 setup. (#36900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36900

This commit effectively removes all the Buck 1 OSS infra code we do have inside
React Native as we'll need to rework most of it once we move to Buck 2

Changelog:
[Internal] [Changed] - Remove Buck OSS 1 setup

Reviewed By: mdvacca, cipolleschi

Differential Revision: D44956134

fbshipit-source-id: c0ad1914286c428480248658c4282df5477bba2b
2023-04-13 13:19:24 -07:00
Kevin Gozali d49f1ebc65 rn_codegen: define a method to convert package.json codegenConfig into Buck format (#36868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36868

Given a codegenConfig definition in a library's package.json, convert it into Buck specific codegen format, as defined by the kwargs of rn_codegen().

Reference:
https://reactnative.dev/docs/next/new-architecture-library-intro#configure-codegen

Changelog: [Internal]

Reviewed By: cortinico, mdvacca

Differential Revision: D44857743

fbshipit-source-id: 82011161d43cebe701cd2b129208054c21d3175a
2023-04-11 17:45:40 -07:00
Kevin Gozali 9193c4f50c rn_codegen: renamed src_prefix to codegen_src_prefix (#36866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36866

For consistency with internal build rules, rename this kwarg. This will make it easier to keep both internal and external usages consistent.

Changelog: [General][Changed] react-native-codegen: Buck-only: renamed src_prefix kwarg

Reviewed By: sammy-SC

Differential Revision: D44857745

fbshipit-source-id: 475658281a6c2846be42e130f81e23dfcae5856b
2023-04-11 02:48:42 -07:00
Christoph Purrer 95dabeb53c code-gen: Enable opt-in to mobile dependencies when building for Apple Catalyst (#36851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36851

Changelog:
[Internal]

Differential Revision: D44795138

fbshipit-source-id: 4d667531a50d41b8da8146be3c0a9b8854eb6bd1
2023-04-07 12:46:03 -07:00
Shawn Dempsey 247a913af0 Refactor react native codegen to export macOS specific deps (#36805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36805

**Changelog:** Export macOS specific dependencies for react-native-codgen

[Internal][Changed] - RN macOS uses an older version of React Native (0.68) so we need to specify macOS specific dependencies when running codegen for RN Desktop

Reviewed By: christophpurrer

Differential Revision: D44687704

fbshipit-source-id: 9dcabc88d4abf17845db0844c952f1cb4a13e3ad
2023-04-06 17:37:53 -07:00
Kevin Gozali bfaedfe6f1 rn_codegen Buck: process TS spec files for native components as well (#36843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36843

It already consumes .ts files for native module specs, but not for native components, so let's enable it.

Changelog: [General][Fixed] react-native-codegen Buck support: also process .ts files for native component specs

Reviewed By: cortinico

Differential Revision: D44735387

fbshipit-source-id: 7173e07280dfaec06f08347838824827ef88e31a
2023-04-06 16:11:55 -07:00
Riccardo Cipolleschi 610b14e4f3 Move min ios version to 13.4 for OSS (#36795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36795

This change bump the min iOS version for React Native to 13.4, to align with company guidelines.

## Changelog:
[iOS][Changed] - Moved the min iOS version to 13.4

Reviewed By: cortinico

Differential Revision: D44634663

fbshipit-source-id: 035e8fcbb395f7394f8253e3ec485ad9937531c2
2023-04-06 12:07:26 -07:00
Gijs Weterings edc5ea11bb Add Meta header to xplat/js/react-native-github/tools/build_defs/oss/preload.bzl (#36814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36814

Working through the backlog of failing open source requirements (T139285789). Most files that are violating Copyright rules are due to the exemptions being outdated, but this file actually needs a header.

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D44705585

fbshipit-source-id: 0319be3be0726a76cd98448205f5af76343ad356
2023-04-05 06:55:34 -07:00
Moti Zilberman 6abc097bf3 Remove dev-mode Hermes bytecode experiment
Summary:
Changelog: [General][Removed] Remove experimental support for loading bytecode from Metro

Removes the experimental bundling strategy that offloads Hermes bytecode compilation to the packager server. The React Native parts of this experiment were never part of the public API, and the Metro parts never fully shipped in open source.

Followup from D43597007.

Reviewed By: robhogan

Differential Revision: D43604705

fbshipit-source-id: db3be553750ccbf286d876f75858299c5b750f19
2023-03-21 09:52:50 -07:00
Ruslan Lesiutin dacb1593de RN: add @react-native/tester as a workspace to xplat/js/public (#36531)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36531

Changelog: [Internal]

In order to make `react-native/tester` imports work, adding this package to `xplat/js/public`

Also moving devDependecies from `react-native/tester/package.json` to root package json to avoid checking in dev dependencies in `xplat/js/public/node_modules`

Reviewed By: cortinico

Differential Revision: D44030539

fbshipit-source-id: b06e49869cdad6e511b1675d1063a1ceac56e3e6
2023-03-20 07:05:52 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Ruslan Shestopalyuk 1629b9f0a1 Refactor BUCK file for WebPerformance (use TurboModule plugins) (#36197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36197

[Changelog][Internal]

This turns NativePerformance* module dependencies into "TurboModule plugins", which allows for more streamlined client integration (as it makes them register automatically once the dependency is there).

Reviewed By: rubennorte

Differential Revision: D43353204

fbshipit-source-id: 01d0089750a4873088dc4aefe34fd48693ee9791
2023-02-17 19:10:41 -08:00
Jordan Eldredge 83743e1edf Update React Native's synced sort-imports lint rule
Summary:
Changelog:
[Internal][Changed] - Update synced sort-import lint rule to newest version

Reviewed By: yungsters

Differential Revision: D42779224

fbshipit-source-id: bd388c258e5882331fd20d7313b4717a6b88f611
2023-01-30 17:05:25 -08:00
Neil Mitchell bdb2fd6979 Add support for Buck oncall annotations (#35562)
Summary:
Newer versions of Buck (not released open source) support an `oncall` annotation to denote who owns a particular BUCK file. These annotations are useful to support so that if BUCK files are updated with such annotations they don't break.

## Changelog

[Internal] [Changed] - support oncall annotation in BUCK files

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

Test Plan: The `test_buck` CI job validates that the file can be evaluated by open-source Buck. I ran this on a CircleCI fork, and it passed.

Reviewed By: motiz88

Differential Revision: D41731925

Pulled By: cortinico

fbshipit-source-id: 7d0ae164c3e6289d4aa76892658d46bbe4faf99c
2022-12-05 06:12:46 -08:00
Pieter De Baets 322a796cba Ignore disable_infer_precompiled_header in OSS BUCK
Summary:
A codemod landed which broke our public CI as it added
disable_infer_precompiled_header which is not known to Buck OSS. This ignores the argument like we do for other internal parameter types.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41729615

fbshipit-source-id: 30601d793b15cca3164d0513882da94064b47996
2022-12-05 03:01:05 -08:00
Pieter De Baets effbae5f8c Rename rn_xplat_cxx_library2 to rn_apple_xplat_cxx_library
Summary:
Rename this helper to make it explicit what it's used for. There's still more to do here to simplify these.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D41184338

fbshipit-source-id: a33d306978cb9026ebf10b00853042da4aaecd5a
2022-11-15 09:14:09 -08:00
Christoph Purrer 53f1f6b9cd Add TurboModule code-gen support
Summary:
Add TurboModule code-gen support for macOS and Windows

Changelog
[General][Internal] - Add TurboModule code-gen support for macOS and Windows

Reviewed By: javache

Differential Revision: D40140890

fbshipit-source-id: 60d235f16af590c07abddba3d289efa7d1d973c0
2022-10-10 15:42:06 -07:00
Rubén Norte 7c36d0b6a0 Specify command to regenerate bundled sort-imports ESLint rule
Summary: Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D40138586

fbshipit-source-id: 2d593f6064680beec810ee608852895fdfff4f3b
2022-10-06 09:40:09 -07:00
Joshua Selbo 87acdfb436 Remove androidx args on library wrappers
Summary:
Changelog:
[Internal][Removed] - Remove legacy AndroidX arguments on buck targets

Differential Revision: D39835294

fbshipit-source-id: dbbdd7546d60c459b7f9184654dad7a8d5a196e8
2022-10-05 13:49:48 -07:00
Tim Yung 4363626701 RN: Enforce flow-typed Signatures
Summary:
Creates a new `valid-flow-typed-signature` ESLint rule that validates the `flow-typed` signatures at the top of each file.

This lint rule will discourage contributors from locally forking the `flow-typed` definitions. Instead, any changes should be submitted as patches to the upstream definition in: https://github.com/flow-typed/flow-typed

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D39868721

fbshipit-source-id: e5e3ffe7568dbe52c9b598b53110b0fcbcad3e38
2022-09-30 14:28:48 -07:00
Tim Yung 868be00d8c RN: Create Portable sort-imports ESLint Rule
Summary:
Introduces a portable bundle that implements the `sort-imports` ESLint rule that we use internally at Meta, to the React Native repository.

As a consequence of the rapid changes that occur to this rule internally (and the desire to minimize red tape for Meta engineers), the portable bundle is built with Rollup with a lot of context omitted.

Changelog:
[Internal]

Reviewed By: skinsshark

Differential Revision: D39907799

fbshipit-source-id: 58fb6dc08030f20ac02c0e3fd1b175e22e4d74c0
2022-09-30 14:28:48 -07:00
Tim Yung 85f3e2416f RN: Fix no-react-native-imports for Windows
Summary:
This lint rule (and the associated Jest test) fails because `path` on Windows outputs backslashes. This diff fixes the rule.

Changelog:
[Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D39887464

fbshipit-source-id: b75480ccf4dcc384e2f7b91d8dcaf3af5f341434
2022-09-28 08:16:49 -07:00
Tim Yung 4f83498462 RN: Replace error-subclass-name with require-extends-error ESLint Rule
Summary:
Removes the `error-subclass-name` ESLint rule from `react-native/eslint-plugin`, and implements a new `require-extends-error` ESLint rule inside the React Native repository. This rule was only intended to be used for internal development of React Native.

This will change `react-native/eslint-plugin` to no longer provide the `error-subclass-name` rule.

NOTE: One behavior difference here is that I also implemented the desired behavior of checking classes that extend `Library.SomeError`.

Changelog:
[General][Removed] - `react-native/eslint-plugin` no longer provides the `error-subclass-name` rule.

Reviewed By: lunaleaps

Differential Revision: D39858882

fbshipit-source-id: 27b53216d77a15b3425bd9669dbc9d954c1c61da
2022-09-27 14:37:29 -07:00
Tim Yung 1ec69b1823 RN: Move no-haste-imports ESLint Rule into Repository
Summary:
Moves the `no-haste-imports` ESLint rule into the React Native repository because it was only intended to be used for internal development of React Native.

This will change `react-native/eslint-plugin` to no longer provide the `no-haste-imports` rule.

Changelog:
[General][Removed] - `react-native/eslint-plugin` no longer provides the `no-haste-imports` rule.

Reviewed By: lunaleaps

Differential Revision: D39858883

fbshipit-source-id: b8d91ce5996b615341cf60c6f839afac1e26dac9
2022-09-27 14:37:29 -07:00