Commit Graph

28866 Commits

Author SHA1 Message Date
Moti Zilberman a04a91838f Fork jsinspector as jsinspector-modern (#39288)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39288

Forks `ReactCommon/jsinspector` → `ReactCommon/jsinspector-modern`.

The Gradle, CocoaPods and Buck builds of React Native have been updated to use `jsinspector` everywhere (outside of `ReactCommon/hermes/inspector`, which is itself dead code as of D48897203). The code in `ReactCommon/jsinspector` is thus deprecated and unused in the open source build, and will be deleted in an upcoming diff (likely before the 0.73 cut).

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D48966244

fbshipit-source-id: db81739da83ef9be73690d95d010065e3b3441c7
2023-09-05 12:47:52 -07:00
Carmen Krol 79b293ea33 Fix announcement issue with Switch (#39298)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39298

Previously, switches were being announced using Talkback in this order: [state][role][label] but they should be announced as [state][label][role].

Reviewed By: NickGerleman

Differential Revision: D48807314

fbshipit-source-id: e827b9ca6d3b61b5bd2884f0f0ce6ddae00bb7df
2023-09-05 10:33:01 -07:00
Arushi Kesarwani a13d463a59 Internal summary in pods (#39266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39266

Changing the summary in internal pods as per suggestions in D48789176

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D48921731

fbshipit-source-id: cce2a59d5424ac959dd1c78e718d3d060ef94a2e
2023-09-05 09:21:49 -07:00
Nick Gerleman a410ef97f6 Only disable throttling when scrollEventThrottle isn't set (#39293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39293

This QE is meant to change behavior to not throttle if `scrollEventThrottle` isn't set, but it's actually disabling throttling entirely.

This changes the gating to instead change the initialization path to set `_scrollEventThrottle = 0` when the QE is set.

`_scrollEventThrottle` is already set to zero when the `scrollEventThrottle` prop is removed/set to null, as the default value in ScrollViewProps.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D48968754

fbshipit-source-id: c46c7f5093a60e326267c2e5f2f86dc2d545ac7f
2023-09-05 09:02:19 -07:00
generatedunixname89002005325672 c8d72156bc Daily arc lint --take KTFMT (#39297)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39297

Changelog: [Internal]

Reviewed By: hick209

Differential Revision: D48950527

fbshipit-source-id: be72dd01318de23700570d2b135d550ae1ec5743
2023-09-05 08:52:56 -07:00
Pieter De Baets 242c835c42 Fix backfaceVisibility after transform changes (#39294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39294

Because we now apply the transform property after all properties have been applied, the [custom logic we have for backfaceVisibility](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java#L1004) no longer applied correctly.

Changelog: [Fixed] backfaceVisibility is correctly applied again after the transform changes.

Reviewed By: fabriziocucci

Differential Revision: D48968421

fbshipit-source-id: f94793f4c14fe0ecf686408ac41d7163c78dbc35
2023-09-05 08:29:33 -07:00
Nick Gerleman d468d9d57f C++ Cleanup 10/N: YGNodeCalculateLayout (#39195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39195

X-link: https://github.com/facebook/yoga/pull/1352

## This diff

This splits out all of the logic under `YGNodeCalculateLayout` to a couple of different files, does some mechanical renaming, and starts to split up the implementation a tiny bit. After this, core layout functions are all C++ convention and namespaced.

Each new file is marked as a move for the sake of blame history. It means Phabricator has a very inaccurate count of lines removed though.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

Reviewed By: rshest

Differential Revision: D48770478

fbshipit-source-id: 2a74b86441c3352de03ae193c98fc3a3573047ed
2023-09-05 05:24:54 -07:00
antliann deb81853f5 Add missing type for TextInput.readOnly in Typescript (#39281)
Summary:
The `readOnly` prop is available in the `TextInput` implementation (see [usage https://github.com/facebook/react-native/issues/1](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/TextInput/TextInput.js#L1646), [usage https://github.com/facebook/react-native/issues/2](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/TextInput/TextInput.js#L1671)), but the corresponding Typescript type is currently missing. Those who use Typescript get an invalid prop error when using the `readOnly` prop on `TextInput`.

Having this prop type included in TypeScript would fix the bug above and also would be beneficial for consistency and comprehensive type support.

Notably, this prop is also included in the Flow types [here](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/TextInput/TextInput.flow.js#L814).

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Add missing type for TextInput.readOnly in Typescript

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

Test Plan: N/A

Reviewed By: rshest

Differential Revision: D48955477

Pulled By: NickGerleman

fbshipit-source-id: 9d3431351b8ad65a4d2fc57939b98c167dc70cee
2023-09-05 04:57:52 -07:00
Riccardo Cipolleschi 735f4ed62a Fix use_hermes condition in React-Core (#39262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39262

The use_hermes condition in React core was imprecise as using hermes is the default now. So, if USE_HERMES is not defined, then we are using hermes.

## Changelog:
[iOS][Fixed] - Use the right condition in React-Core for USE_HERMES.

Reviewed By: dmytrorykun

Differential Revision: D48907854

fbshipit-source-id: daeaa1782f23e0ab3992240e70f49ff0b2fd75de
2023-09-05 04:08:02 -07:00
Riccardo Cipolleschi 89dfc082fd Allow to control flipper with an Env var (#39261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39261

This change allow us to control whether we want to install flipper or not in RNTester using an env var.
This is just a simple quality of life change to speed up local testing.

## Changelog:
[Internal] - Allow to control whether to install Flipper or not from an env variable

Reviewed By: dmytrorykun

Differential Revision: D48907743

fbshipit-source-id: ef0f9362890e2d66be55018622f9b3bf9620bd95
2023-09-05 04:08:02 -07:00
Intl Scheduler 4bc089a93d translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940863070
Sandcastle Job Instance ID: 13510799920495023
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48956847

fbshipit-source-id: eb143f2959dbbfb1de83e2162d2b811d0bb7061e
2023-09-04 14:41:01 -07:00
Moti Zilberman 3ec22c1e69 Add option to enable experimental debugger frontend (#39227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39227

Changelog: [Internal]

1. Adds an `unstable_experiments` option to `createDevMiddleware` in `react-native/dev-middleware`.
2. Adds `enableCustomDebuggerFrontend` (default `false` for now) as an experiment flag controlling whether the new debugger frontend (D48680624, D48682302) is in use. We plan to enable this by default in RN 0.73 after additional testing.

If enabled, the new debugger frontend will only be used for the `/open-debugger` flow

Reviewed By: huntie

Differential Revision: D48602725

fbshipit-source-id: 598865b559478df1f19420daf3633ee6c233362a
2023-09-04 12:21:47 -07:00
Nick Gerleman b7d2d2cd4b C++ Cleanup 9/N: YGAssert (#39201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39201

X-link: https://github.com/facebook/yoga/pull/1353

## This diff

This moves and renames `YGAssert`, and removes it from the public API, since external users should not need to call into internal Yoga assert functions, and the current API prevents us from making this a macro later to include the condition in the message.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

Reviewed By: rshest

Differential Revision: D48769809

fbshipit-source-id: b5480ac54781bc01b00c158b07d2d751fac87d37
2023-09-04 11:20:17 -07:00
Nick Gerleman 51572cea11 C++ Cleanup 8/N: Yoga-internal (#39198)
Summary:
X-link: https://github.com/facebook/yoga/pull/1355

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

## This diff

This splits up `Yoga-internal.h` which has become a grab bag. The actual header is left, with the purpose of being a private C ABI for bindings, but everything else is moved to a place more appropriate or removed.

A few notes:
1. `yoga::isUndefined` is replaced with `std::isnan` to avoid a layer of indirection (we will never be able to change its representation anyway). Internal usages of `YGFloatIsUndefined` are also replaced with `std::isnan` since the previous being at a library boundary means I'm not sure it can be inlined/.
2. `leading`, `trailing` arrays are factored into proper functions
3. `Values` is replaced entirely with `std::array`, since most of it was unused.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

Reviewed By: rshest

Differential Revision: D48769241

fbshipit-source-id: 5b8e2192309539e7c133c3b3b29b445b59dd5835
2023-09-04 11:20:17 -07:00
Nick Gerleman d2e91599c8 PointerAlignment: Left
Summary:
This changes Clang format config to enforce left pointer alignment instead of right, in accordance with https://www.internalfb.com/intern/wiki/Cpp/CppStyle/

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D48952040

fbshipit-source-id: 108329b2f11d2041a31dee3334c7801d69a3f1ad
2023-09-04 10:55:18 -07:00
Alex Hunt 321f7dbcad Add 'j' to debug key handler (#39256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39256

## Context

RFC: Decoupling Flipper from React Native core: https://github.com/react-native-community/discussions-and-proposals/pull/641

## Changes

- Adds `j` key handler to open JS debugger (mirroring Expo CLI).
- Updates `isDevServerRunning` to consider server scheme and host.
- Reorders key prompts.

Changelog:
[General][Changed] Add 'j' to debug key trigger from CLI

Reviewed By: motiz88

Differential Revision: D48873335

fbshipit-source-id: e3f208522c19857c565fa73f8b81d646a7e4ff31
2023-09-04 06:36:42 -07:00
Alex Hunt f688a2d4be Update /open-debugger to try first target when unspecified (#39255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39255

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D48873336

fbshipit-source-id: 8d3aac383de1cefa303a89fbfee9a23ce906a979
2023-09-04 06:36:42 -07:00
Ales Pergl 054ab62be0 Fix building Android on Windows (#39190)
Summary:
Currently Android fails to build on Windows, because CMake cannot work with
native Windows paths that are passed to it as build arguments. This change
converts the input paths to the CMake format.

## Changelog:

[Android] [Fixed] - Fix building Android on Windows.

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

Test Plan: Build the React Native Android project on Windows. It should complete successfully.

Reviewed By: NickGerleman

Differential Revision: D48948140

Pulled By: cortinico

fbshipit-source-id: 6d584c2a10e683cdb6df0dd6dcd5875da7e06e2b
2023-09-04 05:28:46 -07:00
Oskar Kwaśniewski 7f26b088b2 Convert ColorUtilTest to Kotlin (#38979)
Summary:
Converts ColorUtilTest to kotlin as requested in https://github.com/facebook/react-native/issues/38825

## Changelog:

[INTERNAL] [CHANGED] - Convert ColorUtilTest to Kotlin

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

Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test`.
2. All tests should pass.

Reviewed By: fkgozali, cortinico, arushikesarwani94

Differential Revision: D48802302

Pulled By: mdvacca

fbshipit-source-id: 876caf288bd5df1e1fdc4b0b20b41afdfacf364f
2023-09-04 04:29:05 -07:00
Broda Noel 83885f1d69 Update Image.d.ts (#39230)
Summary:
I've seen that this throws a warning:
```
<ImageBackground source={{ uri: undefined }}>
```

But this is properly working, without a warning, thus, I believe the code is allowing it:
```
<ImageBackground source={isLoading ? undefined : { uri: 'https://....' }}>
```

## Changelog:

[GENERAL] [CHANGED] - Fixed `source` in `Image` type

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

Test Plan: Not necessary. It's just a DOC change

Reviewed By: rshest

Differential Revision: D48939824

Pulled By: NickGerleman

fbshipit-source-id: fca2e07b7b4d4b947e365bb9d82fcf4cea484951
2023-09-04 03:05:40 -07:00
Moti Zilberman 4dea63530f Fork ReactCommon/hermes/inspector as inspector-modern (#39253)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39253

X-link: https://github.com/facebook/hermes/pull/1112

Changelog: [Internal]

Forks `ReactCommon/hermes/inspector` → `ReactCommon/hermes/inspector-modern`. More changes to `inspector-modern` will come in subsequent diffs.

The Gradle, CocoaPods and Buck builds of React Native have been updated to use `inspector-modern` everywhere. The code in `ReactCommon/hermes/inspector` is thus **deprecated** and unused in the open source build, and will be deleted in an upcoming diff (likely before the 0.73 cut).

NOTE: The reason we're not immediately deleting `ReactCommon/hermes/inspector` is that there are a handful of references to it in Meta's internal monorepo (*outside of React Native*) that we are in the process of migrating away. Once we've deleted the existing `ReactCommon/hermes/inspector`, we *may* rename `inspector-modern` back to `inspector`.

Reviewed By: blakef

Differential Revision: D48897203

fbshipit-source-id: 13682747d280a3231b7f6bce560f25ad174304e9
2023-09-04 02:48:02 -07:00
Intl Scheduler 152afe9244 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940832858
Sandcastle Job Instance ID: 13510799920053222
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48941197

fbshipit-source-id: 41d203e41df61c743f2372fe84c3eb9756bb04ba
2023-09-03 19:16:09 -07:00
Yedidya Feldblum 041f459d8c forward-compatible use of u8"..." strings (#39264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39264

X-link: https://github.com/facebook/hermes/pull/1113

Since C++20, the type of a `u8"..."` string literal is `const char8_t[N]` whereas prior to C++20 the type is `const char[N]`. `char8_t` has the same size, alignment, and signedness as `unsigned char` but is a different type from `unsigned char`, as well as being a different type from `signed char` and from `char`.

In context, the uses of the `u8"..."` expect `const char*` (to which `const char[N]` decays) and not `const char8_t*` (to which `const char8_t[N]` decays). To fit the string to the context since C++20, we must `reinterpret_cast` to `const char*`; this is a type-level no-op prior to C++20.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D48908076

fbshipit-source-id: e68d8fc4ff9dfb9528846901e37e2775c2b98866
2023-09-02 16:23:34 -07:00
Intl Scheduler 7a0d2a06fb translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907940766435
Sandcastle Job Instance ID: 22517999172097970
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D48929200

fbshipit-source-id: 0a19658d278a4832a5defaba85c3f7c4f589167a
2023-09-02 01:01:49 -07:00
Peter Xu b0a9053e67 Update typings for StyleSheet.create to catch typos in style keys (#39225)
Summary:
Previously, when you tried to create some styles using `StyleSheet.create`, you can create styles with invalid styles:

```ts
const styles = StyleSheet.create({
  container: {
    marginLeft: 1,
    magrinRight: 1, // This is a typo, but would not cause typecheck errors
  },
});
```

The root cause is that Typescript uses a looser [Excess Property Checks](https://www.typescriptlang.org/docs/handbook/2/objects.html#excess-property-checks) if we're using template types rather than using the actual specific types in the function signature.

- https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/62481

## Changelog:

[INTERNAL] [FIXED] - Make StyleSheet.create better check property keys for typos

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

Test Plan: Added a test in __typeTests__, which should get run by CI.

Reviewed By: rshest

Differential Revision: D48859679

Pulled By: NickGerleman

fbshipit-source-id: 43aa69cf85cd69353d053b782dba73ab2027eb64
2023-09-01 21:40:37 -07:00
Jacob Parker 5f40f0800e Implement transform-origin for old arch iOS (#38626)
Summary:
Adds transform-origin for old arch iOS

See also intergalacticspacehighway's work for iOS Fabric and Android:-

- https://github.com/facebook/react-native/pull/38559
- https://github.com/facebook/react-native/pull/38558

## Changelog:

[IOS] [ADDED] - Added support for transform-origin on old arch

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

Test Plan: See RN tester

Reviewed By: NickGerleman

Differential Revision: D48528353

Pulled By: javache

fbshipit-source-id: 09592411e26484d81a999a7e601eff751ca7ae0b
2023-09-01 13:03:50 -07:00
Nishan 9e68599daf feat: android transform origin (#38558)
Summary:
This PR adds transform-origin support for android to make it easier to review. https://github.com/facebook/react-native/pull/37606#pullrequestreview-1513082850 by javache. I'll answer feedback from javache below.

## Changelog:
[Android] [ADDED] - Transform origin
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan: Run iOS RNTester app in old architecture and test transform-origin example in `TransformExample.js`.

Reviewed By: NickGerleman

Differential Revision: D48528339

Pulled By: javache

fbshipit-source-id: e255a7f364e57396dada60b2c69c724cec406f51
2023-09-01 13:03:50 -07:00
Nishan 177ef21ea2 feat: ios fabric transform origin (#38559)
Summary:
This PR adds transform-origin support for iOS fabric. This PR also incorporates feedback/changes suggested by javache in the original [PR.](https://github.com/facebook/react-native/pull/37606)

## Changelog:
[IOS] [ADDED] - Fabric Transform origin
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan: Run iOS RNTester app in old architecture and test transform-origin example in `TransformExample.js`.

Reviewed By: NickGerleman

Differential Revision: D48528363

Pulled By: javache

fbshipit-source-id: 347b7c5896ad19ad24278de81b0e055e4cb01016
2023-09-01 13:03:50 -07:00
Pieter De Baets a69bc7f1fd Simplify shadow node fragment placeholders (#39239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39239

We can avoid static guards and heap allocation memory by forcing a default initialized shared_ptr (which is constexpr), and telling the compiler to not bother with registering a destructor, as these shared_ptr will never hold a value.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D48867013

fbshipit-source-id: c31f535bb19382878c9f21d7145188bd91b63265
2023-09-01 09:53:57 -07:00
Arushi Kesarwani 2b98cda74e Bridgeless -> Runtime in iOS (#39248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39248

`Bridgeless` -> `Runtime` in .podspec

changelog: [internal] internal

Reviewed By: fkgozali, cipolleschi

Differential Revision: D48789176

fbshipit-source-id: bc656097e0274c7381e66117d91e7300d5c6f6c4
2023-09-01 09:45:48 -07:00
Ethan Gill 92d8428644 Remove superfluous JSI import? (#39247)
Summary:
Seems to be invalid given the other jsi import
Pull Request resolved: https://github.com/facebook/react-native/pull/39247

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D47380384

fbshipit-source-id: 226a3e213176e50b4c882b5ea3f10c57130bd494
2023-09-01 08:01:28 -07:00
Tomasz Sapeta a2dc4d70fa Fix downloading hermes for nightlies (#39243)
Summary:
https://github.com/facebook/react-native/pull/38963 introduced a regression that breaks downloading hermes tarball for nightlies. It fails with the following error when running `pod install`:

```
Fetching podspec for `hermes-engine` from `../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[!] Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined local variable or method `react_native_path' for Pod:Module
Did you mean?  react_native_post_install.
```

The root cause is that the `download_nightly_hermes` method was just not implemented.

## Changelog:

[IOS] [FIXED] - Fixed downloading hermes tarball for nightlies

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

Test Plan: After applying these changes, `pod install` in my project no longer fails and downloads the tarball correctly.

Reviewed By: dmytrorykun

Differential Revision: D48897925

Pulled By: cipolleschi

fbshipit-source-id: a504f01b739862bd092f22bca1f240f6df3a6df8
2023-09-01 06:38:45 -07:00
Rob Hogan 5c513cb2f8 Register Babel in Jest setup to load transformer (#39251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39251

As `react-native/babel-preset` is extended to include parts of codegen (written in Flow) via `react-native/babel-plugin-codegen`, we need to register Babel (with a Node JS config) in order to load the `react-native/babel-transformer` that Jest needs to transform RN code when running from source.

(This is *only* relevant to running from source, ie internally at Meta or when developing on a clone of the OSS repo)

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D48871440

fbshipit-source-id: 2f206b2380d67007e37782f211a6e831b35291f8
2023-09-01 04:43:41 -07:00
Elżbieta Berger aa2a0c1115 New RNtester e2e tests (#39117)
Summary:
The motivation was to create more e2e tests that test other components in the RNTester app.
The list of components that have been tested is below:

| Component|Test is added|Platform|
| :---        |    :----:   |---: |
|DrawerLayoutAndroid|NO|Android|
|ActivityIndicator|YES|iOS & Android|
|Button|YES|iOS & Android|
|FlatList|YES|iOS & Android|
|Image|NO|iOS & Android|
|JSResponderHandler|YES|iOS & Android|
|InputAccessoryView|NO|iOS|
|KeyboardAvoidingView|YES|iOS & Android|
|Modal|YES|iOS & Android|
|New App Screen|YES|iOS & Android|
|Pressable|YES|iOS & Android|
|RefreshControl|YES|iOS & Android|
|ScrollView|NO|iOS & Android|
|ScrollViewSimpleExample|YES|iOS & Android|
|SafeAreaView|NO|iOS|
|ScrollViewAnimated|NO|iOS & Android|
|ScrollViewIndicatorInsets|NO|iOS|
|SectionList|NO|iOS & Android|
|StatusBar|NO|iOS & Android|
|SwipeableCard|NO|iOS & Android|
|Switch|NO|iOS & Android|
|Text|NO|iOS & Android|
|TextInput|NO|iOS & Android|
|Touchable* and onPress|NO|iOS & Android|
|TextInputs with key prop|NO|Android|
|TransparentHitTestExample|NO|iOS|
|View|NO|iOS & Android|
|New Architecture Examples|NO|iOS & Android|
|Performance Comparison Examples|NO|iOS & Android|

## Changelog:

[General] [Added] - Added next component tests for RNTester

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

Test Plan:
Follow Readme file.

## Test Result:

For iOS platform:<br>
![Screenshot 2023-08-22 at 18 08 28](https://github.com/facebook/react-native/assets/19895261/c9d0ef78-ae31-487f-aa53-4c299fefef6a)

For Android platform:<br>
![Screenshot 2023-08-22 at 18 13 47](https://github.com/facebook/react-native/assets/19895261/db661c95-1cf9-4e1a-b02f-4a6141313719)

Reviewed By: yungsters

Differential Revision: D48828525

Pulled By: cipolleschi

fbshipit-source-id: dfe7cc9871666a6b5c0704a207ca1eeb65f50114
2023-09-01 03:24:30 -07:00
Ethan Gill 70fe5fc870 Delete unused CppComponentRegistry.java (#39246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39246

Appears to no longer be used

Reviewed By: boxinYang

Differential Revision: D48872901

fbshipit-source-id: 3fd376b30304a1dc643ef77ffa503376dbbab7e7
2023-08-31 20:02:29 -07:00
Xin Chen c99c653398 Add PerformanceStatsHistory to perf monitor overlay (#39202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39202

This diff adds `PerformanceStatsHistory.kt` which is used to track performance stat in buckets with resolution (in ms) and size. This is to help group perf stats in a time series data structure that we can adapt to any visualization in the future.

Changelog:
[Internal] - Performance monitoring overlay improvements

Reviewed By: rshest

Differential Revision: D48657874

fbshipit-source-id: 3e3fe7c50db6672b1eff117a36f0de72a774fc96
2023-08-31 14:26:26 -07:00
Alex Hunt a5fd0f17e9 Revert to built-in devToolsFrontendUrl in target list (#39242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39242

Reverts external behaviour of https://github.com/facebook/react-native/pull/39122.

- `/json/list` once again returns the built-in `devtools://devtools/bundled/js_app.html` URL — effectively freezing the current experience in Flipper.
- `/open-debugger` continues to use the *new* frontend via `getDevToolsFrontendUrl`.
    - *Eventually*, we'll want to align this as the returned `devtoolsFrontendUrl` value once Flipper is out of the picture.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D48868767

fbshipit-source-id: 088ecebffa6ce45cb9bed44e3b02df4b7b471068
2023-08-31 09:36:00 -07:00
Moti Zilberman 0cd5648155 Fix up missing index.js in files (#39244)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39244

Changelog: [Internal]

TSIA. Fixup from D48680624.

#publish-packages-to-npm

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D48869800

fbshipit-source-id: 40733d09f9423232b4b5adb120bf268f8f7e4994
2023-08-31 09:19:52 -07:00
Dmitry Rykun 17df951fe9 Remove unused code from setup_hermes function (#39238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39238

This does nothing useful. Let's get rid of it.
Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D48833211

fbshipit-source-id: 0b6937f83148bb2ddc66212d2669e72887430364
2023-08-31 08:40:04 -07:00
Moti Zilberman 482207f602 Initial sync of debugger-frontend (#39226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39226

Changelog: [Internal]

Syncs a custom build of the Chrome DevTools frontend (performed using the script in D48680624) into the `react-native/debugger-frontend` package. **The package is not used anywhere yet.** In a subsequent diff, it will be integrated into `react-native/dev-middleware`.

Review the `BUILD_INFO` file for information about the source revision and build settings that were used to generate this diff.

Reviewed By: huntie

Differential Revision: D48682302

fbshipit-source-id: 50ea532f45d8c751c141d5f4253afe080af31559
2023-08-31 08:34:33 -07:00
Moti Zilberman b27607f853 Add debugger-frontend package and manual build script (#39161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39161

Changelog: [Internal]

Creates a new stub package named `react-native/debugger-frontend`, which will contain a minimal build of the Chrome DevTools frontend adapted for React Native. Initially, the compiled frontend assets will be checked into the React Native repo, but we intend to replace this with a fully automated build in CI at a later date.

Reviewed By: huntie

Differential Revision: D48680624

fbshipit-source-id: a24c8b019881187963d0be88e773bc0a97a2437d
2023-08-31 08:34:33 -07:00
Pieter De Baets c66d570eb9 Re-enable LayoutableShadowNodeTest inversion tests (#39211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39211

Some tests were not running because they were disabled when experiment with `enableCalculateTransformedFrames`. Instead, run tests against both variants of the experiment so differences can be better understood.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D48826739

fbshipit-source-id: 5d6fd12e7ab396e4c2f6ee602cdc0aa47b8f45f3
2023-08-31 06:45:39 -07:00
Riccardo Cipolleschi 9552ed0ffc Persist Hermes MacOS Artifacts to Workspace Depending on Build Flavor (#39234)
Summary:
In some occasion, we have a race condition when:
- prepare hermes workspace has some artifacts but not all of them, and it store them to the workspace
- the pipeline rebuilds the missing artifacts
- the build_hermes_macos jobs tries to upload the pre-existing artifacts, uploading the whole folder.

So, for example, imagine that at the prepare_hermes_workspace time, we are able to restore both the `hermes-ios-release.tar.gz` and the `hermes-ios-debug.tar.gz`. When the two
concurrent `build_hermes_MacOS-Debug` and `build_hermes_MacOS-Release`, they will both try to upload both tars at the same time, and that results in the concurrent errors we
are seeing.

This change should fix this, by having the Debug job upload the Debug artifacts only and the Release jobs upload the Release artifacts only, so there will be no concurrent
upload of the same files.

## Changelog:

[Internal] - Upload Hermes macos artifacts depending on the Build flavor.

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

Test Plan: CircleCI stays green.

Reviewed By: GijsWeterings

Differential Revision: D48861430

Pulled By: cipolleschi

fbshipit-source-id: 02bd045cdb969ad1c173e78ffb42185c14ba171e
2023-08-31 03:46:50 -07:00
Nick Gerleman ce32d07ed9 C++ Cleanup 7/N: BitUtils (#39223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39223

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

X-link: https://github.com/facebook/yoga/pull/1351

## This diff

This splits up `BitUtils.h`, does some minor renaming, and namespace consistency fixes.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

bypass-github-export-checks

Reviewed By: shwanton

Differential Revision: D48847255

fbshipit-source-id: 4b9722303372f43e936118f8187c0127bceeb1d4
2023-08-31 01:17:39 -07:00
Nick Gerleman 12aca7bfd0 C++ Cleanup 6/N: YGFloatOptional (#39224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39224

X-link: https://github.com/facebook/yoga/pull/1356

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

## This diff

This renames YGFloatOptional to FloatOptional, adds it to a namespace, and moves it to a subdirectory. This needs Fabric updates because Fabric uses Yoga internals for props storage.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: shwanton

Differential Revision: D48847256

fbshipit-source-id: ab9729a4a02ab90d974183425935f4d274db5732
2023-08-31 01:17:39 -07:00
Nick Gerleman 5225250005 C++ Cleanup 5/N: Reorganize Utils (#39222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39222

X-link: https://github.com/facebook/yoga/pull/1357

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

## This diff

This splits `Utils.h` and `Utils.cpp`, and tweaks naming and namespaces.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

bypass-github-export-checks

Reviewed By: shwanton

Differential Revision: D48847260

fbshipit-source-id: b99df3029cd66257a7ae64de28c13e8751ceb20c
2023-08-31 01:17:39 -07:00
Nick Gerleman 4f755aa6e7 C++ Cleanup 4/N: Reorganize Log and YGNodePrint (#39220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39220

X-link: https://github.com/facebook/yoga/pull/1354

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

## This diff

Moves these files to a `yoga/debug` subdirectory and does some mild renaming, namespace adjustment, and removes Yoga internal log function from list of library exports.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

bypass-github-export-checks

Reviewed By: shwanton

Differential Revision: D48847259

fbshipit-source-id: c1607b1c6457d5a47039c735cdb7c365a301ebc0
2023-08-31 01:17:39 -07:00
Nick Gerleman 5b06ba7201 C++ Cleanup 3/N: Reorganize YGNode (#39219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39219

X-link: https://github.com/facebook/yoga/pull/1350

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

## This diff

This diff adds a top level `node` directory for code related to Yoga nodes and data structures on them (inc moving `YGLayout` to `LayoutResults`).

The public API for config handles is `YGNodeRef`, which is forward declared to be a pointer to a struct named `YGNode`. The existing `YGNode` is split into `yoga::Node`, as the private C++ implementation, inheriting from `YGNode`, a marker type represented as an empty struct. The public API continues to accept `YGNodeRef`, which continues to be `YGNode *`, but it must be cast to its concrete internal representation at the API boundary before doing work on it.

This change ends up needing to touch quite a bit, due to the amount of code that mixed and matched private and public APIs. Don't be scared though, because these changes are very mechanical, and Phabricator's line-count is 3x the actual amount due to mirrors and dirsyncs.

## This stack

The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers

This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes

This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.

These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: shwanton

Differential Revision: D48847258

fbshipit-source-id: fc560893533b55a5c2d52c37d8e9a59f7369f174
2023-08-30 19:57:16 -07:00
Nick Gerleman a966291611 Consistent QualifierAlignment (for real this time I swear) (#39217)
Summary:
(reland of D48761722)

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

React Native uses an inconsistent mix of "west const" and "east const". E.g. `const auto &` in 74 files, but `auto const &` in 60. Sometimes they are mixed from one line to the next:  {F1079102436}

Clang format 14 adds a QualifierAlignment option, but fbsource is still on 12, so we cannot use it in our config until the [world is updated]()https://fb.workplace.com/groups/toolchain.fndn/posts/24006558685624673/?comment_id=24009214565359085&reply_comment_id=24009455088668366. This diff just runs a local version of Clang format locally first to fix QualifierAlignment, then reformats with the fbsource version, to fix any other output differences unrelated to that. This will not continually enforce a style, but will make the world more consistent, and hopefully encourage a consistent style until we can set it.

West const seems more popular in `//xplat` so I just picked left alignment somewhat arbitrarily, but we could also maybe take a poll on this.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: shwanton

Differential Revision: D48852450

fbshipit-source-id: 1789aa0db43948169f482188cb8b5e8f0f0246b8
2023-08-30 19:56:13 -07:00
Nick Gerleman 6d05aa54bf Remove extra QualifierAlignment
Summary: Accidentally left erroneously

Reviewed By: shwanton

Differential Revision: D48851833

fbshipit-source-id: a7f4436e9283148585f9b2b1596f4afc64c4f4b5
2023-08-30 16:39:12 -07:00