Граф коммитов

29234 Коммитов

Автор SHA1 Сообщение Дата
Riccardo Cipolleschi 63884b4888 Update Xcode 15 patches to be more robust (#39710)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39710

Last week Apple released Xcode 15, which required us to ship a workaround for the new linker.
Unfortunately, the previous fix was not good enough and there were some edge cases that were not covered.
For example, in some occasions the flags are read as an array and the `-Wl` and the `-ld_classic` flags were separated and not properly removed when moving from Xcode 15 to Xcpde 14.3.1.

This change fixes those edge cases, with a more robust solution where:
- We convert the flags to a string.
- We trim the string and the values properly.
- We add the flags when running `pod install` with Xcode 15 as the default iOS toolchain.
- We remove the flags when running `pod install` with Xcode <15 as the default iOS toolchain.

## Changelog:
[Internal] - Make the Xcode 15 workaround more robust.

Reviewed By: dmytrorykun

Differential Revision: D49748844

fbshipit-source-id: 34976d148f123c5aacba6487a500874bb938fe99
2023-09-29 10:22:36 -07:00
Nick Gerleman 5be6f49942 C++ style enums 16/N: Dimension (#39598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39598

X-link: https://github.com/facebook/yoga/pull/1403

Replaces all usages of YGDimension with Dimension.

Adds `yoga::to_underlying` to act like `std::to_underlying`, added in C++ 23.

This enum is oddly only used internally, and is never an input to the public API, but it handled as any other public generated enum. Potentially some more cleanup to do there.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D49475409

fbshipit-source-id: 7d4c31e8a84485baea0dab50b5cf16b86769fa07
2023-09-29 00:06:34 -07:00
Mateusz e21b3c8296 This fix improving logging during running e2e tests. (#39466)
Summary:
Motivation was to improve logging for RNTester e2e tests.

## Changelog:

[INTERNAL] - Add logging.

Pull Request resolved: https://github.com/facebook/react-native/pull/39466

Test Plan: Check logs during 2e automation is running.

Reviewed By: NickGerleman

Differential Revision: D49499233

Pulled By: cipolleschi

fbshipit-source-id: c803fa9227995ed3862b6a919a7590f80e2afc08
2023-09-28 20:18:25 -07:00
James Maxell Eroy 8e36cc0293 Add `onPress` prop (#39701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39701

TextInput already uses Pressability, but doesn't expose the onPress prop. Link:https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/TextInput/TextInput.js#L1381-L1414.

Currently TextInput only exposes the onPressIn() and onPressOut() props from Pressability. While onPressOut() can serve the same purpose as onPress() in most cases, it doesn't fare well with PanResponder...say a swipe gesture implemented using PanResponder.

When the pointer/cursor exits the hit test bounds of TextInput, onPressOut() will be triggered even though the desired behavior could be that we only want to invoke the event handler when the user lifts their finger from the screen (while still in the hit test bounds of the TextInput).

Example of TextInput in a PanResponder:
https://snack.expo.dev/jambalaya/panresponder

Changelog: [General][Added] Add onPress prop to TextInput

Reviewed By: NickGerleman

Differential Revision: D49653011

fbshipit-source-id: 28477416c6c0f17a0737986cab49e51a55094ba7
2023-09-28 10:00:38 -07:00
David Vacca b138a4f72d Remove support for Android API < 23 in ReactTextAnchorViewManager (#39676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39676

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactTextAnchorViewManager

changelog: [Android][Breaking] Remove support for Android API < 23 in ReactTextAnchorViewManager

Reviewed By: NickGerleman

Differential Revision: D48545519

fbshipit-source-id: 4eca438fa9b33314c495f2181559c8f0ce6fd93f
2023-09-27 20:24:37 -07:00
David Vacca 0505f5c28c Remove support for Android API < 23 in ReactBaseTextShadowNode (#39665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39665

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactBaseTextShadowNode

changelog: [Android][Breaking] Remove support for Android API < 23 in ReactBaseTextShadowNode

Reviewed By: NickGerleman

Differential Revision: D48545509

fbshipit-source-id: 2bd1c74251c8af92013b065daafbab3d96a05a2e
2023-09-27 20:24:37 -07:00
Intl Scheduler 0b1fcfb301 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907941692284
Sandcastle Job Instance ID: 4503600687598755
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D49712798

fbshipit-source-id: 45f86724c50bec77a72f0b7f093be7eb55ee852d
2023-09-27 17:06:11 -07:00
Nick Gerleman 596dfcc44c Remove dead code for Android onLayout events (#39645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39645

Removes some dead code related to emitting OnLayout evennts in Paper.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D49626884

fbshipit-source-id: c02f3345f0f50be00aa09630410a5ac55ab30773
2023-09-27 15:54:04 -07:00
Mike Hardy fa87eaaebf chore: fix grammar in Xcode 15 helper method name (#39658)
Summary:
Thanks for working through Xcode 15 compatibility issues!

I reviewed the diff of the PR (https://github.com/facebook/react-native/issues/39474) that altered Xcode 15 settings for react-native release 0.72.5 and I noticed that

- everything looked great (worth saying)
- there was a grammatical error in another of the method names

Trivial errors but, as long as I was in there, thought I'd submit a PR

## Changelog:

[IOS] [FIXED] - fix grammar in Xcode 15 helper method name

Pull Request resolved: https://github.com/facebook/react-native/pull/39658

Test Plan: CI should catch it of course, but in general I did a full grep for the name and changed everything / typical method name refactor

Reviewed By: cortinico

Differential Revision: D49641551

Pulled By: cipolleschi

fbshipit-source-id: d77d33bbd6941f039dd30766e1308d5c4c4a6ca8
2023-09-27 14:50:09 -07:00
David Vacca 6eb4f1e997 Remove support for Android API < 23 in StatusBarModule (#39669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39669

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class StatusBarModule

changelog: [Android][Breaking] Remove support for Android API < 23 in StatusBarModule

Reviewed By: NickGerleman

Differential Revision: D48545516

fbshipit-source-id: ff79ac0d515b9a731c1c4ed861a73ce7998cb7f8
2023-09-27 13:10:31 -07:00
David Vacca 0384e3cf1f Remove support for Android API < 23 in PermissionsModule (#39680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39680

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class PermissionsModule

changelog: [Android][Breaking] Remove support for Android API < 23 in PermissionsModule

Reviewed By: NickGerleman

Differential Revision: D48545517

fbshipit-source-id: 1ead079689aee5fd42d2b0bc530b7f69780938ff
2023-09-27 13:10:31 -07:00
David Vacca 52ec1d87e9 Remove support for Android API < 23 in RequestBodyUtil (#39672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39672

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class RequestBodyUtil

changelog: [Android][Breaking] Remove support for Android API < 23 in RequestBodyUtil

Reviewed By: NickGerleman

Differential Revision: D48545515

fbshipit-source-id: 8cc82a234cdb37304ad0d383ad57a7ce0de50a0e
2023-09-27 13:10:31 -07:00
David Vacca c359a44676 Remove support for Android API < 23 in WindowOverlayCompat (#39673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39673

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class WindowOverlayCompat

changelog: [Android][Breaking] Remove support for Android API < 23 in WindowOverlayCompat

Reviewed By: NickGerleman

Differential Revision: D48545505

fbshipit-source-id: 51246bbe5c78efc3cf7d3f1cf0a4ab31cb9c0b5c
2023-09-27 13:10:31 -07:00
David Vacca 2286c123b7 Remove support for Android API < 23 in DebugOverlayController (#39664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39664

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class DebugOverlayController

changelog: [Android][Breaking] Remove support for Android API < 23 in DebugOverlayController

Reviewed By: NickGerleman

Differential Revision: D48545520

fbshipit-source-id: 3a1140a46310c617610ff1e0c40b02427357087a
2023-09-27 13:10:31 -07:00
David Vacca 414b25b125 Remove support for Android API < 23 in ReactFragment (#39668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39668

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactFragment

changelog: [Android][Breaking] Remove support for Android API < 23 in ReactFragment

Reviewed By: NickGerleman

Differential Revision: D48545506

fbshipit-source-id: 9b5e335eae8ca11aac580c14c31431ca87eb11a2
2023-09-27 13:10:31 -07:00
David Vacca 3664b8aa22 Remove usage of Android API <23 in ReactActivityDelegate (#39663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39663

Since minSDK was bumped to Android API 23 we are removing support of code using Android API <23 in

changelog: [Android][Breaking] Remove support for Android API < 23 in

Reviewed By: NickGerleman

Differential Revision: D48545501

fbshipit-source-id: fa0dd69c3506e80eb1a4353d497b911b5d43c8c8
2023-09-27 13:10:31 -07:00
David Vacca 70fcb1ebf6 Bump minSdk to 23 in RN OSS (#38874)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38874

In this diff I'm increasing the minSdk of RN Android to 23 to keep it in sync with Meta min sdk

changelog: [Android][Breaking] Increase min sdk version of RN Android to 23

Reviewed By: fkgozali, NickGerleman

Differential Revision: D48177965

fbshipit-source-id: 79f46f6e1674fe9d38dc9dfbe8f0f9a43f39a712
2023-09-27 13:10:31 -07:00
Ramanpreet Nara 271ce7edbc Fix and re-introduce interop test (#39690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39690

This diff re-introduces the test for the TurboModule interop layer.

This test was originally reverted in D49200360, because it was broken.

***New:*** This test runs in Bridgeless mode, with the interop layer enabled. (Catalyst is now native mobileconfig ready).

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D49208528

fbshipit-source-id: 3109d7826e7024fd7a1074321d4aab8f3a489609
2023-09-27 10:18:50 -07:00
Dmitry Rykun 0d3854c6c3 Export Commands and Constants only if native view config interop is enabled (#39696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39696

`Commands` and `Constants` should be set in native only if component data is instantiated via native view config interop layer.
Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D49684166

fbshipit-source-id: ceaa29c2ed3336aa6e21a116a3f5f94e03c225c1
2023-09-27 10:05:33 -07:00
David Vacca 5203354d70 NIT lint warns fixed in BlobProvider (#39614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39614

NIT lint warns fixed in BlobProvider

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D49483635

fbshipit-source-id: 51f6f0d7841d2552f30ed64d0bb4447bd0b0ec54
2023-09-26 18:58:56 -07:00
David Vacca e1d2a8482e Remove mTurboModuleManagerJSIModule from CatalystInstanceImpl (#39612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39612

I'm removing mTurboModuleManagerJSIModule from CatalystInstanceImpl, as this is a duplicated variable.

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D49483637

fbshipit-source-id: 01f9e48e9a53eeaeed2dec9af07eb000bd164676
2023-09-26 18:58:56 -07:00
David Vacca 5f215cdde2 Rename onCatalystInstanceDestroy -> invalidate (#39611)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39611

I'm renaming onCatalystInstanceDestroy -> invalidate, this is necessary to converge TurboModuleRegistry -> turboModuleManager in the next diffs of the stack

changelog: [intenral] internal

Reviewed By: arushikesarwani94

Differential Revision: D49469208

fbshipit-source-id: 877c5af6ad0fc378ec9cbd952f33db0ea08f761c
2023-09-26 18:58:56 -07:00
generatedunixname89002005232357 36057dac59 Revert D49509633: Multisect successfully blamed "D49509633: [react-native][PR] fix: Text cut off issues when adjusting text size and font weight in system settings" for test or build failures
Summary:
This diff is reverting D49509633
D49509633: [react-native][PR] fix: Text cut off issues when adjusting text size and font weight in system settings by ryancat has been identified to be causing the following test or build failures:

Tests affected:
- [xplat/endtoend/jest-e2e/apps/facebook_xplat/ReactNativeTTRCTester/__tests__/ReactNativeTTRCTester-errorReportedManually-android-e2e.js](https://www.internalfb.com/intern/test/281475019301157/)

Here's the Multisect link:
https://www.internalfb.com/multisect/3131615
Here are the tasks that are relevant to this breakage:

We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.

If you believe this diff has been generated in error you may Commandeer and Abandon it.

Reviewed By: NickGerleman

Differential Revision: D49645585

fbshipit-source-id: 414531e067cffa109d0663d6af185dcaf8fb9c4e
2023-09-26 18:34:51 -07:00
Intl Scheduler 41e5a5e692 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907941650214
Sandcastle Job Instance ID: 18014399568859493
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D49661278

fbshipit-source-id: 8db6f313902418c9e190c9b6110c957c14864b60
2023-09-26 15:10:30 -07:00
Ramanpreet Nara aa1ad5496c Enable TurboModule interop in Bridgeless Mode (#39687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39687

Bridgeless mode is releasing in 0.73.

Bridgeless mode isn't stable inside RNTester (in 0.73) without the TurboModule interop layer: T164853040.

**Changes:** Enable the TurboModule interop layer in RNTester (Bridgeless Mode).

**Urgency:** This will unblock the 0.73.

Changelog: [General][Added] - Enable TurboModule interop in Bridgeless mode

Reviewed By: fkgozali, dmytrorykun, luluwu2032

Differential Revision: D49653919

fbshipit-source-id: a4a09a99544c2ef8713484dbeab5cb04f29256cc
2023-09-26 14:51:02 -07:00
David Vacca aa1dffbb41 Fix lit warn (#39685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39685

Fix lit warn

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D49645243

fbshipit-source-id: 68516bfa5de414dddfba2411889d7485d20804ed
2023-09-26 13:40:57 -07:00
Rui Ying 7c7e9e6571 Allow non-ascii header values & add utf-8 filename fallback (#35060)
Summary:
Fix https://github.com/facebook/react-native/issues/31537: [Android] React Native strips non-ASCII characters from HTTP headers

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Android] [Changed] - Allow non-ascii header values on Android and add utf-8 filename fallback in FormData

Pull Request resolved: https://github.com/facebook/react-native/pull/35060

Test Plan:
1. Clone the `react-native` repo.
2. Build the rn-tester app.
3. Prepare tests
   1. Add `android:usesCleartextTraffic="true"` to AndroidManifest.xml
   2. Use the following code as a server:
       ```javascript
		const http = require('http');

		const requestListener = function (req, res) {
		    // raw header value
		    console.log(req.headers['content-disposition']);
		    // nodejs assumes the header value is ISO-8859-1 encoded
		    console.log(Buffer.from(req.headers['content-disposition'], 'latin1').toString('utf-8'));
		    // decode encoded header value if it's sent as UTF-8
		    console.log(decodeURI(req.headers['content-disposition']));
		    res.writeHead(200);
		    res.end();
		};

		const server = http.createServer(requestListener);
		server.listen(3000);
       ```
  	3. Run `adb reverse tcp:3000 tcp:3000` to connect the 3000 port on the emulator if necessary.
4. Edit `RNTesterAppShared.js` to include test code:
    ```javascript
	  useEffect(() => {
	    fetch('http://localhost:3000/', {
	      headers: {
	        'Content-Type': 'multipart/form-data; charset=utf-8',
	        'Content-Disposition': `attachment; filename*=utf-8''${encodeURI(
	          'filename测试abc.jpg',
	        )}`,
	      },
	    }).then(res => {
	      console.log(res.ok);
	    });
	    fetch('http://localhost:3000/', {
	      headers: {
	        'Content-Type': 'multipart/form-data; charset=utf-8',
	        'Content-Disposition': `attachment; filename="filename测试abc.jpg"`,
	      },
	    }).then(res => {
	      console.log(res.ok);
	    });
	  }, []);
    ```
5. Both requests should succeed; without the fix, the second request received by the server will not have the utf-8 characters "测试" in the header value.

Reviewed By: NickGerleman

Differential Revision: D40639985

Pulled By: cortinico

fbshipit-source-id: 005f2481976046a92a26239ad704780ac58d4a44
2023-09-26 12:39:18 -07:00
Lulu Wu 8b2f324a9b Enable Template with Bridgeless (#39661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39661

Changelog:
[Android][Changed] - Enable Template with Bridgeless

Reviewed By: cortinico

Differential Revision: D49464580

fbshipit-source-id: 26dd8e2a0b9a66421d58f147eed4d2fd28817dc7
2023-09-26 10:32:45 -07:00
Ingrid Wang 6b3d25a075 Update deprecated stringByAddingPercentEscapesUsingEncoding to NSCharacterSet (#39638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39638

# Changelog:
[Internal] - Removing usage of stringByAddingPercentEscapesUsingEncoding

Per deprecation message:

> 'stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.

Reviewed By: cipolleschi

Differential Revision: D49610243

fbshipit-source-id: 7c40ce9f6b643851c8aae8149acde2c435c06a76
2023-09-26 10:26:06 -07:00
Katy Chang 91d3a9539d Change assertion to avoid crash in ReactScrollView.java (#39593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39593

Looking into a crash leads by assertion error in this line, I talked to NickGerleman and we think there might be some case when ContentView is not rendered, so it would have 0 child. Changing the assertion to allow 0 child.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D49508540

fbshipit-source-id: 43c50814ead24332c1b24ff2dea50d564519034b
2023-09-26 10:13:03 -07:00
Dmitry Rykun 4fbe05577b Enable native view configs in bridgeless mode in OSS (#39476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39476

This diff enables native view config interop layer in bridgeless mode by default for OSS.
It also removes redundant `enableNativeViewConfigsInBridgelessMode` JS feature flag.
Changelog: [General][Added] - Native view config interop layer enabled in bridgeless mode.

Reviewed By: luluwu2032

Differential Revision: D49318325

fbshipit-source-id: ea2e38b2ea10637b578d98e38d97eed923498fb3
2023-09-26 09:59:16 -07:00
Dmitry Rykun 3eb8e4d482 Make hermesc build script to run in a clean build environment (#39662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39662

Hermesc is built with the build script that is executed by Xcode as a "Run script" build phase. For every build Xcode configures environment based on the build target. The Hermesc build script runs in that environment.

**The problem**
If we build for iPhone of iPhone Simulator, then the environment is configured for these platforms, but Hermesc must always be built for macosx.

**The old solution**
Previously we experimentally determined what envvars should be changed for Hermesc build to succeed. But it is not robust, because this may change with new Xcode releases.

**The new solution**
We clear the entire environment and only define `SDKROOT`. This is equivalent to running Cmake outside of Xcode.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D49639599

fbshipit-source-id: f8d8fccb0e61605b1fef9927dc4a3fdf79e4f212
2023-09-26 09:58:00 -07:00
Arushi Kesarwani 35a66302d0 Reduce visibility of functions in ReactHostImpl (#39640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39640

changelog: [internal] internal

Reducing visibility from public to package only for `ReactHostImpl.getDefaultHardwareBackBtnHandler()` since it's only used within package

Reviewed By: mdvacca

Differential Revision: D49612859

fbshipit-source-id: 3c40888da732f33dc046d9363b08119e707f4ea4
2023-09-26 07:30:41 -07:00
Cookiezby 8c779cd630 fix: typo at utils.rb (#39572)
Summary:
Fix typo in `packages/react/native/scripts/cocoapods/utils.rb`

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[iOS] [Fixed] - Fix the typo for the method `is_using_xcode15_or_greater`

Pull Request resolved: https://github.com/facebook/react-native/pull/39572

Reviewed By: dmytrorykun

Differential Revision: D49594275

Pulled By: cortinico

fbshipit-source-id: 8637fc9b10cfad3742b038ed9402585fe2af56b7
2023-09-26 06:57:52 -07:00
Nicola Corti 63ca55bdcc Unblock build-from-source on nightlies (#39634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39634

Running build from source as suggested here:
https://reactnative.dev/contributing/how-to-build-from-source
is currently broken for nightly versions (and for 0.73).

This fixes it by:
- Fixing the import of the Gradle Version Catalog
- Actually adding the Gradle version catalog to the NPM package
- Fixing how the build Codegen CLI task is invoked for build-from-source
- Updating the search directories for codegenDir/reactNativeDir from build-from-source

Changelog:
[Internal] [Fixed] - Unblock build-from-source on nightlies

Reviewed By: cipolleschi

Differential Revision: D49562595

fbshipit-source-id: 9594b7d947569d41c461a7e8287d3ae68fb87b98
2023-09-26 06:26:55 -07:00
lizhiqiang05 babbc3e43c fix: Text cut off issues when adjusting text size and font weight in system settings (#39581)
Summary:
Fix Text cut off issues when adjusting text size and font weight in system settings.

This pr fixed the problem that can be reproduced with the [snack](https://snack.expo.dev/fl5DSrLBJ) on Xiaomi devices with MIUI13 and MIUI14. The problem is shown as the image below: the number "999" is cut off and only "99" is rendered.
<img src="https://github.com/facebook/react-native/assets/23273745/64269ced-4060-4ab5-8233-8199e4f2acbd" width="20%" height="20%" alt="text-cutoff-when-scaling-miui14" />

The problem is produced with setting font scaling in system settings like the image below shows.

<img src="https://github.com/facebook/react-native/assets/23273745/c31d1bf2-d038-4536-b1a4-509050f2aa7c" width="20%" height="20%" alt="settings" />

This text cut off case can be avoided by setting [`allowFontScaling`](https://reactnative.cn/docs/text#allowfontscaling) to false. But this pr can make it no matter what value `allowFontScaling` is set.

The root cause of this case, according to MIUI developers, is that Misans typeface, as a variable font which will adjust the weight of different font axes with different font size, gets different widths when Text is measured and drawn for a bug in the framework of MIUI rom. They will fix this bug in next version while this pr fixed it in old versions.

## Changelog:

[ANDROID][FIXED]-Fix Text cut off issues when adjusting text size and font weight in system settings.

<!-- 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

Pull Request resolved: https://github.com/facebook/react-native/pull/39581

Test Plan:
The effect after fixed is shown in the image below.

<img src="https://github.com/facebook/react-native/assets/23273745/1f93f47f-5cdf-4ee1-934a-6cb3b04309ea" width="20%" height="20%" alt="fixed" />

Reviewed By: NickGerleman

Differential Revision: D49509633

Pulled By: ryancat

fbshipit-source-id: fd93f14bdbced8026a45dc9e0299465962433de5
2023-09-25 20:07:06 -07:00
Alan Hughes 6118aff69d fix: over reporting trait changes (#39439)
Summary:
Closes https://github.com/facebook/react-native/issues/35972
Closes https://github.com/facebook/react-native/issues/36713

This PR addresses a couple of issues with `useColorScheme` and the `Appearance` API.

- https://github.com/facebook/react-native/issues/38214 introduced a regression. Using to `RCTExecuteOnMainQueue` was a mistake as we need this to happen synchronously to return the result. Doing it async causes the `traitCollection` to remain uninitialized.
- The `useColorScheme` hook is updating when the app is in the background on iOS and the OS is taking the snapshots for the app switcher. This causes a flash when returning to the app as the correct color is set again. Here, we can check for the app state in `traitCollectionDidChange` and not send these events when in the background.
- Removed a line that was left over after some OS version checks were removed when support for iOS 12 was dropped.

## Changelog:

[IOS] [FIXED] - Don't send the `RCTUserInterfaceStyleDidChangeNotification` when the app is in the background.

Pull Request resolved: https://github.com/facebook/react-native/pull/39439

Test Plan: Tested on `rn-tester`, logged the changes whenever `useColorScheme` updates. It no longer happens when the app is in the background. The returned interface style on the initial render is always correct now.

Reviewed By: NickGerleman

Differential Revision: D49454281

Pulled By: javache

fbshipit-source-id: 87e24158a49c50608c79e73fb484442f5aad36a6
2023-09-25 20:00:41 -07:00
David Vacca 27b631e5b0 reactHostInterface -> reactHost (#39636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39636

rename ReactApplication.reactHostInterface -> ReactApplication.reactHost

changelog: [internal] internal

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D49610674

fbshipit-source-id: 24ddf410cf6aae176f673dc574216a3a12f25767
2023-09-25 18:09:13 -07:00
Saad Najmi c62d174989 Remove undefined references to OCMock from RNTesters' pbxproj (#39616)
Summary:
In https://github.com/facebook/react-native/pull/36239 , I removed the copy of libOCMock we had locally in favor of a Pod. The references were left in RNTester's pbxproj and undefined. Let's just remove them.

## Changelog:

[INTERNAL] [FIXED] - Remove undefined references to OCMock from RNTesters' pbxproj

Pull Request resolved: https://github.com/facebook/react-native/pull/39616

Test Plan: CI should pass

Reviewed By: NickGerleman

Differential Revision: D49612102

Pulled By: ryancat

fbshipit-source-id: 85a5a67612dc58d5dba906edc1c56091d22b0978
2023-09-25 16:28:11 -07:00
Saad Najmi 036d5072b1 Don't load RCTRootViewIntegrationTestsApp.bundle in objc-test.sh (#39615)
Summary:
https://github.com/facebook/react-native/pull/38871/ removed all the RCTRootViewIntegrationTest stuff. Looks like we missed a line so I'm removing now.

## Changelog:

[INTERNAL] [FIXED] - Don't load RCTRootViewIntegrationTestsApp.bundle in objc-test.sh

Pull Request resolved: https://github.com/facebook/react-native/pull/39615

Test Plan: CI should pass

Reviewed By: cipolleschi

Differential Revision: D49612227

Pulled By: ryancat

fbshipit-source-id: c16dcf7bec0bdfa839d250cfa6eadf83d792ae0d
2023-09-25 16:28:11 -07:00
Lulu Wu a07c31bb4b Add DefaultReactHost for Template (#39585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39585

So that to enable Bridgeless in Template android we only need to override the ReactHostInterface variable in Template's application, see D49464580

Changelog:
[Android][Changed] - Add DefaultReactHost

Reviewed By: cortinico

Differential Revision: D49463901

fbshipit-source-id: ff6ef1bef8626996a3658597d1519eec310c77c3
2023-09-25 14:54:04 -07:00
Dmitry Rykun 3f1ee478bb Native view configs in bridgeless mode: constantsToExport support (#39519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39519

If the `constantsToExport` method is overridden by RCTViewManager subclass, we'll out those constants in "Constants" property of the view config.
This diff also defines a property on UIManager for every view configs. This add support for `UIManager.RNTMyLegacyNativeView.Constants.PI` syntax in bridgeless mode.
Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D49372561

fbshipit-source-id: e9333c94ad882ee38a5a3729ccc19330d7736657
2023-09-25 14:23:56 -07:00
Dmitry Rykun 2de964cfd2 Set runtime config provider for the Template (#39633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39633

This diff sets runtime config provider for the template. It sets `native` to `false` to prioritize static view configs over native view configs.
Changelog: [Breaking] - Set runtime config provider for the Template.

Reviewed By: luluwu2032

Differential Revision: D49604628

fbshipit-source-id: 0ea19eb76fc67d0df862b82ec4b9d172ae92d56d
2023-09-25 13:03:57 -07:00
Sunbreak af7bf9371c Fix typo of JSI module Cpp codegen (#39604)
Summary:
Fix code generatetion comment from `GenerateModuleH.js` to `GenerateModuleCpp.js`

## Changelog:

[GENERAL] [FIXED] - Fix typo of JSI module Cpp codegen

Pull Request resolved: https://github.com/facebook/react-native/pull/39604

Test Plan: None

Reviewed By: christophpurrer

Differential Revision: D49558245

Pulled By: cortinico

fbshipit-source-id: 28b6a6f4da0f5f973717f785fe21db86179f1996
2023-09-25 12:30:34 -07:00
Thibault Malbranche 87d2ea9c36 Add 0.72.5 changelog (#39628)
Summary:
Adds changelog for the 0.72.5 patch.

Changelog:
[Internal] [Changed] - Add 0.72.5 changelog

Pull Request resolved: https://github.com/facebook/react-native/pull/39628

Reviewed By: cipolleschi

Differential Revision: D49594657

Pulled By: huntie

fbshipit-source-id: 275092c73bc786a5ec2c1a6a736b2f991fd8ae86
2023-09-25 10:55:26 -07:00
Lulu Wu cee5dceac7 Fix instacrash with RNTester (#39631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39631

Don't display the PopupWindow when current activity is in a bad state, other wise there will be a crash P832378432

Changelog:
[Android][Changed] - Don't display the PopupWindow when current activity is in a bad state

Reviewed By: mdvacca

Differential Revision: D49501328

fbshipit-source-id: 1a51855daa470e8da9399f72ca7211a95388e38f
2023-09-25 10:51:24 -07:00
Lulu Wu 188eceec98 Fix crash "lateinit property initialProps has not been initialized" (#39632)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39632

Found a new [crash](P837035842) caused by converting RNTesterActivity to kotlin in D49506304

Changelog:
[Android][Changed] - fix crash "lateinit property initialProps has not been initialized"

Reviewed By: cortinico

Differential Revision: D49594073

fbshipit-source-id: e6d086f6e9bc64b449e6a3da4bc1903729970e7d
2023-09-25 10:36:04 -07:00
evanbacon 030663bb06 bump react-refresh to latest (#39486)
Summary:
- Companion PR to https://github.com/facebook/metro/pull/1085
- The Fast Refresh changes appear to be required for using static rendering and React DOM. In frameworks like Expo Router which support both native and web, this causes users to not be able to use Fast Refresh on web.

## Changelog:

[GENERAL] [CHANGED] - Upgrade React Refresh package from 0.4.0 to 0.14.0

Pull Request resolved: https://github.com/facebook/react-native/pull/39486

Test Plan:
1. In a React Native project's `package.json`:
```json
 "resolutions": {
    "react-refresh": "~0.14.0"
  },
```
2. Start the server with a clear Metro cache.
3. Changes should update while preserving React state.

Reviewed By: huntie

Differential Revision: D49348078

Pulled By: robhogan

fbshipit-source-id: ac3dcb096c35c6c29c6e6a919cf263559bceaa7c
2023-09-24 07:16:28 -07:00
Rob Hogan 0d23ef5bde Gradle distribution type bin -> all (#39619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39619

https://github.com/facebook/react-native/pull/39603 unintentionally changed our Gradle distribution type in `gradle.properties` to `bin`. This changes it back to `all` while preserving the upgrade to 8.3.

Generated with
```
./gradlew wrapper --gradle-version=8.3 --distribution-type all
```

Changelog:
[Internal][Changed] Revert Gradle distribution type to ‘all’

Reviewed By: NickGerleman

Differential Revision: D49569492

fbshipit-source-id: fc5b2c8a2c2cea455ed5bd0dbd6743d34b527c9b
2023-09-24 06:09:53 -07:00
Pieter Vanderwerff 29f62a41b4 Deploy 0.217.0 to fbsource (#39610)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39610

Reviewed By: SamChou19815

Differential Revision: D49522399

fbshipit-source-id: 98dc8ce53a4dea2b68909fda5f92251c6cc91717
2023-09-22 17:29:26 -07:00