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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41516
This cleans up some dead code in animated components (some wrappers that actually don't do anything), which in this case leads to component names being properly defined for debugging in React DevTools, etc.
Changelog: [internal]
Reviewed By: sammy-SC
Differential Revision: D51401568
fbshipit-source-id: 0de43f526b77a6b83e66e03f0ffa8d42c2b77112
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41507
Noticed we were creating this in various places and could consolidate it. This shouldn't have any perf impact since all of these use the same Handler.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D51348699
fbshipit-source-id: b11799f64cad3e9c1122e074954fce60e586d00d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41508
```
> Task :packages:react-native:ReactAndroid:compileDebugKotlin FAILED
e: warnings found and -Werror specified
w: file:///root/react-native/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/touch/JSResponderHandler.kt:55:38 The corresponding parameter in the supertype 'OnInterceptTouchEventListener' is named 'view'. This may cause problems when calling this function with named arguments.
```
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D51394096
fbshipit-source-id: ff322a10121b529c9a39b800e16a1a8cc5977d4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41499
After D48152876 we consume JSI from `ReactCommon/jsi`, and ignore JSI that is distributed with `hermes-engine`.
This diff removes `include/jsi` from `source_files` of `hermes-engine` so we don't get two sets of JSI headers - one from `ReactCommon`, and the other one from `hermes-engine`.
This diff also fixes accidental breakage of ODR violation. We will no longer compile JSI into `react-native` when linking against `hermes-engine`, which already has JSI in it.
Changelog: [iOS][Fixed] - Exclude JSI headers when using hermes-engine prebuilt.
Reviewed By: cipolleschi
Differential Revision: D51347562
fbshipit-source-id: 6e4b9940c43d74d227a05999926b8752d7685670
Summary:
NotThreadSafeViewHierarchyUpdateDebugListener is not implemented in the new architecture because it is not relevant. That's why I'm marking NotThreadSafeViewHierarchyUpdateDebugListener as deprecated in new architecture
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: rshest
Differential Revision: D51262576
fbshipit-source-id: 05022f7605ffc9f9aee3dbb0652f331849db82e0
Summary:
com/facebook/react/surface package only contains one file (ReactStage), this annotation is only used internally by the framework and it fit better in uimanager package.
In this diff we are:
- deleting com/facebook/react/surface package
- moving ReactStage to com/facebook/react/uimanager
- Properly using ReactStage in ReactRoot and ReactRootView
This is a backward compatible change because ReactStage is only used in the internals of React Native
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: rshest
Differential Revision: D51262575
fbshipit-source-id: 34c140fbd0868a5a95489ee51b3262263b33ca69
Summary:
The new architecture will only support Fabric UIManager, that's why we will just deprecate UIManagerType as part of the new architecture
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: rshest
Differential Revision: D51262582
fbshipit-source-id: ff918ff760e95bbda39f5010b141a542c9171517
Summary:
This diff marks uimanager annotations as deprecated in new architecture becasue we've decided the native codegen will not be addopted in new architecture
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: rshest
Differential Revision: D51262580
fbshipit-source-id: 1248117ca697c612c89062fcee56788cce40a1ae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41484
## Changelog:
[Internal] -
Uses mount hooks to report "paint time" via the Event Timing API - i.e. "duration" now corresponds not the the JS dispatch end point, but to the moment when the corresponding mount ("paint") happened on the native side.
This feature is disabled by default for now, but can be enabled via `NativePerformanceObserver.setIsReportingEventPaintTime(true);`.
Reviewed By: rubennorte
Differential Revision: D51313902
fbshipit-source-id: b15fed772056bb3af619496f805e45dd9222426d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41485
Now that React-Hermes does not depends on folly::Futures anymore, we can safely delete the `libevent` dependency.
This will speedup the pod install step and potentially also the bundle size (to be tested)
## Changelog
[Android][Removed] - Remove libevent dependency
Reviewed By: javache
Differential Revision: D51319583
fbshipit-source-id: 155cc3632b005074c43565e7281c9873ab046f0d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41486
Now that React-Hermes does not depends on folly::Futures anymore, we can safely delete the `libevent` dependency.
This will speedup the pod install step and potentially also the bundle size (to be tested)
## Changelog
[iOS][Removed] - Remove libevent dependency
Reviewed By: javache
Differential Revision: D51307333
fbshipit-source-id: 029c1d6aaad46fc261502241f7df28b4d5f59eb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41037
Build JSI as a shared library by default. This avoids running into a
problem with duplicate JSI when building against `libhermes` as a
shared library. This is already the case for React Native on Android.
For RN's iOS builds, explicitly specify that JSI should be statically
linked.
Changelog: [Internal]
Reviewed By: dannysu
Differential Revision: D50294405
fbshipit-source-id: 5e77e6d4ab77f8e338ca5ca4154e879eb3d616d7