Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41463
S378983 Circle CI tests have been red for 5 days. There's a test setup issue somewhere in this test suite, until motiz88 can determine where exactly, let's disable them
T169943794 filed to follow up
Changelog: Internal
Reviewed By: cipolleschi
Differential Revision: D51271630
fbshipit-source-id: 7dbc61bb4c8df0d5360ba239a1f00c4270a691f3
Summary:
CircleCI was broken since Friday because a change broke JS tests on Windows only.
The test_windows job didn't run on those changes because they were JS changes only, therefore won't affect the build of React Native on Windows.
The `test_windows` was listed among the various `test_android` jobs, but it is not actually building React Native android on windows machines.
Instead, the test_windows jobs is actually only running JS tests on a windows machines. Therefore, it makes more sense to have this test under the test_js group.
bypass-github-export-checks
## Changelog:
[Internal] - Move the test_windows job under the testJS configuration
Pull Request resolved: https://github.com/facebook/react-native/pull/41455
Test Plan:
CircleCI is green.
test_windows run together with the JS tests
Reviewed By: mdvacca
Differential Revision: D51258120
Pulled By: cipolleschi
fbshipit-source-id: a523c48f697b64620433ec9672f13baa308d75a8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41410
Changelog: [Internal]
I am planning some changes in this component. No functional changes in this diff.
Reviewed By: robhogan
Differential Revision: D50644901
fbshipit-source-id: 5464640d64bf2e50696d7e579b30985b6ceaef5a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41411
Changelog: [Internal]
I am planning some changes in this component. No functional changes in this diff, except for the `panelContainerStyle` change for iOS to fix top gap.
Reviewed By: robhogan
Differential Revision: D50644902
fbshipit-source-id: 3111da100261552c89d0cd4eae724500c446cdfd
Summary:
`build_codegen!` currently assumes that `react-native/codegen` gets installed next to `react-native`. In a pnpm setup, it's found under `/~/react-native/node_modules/react-native/codegen` instead.
However, as dmytrorykun pointed out, we don't actually need to build it outside of this repository.
## Changelog:
[GENERAL] [FIXED] - `react-native/codegen` shouldn't be built unless it's in the repo — fixes `pod install` failures in pnpm setups
Pull Request resolved: https://github.com/facebook/react-native/pull/41399
Test Plan: We have a patched version of `react-native` working in a pnpm setup here: https://github.com/microsoft/rnx-kit/pull/2811
Reviewed By: dmytrorykun
Differential Revision: D51201643
Pulled By: cipolleschi
fbshipit-source-id: 53767ae08686a20f03b3b93abcbc7d5383083872
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41420
X-link: https://github.com/facebook/yoga/pull/1465https://yogalayout.com now redirects to https://yogalayout.dev
This replaces references to "yogalayout.com" with "yogalayout.dev", the same website, with a new domain. This includes:
1. Code comments
2. Yoga website config (publish action CNAME, Docusaurus config)
3. Documentation URLs in Yoga packages
Changelog:
[General][Fixed] - "yogalayout.com" to "yogalayout.dev"
Reviewed By: christophpurrer
Differential Revision: D51229587
fbshipit-source-id: b1c336a52aab5e02565071b61430d5435381dc0a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41412
The PR https://github.com/facebook/react-native/pull/39682
moved all TurboModule classes into the folder com/facebook/react/internal/turbomodule/core/interfaces/TurboModule. The reasoning is TurboModule classes are internal implementation of RN and they shouldn't be part of the public API.
Later we realized that com.facebook.react.internal.turbomodule.core.interfaces.TurboModule interface is actually being used by OSS developers too implement the TurboReactPackage.getReactModuleInfoProvider() method:
https://reactnative.dev/docs/next/the-new-architecture/pillars-turbomodules#updating-the-calculatorpackagejava
In this diff I'm re-introducing the com.facebook.react.turbomodule.core.interfaces.TurboModule interface jus for backward compatibility.
Since the plan is to delete the TurboReactPackage.getReactModuleInfoProvider method in the next few months, the plan is:
- Iterate on the experiments to remove TurboReactPackage.getReactModuleInfoProvider method
- Once TurboReactPackage.getReactModuleInfoProvider method is ready to be deleted, there's no need to expose TurboModule interface anymore, so we will delete 'com.facebook.react.turbomodule.core.interfaces.TurboModule' and 'TurboReactPackage.getReactModuleInfoProvider' method
- com.facebook.react.internal.turbomodule.core.interfaces.TurboModule will still remain in the codebase, but this will be an internal API
changelog: [Android][Changed] Fix backward compatibility breakage
Reviewed By: fkgozali
Differential Revision: D51168413
fbshipit-source-id: 921475f4beee7c6f04912558204a1911cd74b5ca
Summary:
X-link: https://github.com/facebook/yoga/pull/1451
Pull Request resolved: https://github.com/facebook/react-native/pull/41327
The special meaning of `0.0` is now explained in the function header, and we aren't doing any sort of insensitive compare here, so the code after should be equivalent and a bit simpler.
Reviewed By: yungsters
Differential Revision: D51014264
fbshipit-source-id: 60f4a2df039f74089d5c7fabd4b7d8ac6234ba72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41317
X-link: https://github.com/facebook/yoga/pull/1449
This aims to clean up the public Yoga C API, by:
1. Documenting public YGNode, YGValue, YGConfig APIs
2. Splitting APIs for specific objects into different header files (because Yoga.h was big enough without documentation)
3. Reordering headers and definitions for consistent grouping
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D50963424
fbshipit-source-id: 45124b7370256fc63aefd6d5b7641466e9a79d3b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41402
Changelog: [Internal]
UIActionSheet was deprecated in iOS 8.3.
The RCTActionSheetManager class listed the UIActionSheetDelegate as an adopted protocol but none of the protocol methods were implemented.
Reviewed By: sammy-SC
Differential Revision: D50732844
fbshipit-source-id: e954f1e9a03e80561b3b066557e56c7f3d3589d4
Summary:
React Native, the text inline is made versatile by design. Being managed in an alien layout logic (i.e., text paragraph), inline views work seamlessly as if in normal **flex** layout. The capacities such as animation and relayout, however, requires extra efforts on native layer.
This PR fixed one critical issue for inline, i.e., `setState()` is not working when inline contains nested views.
Closes https://github.com/facebook/react-native/issues/41348
Demo (Fixed)
https://github.com/facebook/react-native/assets/149237137/2b42d657-4024-476b-bf0c-be25ef4f8c0c
## Problem in technical:
This issue is caused by a bug in `RCTShadowView::sizeThatFitsMinimumSize()` which accidentally unlink children (of yoga nodes) with their parent (owner). More specifically, on the critical path, it
1. first **shallow** clones the current node
```
YGNodeRef clonedYogaNode = YGNodeClone(self.yogaNode);
```
2. then calls `YGNodeCalculateLayout()` using the cloned node
3. deallocate the cloned node `YGNodeFree()`
One unseen implication of `YGNodeFree()` is to unlink all its children (because of the **shallow** clone)
```
for (size_t i = 0; i < childCount; i++) {
auto child = node->getChild(i);
child->setOwner(nullptr);
}
```
Next, let's examine,
**How nullptr of owner can cause the broken `setState()` of nested inline views**
The orphan children has two consequences:
**a**. the changes on child node (`setState()`) cannot be propagated to the parent (`YGNodeMarkDirty` -> `node->markDirtyAndPropagate();`);
**b**. `YGNodeCalculateLayout()` (`yoga::calculateLayoutImpl`) will create new children instances when orphan is detected (see below)
```
node->cloneChildrenIfNeeded(); // line 1599 # CalculateLayout.cpp
```
Both compounded are contributing the failed `setState()`. Respectively,
**a** causes early return of `YGNodeCalculateLayout()` because parent is recognized as not *dirty*;
**b** clones a new *dirty* node which replaces the child which is supposed to be *cleaned* within `YGNodeCalculateLayout()`. And this is the *dirty* node detected by the assertion mentioned in the issue description https://github.com/facebook/react-native/issues/41348.
## The fix:
The fix introduced in this PR is to relink the children with their parent in `RCTShadowView::sizeThatFitsMinimumSize()`
## Changelog:
[IOS] [FIXED] - `setState` is not working for nested inline views in text
Pull Request resolved: https://github.com/facebook/react-native/pull/41352
Test Plan:
Test directly in rn-tester
TBD
Reviewed By: yungsters
Differential Revision: D51071338
Pulled By: NickGerleman
fbshipit-source-id: 1f3d8a3e1e03cb11577f903e43f2c2cce9e07b6e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41408
When FabricRenderer is used during jests it will currently error out since `nativeFabricUIManager` is nog a configured global.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D51198314
fbshipit-source-id: 4db1450f6b36699311692c2cd467184f6abea518
Summary:
The goal for this PR is to further remove references for `[UIScreen mainScreen]` and migrate them to use trait collections. This helps out of tree platforms like visionOS (where the `UIScreen` is not available).
bypass-github-export-checks
## Changelog:
[INTERNAL] [CHANGED] - use currentTraitCollection for FBSnapshotTestController.m
[IOS] [CHANGED] - use key window width to assign the correct width for RCTDevLoadingView
Pull Request resolved: https://github.com/facebook/react-native/pull/41388
Test Plan:
– Check if tests passes
- Check if `RCTDevLoadingView` shows up correctly.
Screenshot:

Reviewed By: javache
Differential Revision: D51156230
Pulled By: cipolleschi
fbshipit-source-id: bbe711e0281046a082fd1680b55e2d117915ad00
Summary:
Recently, both `metro-inspector-proxy`(https://github.com/facebook/react-native/pull/39045) and `react-native-community/cli-plugin-metro`(https://github.com/facebook/react-native/pull/38795) were moved to this repo and in the process of moving these packages, the `exports` field inside package.json was added, only exporting the `index.js` file.
The problem is that Expo CLI (and possibly other community packages) rely on functions and classes that are not exported in the `index.js` file, e.g. Importing the InspectorProxy class from `react-native/dev-middleware/dist/inspector-proxy/InspectorProxy`. Normally this wouldn't be a problem and we would just import from `dist/` but due to the `exports` field, attempting to import from any other file not specified on this field will result in a `ERR_PACKAGE_PATH_NOT_EXPORTED` error.
As a short-term fix, we should create `unstable_`-prefixed exports of individual features Expo currently depends on.
## Changelog:
[INTERNAL] [CHANGED] - Expose unstable_InspectorProxy and unstable_Device from `react-native/dev-middleware`
Pull Request resolved: https://github.com/facebook/react-native/pull/41370
Test Plan: N / A
Reviewed By: robhogan
Differential Revision: D51163134
Pulled By: blakef
fbshipit-source-id: e67adaedc4fc64131e4c9dd8383c9877b8202283
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41374
Refactoring `DefaultReactNativeHost` to use the new way of Fabric initialization through `FabricUIManagerProviderImpl`
Changelog:
[Internal] internal
Reviewed By: philIip, luluwu2032
Differential Revision: D50926872
fbshipit-source-id: be2bcea7b2ce7cb1b3f903dc92fcd2c91be267da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41313
Refactor ReactNativeHost, ReactInstanceManager & Builder of `react-native-github` to use the new way of fabric initialization using the newly added class `FabricUIManagerProviderImpl.java` instead of JSIModule and thereby also refactoring the call site in FbReactInstanceHolder.java
Changelog:
[Internal] internal
Reviewed By: philIip
Differential Revision: D50783751
fbshipit-source-id: 0a9d3412bc995834cafa8fbaec2ff17e321d9906
Summary:
In pnpm setups, codegen will fail during build because it cannot find its dependencies. Some of the dependencies it relies on at runtime are currently declared under `devDependencies`. This change moves them to `dependencies`.
## Changelog:
[GENERAL] [FIXED] - Fix `react-native/codegen` not being able to resolve dependencies in pnpm setups
Pull Request resolved: https://github.com/facebook/react-native/pull/41398
Test Plan: We are currently trying to [enable pnpm mode](https://github.com/microsoft/rnx-kit/pull/2811) in rnx-kit and hit this issue. We've patched this package locally and it works.
Reviewed By: christophpurrer
Differential Revision: D51169116
Pulled By: NickGerleman
fbshipit-source-id: 28906a0de412c660d2fc42f62deaf77240d27a58
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41385
Changelog: Internal
Adding a Cxx TM example which adds a listener and returns a subscription to remove that listener from the TM.
You should be able to use this with React Hooks - https://legacy.reactjs.org/docs/hooks-reference.html
E.g.
```
useEffect(() => {
const subscription = NativeCxxModuleExample.setValueCallbackWithSubscription(
callbackValue => // use it
);
return subscription;
});
```
Reviewed By: shwanton
Differential Revision: D50473063
fbshipit-source-id: 4e9b92aeccff1771eb4ffad6bdaa20ba7f18435f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41360
Changelog: [Internal]
This is Flipper-only, React DevTools inject these internals in `connectToDevTools` call
Mostly for 2 reasons:
- For React DevTools' hook being accessed only in one place (AppContainer-dev)
- This logic is not related to Inspector itself
Reviewed By: GijsWeterings
Differential Revision: D50559547
fbshipit-source-id: 2127f3a20b71261858fdfc004a372d1d95ced164
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41291
Changelog: [Internal]
We have the same logic in 3 different places, encapsulating access to React DevTools hook in one place, all other components that require agent will get it as a prop.
Reviewed By: GijsWeterings
Differential Revision: D50559550
fbshipit-source-id: f3667a82ca48a36032c60c730df8f661098401ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41307
Changelog: [Internal]
To be able to use it in other possible places.
Reviewed By: javache
Differential Revision: D50952773
fbshipit-source-id: f21f4553e7f51ab0683a6adb834dc5c90c33c927
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41285
Changelog: [Internal]
I have an ongoing work on improving debugging overlays, lots of changes in these files are planned.
- Split `AppContainer` into 2 implementations: DEV and PROD
- Rewrite to functional components
Reviewed By: javache
Differential Revision: D50559549
fbshipit-source-id: 3790f149d504bd45be78c6f3103e05677f3a107d
Summary:
https://github.com/facebook/react-native/issues/41308 introduce the possibility to run e2e tests if a commit contains #run-e2e-tests in the commit message.
This PR builds on top of that, and let users to run e2e tests by adding a comment with with #run-e2e-tests
## Changelog:
[Internal] - Allow to run e2e tests from comments
Pull Request resolved: https://github.com/facebook/react-native/pull/41311
Test Plan: Not sure it can be tested until the PR is merged... ¯\_(ツ)_/¯
Reviewed By: dmytrorykun
Differential Revision: D51111543
Pulled By: cipolleschi
fbshipit-source-id: e6c55950552f03830fa35c89d385ab9b17f8facb
Summary:
This PR aims to make scripts building hermes locally more extensible for out-of-tree platforms. It will make it easier for forks like visionOS to add additional `elif` statements.
As a side benefit this PR fixes Hermes builds for MacOS 😄 (I've checked that it now builds correctly)
## Changelog:
[IOS] [ADDED] - make build-hermes-xcode.sh more extensible for out-of-tree platforms
Pull Request resolved: https://github.com/facebook/react-native/pull/41387
Test Plan: Run the local Hermes build by running `USE_HERMES=1 bundle exec pod install` and check if it runs smoothly. Also, a CI check should be sufficient.
Reviewed By: dmytrorykun
Differential Revision: D51156307
Pulled By: cipolleschi
fbshipit-source-id: 1c65b84b16fc8bd0552037c6ef558543cbe03889
Summary:
Enable Flow `casting_syntax=both` in fbsource, before the announcement so that when people see it they can check it out without rebasing.
bypass-github-export-checks
bypass-lint
Changelog: [Internal]
Reviewed By: SamChou19815
Differential Revision: D51097870
fbshipit-source-id: dfcb04000df26140c971422389b6fce0b1ba51e7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41381
Noticed that when scrolling VirtualizedList's CellRenderer was re-rendering due to `onCellFocusCapture` not having a stable identify. Change the interface to CellRenderer to pass in the `cellKey` in the callback to save on creating new callbacks.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D51112928
fbshipit-source-id: 3fcb974d9b5585403895746fbc45f2cf5a9fa6b1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41342
While rewriting `Debugger.getScriptSource` messages to fetch code and source map over HTTP, we weren't checking the status code of the fetch calls. This diff fixes that and adds corresponding tests (as well as for the filesystem error case).
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D51013054
fbshipit-source-id: 58e7bb9fcd6a3cf92329b43fb8a139093c80d305
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41341
* Extends `dev-middleware`'s test utilities to enable testing against an HTTPS server with a self-signed cert.
* Runs the CDP transport integration tests (D51002261) using both HTTP and HTTPS.
* Adds a test to explicitly cover the `ws=...` / `wss=...` variation in `devtoolsFrontendUrl` first introduced in D49158227.
Changelog: [Internal]
Reviewed By: blakef
Differential Revision: D51006835
fbshipit-source-id: df3db8cd865898248cd0d8f307f75949a7f313fd