Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41595
Instead of having to select between Enable/Hide the Element Inspector String, let's just use "Toggle".
Changelog:
[Internal] [Changed] - Update Element Inspector string to "Toggle"
Reviewed By: cipolleschi
Differential Revision: D51503403
fbshipit-source-id: 2ad24df8324eb789b0016fe7ac5d439cba6f5952
Summary:
This diff is reverting D51346658
D51346658: [RN][Android] Handle all incoming Inspector messages on main thread, downgrade some errors to logs by motiz88 has been identified to be causing the following test failure:
Tests affected:
- [xplat/endtoend/jest-e2e/apps/facebook_xplat/ReactNativeTTRCTester/__tests__/ReactNativeTTRCTester-storeOrNetworkWithoutCachedContent-android-e2e.js](https://www.internalfb.com/intern/test/281475019301167/)
Here's the Multisect link:
https://www.internalfb.com/multisect/3539088
Here are the tasks that are relevant to this breakage:
We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.
If you believe this diff has been generated in error you may Commandeer and Abandon it.
bypass-github-export-checks
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D51512872
fbshipit-source-id: 8bc8e12b651f91a6f74243a0a85fca7fd1953bdb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41598
This code merges native, Android provided theme text input padding, with Yoga style. We are removing operations on all edges as aggregate, so this replaces that.
This was previously part of D50998164
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D51503493
fbshipit-source-id: c6e2f3183a05861745fdd8f044d12e3dd8205804
Summary:
X-link: https://github.com/facebook/yoga/pull/1475
Pull Request resolved: https://github.com/facebook/react-native/pull/41568
Removes cases where we rely on comparing composite of Yoga edges, since we are removing that internal API (public API is already one at a time). Extracted from D50998164, with more sound facility for looping through edges.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D51478403
fbshipit-source-id: 162170b91345ff86db44a49a04a2345f0fbd0911
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41590
Causing a small leak while we wait for the surface to be fully destroyed.
Changelog: [Internal]
Reviewed By: fabriziocucci
Differential Revision: D51499256
fbshipit-source-id: 8f9e65898dcb9e0261502028874378ec9cc0f3fc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41582
# Changelog:
This will allow to have custom `ImageManager` implementations on new platforms.
Reviewed By: christophpurrer
Differential Revision: D51495143
fbshipit-source-id: bbd03bdad1b87fd53e70a886f1fdc74f371987c8
Summary:
Changelog: [Internal]
* Updates `InspectorPackagerConnection.java`, `DevServerHelper.java` and `DevSupportManagerBase.java` to perform all connection management and message dispatching for the inspector socket on the main thread. This is in support of a new CDP implementation in React Native that will strictly assume it's called on the main thread (thus avoiding the need for explicit locking in many places).
* Downgrades JSON parsing errors and duplicate connection errors from exceptions to logs, matching the [iOS implementation](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Inspector/RCTInspectorPackagerConnection.m).
Reviewed By: javache
Differential Revision: D51346658
fbshipit-source-id: 3d0d5588a824c1b28da5499ef9d040998a941288
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41581
# Changelog:
There was nothing platform-specific in `ImageRequest` implementation, defined on iOS, so might as well share across platforms.
Reviewed By: christophpurrer
Differential Revision: D51495144
fbshipit-source-id: ef15c5c8c6b07c1a87ca83eb15b5997ba703fbcc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41567
Sometimes `createNode` calls into is throwing `std::out_of_range_error` or `std::length_error` in response to both vector and string operations.
Instead of propagating `std::logic_error`, which indicates a defect in native code, terminate, so we can get an actionable native stack trace.
`createNode` and `cloneNode` also both ocasionally see `bad_alloc`, but this is not usually an instance of a defect at the allocation-site, and throwing would be more graceful.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D51463600
fbshipit-source-id: 870cbf3538d8ccbc01ded2868781a63ba12a941c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41548
`JSEngineInstance` is a misnomer - this interface actually creates `jsi::Runtime`s and doesn't represent an "instance of a JS engine". This diff renames it to `JSRuntimeFactory`.
Changelog: [Internal]
Reviewed By: huntie, arushikesarwani94
Differential Revision: D51447882
fbshipit-source-id: e118fe5c202607500a62d8e15afec088c4946969
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41577
# Changelog:
[Internal]-
The change is equivalent in terms of API, however this makes it work nicer with C++ codegen and easier to use with a pure C++ implementation of the native module.
Reviewed By: GijsWeterings
Differential Revision: D51493466
fbshipit-source-id: bf9105670ae56a191ab2e6c8cfb794c2fecd4809
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41533
This diff removes `configFilename` and `configKey` arguments from iOS codegen CLI. Now we always expect them to be `package.json` and `codegenConfig` respectively.
## Motivation
The existing implementation expects every library to have its codegen config in a file with `configFilename` name. `configFilename` is passed as a single CLI argument and applied to every app dependency. I.e. if `configFilename = codegen.config.json` then we expect to find this file in *every* third-party library. That is weird expectation. This customisation option is unsound. Same with `configKey`. It is much simpler to just stick with convention that `configFilename = "package.json"` and `configKey = "codegenConfig"`.
Changelog: [General][Breaking] - Delete `configFilename` and `configKey` arguments from iOS codegen CLI. Now we always expect them to be `package.json` and `codegenConfig` respectively.
Reviewed By: cipolleschi
Differential Revision: D51256486
fbshipit-source-id: fe190b514be7c4e489c7be01294958cf3254602a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41531
This diff converts in-out `libraries` argument of codegen library lookup functions to a normal return value. This makes these functions simpler to reason about, and simplifies subsequent refactors.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D51111416
fbshipit-source-id: 12b5dda4d326e3f1c866c16f7bcd17080be54b58
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41503
Changelog: [Internal]
Updates RCTInspectorPackagerConnection to dispatch all messages on the main thread (which is SocketRocket's default behaviour). This is in support of a new CDP implementation in React Native that will strictly assume it's called on the main thread (thus avoiding the need for explicit locking in many places).
Reviewed By: javache
Differential Revision: D51346659
fbshipit-source-id: c529b0aea97f7732cea58a4dc66993c5c8259958
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41570
## Changelog:
[Internal] -
This fixes a subtle problem whereas an update to `Image.source` (or `Image.src`) prop on JS side may not end up getting propagated to the C++ side, with New Architecture.
As the result, this can lead to some weird corner cases, whereas e.g. layout doesn't update after the image's size changes.
Differential Revision: D51479305
fbshipit-source-id: 72afb7dfd0ba32f96af4f9a6564b3b8121a597c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41509
We currently ignore `IllegalArgumentException` being thrown from TurboModule getters, as it was deemed acceptable to use that to signal a Package didn't have that module. This however can mask legitimate errors thrown during a TurboModule constructor.
TurboReactPackage#getModule is already marked as allowing nullable returns, so let's leave the use of exceptions for exceptional scenarios.
Changelog: [Android][Changed] Use null to signal a missing TurboModule instead of IllegalArgumentException.
Reviewed By: RSNara
Differential Revision: D51395165
fbshipit-source-id: 1eea1db6c7e3313a36d24e7837b36a3d0fccc718
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41495
Fix ReactInstanceManager for adding the callsite of `getJSIModule()` as an alternate path to new way of Fabric initialization in order to make Catalyst and RN-Tester work with the changes for Fabric initialization
Reviewed By: javache
Differential Revision: D51338036
fbshipit-source-id: 49badac52f1032f1032a989b76dd422e3cf7582f
Summary:
This PR fixes a typo in `cli.js`.
## 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] [FIXED] - typo in react-native/cli.js
Pull Request resolved: https://github.com/facebook/react-native/pull/41523
Test Plan: Not needed
Reviewed By: christophpurrer
Differential Revision: D51452866
Pulled By: arushikesarwani94
fbshipit-source-id: 61f1da70621bfe1a159ec63da0014141b182c5ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41464
Now, DefaultTurboModuleManagerDelegate can be created with a CxxReactPackage.
If it exists, DefaultTurobModuleManager will use the CxxReactPackage to create C++-only turbo modules.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D51166524
fbshipit-source-id: 2fdc404e79213d685c4f41b2a152b68226bb71b2
Summary:
CxxReactPackage is supposed to be the way apps register C++-only turbo modules with React Native.
Applications are meant to subclass this jni::HybridObject.
Since this is a jni::HybridObject, applications are meant to create this CxxReactPackage in java, and initialize it with java dependencies.
React Native will reach into its c++ part, and use it create C++-only turbo modules.
NOTE: This is a **temporary** abstraction meant to unblock the stable API effort of removing the turbomodulemanagerdelegate builder from ReactHostDelegate:
https://www.internalfb.com/code/fbsource/[e7efced3018f6178b7187a2358f3b76d40e2b43c]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostDelegate.kt?lines=50-51
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D51166523
fbshipit-source-id: 51a22411239fbba32f3a70cc363e59947c2782dc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41467
Make the DefaultTurboModuleManagerDelegate and the DefaultComponentRegistry load their own so's when they're created.
**Motivation:** We are going to use these two classes in Meta apps. And Meta apps will not invoke DefaultNewArchitectureEntryPoint.load.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D51036133
fbshipit-source-id: 5ebd4d3b85f435229c9b5950493310aa7fa36ba0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41544
## Change
Extend DefaultTurboModuleManagerDelegate's API so that it specify which modules should be eagerly initialized.
## Rationale
This information was originally stored on the module's ReactModuleInfo object.
But, we're running an experiment (i.e: lazy mode) that gets rid of the ReactModuleInfo object. See D51093697 for more details.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D51307434
fbshipit-source-id: 6d867436588de2f9b8dd084327e74bd51ed61a2d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41468
Currently ReactPackageTurboModuleManagerDelegate uses ReactModuleInfos to create turbo modules. We want to see if it's possible to remove ReactModuleInfo from React Native's public API.
Therefore, we are forking the implementation of each each method inside ReactPackageTurboModuleManagerDelegate:
- **lazy mode:** doesn't use ReactModuleInfo
- **control:** uses ReactModuleInfo
This optimization was previosuly implemented outside of ReactPackageTurboModuleManagerDelegate. But, to simplify things, we are just pulling it inside the ReactPackageTurboModuleManagerDelegate.
Changelog: [Internal]
Reviewed By: philIip, mdvacca
Differential Revision: D51093697
fbshipit-source-id: 6eb11020e0bf87eb704b35b990a0f14f157eea66
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41415
Changelog: [iOS][Deprecated]
an example of RCT_DEPRECATION in action. you will get a build time warning if `RCT_DEPRECATED_DECLARATIONS` is enabled.
Reviewed By: cipolleschi
Differential Revision: D51184572
fbshipit-source-id: a0bcb4c69e63620bbdf2e2a7afb25c649fcaa100
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41416
Changelog: [Internal]
cocoapods boilerplate to integrate the first RCTFoundation library. decided to split this up so we can reference it easily in the future when adding new libs
Reviewed By: cipolleschi
Differential Revision: D51184321
fbshipit-source-id: 28696f0a8e43e0bcd24a37956823fb544ecd84be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41417
Changelog: [Internal]
BUCK boilerplate to integrate the first RCTFoundation library. decided to split this up so we can reference it easily in the future when adding new libs
Reviewed By: cipolleschi
Differential Revision: D51101009
fbshipit-source-id: fe828b64c7fd939f8576a496478b6a401bfae69c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41418
Changelog: [iOS][Added]
creating a top level directory for shared lightweight utility functions
open to suggs on naming and rules we want to enforce
Reviewed By: shwanton, christophpurrer
Differential Revision: D51170983
fbshipit-source-id: 8bc0a193b486f5a0653ad58d92a034cacede2d61
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41419
Changelog: [iOS][something]
Creating a new top level directory for Apple platform specific code.
Reviewed By: christophpurrer
Differential Revision: D51170984
fbshipit-source-id: 1a453c9ae9142167afef5ac4a348c644fa6f1ab3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41535
## Context
**Remote JS Debugging removal**
In React Native 0.73, we have deprecated Remote JS Debugging (execution of JavaScript in a separate V8 process) and also removed the Dev Menu launcher (https://github.com/facebook/react-native/pull/36754).
## This diff
Follows D46187942 — this option wasn't correctly removed for Android when running JSC. This is now consistent with iOS.
Changelog:
[Android][Changed] "Open Debugger" is no longer available for remote JS debugging from the Dev Menu (non-Hermes). Please use `NativeDevSettings.setIsDebuggingRemotely()`.
Reviewed By: blakef
Differential Revision: D50555095
fbshipit-source-id: 1aeb48ab1390dc12ce300d6f321c30de5343cf0a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41537
# Changelog:
[Internal] -
This allows to optionally provide a custom list of component/api test clauses into `RNTesterApp`.
Reviewed By: christophpurrer
Differential Revision: D51429407
fbshipit-source-id: 3ee35f13f6156fd055f6e0cbc788b7cf01c22b36
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41529
# Changelog:
[Internal]-
The change is equivalent in terms of API, however this makes it work nicer with C++ codegen and easier to use with a pure C++ implementation of the native module.
Reviewed By: christophpurrer
Differential Revision: D51426015
fbshipit-source-id: aae4d91bb93834e1a9c14a21417724a348de0bd7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41526
CI failures in Windows JS tests recently (https://github.com/facebook/react-native/pull/41463) were caused by the triggering of Babel registration during tests, due to an import of `packages/dev-middleware` (index), breaking subsequent transformation of other tests.
## Root cause
Example of a problematic import:
https://github.com/facebook/react-native/blob/a5d8ea4579c630af1e4e0fe1d99ad9dc0915df86/packages/dev-middleware/src/__tests__/ServerUtils.js#L15
..which triggers a Babel registration:
https://github.com/facebook/react-native/blob/a5d8ea4579c630af1e4e0fe1d99ad9dc0915df86/packages/dev-middleware/src/index.js#L16-L18
That registration behaves differently on Windows due to the `ignore: [/\/node_modules\/\]`, which doesn't match against Windows path separators - Babel matches against system separators.
In particular, this changed whether `node_modules/flow-parser` was transformed when loading the RN Babel transformer. Transforming this file causes a `console.warn` from Babel due to its size:
> [BABEL] Note: The code generator has deoptimised the styling of /Users/robhogan/workspace/react-native/node_modules/flow-parser/flow_parser.js as it exceeds the max of 500KB.
This throws due to our setup:
https://github.com/facebook/react-native/blob/a5d8ea4579c630af1e4e0fe1d99ad9dc0915df86/packages/react-native/jest/local-setup.js#L27
This all manifests as the first test following a Babel registration (within the same Jest worker) that requires the RN Babel transformer throwing during script transformation.
## This change
This is the minimally disruptive change that makes Babel registration behaviour consistent between Windows and other platforms. The more durable solution here would be *not* to rely on any Babel registration for Jest, which has its own `ScriptTransformer` mechanism for running code from source. Given the fragile way our internal+OSS Babel set up hangs together that's a higher-risk change, so I'll follow up separately.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D51424802
fbshipit-source-id: 8b733c0c159ee84690aef04abced682d126c6d27
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41525
This creates an experimental mechanism to get notifications when image instances are created anywhere in the app.
This can be useful to set up things like image performance tracking automatically without having to use a custom component and manually access refs from image components.
Changelog: [internal]
Reviewed By: oprisnik
Differential Revision: D49962063
fbshipit-source-id: b991a808aaa723bea98c27812892cfa468f025a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41500
Right now, the old architecture uses Codegen in a slightly different way w.r.t. the New Architecture.
In the Old Architecture, codegen is used to generate some basic TM and components that are part of Core.
Both architectures use the same scripts that actually generates the code, but they are invoked differently.
This is causing some maintenance costs that we would like to reduce.
## Changelog:
[Internal] - Defragment how Codegen is run between old and new architecture
Reviewed By: dmytrorykun
Differential Revision: D51349874
fbshipit-source-id: 188d3ed436a30a77bd42a26306d4a08666d3a00b