Summary:
This annotation is missing it's retention policy which should be `SOURCE` as it's an IntDef and not used at runtime.
Changelog:
[Internal] [Changed] - Add missing retention policy on EventCategoryDef annotation
Created from CodeHub with https://fburl.com/edit-in-codehub
Reviewed By: cipolleschi
Differential Revision: D43187398
fbshipit-source-id: d00bc3a5cf74d2eb983fa7369905e2260db80142
Summary:
Our stale bot is at capacity and reaches quota, resulting in marking as stale 2/3 issues a day.
I'm increasing the frequency of the bot to 4 times a day.
## Changelog
Changelog:
[Internal] [Changed] - Stale issues more frequently (4 times a day)
Pull Request resolved: https://github.com/facebook/react-native/pull/36130
Test Plan: nothing to test
Reviewed By: cipolleschi
Differential Revision: D43207979
Pulled By: cortinico
fbshipit-source-id: 1de45315e724ddf9afdb9426eddc639875ba0b24
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36137
This change stabilize the build for Hermes in CI, making it more robust in case the rename step fails or the wrong params are passed to hermes.
## Changelog:
[internal] - Update Hermes build logic
Reviewed By: cortinico
Differential Revision: D43232941
fbshipit-source-id: 1121716c69dd3ca247ffeaed57e0d4dfd5daca84
Summary:
Our first party modules are still using `namespace`. This cleans this up.
The Manifest file for ReactAndroid is also not needed anymore. The one
from hermes-engine can also be removed from facebook/hermes in a separate diff.
Changelog:
[Internal] [Changed] - Use namespace for ReactAndroid and hermes-engine
Reviewed By: cipolleschi
Differential Revision: D43198514
fbshipit-source-id: d988cfa81ecc4484b6b2add4ae2c1d9376febc3e
Summary:
Add minimum necessary .d.ts files to react-native-codegen.
I found .d.ts files will be copied to `lib` so I guess no additional script is needed.
## Changelog
[GENERAL] [CHANGED] - Add minimum necessary .d.ts files to react-native-codegen
Pull Request resolved: https://github.com/facebook/react-native/pull/36102
Test Plan: `npm run build` in `packages/react-native-codegen` and see all .d.ts files appear in `lib`.
Reviewed By: cortinico
Differential Revision: D43157233
Pulled By: cipolleschi
fbshipit-source-id: 6f122f0f4cda693ba22af6dd534e9d34d069ecac
Summary:
See code comment. D42282358 (https://github.com/facebook/react-native/commit/e55277c3310d8f6b712a57f80589cfe91ed35553) added usage of `YGConfigIsExperimentalFeatureEnabled` during layout, in a place where we sometimes encounter a Yoga node from RN which has an unexpectedly null config.
This is a hack to stop the bleed while we add logging to figure out where the null config is coming from in RN.
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D43203521
fbshipit-source-id: 2a21143a45c712ca00d16172f734fb116d165926
Summary:
After a [change](https://github.com/facebook/hermes/commit/4ff7c31fb43f534947cca591e1f156d8c45aef9c) that landed on Hermes, the build script for Hermes generated an invalid dSYM name for Catalyst builds, which make our CI fail.
This PR aims to patch it while the Hermes team works on a long term fix for it.
The CI will go back to red as soon as that happen, but in that case, we will just need to revert this change. But, at least, we can go back to a green state for CircleCI.
## Changelog
[Internal] - update Hermes build script to be more resilient from dSYM names
Pull Request resolved: https://github.com/facebook/react-native/pull/36126
Test Plan: CircleCI is green
Reviewed By: cortinico
Differential Revision: D43193705
Pulled By: cipolleschi
fbshipit-source-id: a349dde8556564dacf4852f050610ae59139ffd8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36128
This commit fixes a problem which is making harder to use the New Architecture in monorepos.
Specifically if a user specifies a `codegenDir` in their app, libraries should honor it.
This is not the case today.
The fix is to register an extension on the root project which will "pass" values from app
to libraries.
I've also cleaned up some of the logic in `readPackageJsonFile` function restricting
the access to those functions only to `.root` which is the only field they're accessing.
Fixes#35495
Changelog:
[Android] [Fixed] - Better Monorepo support for New Architecture
Reviewed By: cipolleschi
Differential Revision: D43186767
fbshipit-source-id: 5c5ca39397306120b6b6622cb728633bd331e021
Summary:
In our build logic we're mixing `plugins{}` and `buildscript{}`
which have unpredictable side-effect on the build classpath.
I'm moving over everything to use `plugins{}`. This is possible now
that we don't use build from source for New Architecture anymore.
Changelog:
[Internal] [Changed] - Do not use a mixture of plugins{} and buildscript{}
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D43186768
fbshipit-source-id: dcd115bd9d7aadf5cb837b3a28598e274a092873
Summary:
changelog: [internal]
There was a bug in prop parsing where `accessibilityRole` and `accessibilityTraits` had wrong default value. Instead of falling back to sourceProps, they would set role to empty and trait to none. The fix is to fall back to sourceProps.
The issue surfaces with Animated, which clones props.
Reviewed By: cipolleschi
Differential Revision: D43190775
fbshipit-source-id: ec6b48c082c1dcc5b6e81dbff4f92b3a58a41da2
Summary:
Changelog:
[Internal] [Changed] - Remove unused variable in a test in RNGP
Created from CodeHub with https://fburl.com/edit-in-codehub
Reviewed By: cipolleschi
Differential Revision: D43185910
fbshipit-source-id: b1f328592e0b38654fd2e0a36304ce8f1d433b44
Summary:
When working on Dynamic Type, I accidentally referred to it as "Dynamic Text" in some of the documentation. This is just a minor cleanup bit.
## Changelog
[IOS] [FIXED] - Fix typo in documentation
Pull Request resolved: https://github.com/facebook/react-native/pull/36113
Test Plan: Non-functional change, no testing should be needed :-)
Reviewed By: javache
Differential Revision: D43184999
Pulled By: cortinico
fbshipit-source-id: ed057e48289ae6037637bacecb20b8dd58c1d8b5
Summary:
Fix typo in the initialNumToRenderOrDefault description's comment : function's parameter should be this.props.initialNumToRender instead of this.props.initialNumToRenderOrDefault
## Changelog
[GENERAL] [FIXED] - Fixed typo in the initialNumToRenderOrDefault description's comment
Pull Request resolved: https://github.com/facebook/react-native/pull/36110
Test Plan: Typo in a comment - no testing required
Reviewed By: christophpurrer
Differential Revision: D43160548
Pulled By: cortinico
fbshipit-source-id: 0555c7752102f431fb327b920434faaf4de4ff81
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36107
Having concurrentRoot disabled when Fabric is enabled is not recommended.
This simplifies the setup and makes sure that both are either enabled or disabled.
Changelog:
[Android] [Breaking] - Hardcode concurrentRootEnabled to true when Fabric is enabled
Reviewed By: cipolleschi
Differential Revision: D43127625
fbshipit-source-id: 88e5e800b55d5df228fb072bedf8533b0ab6c20d
Summary:
Changelog: [Internal] Replace assert calls with RCTAssert in RCTSurfaceTouchHandler
We've been recieving crash report tasks related to these calls but it appears (based on D19221204 (https://github.com/facebook/react-native/commit/23d2a6248c9ce1e3b969e3b8fae0ae43c549db93)) that the expectation was that these should be stripped in production and don't cause real problems. RCTAssert does not have that same issue.
Reviewed By: fkgozali
Differential Revision: D43167817
fbshipit-source-id: 45b1b4a3060cfd1e01356c003d63fa4b91c4222a
Summary:
I encountered build error when using performance API in catalyst android mobile app. The error message P617433618 points at using non-const `std::strlen` API in a `constexpr`.
```
$ buck install catalyst-android
...
stderr: xplat/js/react-native-github/Libraries/WebPerformance/PerformanceEntryReporter.cpp:208:13: error: constexpr constructor never produces a constant expression [-Winvalid-constexpr]
constexpr StrKey(const char *s)
^
xplat/js/react-native-github/Libraries/WebPerformance/PerformanceEntryReporter.cpp:209:39: note: non-constexpr function 'strlen' cannot be used in a constant expression
: key(folly::hash::fnv32_buf(s, std::strlen(s))) {}
```
Changelog:
[General][Fixed] - Fixed string key calculation in constexpr from Performance C++ native module.
Reviewed By: javache
Differential Revision: D43136624
fbshipit-source-id: c691671b157b507745c67a505c91f75cf6b878d1
Summary:
Changelog:
[iOS][Fixed] - Unrecognized fontFamily values no longer trigger a redbox
## Context
We are starting to roll out a new consistent approach to style errors in React Native, where malformed or semantically invalid style values will never be treated as runtime errors. Instead, bad style values will consistently fall back to known defaults; the incorrect visual rendering will serve as the main runtime diagnostic for developers. We will advise developers to rely on static types for additional diagnostics.
This work will take place over multiple commits and possibly multiple releases of React Native.
## This diff
Here we fix this issue as it applies to the `fontFamily` style prop. The legacy (Paper) renderer on iOS is the only concrete implementation that had to change. Fabric and Android already implement the correct behaviour.
h/t EvanBacon for the report: https://twitter.com/Baconbrix/status/1623039650775371792
Reviewed By: huntie
Differential Revision: D43159284
fbshipit-source-id: 6afeef3abc5781e18671708f642073d25f2347e9
Summary:
D42721684 (https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) left a pretty bad bug when using Fabric for Android. I missed that in Fabric specifically, on edit we will cache the Spannable backing the EditText for use in future measurement.
Because we've stripped the sizing spans, Spannable measurement has incorrect font size, and the TextInput size will change (collapsing) after the first edit. This effectively breaks any uncontrolled TextInput which does not have explicit dimensions set.
Changelog:
[Android][Fixed] - Fix measurement of uncontrolled TextInput after edit
Reviewed By: sammy-SC
Differential Revision: D43158407
fbshipit-source-id: 51602eab06c9a50e2b60ef0ed87bdb4df025e51e
Summary:
This adds the `DOMRect` and `DOMRectReadOnly` classes to React Native, mostly following the Web spec.
This is a requirement for `node.getBoundingClientRect()`, which we'll implement in React (in https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFabricHostConfig.js#L134-L323).
Changelog: [General][Added] - Added Web-compatible `DOMRect` and `DOMRectReadOnly` classes to the global scope.
Reviewed By: ryancat
Differential Revision: D42963222
fbshipit-source-id: bf2ed15bfbfd71822cb6f969f8cc0a67c7834333
Summary:
This declares a few globals that were missing in our `global.js` Flow declaration file:
* `process`
* `performance` with its current definition. We'll replace it with the new API when we replace `setupPerformance` with `setupWebPerformance`.
* `navigator`
* `setImmediate`
* `clearImmediate`
Eventually we should stop including all DOM definitions that Flow provides out of the box and define only what we provide (which is pretty much this file).
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D42964772
fbshipit-source-id: 6156968e8a9d193e7068d8a5043aa682ad45bba1
Summary:
This test is flaky on Windows only on CI, so I'm disabling it as we cover this
test already on other platforms.
Changelog:
[Internal] [Changed] - Disable a /Libraries/Pressability test on Windows only
Reviewed By: yungsters
Differential Revision: D43153475
fbshipit-source-id: 861a31fbbf3c14f2af95ca3ffd40737ef975048b
Summary:
This mitigates some of the failures we're seeing inside the docker containers
where we're receiving 50x when trying to download native sources.
Changelog:
[Internal] [Changed] - Setup retries on Gradle donwload tasks
Reviewed By: cipolleschi
Differential Revision: D43155926
fbshipit-source-id: fa2266b3f5de48faefad37d6239f54f13481cd5f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36106
Having `concurrentRoot` disabled when Fabric is enabled is not recommended.
This simplifies the setup and makes sure that both are either enabled or disabled.
## Changelog:
[iOS] [Breaking] - Hardcode concurrentRootEnabled to `true` when Fabric is enabled
Reviewed By: cortinico
Differential Revision: D43153402
fbshipit-source-id: d67aeb3413dbdf2430381aa44ede47ed00db32c6
Summary:
Fixes https://github.com/facebook/react-native/issues/36097
When building RNTester with the old architecture, we skip a call to `build_codegen`, which will build the JS package at `packages/react-native-codegen`. This is needed for the Xcode Script phase `Generate Specs`. This causes a build with fabric disabled to fail. We can fix this by ensuring we call `build_codegen` in both paper and fabric.
We've had this change in React Native macOS already since 0.68: https://github.com/microsoft/react-native-macos/commit/1175372ffecf6b4e18fa27b75b68f3ec7967a384
## Changelog
[IOS] [FIXED] - Build codegen package while using old architecture
Pull Request resolved: https://github.com/facebook/react-native/pull/36098
Test Plan:
CI should suffice. Locally built RN-Tester without fabric with and without my change to show that disabling fabric will only succeed with this change included.
While running `pod install`, you should now see this extra line with the old architecture:
> [Codegen] building ./../../packages/react-native-codegen.
Reviewed By: cortinico
Differential Revision: D43152692
Pulled By: cipolleschi
fbshipit-source-id: 2cf3002f07eaad442ccb0272831fe2de58ec9c1a
Summary:
changelog: [internal]
`useLayoutEffect` has two guarantees which React Native breaks:
- Layout metrics are ready.
- Updates triggered inside `useLayoutEffect` are applied before paint. State between first commit and update is not shown on the screen.
React Native breaks the first guarantee because it uses Background Executor. Background executor moves Yoga layout to another thread. If user core reads layout metrics in `useLayoutEffect` hook, it is a race. The information might be there, or it might not. They can even read partially update information. This diff does not affect this. We already have a way to turn off Background Executor. We haven't done this because it introduces regressions on one screen but we have a solution for that.
React Native breaks the second guarantee. After Fabric's commit phase, Fabric moves to mounting the changes right away. In this diff, we queue the mounting phase and give React a chance to change what is committed to the screen. To do that, we schedule a task with user blocking priority in `RuntimeScheduler`. React, if there is an update in `useLayoutEffect`, schedules a task in the scheduler with higher priority and stops the mounting phase.
We are not delaying mounting, this just gives React a chance to interrupt it.
Fabric commit phase may be triggered by different mechanisms. C++ state update, surface tear down, template update (not used atm), setNativeProps, to name a few. Fabric only needs to block paint if commit originates from React. Otherwise the scheduling is wrong and we will get into undefined behaviour land.
Rollout:
This change is gated behind `react_fabric:block_paint_for_use_layout_effect` and will be rolled out incrementally.
Reviewed By: javache
Differential Revision: D43083051
fbshipit-source-id: bb494cf56a11763e38dce7ba0093c4dafdd8bf43
Summary:
It's cheaper to pass nullptr over JNI, and allocate an empty folly::dynamic::object on the stack.
Changelog: [Internal]
Reviewed By: genkikondo
Differential Revision: D43117216
fbshipit-source-id: e127cce7a1ccf50395073ca9c1c0469d0faa9f82
Summary:
Incorrect TS type disallows use of `hitSlop={number}`. Fixed by using Pressable's hitSlop type.
NOTE: I did not bother to change Flow types in the `.js` file, please add a commit doing that if required.
## Changelog
[GENERAL] [FIXED] - Fix touchable hitSlop type
Pull Request resolved: https://github.com/facebook/react-native/pull/36065
Test Plan: None needed
Reviewed By: christophpurrer
Differential Revision: D43117689
Pulled By: javache
fbshipit-source-id: 96e5ae650f47382c8d7fa1ddf63c76461c65dcc7
Summary:
changelog: [internal]
Passing MountingCoordinator argument by value instead of reference. Using reference does not make sense since we eventually take ownership of shared_ptr anyway. This better communicates the intent.
Reviewed By: christophpurrer
Differential Revision: D43082955
fbshipit-source-id: 29e20abb9824c10a5f0d5e0ba1049ff6d67cee98
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36093
The Test Docker Android job is flaky as sometimes fetching artifacts from remote
returns different hashes.
I'm moving the job to CircleCI (so it's faster) + I'm using the `buck_fetch.sh`
script we already have which has a retry logic.
Changelog:
[Internal] [Changed] - Move test-docker-android from GH Actions to CircleCI
Reviewed By: javache
Differential Revision: D43121477
fbshipit-source-id: 1df114fd3ad9445a4a5dc7834bf811c3476322cd
Summary:
Just got a report that we depend on `activesupport` 6.1.7 which is marked as vulnerable
as per CVE-2023-22796
https://github.com/advisories/GHSA-j6gc-792m-qgm2
I'm adding a dep on >= 6.1.7.1 in the Gemfile.
Changelog:
[Internal] [Changed] - Bump activesupport to 6.1.7.1 to address CVE-2023-22796
Reviewed By: yungsters
Differential Revision: D43117034
fbshipit-source-id: 2c925754ca32257c9523d5bd68d6cf3bb3eb31e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36092
This test is partially disabled already, causing high flakyness of the `test_windows` CI job.
I'm taking a different approach at disabling it here (disabling the offending tests using a `Promise`
rather than disabling at the assert level).
Changelog:
[Internal] [Changed] - Reduce flakyness on InteractionManager-test
Reviewed By: cipolleschi
Differential Revision: D43120897
fbshipit-source-id: 69edee804aaaa8b6f89ff8440561254f393efae4
Summary:
Changelog: [Internal]
Caller needs to explicitly set commit options. This is for readability and making sure caller is aware of what are the options of the commit. This will be important in subsequent diff where we will add another commit option.
Reviewed By: christophpurrer
Differential Revision: D43082837
fbshipit-source-id: 1417205299c19430f902453c2b6d9bb9ca31707d