Commit Graph

38536 Commits

Author SHA1 Message Date
Phillip Pan 2599cc6b1f decouple RCTDevLoadingView from RCTBundleManager
Summary:
Changelog: [Internal]

not used, remove

Reviewed By: cipolleschi

Differential Revision: D45756364

fbshipit-source-id: e825efba6adc45b3ff3b39d2e9c5a8fd95eec4a1
2023-05-11 20:51:46 -07:00
Phillip Pan 2acd5c0329 remove jsErrorHandlingFunc from constructor of RCTHost
Summary:
Changelog: [Internal]

after D45720132, we don't need this!

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D45720130

fbshipit-source-id: dd3d8a5bd95faffefb94264d67dfb785dff50ade
2023-05-11 18:58:13 -07:00
Phillip Pan d1348f6ba4 parse js error response in RCTHost and pass it to delegate (#37344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37344

Changelog: [Internal]

in this diff we do the following:
- pass an error handler that's responsible for bubbling up the error metadata from the react instance obj-c wrapper (RCTInstance) to the actual react instance (ReactInstance)
- parse the error metadata in RCTHost and pass it up to its delegate

Reviewed By: cipolleschi

Differential Revision: D45720132

fbshipit-source-id: 996c7c43ed6feb72596296eedac18e204b960426
2023-05-11 18:58:13 -07:00
Phillip Pan 1374e6b89d introduce callback path for js errors (#37343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37343

Changelog: [Internal]

in this stack i address the `jsErrorHandlingFunc` argument in the constructor of `RCTHost`.

currently in userland, the delegate of `RCTHost` is responsible for the following if they want to handle the errors fired in C++ land:
- importing the C++ class MapBuffer
- creating a C++ lambda method
- parsing the MapBuffer

in this diff stack i simplify this so we only need to implement a delegate method where userland only receives Foundation types. yay!

bypass-github-export-checks

Reviewed By: RSNara

Differential Revision: D45720131

fbshipit-source-id: b5541abe505140b4b85cbec1a8acecc1a3df7a72
2023-05-11 18:58:13 -07:00
Samuel Susla a239827a57 Fix MobileConfig react_fabric:enable_text_measure_cache (#37400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37400

changelog: [internal]

This diff wires up MobileConfig `react_fabric:enable_text_measure_cache` and remove unnecessary header include.

Reviewed By: christophpurrer

Differential Revision: D45779990

fbshipit-source-id: 47b28569c83bbdfeb20b606219361ec085ad1f7f
2023-05-11 18:55:10 -07:00
Luna Wei f9bf14d09d Make the fabric-only CSS aliases experimental (#37338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37338

Changelog: [General] [Changed] - Change the way types for New Architecture/experimental APIs are exposed.

Reviewed By: NickGerleman

Differential Revision: D45699522

fbshipit-source-id: 9265ce0c0964bf2e967624cb4d81c2c8a58cfbe7
2023-05-11 18:17:10 -07:00
Phillip Pan 2668f5016c move registerSegmentWithId: to internal APIs (#37398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37398

Changelog: [Internal]

in this diff, i introduce an internal category and header for RCTHost for functionality that needs to be accessible for our purposes, but not an official part of our stable API.

after this change, we can remove `ReactInstanceForwarding`.

Reviewed By: cipolleschi

Differential Revision: D45760091

fbshipit-source-id: 88a82fc70a20934f5d8989041c3eb2ffe2d27b20
2023-05-11 15:13:03 -07:00
Phillip Pan 0ccc98d894 move callFunctionOnJSModule to public api (#37399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37399

Changelog: [Internal]

in this stack, i remove the `ReactInstanceForwarding` protocol. it is super lean and is only used by two classes, and the polymorphic behavior never comes into play because we never have a pointer to `id<ReactInstanceForwarding>` in our codebase.

being able to call into JS from native is tablestakes behavior in userland, so i'm moving that to the public API. i also renamed it to be more clear that it's calling from native into JS, not the other way around.

Reviewed By: cipolleschi

Differential Revision: D45760090

fbshipit-source-id: 8ac99723796cb65891076e8e7d69aeefe3e94213
2023-05-11 15:13:03 -07:00
Nick Gerleman 92fc503d56 Make jni_YGNodeDeallocateJNI call YGNodeDeallocate (#37388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37388

Fixes https://github.com/facebook/yoga/issues/1271

Updating this glue was missed in D45556206 when moving from one revision to the other...

Reviewed By: yungsters

Differential Revision: D45780647

fbshipit-source-id: 4ca64bc9971d3e4697990e73b618a3dc91df259b
2023-05-11 13:30:49 -07:00
Intl Scheduler a26fa1d3e0 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907877051285
Sandcastle Job Instance ID: 9007200199197480
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45789596

fbshipit-source-id: 8ceae93cec037388020f94740644cd4542d08da0
2023-05-11 13:08:20 -07:00
Intl Scheduler 7513f6fff6 translation auto-update for i18n/instagram.config.json on master
Summary:
Chronos Job Instance ID: 1125907877051285
Sandcastle Job Instance ID: 9007200199197480
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45789601

fbshipit-source-id: 727efc6c673daadd9783fe8d068ed3386cd7a8b2
2023-05-11 13:08:20 -07:00
Intl Scheduler a0b151f031 translation auto-update for i18n/twilight.config.json on master
Summary:
Chronos Job Instance ID: 1125907877051285
Sandcastle Job Instance ID: 9007200199197480
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45789599

fbshipit-source-id: cd0f7599c1b9b752dbd819fb065df3cc4ebcc0a0
2023-05-11 13:08:20 -07:00
Nick Gerleman 99674b360a Enable -Wextra in C++ builds (#37383)
Summary:
X-link: https://github.com/facebook/yoga/pull/1294

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

Add -Wextra to the build, and fixup some more instances of -Wunused-parameter that it sufaces which were not automatically fixable.

Reviewed By: javache

Differential Revision: D45772846

fbshipit-source-id: 29bf71006f63161521fe5869c3a7d8bf7aae9c81
2023-05-11 09:43:36 -07:00
Nick Gerleman b38383ab02 Apply fixes from clag-tidy misc-unused-parameters (#37384)
Summary:
X-link: https://github.com/facebook/yoga/pull/1293

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

Gets the project mostly clean of `-Wunused-parameter`, part of `-Wextra`.

Reviewed By: yungsters

Differential Revision: D45772554

fbshipit-source-id: db4c4d2bd222debef178c4c16f7b60fb6c8db2a2
2023-05-11 09:43:36 -07:00
Nick Gerleman 6764adafe4 Use reference Yoga CMake build for libyogacore (#37371)
Summary:
X-link: https://github.com/facebook/yoga/pull/1291

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

This makes React Native use `libyogacore` as provided by Yoga's reference CMake build. This in turn matches Yoga in the OSS RN build to the same compilation settings we use internally. It also means less differences between all the builds (maintainability win).

This does not yet do the same for the Yoga JNI bindings.

Changelog:
[Android][Changed] - Use reference Yoga CMake Build

Reviewed By: cortinico

Differential Revision: D45764537

fbshipit-source-id: 1aafd221d2afa994b6efae3c267ee7ffbdf0faad
2023-05-11 08:34:02 -07:00
Riccardo Cipolleschi f5759d7b5a Back out "Integrate TurboModuleManager with legacy module registration"
Summary:
Original commit changeset: 785240c51eb9

Original Phabricator Diff: D44647858

## Changelog:
[iOS][Fixed] - Revert [TM][iOS] Integrate TurboModuleManager with legacy module registration

Reviewed By: jacdebug

Differential Revision: D45773196

fbshipit-source-id: 9d1e8c463e599d0a38b982377ceb5c7aad0c806f
2023-05-11 05:39:12 -07:00
Riccardo Cipolleschi ad116dad16 Back out "Allow the TurboModule system to create legacy modules"
Summary:
Original commit changeset: be6f054556d1

Original Phabricator Diff: D45706884

## Changelog:
[iOS][Fixed] - Revert [TM][iOS] Allow the TurboModule system to create legacy modules

Reviewed By: jacdebug

Differential Revision: D45773198

fbshipit-source-id: ba6b6c136e74fde53af5c014d8223c4c7d1509db
2023-05-11 05:39:12 -07:00
Riccardo Cipolleschi dc913c1647 Back out "Introduce ObjCInteropTurboModule"
Summary:
Original commit changeset: 8b6162181504

Original Phabricator Diff: D44807334

## Changelog:
[iOS][Fixed] - Revert [TM][iOS] Introduce ObjCInteropTurboModule

Reviewed By: jacdebug, NickGerleman

Differential Revision: D45773200

fbshipit-source-id: f8eb1054e7d10e1bcfcfe4dd0477863a55f759a5
2023-05-11 05:39:12 -07:00
Riccardo Cipolleschi 003c175bdd Back out "Finish the JS side of the TurboModule interop layer"
Summary:
Original commit changeset: 14748b5efd73

Original Phabricator Diff: D45243456

## Changelog:
[iOS][Fixed] - Revert [TM][iOS] Finish the JS side of the TurboModule interop layer

Reviewed By: NickGerleman

Differential Revision: D45773199

fbshipit-source-id: c6eca141f80ba58e1212b94d3938456d5d2d20fb
2023-05-11 05:39:12 -07:00
Riccardo Cipolleschi 3f968c801e Back out "Setup: Route all TurboModules through interop layer"
Summary:
Original commit changeset: fc64ff74e1cb

Original Phabricator Diff: D45329537

## Changelog
[iOS][Fixed] - Revert TM][iOS] Setup: Route all TurboModules through interop layer

Reviewed By: javache

Differential Revision: D45773197

fbshipit-source-id: 62d7cadc7bfa94b413082f6dddb896105459eab4
2023-05-11 05:39:12 -07:00
Ken Tominaga 0212179293 Use buildPropSchema from parser-commons (#37043)
Summary:
> The `buildPropSchema` function in `parsers/typescript/components/props.js` and `parsers/flow/components/props.js` is the same. move it to `parser-commons` and use it in the original files.

part of https://github.com/facebook/react-native/issues/34872

- [x] Make the getTypeAnnotation signature from the Flow package to be equal to the typescript one. Specifically, the Typescript one needs an additional parameter withNullDefault that we can safely ignore in the implementation.
- [x] buildPropSchema signature can be updated to accept those two functions in input as callbacks. Then, the getProps function can feed the right functions based on the language to the shared build prop schema.

ref: https://github.com/facebook/react-native/issues/34872#issuecomment-1517519254

bypass-github-export-checks

## 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
-->

[Internal] [Changed] - Use `buildPropSchema` from parser-commons

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

Test Plan: - [ ] `yarn jest react-native-codegen` pass

Reviewed By: rshest

Differential Revision: D45209982

Pulled By: cipolleschi

fbshipit-source-id: c241bc0542ba662c965d70d1dc283f48541e14ea
2023-05-11 05:36:45 -07:00
Nick Gerleman 3de44e7d51 Add hasErrata(), addErrata(), removeErrata() (#37375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37375

Adds internal helpers to YGConfig to make bit manipulation more readable. We also expose `hasErrata()` to YGNode beacuse checking that will be a common pattern. We intentionally don't add mutating functions to the node, since current model is to inval a node on commiting whole config.

This is not exposed via the C ABI.

Reviewed By: yungsters

Differential Revision: D45765971

fbshipit-source-id: eadaee4b9cf5204ac4984ecc52cc08650d144a30
2023-05-11 05:30:57 -07:00
Nick Gerleman 65b792ce0b Dirsync yoga cmake directory (#37372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37372

For usage in shelling into the reference build. I separately looked at moving `cmake` to be inline inside of `yoga`, but this ends up having a worse structure than being at the top level.

I also cleaned up the dirsync naming to be more easy to understand.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D45764337

fbshipit-source-id: f810db5d6acc7c4c92003beb2ac3399bd78b9886
2023-05-11 03:05:24 -07:00
Nicola Corti 40f816d5bc Add scripts to yarn start and yarn android from root
Summary:
This adds script to better work with RN Tester from the root of the repo.
- `yarn start` is broken as of today
- `yarn android` is not working fine and I've adapter it here.

This should make easier to work with RN Tester from within the Repo.

Changelog:
[Internal] [Changed] - Add scripts to `yarn start` and `yarn android` from root

Reviewed By: mdvacca, cipolleschi

Differential Revision: D45735926

fbshipit-source-id: eaebf80b8819ee42ccb9c14b67f8945167bf05e6
2023-05-11 00:03:00 -07:00
Nick Gerleman 2952170402 Fix use-after-free if JNI Yoga nodes are garbage collected using multiple threads (#37243)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37243

X-link: https://github.com/facebook/litho/pull/944

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

Java bindings for Yoga rely solely on garbage collection for memory management. Each Java `YogaNode` has references to its children and parent Java Nodes. This means, for a node to be garbage collected, it cannot be reachable from any user accessible node. Each node then has single ownership of a `YGNodeRef`. When the `YogaNode` is garbage collected, a finalizer is run to call `YGNodeFree` and free the underlying native Yoga Node.

This may cause a use-after-free if finalizers are run from multiple threads. This is because `YGNodeFree` does more than just freeing, but instead also interacts with its parent and children nodes to detach itself, and remove any dangling pointers. If multiple threads run finalizers at once, one may traverse and try to mutate a node which another is freeing.

Because we know the entire connected tree is dead, there is no need to remove dangling pointers, so I want to expose a way to just free a Yoga Node, without it mutating the tree as a side effect.

This adds a currently private `YGNodeDeallocate` that frees without traversal. Ideally from naming this is what `YGNodeFree` would do, but we think changing the behavior of that might be too disruptive to OSS. At the same time there may be other memory safety related API changes we would like to eventually make, so this isn't made public beyond the JNI bindings to prevent needing to transition more APIs.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D45556206

fbshipit-source-id: 62a1394c6f6bdc2b437b388098ea362a0fbcd0f7
2023-05-10 22:52:48 -07:00
Tim Yung 72b88fca31 RN: Align Dependency Version Constraints (#37363)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37363

Revises some dependency version constraints.

Changelog:
[Internal]

Differential Revision: D45739399

fbshipit-source-id: f394740bf506eb31d165dd209cfd46a6df194d4b
2023-05-10 19:44:55 -07:00
Intl Scheduler 7bf9166883 translation auto-update for i18n/anna.config.json on master
Summary:
Chronos Job Instance ID: 1125907876716262
Sandcastle Job Instance ID: 22517999081446383
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45760772

fbshipit-source-id: 3bab832c46307ec900b363efc0208dc7830c43ea
2023-05-10 19:03:36 -07:00
Intl Scheduler ec8825f3ff translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907876716262
Sandcastle Job Instance ID: 22517999081446383
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45760765

fbshipit-source-id: ecbc420dad5eb7b5111557ce2dfc8007b77f770f
2023-05-10 19:03:36 -07:00
Intl Scheduler d4c8741c2d translation auto-update for i18n/analyticsapp.config.json on master
Summary:
Chronos Job Instance ID: 1125907876716262
Sandcastle Job Instance ID: 22517999081446383
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45760767

fbshipit-source-id: 1752e20eb3173838579feaba747fe21c9f1c6fed
2023-05-10 19:03:36 -07:00
Ramanpreet Nara 8b57d8c1db Setup: Route all TurboModules through interop layer (#37365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37365

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D45329537

fbshipit-source-id: fc64ff74e1cbe3031bc2c525f553a3906dd02a4a
2023-05-10 15:58:13 -07:00
Ramanpreet Nara 6efb144c53 Finish the JS side of the TurboModule interop layer (#37368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37368

## Changes
This diff hooks up global.nativeModuleProxy to the TurboModule interop layer.

Now, when you call NativeModules.Foo, the TurboModule system will create the Foo legacy module, and return it to JavaScript.

## Example
global.nativeModuleProxy.Foo:
- ObjC++: Use RCTTurboModuleManager to create the ObjC legacy module for Foo
- C++: Use the ObjC legacy modules to create and return a ObjCInteropTurboModule object to JavaScript.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D45243456

fbshipit-source-id: 14748b5efd73b95bbdddf28a4f7ed2a8e80e0788
2023-05-10 15:58:13 -07:00
Ramanpreet Nara f06632c83d Introduce ObjCInteropTurboModule (#37367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37367

## Changes
This diff introduces ObjCInteropTurboModule.

ObjCInteropTurboModule implements method dispatch for legacy native modules (i.e: modules that aren't schematized).

**Note:** This method dispatch relies on the RCT_EXPORT_METHOD macros, not the TurboModule system's C++ codegen.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D44807334

fbshipit-source-id: 8b6162181504ca9fbf8bf13a6951061936e0ff26
2023-05-10 15:58:13 -07:00
Ramanpreet Nara f8929f8d54 Allow the TurboModule system to create legacy modules (#37364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37364

When the TurboModule interop layer is enabled, it should create modules that conform to RCTBridgeModule (i.e: legacy and turbo modules).

When the TurboModule interop layer is disabled, it should only create modules that conform to RCTTurboModule (i.e: turbo modules).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D45706884

fbshipit-source-id: be6f054556d1506e2934884ab5014394f0c08e8f
2023-05-10 15:58:13 -07:00
Ramanpreet Nara 16a250eb13 Integrate TurboModuleManager with legacy module registration (#37366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37366

## Rationale
In Bridgeless mode, the TurboModule system needs to integrate with the legacy native module registration mechanisms.

That way, it knows what legacy native modules it's responsible for creating.

## Context
There are three ways to register native modules with the Bridge.

### A) Class loads (i.e: +load)
1. Write an [RCT_EXPORT_MODULE()](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/rn-tester/NativeComponentExample/ios/RNTMyLegacyNativeViewManager.mm?lines=25) macro in the module's implementation.
2. This macro [generates a +load](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridgeModule.h?lines=70%2C76-79) method on the native module class. When the ObjC runtime loads the native module class (during app start), it executes the class's +load method, which [inserts the native module class into a global array (i.e: RCTModuleClasses)](https://www.internalfb.com/code/fbsource/[daf070f990c6a701677f4db3de8bf6fd3d00c6a4]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridge.m?lines=43-44%2C58-61)
4. Then, when the application starts the bridge, the bridge [registers all these native module classes (in RCTModuleClasses) with itself](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=412).

### B) App provides modules eagerly (i.e: extraModulesForBridge)

1. The application provides an RCTBridgeDelegate to the Bridge. This delegate implements [extraModulesForBridge:](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridgeDelegate.h?lines=13%2C23%2C25-39)
2. The Bridge [registers these extra modules with itself](https://www.internalfb.com/code/fbsource/[574e410dcffbc900152cea60a50e750d833a2534]/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=389%2C410%2C412%2C799%2C804-805), when it starts up.

### C) App provides modules lazily (i.e: bridge:didNotLoadModule)
1. The application provides an RCTBridgeDelegate to the Bridge. This delegate implements [bridge:didNotFindModule:](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridgeDelegate.h?lines=13%2C23%2C57)
2. When module lookup fails on the bridge, the bridge [calls the delegate's bridge:didNotFindModule](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=585%2C618-619)
3. In this method, the delegate [loads the native module class from *somewhere*](https://www.internalfb.com/code/fbsource/[0f0f48a4723c830310c6e2c194822b6a5ba3000e]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1072%2C1074-1075), and [registers it with the bridge](https://www.internalfb.com/code/fbsource/[0f0f48a4723c830310c6e2c194822b6a5ba3000e]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1072%2C1083-1085)

## Changes
This diff integrates the TurboModule system with +loads and extraModulesForBridge.

It does not integrate with the lazy module registration mechanism, because I believe that mechanism isn't used in open source.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D44647858

fbshipit-source-id: 785240c51eb90f0f3e15304c25b5998b2069c2d2
2023-05-10 15:58:13 -07:00
Nick Gerleman 26983aed25 Rename directory "eslint-config-react-native-community" (#37347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37347

This fixes the file-structure of `eslint-config-react-native-communtiy`, and `eslint-plugin-react-native-communtiy` to match the name they were renamed to as part of 0.72.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D45721173

fbshipit-source-id: 7ad784dbf56fb4cd05d7dba608e6d5064392e43d
2023-05-10 15:46:34 -07:00
Nick Gerleman cae52f6cf8 Add @react-native/typescript-config (#37345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37345

This moves from `tsconfig/react-native`, a centralized repository of tsconfigs, to `react-native/typescript-config`, a package maintained as part of the RN monorepo.

We end up wanting to make changes where the versions are coupled, so this publishes them as part of the same repo, etc. It also means Meta engineers can more freely make changes to it with normal approval processes.

Changelog:
[General][Added] - Add react-native/typescript-config

Reviewed By: cortinico

Differential Revision: D45721088

fbshipit-source-id: b949bffb14014695abf3b9b359d3f5e30bfc8919
2023-05-10 15:46:34 -07:00
Intl Scheduler 61fc1a5796 translation auto-update for i18n/instagram.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746209

fbshipit-source-id: e18eafcbe3af8d4da604a1791cb8b9a1ce3bbde1
2023-05-10 12:51:36 -07:00
Intl Scheduler 1831b96d6a translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746196

fbshipit-source-id: d740bcf2947a71b23efe12037db08690786d8317
2023-05-10 12:51:36 -07:00
Intl Scheduler 9e27a422ec translation auto-update for i18n/barcelona.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746197

fbshipit-source-id: 3d977191a703acb48869cab6594c403c0e5430a8
2023-05-10 12:51:36 -07:00
Intl Scheduler 9ea1a38335 translation auto-update for i18n/adsmanager.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746207

fbshipit-source-id: b1c55462827bd7f1fe73929f95188b9e19387ebf
2023-05-10 12:51:36 -07:00
Intl Scheduler cdc7fbf656 translation auto-update for i18n/oculus-mirage.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746202

fbshipit-source-id: 380a4b06b6cd6e3c0328de272907b26aea755f59
2023-05-10 12:51:36 -07:00
Intl Scheduler 3fe23b6589 translation auto-update for i18n/pages-manager.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746198

fbshipit-source-id: 803734749fa1b4d49eae551c1b7b091ac0f0264a
2023-05-10 12:51:36 -07:00
Intl Scheduler 0d8b684f7f translation auto-update for i18n/creatorstudio.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746200

fbshipit-source-id: 88d361a964e645edafe7796ca76062083c88003a
2023-05-10 12:51:36 -07:00
Samuel Susla 757851607c Update scheduler package (#37295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37295

changelog: [internal]

Update scheduler package. It will use the native scheduler if available.

Reviewed By: cortinico, cipolleschi

Differential Revision: D45634886

fbshipit-source-id: f169a1e9ab12399a0e0d7bc5e9a19c27944db1d0
2023-05-10 11:20:03 -07:00
Lorenzo Sciandra 9aa25e6162 add 0.71.8 changelog (#37354)
Summary:
Adds changelog for new patch.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - add changelog entry for 0.71.8

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

Test Plan: N/A

Reviewed By: lunaleaps

Differential Revision: D45733332

Pulled By: cipolleschi

fbshipit-source-id: 0505378aef165f66361f6fc21128fa85f0ef5e32
2023-05-10 11:01:16 -07:00
kassens (Meta Employee) cbc28da666 Flow upgrade to 0.205.1 (#26796)
Summary:
Just a small upgrade to keep us current and remove unused suppressions
(probably fixed by some upgrade since).

- `*` is no longer allowed and has been an alias for `any` for a while
now.

DiffTrain build for commit https://github.com/facebook/react/commit/fda1f0b902b527089fe5ae7b3aa573c633166ec9.

Changelog: [Internal]

Reviewed By: tyao1

Differential Revision: D45695294

Pulled By: kassens

fbshipit-source-id: 1090328c30faf5ca8c22744f0b25ddf7fa60cd93
2023-05-10 09:02:50 -07:00
Mathieu Acthernoene 33e0521788 Add view getter on RCTRootView / RCTFabricSurfaceHostingProxyRootView (#37310)
Summary:
Hi 👋

During the [react-native-bootsplash](https://github.com/zoontek/react-native-bootsplash) implementation of the new architecture, I noticed a few thing regarding `RCTRootView` / `RCTFabricSurfaceHostingProxyRootView` compat.

Currently `RCTRootView` inherits from `UIView`, but `RCTFabricSurfaceHostingProxyRootView` does not, which this works:

```obj-c
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
                          moduleName:(NSString *)moduleName
                           initProps:(NSDictionary *)initProps {
  RCTRootView *rootView = (RCTRootView *)
      [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
  UIView *loadingView = [[storyboard instantiateInitialViewController] view];

  loadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  loadingView.frame = rootView.bounds;
  loadingView.center = (CGPoint){CGRectGetMidX(rootView.bounds), CGRectGetMidY(rootView.bounds)};
  loadingView.hidden = NO;

  [rootView addSubview:loadingView];

  return rootView;
}
```

But this doesn't:

```obj-c
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
                          moduleName:(NSString *)moduleName
                           initProps:(NSDictionary *)initProps {
  RCTFabricSurfaceHostingProxyRootView *rootView = (RCTFabricSurfaceHostingProxyRootView *)
      [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
  UIView *loadingView = [[storyboard instantiateInitialViewController] view];

  loadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  loadingView.frame = rootView.bounds;
  loadingView.center = (CGPoint){CGRectGetMidX(rootView.bounds), CGRectGetMidY(rootView.bounds)};
  loadingView.hidden = NO;

  [rootView addSubview:loadingView];

  return rootView;
}
```

Because `RCTFabricSurfaceHostingProxyRootView` is an imperfect proxy as it doesn't give access to the underlaying `UIView *`. As a solution, I added a prop on both: `UIView *view`

PS: I'm well aware that `setLoadingView` also exists in both files, but it's currently not usable as the current `isActivityIndicatorViewVisible` / `isSurfaceViewVisible` / `_activityIndicatorViewFactory` logic in `RCTSurfaceHostingView.mm` doesn't work: a situation where `isActivityIndicatorViewVisible == true && isSurfaceViewVisible == false && _activityIndicatorViewFactory != nil` never happen:

<img width="1162" alt="Screenshot_2023-05-06_at_18 10 18" src="https://user-images.githubusercontent.com/1902323/236883439-2256ddfb-7846-482a-b957-002a7d51a148.png">

## 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

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

Test Plan:
Add this block of code in `AppDelegate.mm`:

```obj-c
#import <React/RCTRootView.h>

#if __has_include(<React/RCTFabricSurfaceHostingProxyRootView.h>)
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#endif

// …

- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
                          moduleName:(NSString *)moduleName
                           initProps:(NSDictionary *)initProps {
#ifdef RCT_NEW_ARCH_ENABLED
  RCTFabricSurfaceHostingProxyRootView *rootView = (RCTFabricSurfaceHostingProxyRootView *)
#else
  RCTRootView *rootView = (RCTRootView *)
#endif
      [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

  // accessing the "real" root view on both arch
  UIView *view = rootView.view;

  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
  UIView *loadingView = [[storyboard instantiateInitialViewController] view];

  loadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  loadingView.frame = view.bounds;
  loadingView.center = (CGPoint){CGRectGetMidX(view.bounds), CGRectGetMidY(view.bounds)};
  loadingView.hidden = NO;

  [view addSubview:loadingView];

  return rootView;
}
```

It should persist the splash screen on both old and new architecture.

Reviewed By: sammy-SC

Differential Revision: D45688644

Pulled By: cipolleschi

fbshipit-source-id: b6f2fc8091a15189ea2eceb8ea426593f62674cb
2023-05-10 05:48:17 -07:00
LeoTM d2e446d98f Bump TypeScript in template from 4.8.4 to 5.0.4 (#36862)
Summary:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0

## Changelog:

[GENERAL] [CHANGED] - Bump TypeScript in template from 4.8.4 to 5.0.4 and ESLint pkgs from 8.19.0 to 8.38.0

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

Test Plan: Everything builds and runs as expected

Reviewed By: cortinico

Differential Revision: D45720238

Pulled By: NickGerleman

fbshipit-source-id: d38b60110434760fdedc84ad941e0918bb986a40
2023-05-10 02:55:42 -07:00
Intl Scheduler 7ea3950a56 translation auto-update for i18n/analyticsapp.config.json on master
Summary:
Chronos Job Instance ID: 1125907876026300
Sandcastle Job Instance ID: 31525198336491767
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45724898

fbshipit-source-id: ad096ebb60c1cb1c27fdcdba7d8f3d824c560c14
2023-05-10 01:12:59 -07:00
Intl Scheduler 12616e87e1 translation auto-update for i18n/twilight.config.json on master
Summary:
Chronos Job Instance ID: 1125907876026300
Sandcastle Job Instance ID: 31525198336491767
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45724900

fbshipit-source-id: a27cef7d3e2fe4d470129181498948981097b223
2023-05-10 01:12:59 -07:00