Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43530
Fixes and changes following D54956345, encountered during the release process for 0.74 RC4 today.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D55017872
fbshipit-source-id: 616b387088db00c6f076f4571b4ab1541467361c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43520
Refactor ReactDelegate to have a private `getDevSupportManager()` that can also be re-used by `reload()`
This method conditionally provides the correct DevSupportManager in cases of Bridge & Bridgeless
Changelog:
[Internal] internal
Reviewed By: cortinico
Differential Revision: D54967130
fbshipit-source-id: 37d585de33a50b98d01803d3080c5693a8c494b9
Summary:
The [Windows fix](https://github.com/cezaraugusto/chromium-edge-launcher/pull/1) was merged and published. We no longer need to use the fork.
## Changelog:
[INTERNAL] [FIXED] - Fix experimental debugger launch flow with Edge on Windows
Pull Request resolved: https://github.com/facebook/react-native/pull/43524
Test Plan: n/a
Reviewed By: robhogan
Differential Revision: D55013623
Pulled By: motiz88
fbshipit-source-id: bff2aa2801dd0dcdd6975dca0a2ec2aa9864ff6f
Summary:
Minor fix to package.json which newer version of npm warn about when publishing, after running `npm pkg fix -ws` on the workspace.
{F1470070110}
## Changelog: [Internal] npm pkg fix -ws
Pull Request resolved: https://github.com/facebook/react-native/pull/43519
Test Plan: eyescloseddog
Reviewed By: cortinico
Differential Revision: D55012872
Pulled By: blakef
fbshipit-source-id: ff3c63a3eefaf56d369219a3d4b32d44d6d842c9
Summary:
This PR updates `typescript-eslint/eslint-plugin` and `typescript-eslint/parser` to `v7` and `eslint-plugin-jest` to `v27`, removing any dependencies on `typescript-eslint` `v6`, allowing projects using `react-native/eslint-config` to safely update to `typescript-eslint` `v7` without having to worry about duplicate major versions installed
## Changelog:
- [General] [Changed]: Updated `eslint-plugin-jest` to `v27`
- [General] [Changed]: Updated `typescript-eslint` monorepo to `v7`
Pull Request resolved: https://github.com/facebook/react-native/pull/43406
Test Plan: `yarn run lint` executed locally successfully
Reviewed By: robhogan
Differential Revision: D54749676
Pulled By: tdn120
fbshipit-source-id: f6fae92fc95333e28b36a3d2bd8470c8869d38bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43385
`rncore` and `FBReactNativeComponentSpec` contain the same symbols, which leads to conflicts when we try to merge them into a single shared library. Cleanup the duplication and standardize on `FBReactNativeComponentSpec` everywhere. I've left the Android OSS targets as is, to avoid breaking deps.
Changelog: [Internal]
Reviewed By: cortinico, dmytrorykun
Differential Revision: D54630694
fbshipit-source-id: 75cb961ded9fd75508755c0530e29409fef801cf
Summary:
### Context
- Since RN 0.73, in the jest.setup file, methods of the Image module (Image.getSize, Image.resolveAssetSource...) are mocked on the **JS side** (introduced in https://github.com/facebook/react-native/pull/36996)
- It causes issues like https://github.com/facebook/react-native/issues/41907 : `Image.resolveAssetSource` returns nothing in test env with the new JS mock, when some test relies on it.
- On my project, it broke the snapshots : the URL of images disappeared. I use `react-native-fast-image` which uses `Image.resolveAssetSource` to compute URLs.
- I first opened a PR to fix exclusively Image.resolveAssetSource: https://github.com/facebook/react-native/pull/41957. I will close it to focus on this new one.
- As suggested by ryancat and idrissakhi, it should be better to return to the previous mock, where no method is mocked on the JS side, and we can trust the actual JS to work in test.
This is what this PR intends to do.
### Content
Along fixing the Image module mock in jest.setup, this PR :
- adds unit test on each one of the methods, ensuring they have a consistent behavior even when the module is mocked.
- adds 3 missing native mocks for `NativeImageLoader`: `prefetchImageWithMetadata`, `getSizeWithHeaders` & `queryCache`. After this PR, no method from NativeImageLoader remains unmocked.
## Changelog:
[GENERAL][FIXED] - fix jest setup for Image methods (resolveAssetSource, getSize, prefetch, queryCache)
Pull Request resolved: https://github.com/facebook/react-native/pull/43497
Test Plan:
See exhaustive unit tests in PR.
You can re-use the mock with all the methods mocked and see how the new unit tests fail.
I also patched those changes on my project: my snapshot did have their URL back (see demonstrative screenshots in my original PR: https://github.com/facebook/react-native/pull/41957 - NB; fixed mock was different but result was the same -> those screenshots cover only two cases, but anyway they illustrate well the case!)
Reviewed By: ryancat
Differential Revision: D54959063
Pulled By: tdn120
fbshipit-source-id: 837266bd6991eb8292d9f6af1774e897ac7a8890
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43504
Changelog: [internal]
We identified the issue in the experiments already, so we can remove this flag.
Reviewed By: sammy-SC
Differential Revision: D54945099
fbshipit-source-id: 4d547569eb3bbfd011f5d6894d87bfa542cac07b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43503
Changelog: [internal]
## Context
In the experiments to enable mount hooks on Android we saw some crashes that we couldn't reproduce or pinpoint accurately.
We ran another experiment excluding part of the code in one of the variants, and we found that the problem was in this block (only crashes when `skipMountHookNotifications` is false):
https://github.com/facebook/react-native/blob/121b26184acbb77ff4f2360647cb322ff560b145/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp#L726-L734
Looking more closely at the mounting coordinator code, I realized that some of the methods are not thread-safe, which is likely causing these issues.
~~We're probably only seeing these issues on Android because we have a push model there (we call `pullTransaction` from whatever thread we're committing to, JS thread or Fabric background thread) whereas in the rest of platforms we have a pull model and we always access call `pullTransaction` from the main thread, as we do to report mounts.~~
This is probably fine because both cases are protected by a mutex when accessing through `ShadowTreeRegistry::visit`. But there's a case that doesn't go through it that could be causing the issues: prerendering:
https://github.com/facebook/react-native/blob/121b26184acbb77ff4f2360647cb322ff560b145/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp#L289
## Changes
1) Make `getBaseRevision` return a copy of the revision rather than a reference.
2) Make all methods that access `baseRevision_` and `lastRevision_` thread-safe.
Reviewed By: javache
Differential Revision: D54945100
fbshipit-source-id: d8b211137d0eac02a5814cc6c376c22733290eab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43507
Changelog: [General][Changed] - sync React renderers to 18.3.0-canary-9372c6311-20240315
Syncs React renderers to https://github.com/facebook/react/commit/9372c63116fc1e855c51d93d83f5150661371ec3 which is canary for 18.3.0-canary-9372c6311-20240315.
This includes the necessary changes to enable the use of microtasks for scheduling in Fabric.
Reviewed By: yungsters
Differential Revision: D54947212
fbshipit-source-id: 8fd5def5107d77e6a248f653a9d0260b392fab6b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43518
This is a minimum approach to achieve a **single-command publish flow** for React Native, unifying the previous `yarn bump-all-updated-packages` and `yarn trigger-react-native-release` workflow entry points.
This diff aims to change as little as possible to achieve the above — introducing a new job that merges operations to create the versioning commit. The triggered publish jobs are unchanged. In future, we may follow this change with further simplifications down the workflow tree.
**Key changes**
- Adds a new CircleCI workflow, `prepare_release_new`, which versions **all packages** and writes a single release commit.
- This replaces `yarn bump-all-updated-packages`, now implemented with the newer `set-version` script.
- Wires this up as an experiment within `trigger-react-native-release.js`, conditionally running the new workflow when `--use-new-workflow` is passed.
**Not changed**
- The single release commit written will continue to trigger both of the existing CI workflows on push (`publish_release` and `publish_bumped_packages`), which are unchanged.
- The commit summary now includes the `#publish-packages-to-npm` marker, in order to trigger `publish_bumped_packages`.
- Usage: Release Crew members will continue to use the existing local script entry point (as [documented in the releases repo](https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-process.md#step-7-publish-react-native)), with the opt in flag.
```
yarn trigger-react-native-release --use-new-workflow [...args]
```
After we're happy with the E2E behaviour of this workflow in the next 0.74 RC, I will follow up by dropping the `--use-new-workflow` flag and removing the old scripts (T182533699).
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D54956345
fbshipit-source-id: 35fd7af8f3e60a39507b5d978ccd97472bf03ddb
Summary:
This is causing Twilight Android app to hang and crash on start
Original commit changeset: 3f24271405f6
Original Phabricator Diff: D54905564
Reviewed By: sammy-SC
Differential Revision: D54960053
fbshipit-source-id: 5c1063f11ae1314e71288905eb6d8da32ddbfadd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43516
As titled. This seems dangerous — removing with the motivation that we'd prefer this script to fail during execution than to succeed in publishing `9999`.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D54956661
fbshipit-source-id: 23f8d49abd300385dde74871b6d2492ef63f058e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43513
The previous `update_podfile_lock.sh` script would fail as executed from the repo root (could not locate RNTester dir). Delete this and replace with direct calls in `prepare-package-for-release.js`, which will fail script on error.
{F1469216632}
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D54949214
fbshipit-source-id: 4f032069e803e84f835c279d01332d16787dfafc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43511
Changelog: [Internal]
This is an attempt to fix [#39783](https://github.com/facebook/react-native/issues/39783).
It seems that when `configureBuildForHermes` runs (as part of `yarn android` in `rn-tester`) cmake may not be available and is not installed automatically:
* for 3p, even after installing the latest Android Studio, cmake 3.22.1 is not available by default but needs to be installed manually
* for Meta employees, same story when looking at the `ANDROID_HOME` set by the `setup_fb4a.sh` in the `.zshrc` file:
```
# added by setup_fb4a.sh
export ANDROID_SDK=/opt/android_sdk
export ANDROID_NDK_REPOSITORY=/opt/android_ndk
export ANDROID_HOME=${ANDROID_SDK}
export PATH=${PATH}:${ANDROID_SDK}/emulator:${ANDROID_SDK}/tools:${ANDROID_SDK}/tools/bin:${ANDROID_SDK}/platform-tools
```
This diff introduces an explicit task to install cmake.
### ALTERNATIVE 1
See D54897379.
### ALTERNATIVE 2
Suggested by cortinico:
> Create a mini module called :packages:react-native:ReactAndroid:hermes-engine:cmake-downloader which just triggers an empty cmake build via Android SDK
Reviewed By: cortinico
Differential Revision: D54859484
fbshipit-source-id: f9ecdf78ff408947b1e85e7da4f112c89d3a8c89
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43506
Changelog: [internal]
We've been making all the built-in C++ TurboModules in RN extend `enable_shared_from_this` because we copied from the same template that needed it, but none of them do. This removes that unnecessary extension.
Reviewed By: sammy-SC
Differential Revision: D54901332
fbshipit-source-id: 795c7696e70041d640399e3b9f177999e22fd90b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43470
Changelog: [internal]
This moves the native code for the Web Performance API to `ReactCommon`, to align with the other default C++ native modules we've defined there.
Reviewed By: sammy-SC
Differential Revision: D54860194
fbshipit-source-id: 32dccb080fb8ebd1e2acbdd59fa2dfe47e372c17
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43482
## Context
We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).
## This diff
Now that we are confident that `CDPAgent` is stable, switch to it by default and remove the previous integration.
- Drop `inspectorEnableHermesCDPAgent` feature flag.
- Rename and replace `HermesRuntimeAgentDelegateNew` as `HermesRuntimeAgentDelegate`.
- Drop "Hermes integration: CDPAgent" log message.
- Update tests.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D54897841
fbshipit-source-id: 8a5212d27f21c54112c0820a2a3611e05d606880
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43493
This is a bump of one of our external GH custom action
Closes#38046
Changelog:
[Internal] [Changed] - Bump needs-attention to v2.0.0
Reviewed By: GijsWeterings
Differential Revision: D54905530
fbshipit-source-id: 1ecc25926144641bfc080b4ca7b8551a00a0caa1
Summary:
Changelog: [Internal]
TSIA - useful for the `console` test suite I'm currently writing (D54846940) which would be awkward to fit into `JsiIntegrationTest.cpp`.
bypass-github-export-checks
Reviewed By: huntie
Differential Revision: D54846938
fbshipit-source-id: 9e20bfae7c518b3822da468adf484e51cdc4d0b9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43459
Changelog: [General][Changed] - Console polyfill now copies all properties from the existing `console` object
Fusebox now exposes a full WHATWG `console` object integrated directly with CDP debugging (D54826073). Some WHATWG `console` methods are missing from React Native's polyfill/shim, so let's pass those through unmodified so they can still be called.
(Long term, we shouldn't need most of `console.js`, but let's get there gradually as there are many RN users still depending on `nativeLoggingHook` etc.)
NOTE: We also update the "bundled" copy of `console.js` that lives in the jsinspector-modern C++ test suite.
Reviewed By: huntie
Differential Revision: D54827902
fbshipit-source-id: c6c9128903496810192614f4f8d80b68b02e25c4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43495
## Changelog:
[Internal] -
Fixes build regression of RNTester on OSS, coming from D54764898.
NOTE: This is only Android bit for now, looking into the iOS one.
Reviewed By: cortinico
Differential Revision: D54908736
fbshipit-source-id: 70081d1378a56dd0df3f76322377f5a0e6615f80
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43461
Adds a regression test for the duplicate `scriptParsed` bug in Hermes (T182003727). In the process, we enable Hermes lazy compilation in all our CDPAgent JSI integration tests.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D54852326
fbshipit-source-id: 52e23458d3e9e21902c3659fc944ef85c68731ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43496
This diff adds another sub-sub-spec to React-Fabric pod to fix import paths in `textinput`.
Changelog: [Internal]
Reviewed By: philIip, rshest
Differential Revision: D54918454
fbshipit-source-id: 3949f8b8b201157f4c9eb256f3eb5bd5d66bc228
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43438
changelog: [internal]
EventQueue can now be merged with BatchedEventQueue since there isn't anything else subclassing it.
Reviewed By: javache
Differential Revision: D54687859
fbshipit-source-id: f646583db0e46789b667f8d79d24d0cf9d7fc00c
Summary:
Changelog: [Internal]
We are currently eagerly constructing a `HermesRuntimeTargetDelegate` regardless of whether the Fusebox feature flags are enabled. This can interfere with the legacy CDP backend. Instead, let's lazily construct the target delegate in a code path that only runs when the modern backend is in use.
bypass-github-export-checks
Reviewed By: rozele
Differential Revision: D54907887
fbshipit-source-id: 7dc13506739866ea6690ed21d03d91ad24ef68c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43487
Inconsistent between bridge and bridgeless, but if you forget to implement this interface, ReactDelegate will silently not do anything in bridgeless.
Changelog: [Android] Enforce Activities using ReactDelegate implement DefaultHardwareBackBtnHandler.
Reviewed By: arushikesarwani94
Differential Revision: D54900747
fbshipit-source-id: 5dd31d4f81e4ec37e1c3ee906be836a8a9c6a944
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43491
This diff brings back the `UNSET` constant to `TextAttributeProps`.
The removal of this constant was an unnecessary breaking change, that has broken several third-party libraries.
Changelog: [Android][Fixed] - Bring back the UNSET constant to TextAttributeProps.
Reviewed By: fabriziocucci
Differential Revision: D54899524
fbshipit-source-id: 368bde77d43f310fd458537d0191d09174fa5167
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43456
Changelog: [Internal]
Implements the [WHATWG `console` spec](https://console.spec.whatwg.org/) directly in `RuntimeTarget`, based on the Hermes-powered `addConsoleMessage` method first used in D54494298.
Benefits:
* This allows the console API to work independently of the polyfill shipped in RN, including very early during JS execution.
* It also opens the door to better stack traces (once we start reporting those) and richer functionality in the `console` object itself.
Reviewed By: robhogan
Differential Revision: D54826073
fbshipit-source-id: d5b0bd004bf35c2fce91742ae84ea86225ec1c61
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43486
We use `CopyOnWriteArrayList` in other places across the React Native codebase, as it assumes that reading happens more frequently than updating. This saves us from needing to synchronize and copy when we access the list of listeners.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D54806272
fbshipit-source-id: d1b54d532edb2af3391a7e4fdc758f705621227d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43478
This is rolled out internally already. Also exposing `memoryPressureRouter` to match the ReactInstanceManager interface.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D54802021
fbshipit-source-id: b74dcde71296d3925acfc2171d2a77d90960e15e
Summary:
Changelog: [Internal]
Adds a regression test for a Hermes CDPAgent bug using `JsiIntegrationTest`. See details in comments.
bypass-github-export-checks
Reviewed By: huntie
Differential Revision: D54890188
fbshipit-source-id: 325a32b83b145d2d35f99feaef9988028f15f196