Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49810
Changelog:
[Internal]
Migrated StyleSheet namespace content to StyleSheetExport.js to recreate it by importing * as StyleSheet, which aligns with TS namespace definition. Added .flow files that specify base type declarations and will be digested by the flow tooling.
Reviewed By: huntie
Differential Revision: D70391322
fbshipit-source-id: dd974ef282cb984a1e57d5732e3b5bdab6db4564
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49836
We were passing the path to the `RegularFile` instead of the `PublishingArtifacts` to the gradle script.
cortinico why this is not checked at build time? This should be a typing issue that should be caught at build time, also during the test-all jobs, not just when the nightly run...
## Changelog:
[Internal]
Reviewed By: cortinico
Differential Revision: D70617638
fbshipit-source-id: 67ff1aea2bd827fb110db7a0d2f3651b88a1e8cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49835
The implementation of moduleProviderForName is slightly off.
This method was supposed to replace the previous ternary expression and to enhance with the module provider call.
The ternary expression used to be
```
!RCTTurboModuleInteropEnabled() || [self _isTurboModule:moduleName] ? [self _provideObjCModule:moduleName] : nil
```
However, as you can see from the current implementation, instead of calling `RCTTurboModuleInteropEnabled()` we are calling `RCTTurboModuleEnabled()` which is clearly a mistake.
On top of that, I'm also updating the guard around the `getModuleProvider` selector as it was bypassing the other checks, and that's wrong.
## Changelog:
[Internal] - Fix moduleProviderForName method
Reviewed By: RSNara
Differential Revision: D70569552
fbshipit-source-id: ed4055da9ea385ed10323ed8d7a8772010b3a105
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49823
Introduce LegacyArchitectureLogger class, which provides logging functionality to help track and debug usage of legacy architecture components when an app is running on the new architecture. The data provided by this class will help identify classes and methods that are still being used in the new architecture when they shouldn't.
changelog: [Internal] Internal
Reviewed By: rshest
Differential Revision: D70543605
fbshipit-source-id: 56262170c03bb0fd375b8dc3cb34a7c15a69a810
Summary:
Benchmark to test changes from https://github.com/facebook/react-native/issues/49449
Might be nice to have some version of this in the repo.
## Changelog:
[INTERNAL] [ADDED] - Setup a Macrobenchmark for RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/49486
Test Plan:
### Methodology
Picked various JS file from websites (facebook, instagram) to artificially grow RN tester bundle somewhat realistically. The files are required lazily from a button press callback to simulate the code being included, but not executed, as it would be in a large app that uses lazy requires for the different screens.
I've also made the RN tester screens lazy so all their code is not loaded initially. This is more representative of real apps. Note this is implemented in a hacky way just for the purpose of this test. It would actually be nice to implement this properly.
The tests were made using low end device Samsung Galaxy A03s.
### Compression ON with 10.5 mb bundle
#### Peak allocated memory
60.9 mb
#### ReactInstance.loadJSBundler
148.64 ms
#### Benchmark
timeToFullDisplayMs min 1,825.0, median 1,911.1, max 1,994.8
timeToInitialDisplayMs min 834.9, median 860.9, max 903.9
#### APK
Size: 22.9 mb
Download size: 14.5 mb
### Compression OFF with 10.5 mb bundle
#### Peak allocated memory
51.5 mb
#### ReactInstance.loadJSBundler
946 us
#### Benchmark
timeToFullDisplayMs min 1,752.8, median 1,827.2, max 1,977.5
timeToInitialDisplayMs min 837.7, median 881.3, max 937.2
#### APK
Size: 28 mb
Download size: 14.5 mb
Reviewed By: rshest
Differential Revision: D70002286
Pulled By: cortinico
fbshipit-source-id: 436597f439ba244649373870c1facefdb12297d9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49813
Making use of the recently standardised `REACT_NATIVE_DEBUGGER_ENABLED` preprocessor flag, conditionally swap out `HostAgent` for a stub in production (non dev, non profiling) builds. This uses the same private implementation idiom as `HermesRuntimeTargetDelegate`.
This results in a **42.2kiB** size reduction (uncompressed) in production builds, due to excluding the CDP agent components of `jsinspector-modern`.
- Intentionally, we're gating just this logic, rather than several outer integration points/native bindings for `jsinspector-modern`. This is for predictability and maintenance — the Fusebox subsystem is always loaded/bound, but can fork to an empty implementation.
{F1975625351}
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D70495853
fbshipit-source-id: 00253ac71444819a917a3781efe38365acb91e85
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49786
Most of these call-sites are only used for exceptional scenarios, so we can just rely on std::to_string and do string concatenation. For a few others that may be more perf-sensitive, I switched over to `snprintf`.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D70402439
fbshipit-source-id: 3b90ebb13a7bf1c6cf30722ef636e5e8498a5b26
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49814
`bgWhiteBrigh + t = bgWhiteBright`
seems like no one was using `chalk.bgWhiteBright` before me :)
Changelog:
[General][Internal] fix type on the flow types for "chalk"
Reviewed By: huntie, hoxyq
Differential Revision: D70403987
fbshipit-source-id: 34f65e57fbb2eeadd6030557e0499db0b2603b38
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49815
The pull to refresh component props's casting is imprecise.
This change uses the more precise type for the props.
## Changelog:
[Internal] - cast props to `PullToRefreshViewProps`
Reviewed By: sammy-SC
Differential Revision: D70559080
fbshipit-source-id: c42d3d41a22683a3392813c2af25828781a68401
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49795
# Changelog: [Internal]
I've been able to reliably and consistently record samples with an interval between 2 consecutive ones to be ~0.1-0.2ms, lets bump the sampling frequency to have more frames.
On Windows, Hermes Sampler peaks at ~500Hz, so this won't have much effect.
Reviewed By: huntie
Differential Revision: D70395983
fbshipit-source-id: 9a9e619d75096a3ee75e0e1a2f8b8fff33130268
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49794
# Changelog: [Internal]
Before, we would store all User Timings and Timeline Events in the PerformanceTracer's buffer, and then add Profile event to it as well.
On larger apps, the amount of events buffered could reach ~100k, which inevitably would cause OOM.
With this approach, we will flush out buffered events from PerformanceTracer first, then do JavaScript Profile serialization, then send it over CDP straight away.
Reviewed By: huntie
Differential Revision: D70395982
fbshipit-source-id: 2c17abba421fa9c4afc4d4ca36afd98b1db50905
Summary:
Added a new template `ReactNativeVersion.kt-template.js` to be used to generate the Kotlin template for Android. Updating also the set-rn-artifacts-version script to use this template instead of the Java one.
## Changelog:
[INTERNAL] - Migrate ReactNativeVersion Android template to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/49758
Test Plan:
```bash
yarn test-android
yarn android
node ./scripts/releases/set-version.js 1000.0.0
```
Reviewed By: huntie, rshest
Differential Revision: D70486775
Pulled By: cortinico
fbshipit-source-id: 5dd1e0e2ecf4d848dc24e6c47df243a1259ab559
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49751
fast_float promises significant improvements in float parsing performance and is already what's being used in folly internally. Unifying all percentage parsing on the new css parser logic, which can use fast_float internally.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D70392268
fbshipit-source-id: 56147e5478d008bc2c34579df035ec7acf8744bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49775
Upgrading this dependency to match folly and to enable using this for number parsing across Fabric.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D70482373
fbshipit-source-id: 64429595c1126e6a06436701a7562bdf6dd962d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49807
This change fixes a copy-and-paste mistake in passing the right parameter for publishing the ReactNativeDependencies dSYMs.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D70552858
fbshipit-source-id: fc103814420d94180d26c89ba9b405693864a64b
Summary:
X-link: https://github.com/facebook/yoga/pull/1791
Disabling RTTI for Yoga is causing std::exception to don't work properly in OSS.
Fixes: https://github.com/facebook/react-native/issues/48027
Not sure why we originally disabled RTTI for Yoga, but we have it enable for the whole
React Native build so it probably makes sense to have it enabled for Yoga as well.
Changelog:
[Internal] [Changed] - Enable RTTI to fix exception pointer issue on React Native
bypass-github-export-checks
Reviewed By: javache, NickGerleman
Differential Revision: D70386744
fbshipit-source-id: 36e3a1ddb38346d31979d5c1b77d6e9796d6a855
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49803
This refactors the whole ReactCommon to use the `target_compile_reactnative_options` macro we just introduced.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D70386740
fbshipit-source-id: 1f15ea7e182d79bbb0bedce653284808e3309e4f
Summary:
Found this issue while releasing 0.79.0-rc.0 (see [job](https://github.com/facebook/react-native/actions/runs/13649159968/job/38156418752)).
bypass-github-export-checks
```
SyntaxError: Invalid destructuring assignment target
at new AsyncFunction (<anonymous>)
at callAsyncFunction (/__w/_actions/actions/github-script/v6/dist/index.js:15143:16)
at main (/__w/_actions/actions/github-script/v6/dist/index.js:15236:26)
at /__w/_actions/actions/github-script/v6/dist/index.js:15217:1
at /__w/_actions/actions/github-script/v6/dist/index.js:15268:3
at Object.<anonymous> (/__w/_actions/actions/github-script/v6/dist/index.js:15271:12)
at Module._compile (node:internal/modules/cjs/loader:1469:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Module._load (node:internal/modules/cjs/loader:1104:12)
```
## Changelog:
[Internal] -
Reviewed By: cipolleschi
Differential Revision: D70552301
fbshipit-source-id: b50e3d76c7497cc218e379400d5870531669abe1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49761
LayoutAnination classes are not used on the new architecture, this diff marks the as LegacyArchitecture to drive its removal
Changelog: [Internal] internal
Reviewed By: rshest
Differential Revision: D70410096
fbshipit-source-id: cda84958985c4133c926455a5c9611773a0d32ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49792
This removes the `$` from the `event` and `payload` identifier inside codegen.
This is causing the `-Wdollar-in-identifier-extension` warning to fire.
As I'm looking into enabling `-Wall -Werror` for React Common, this should be addressed as well.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D70500543
fbshipit-source-id: c593680961b1b98561c3985f92ade5d6ba448ac9
Summary:
This is causing the `-Wno-nullability-extension` warning to fire.
As I'm looking into enabling `Wall Werror` for ReactCommon, this should be fixed as it's causing the build to fail.
We don't use nullability extensions at all in the other JNI_OnLoad files, so it's fine (and probably better) we
replace them with a function that also doens't specify a Nullability annotation.
This is impacting only the OSS So Merging toolchain.
Changelog:
[Internal] [Changed] -
bypass-github-export-checks
Reviewed By: cipolleschi
Differential Revision: D70500544
fbshipit-source-id: 2d5b52d8f34ec026a25e8625bd0c6a1812221dea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49797
Backing D70314889 as it was breaking some internal tests.
I verified that before the backout the tests were failing and after the backout they were not.
## Changelog:
[iOS][Changed] - Reverted fix: avoid race condition crash in [RCTDataRequestHandler invalidate].
Reviewed By: Abbondanzo
Differential Revision: D70511155
fbshipit-source-id: 276f6947aa6bb648c9c9eeb5c342f336acc8a26f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49650
- Added a new template to React Native's Feature Flag's script for Canary and Experimental prerelease stages iOS
- Overload initWithDelegate to add optional releaseLevel parameter
- Add Obj-C enum for Release Level
- Use static variables to keep the context on whether a ReactNative Factory has been created and with which flags it has been created.
- Crash in case we try to create multiple factories with different feature flags.
- Creating multiple factories with the same feature flags is allowed
Changelog: [iOS] [Added] - On `RCTReactNativeFactory` add `initWithDelegate` overload with argument to specify release level for an application
Reviewed By: cipolleschi
Differential Revision: D70106210
fbshipit-source-id: 14fe4c8571621a75a7064f1ffd02a07270cea43a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49745
It turns out we want those flags to be available also inside ReactCommon so I'm moving it there.
This will allow us to reference them also inside ReactCommon and will make sure Common does not depend on Android
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D70386742
fbshipit-source-id: 3675c01f5e3f6515af6423d75e3fe145ba3d8936
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49743
Those 3rd party CMake libraries were not using our compiler flags correctly.
This fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D70386743
fbshipit-source-id: e35688f7eb3fa9bcdda1180023006d267782ceaf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49791
The cache for RNTester is broken because the matrix parameters used to test RNTester are not part of the job_id that is used to create the cache keys to restore the Podfile.lock.
This means that we have a race condition on which job of the matrix manages to save the cache. However, those caches are not always valid for the other jobs that presents different matrix parameters.
This change should fix the issue.
## Changelog:
[Internal] - Fix test-rn-tester cache Cache
Reviewed By: cortinico
Differential Revision: D70493507
fbshipit-source-id: 1db6e00507b3e9abe4400831ee1b048c620b9102
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49780
Now that we're using a minimum Metro version of 0.81.3, Metro will dynamically assert `import` or `require` based on the style of the import at source.
Asserting both is likely to cause issues with `babel/runtime` and potentially other packages - see https://github.com/facebook/metro/pull/1447.
Changelog:
[Internal] metro-config: Assert import/require dynamically when using `unstable_enablePackageExports` with Metro.
Reviewed By: hoxyq
Differential Revision: D70473577
fbshipit-source-id: b3e6fbd78e2b6fc0f9a16ec3db2c19698848e6d1