Commit Graph
32109 Commits
Author SHA1 Message Date
Koichi Nagaoka 0c9c57a9f7 Fix onChangeText not firing when clearing the value of TextInput with multiline=true on iOS (#37958)
Summary:
This fix fixes the TextInput issue in https://github.com/facebook/react-native/issues/37784 with onChangeText not working on iOS only.

## Changelog:

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

[IOS] [FIXED] - Fix onChangeText not firing when clearing the value of TextInput with multiline=true on iOS

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

Test Plan:
1. Run the repro code given in the issue (https://github.com/facebook/react-native/issues/37784).
2. Verified that onChangeText works after pressing the submit button.
3. Run the repro code from the issue (https://github.com/facebook/react-native/issues/36494) that caused this issue.
4. Verified that issue (https://github.com/facebook/react-native/issues/36494) is not reoccurring.

Reviewed By: rshest

Differential Revision: D47185775

Pulled By: dmytrorykun

fbshipit-source-id: 1a1a6534d6bf8b5bb8cf1090734dd894bab43f82
2023-07-04 06:25:22 -07:00
Lorenzo Sciandra c0b2770dee add 0.71.12 and 0.70.11 changelog (#38182)
Summary:
Adds changelog for new patch.

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

[Internal] [Changed] - add changelog entry for 0.71.12 and 0.70.11

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

Test Plan: N/A

Reviewed By: GijsWeterings

Differential Revision: D47210080

Pulled By: cipolleschi

fbshipit-source-id: d0df8184a0a6f7848d2bf08102329b73bcb67846
2023-07-04 06:15:05 -07:00
Nicola Corti 16201f8be3 Move Flipper integration to a separate Gradle module inside ReactAndroid (#37688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37688

This moves the `ReactNativeFlipper` classes used to configure Flipper on Android from the template to
a separate Gradle artifact that will be published under the coordinates:
```
com.facebook.react:flipper-integration:0.73.x
```

This reduces the footprint of Flipper on the app template and makes easier for user on 0.73 to migrate
to Kotlin (as they will now have to migrate only 2 files rather than 4).

Changelog:
[Android] [Changed] - Move Flipper integration to a separate Gradle module inside `ReactAndroid`

Reviewed By: huntie

Differential Revision: D46441588

fbshipit-source-id: e197f29b7386b52091b8d38ed09bbd8f74a997df
2023-07-04 06:01:09 -07:00
Gabriel Donadel 0e80fdb1e9 fix: Fix id prop not working on all Touchable components (#38169)
Summary:
This PR fixed the `id` prop to being correctly mapped to `nativeID` on the following components: `TouchableBounce`, `TouchableHighlight`, ` TouchableNativeFeedback`, and `TouchableOpacity`.

Closes https://github.com/facebook/react-native/issues/38117
Follow up of https://github.com/facebook/react-native/pull/34522

## Changelog:

[GENERAL] [FIXED] - Fix `id` prop not working on `TouchableBounce`, `TouchableHighlight`, ` TouchableNativeFeedback`, and `TouchableOpacity`

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

Test Plan: Ensure that the `id` prop android tests pass on CircleCI

Reviewed By: jacdebug

Differential Revision: D47209319

Pulled By: cortinico

fbshipit-source-id: 50cdf0f1113e067aa46d55e4faaff6818509546e
2023-07-04 05:06:32 -07:00
JP ee1cd13db6 iOS: only exclude i386 while using hermes (#38132)
Summary:
- if an existing iOS project specifies `EXCLUDED_ARCHS`, these settings are overwritten by the `react_native_post_install` step as part of the Cocoapods install
- closes https://github.com/facebook/react-native/issues/35544

### Existing Behaviour

- one of the functions called as part of the `react_native_post_install` step is `exclude_i386_architecture_while_using_hermes`
  - see [/packages/react-native/scripts/cocoapods/utils.rb](https://github.com/facebook/react-native/blob/v0.72.1/packages/react-native/scripts/cocoapods/utils.rb#L56-L69)
```
    def self.exclude_i386_architecture_while_using_hermes(installer)
        projects = self.extract_projects(installer)

        # Hermes does not support `i386` architecture
        excluded_archs_default = self.has_pod(installer, 'hermes-engine') ? "i386" : ""

        projects.each do |project|
            project.build_configurations.each do |config|
                config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = excluded_archs_default
            end

            project.save()
        end
    end
```

🐛 **However** 🐛

- this function is currently called regardless of whether or not you are **actually** using Hermes
- this means existing projects that have `EXCLUDED_ARCHS` set, the existing value will be changed either to `"i386"` or a blank string

### Changed Behaviour

- moved the function call inside an `if ReactNativePodsUtils.has_pod(installer, "React-hermes")` block
- `EXCLUDED_ARCHS` should only be modified if needed now

## Changelog:

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

[IOS] [FIXED] Only modify EXCLUDED_ARCHS when needed for Hermes

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

Reviewed By: cortinico

Differential Revision: D47149618

Pulled By: cipolleschi

fbshipit-source-id: cffc2a0d4bc35fa4e933d3f4df6ee85e2f5c4486
2023-07-04 03:38:47 -07:00
Nicola Corti f92ed27fa4 Do not directly access RuntimeEnvironment.application in tests (#38159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38159

Accessing `RuntimeEnvironment.application` is deprecated and we should instead use `RuntimeEnvironment.getApplication()`

Changelog:
[Internal] [Changed] - Do not directly access RuntimeEnvironment.application in tests

Reviewed By: rshest

Differential Revision: D47186902

fbshipit-source-id: dc28930570e2991da0ad91311f0402fd73af8214
2023-07-04 03:19:43 -07:00
Intl Scheduler ebc1fe6d53 translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907911888160
Sandcastle Job Instance ID: 22517999121458532
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47203365

fbshipit-source-id: 99e1419cca5258ec2fc512c75b4675fb2c27e842
2023-07-03 21:12:17 -07:00
Sam Zhou ee425cca0d Deploy 0.211.0 to xplat (#38168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38168

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D47202522

fbshipit-source-id: a3c9fddfcdf917bb88006832cc597b31ed4a76d4
2023-07-03 20:26:57 -07:00
Intl Scheduler e64373aa86 translation auto-update for i18n/talk.config.json on master
Summary:
Chronos Job Instance ID: 1125907911705690
Sandcastle Job Instance ID: 18014399495936303
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47202642

fbshipit-source-id: 5d923d36d271cd92d9faedaaa5909716aa3ae978
2023-07-03 18:34:20 -07:00
Intl Scheduler 33ce19d963 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907911705690
Sandcastle Job Instance ID: 18014399495936303
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47202640

fbshipit-source-id: 37cb4c1ec3d99a7410d5a81bcc27429e6d400392
2023-07-03 18:34:20 -07:00
Rubén Norte f193b1774c Enable MutationObserver in RNTester (#38101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38101

This adds a few examples of using `MutationObserver` in React Native to RNTester.

`MutationObserver` isn't yet enabled so these shouldn't be accessible normally for the time being.

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D46149087

fbshipit-source-id: 8374b5915b8474a17a2f2e3277a9f409f6ab8380
2023-07-03 15:34:34 -07:00
Rubén Norte b1040c4e46 Implementation of a subset of MutationObserver (#38100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38100

This creates an experimental subset of MutationObserver. This will not be available yet and is only compatible with the new React Native architecture. This shouldn't show up in the changelog until we're ready to enable this in some form.

Changelog: [Internal]

## Context

This implements a subset of the `MutationObserver` API (as defined on the Web) for React Native.

This subset allows observing nodes added or removed from the UI tree (at any depth) without modifications in user code. This is not possible at the moment and it's required by some performance logging APIs that rely on observability for tracking.

**This is not intended for general use at the moment**. We will continue experimenting with this API and might change important details about how it works.

## Implementation details

This API is implemented as a native module that registers a commit hook in Fabric. Whenever there's a commit in React Native, we check for nodes added or removed from the shadow tree (compared with the previous committed version).

**This implementation is completely cross-platform.**

This API uses a centralized entity in JS and native to handle registration of observers and dispatch of notifications. The dispatch the notifications for all observers in the same callback so we can easily change the sequencing of events easily (for example, we can change this to use microtasks when they're available in RN).

An important aspect to highlight about this is that we call into JavaScript when executing the commit hooks. **We assume that commit hooks that trigger mutations will always happen in the JS thread**, so it's safe to do so. This was necessary because React nullifies all fields in fiber when they're unmounted, and we're reporting nodes being deleted. If we wait too long to get a reference to the public instances, they become unavailable and this API doesn't work correctly. To avoid this we eagerly get references to these public instances right when mutations are being applied, so it's safe.

## Known limitations

* Only the `childList` and `subtree` options are supported.
* There is a feature flag in React Native to do commits in background threads to avoid having to do that work in JS (including layout). This implementation is NOT compatible with that and we're currently working on removing the background executor permanently.
* Notifications from `MutationObserver` are dispatched as regular JavaScript tasks, not as microtasks, and they don't block rendering/mount/paint. Some consequences of that are:
  * UI changes done in MutationObserver callbacks are not flushed atomically with the changes being observed. This is caused by the lack of microtasks and because Fabric doesn't wait for them to mount commits in the host platform.
  * MutationObserver callbacks cannot reliably set up intersection observers to get a notification for the first paint, as it could have potentially happened already (similar to the previous point).

We are working on infrastructure changes (support for microtasks, blocking paint on microtasks, etc.) to overcome this limitations.

----

Reviewed By: sammy-SC

Differential Revision: D46149086

fbshipit-source-id: be7ba4acd0886d1661a6500d61d2122f34b98b5a
2023-07-03 15:34:34 -07:00
Rubén Norte 2ccde4060e Small cleanups for IntersectionObserver (#38099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38099

A couple of small cleanups after the bulk of the work for `IntersectionObserver` was already merged.

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D47056943

fbshipit-source-id: 2a6f9062d91da458f8b980f3abcdc9a4ac86389b
2023-07-03 15:34:34 -07:00
Luna Wei 2910f87b58 JestE2E: Add view screenshots
Summary: Changelog: [Internal] - Add e2e snapshot testing for our View examples on rntester

Reviewed By: NickGerleman

Differential Revision: D47073356

fbshipit-source-id: 979d34227a5ae77d2d03636d40617b7ecf44c28e
2023-07-03 13:24:11 -07:00
Nicola Corti bf7b81f3a2 Fix multiple warnings post Kotlin migration (#38156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38156

As we migrated several files from Java to Kotlin, our build log got really noisy with several compilation warnings.
That's happing as the Kotlin compiler is stricter than the Java one.

Here I've fixed most of them.

Changelog:
[Internal] [Changed] - Fix multiple warnings post Kotlin migration

Reviewed By: rshest

Differential Revision: D47185820

fbshipit-source-id: f49c90b4a6db9892979ea95b404cf427805c6503
2023-07-03 12:20:01 -07:00
Jatin Nagar f90829fb01 converted JavaScriptModuleRegistryTest java file to kotlin (#38143)
Summary:
Helping in [Kotlin-ify React Native tests](https://github.com/facebook/react-native/issues/37708), Converted [react/bridge/JavaScriptModuleRegistryTest.java](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaScriptModuleRegistryTest.java) to kotlin file

## Changelog:

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

[INTERNAL] [CHANGED] - `JavaScriptModuleRegistryTest.java` file migrated from java to kotlin

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

Test Plan:
Tests should pass
```
./gradlew :packages:react-native:ReactAndroid:test
```

Reviewed By: NickGerleman

Differential Revision: D47164993

Pulled By: mdvacca

fbshipit-source-id: 6aee2bcb2766fc2e6d68f4df272aaafb9c65bdcb
2023-07-03 11:51:42 -07:00
Intl Scheduler b10f0b8a8b translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907911327421
Sandcastle Job Instance ID: 31525198377833807
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47193308

fbshipit-source-id: 7b96b75004d7f2e3fe4aeba0a66f3a496d512a65
2023-07-03 10:44:49 -07:00
Alex Hunt d1882c3056 Remove duplication in rn-tester react-native.config.js file (#37978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37978

Tweaks `react-native.config.js` files to remove duplication. `rn-tester` now references framework-included config from `react-native` (ahead of making config additions to this entry point).

As far as I can tell (from historic diff context), the presence of `packages/rn-tester/react-native.config.js` is a special case, due to the CLI's config discovery algorithm, and this file needs to remain a complete config.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D46859698

fbshipit-source-id: 5d31c6ffe43a364f1f2e7d456a6bc15f900be336
2023-07-03 09:55:11 -07:00
Rob Hogan 971bb81d13 Monorepo Jest - remove now unnecessary Babel registration (#38146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38146

Now that `metro-react-native-babel-transformer` may be loaded from source without transformation, we can remove this workaround / potential footgun.

Jest uses Babel imperatively and doesn't rely on registration (require hooks), so registering within the preprocessor potentially conflicts and has caused problems before. This just tidies up some complexity we don't need.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D47162728

fbshipit-source-id: 06215f9bb7b8e71bcca0429d0bae9f20a22f45a8
2023-07-03 06:58:20 -07:00
Rob Hogan 1202d394a9 Add Babel Flow lib defs to React Native repo (#38145)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38145

Add Babel type definitions ahead of moving `metro-react-native-babel-transformer` under `react-natve`.

These are mostly duplicated from https://github.com/facebook/metro, adapted for RN's naming conventions and lint rules.

Changelog:
[Internal]

Reviewed By: christophpurrer

Differential Revision: D47154206

fbshipit-source-id: a44703f6926507732f2f1c65a17e5d4ac590c724
2023-07-03 06:58:20 -07:00
Intl Scheduler 259a316893 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907910595572
Sandcastle Job Instance ID: 987595037
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47173948

fbshipit-source-id: 0b8415edf595f772153be1990faabb8fbef0b9d2
2023-07-01 23:54:27 -07:00
Intl Scheduler 5957014266 translation auto-update for i18n/instagram.config.json on master
Summary:
Chronos Job Instance ID: 1125907910595572
Sandcastle Job Instance ID: 987595037
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47173950

fbshipit-source-id: 8c9a28a8e20121b74317746f3d01c8c4369a13ca
2023-07-01 23:54:27 -07:00
Intl Scheduler 0958b9b0b6 translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907910549669
Sandcastle Job Instance ID: 18014399495240353
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47173375

fbshipit-source-id: f97a11774474da12c31ba52b46b05f189e717ae0
2023-07-01 20:29:59 -07:00
Intl Scheduler 5262e9bb63 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907910428138
Sandcastle Job Instance ID: 9007200238030275
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47172440

fbshipit-source-id: 3f0f85f09e8bd200f5855e3e8a65e7769e419eea
2023-07-01 14:19:18 -07:00
Intl Scheduler eca0d1231a translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907910091203
Sandcastle Job Instance ID: 4503600612360907
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47170011

fbshipit-source-id: ecead608224885a47f9eb1d90dd8b348ebbcba0f
2023-07-01 04:24:00 -07:00
Nick Gerleman 5008a91029 Disable REACT_NATIVE_DEBUG in gray builds (#38082)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38082

Reviewed By: javache

Differential Revision: D47028243

fbshipit-source-id: 79b3bc2a075bf74fcf4aa197326ec00150167845
2023-06-30 22:18:11 -07:00
Jatin Nagar a9bfd7bb70 converted InteropEventEmitter java file to kotlin (#38144)
Summary:
Helping in [Kotlin-ify React Native tests](https://github.com/facebook/react-native/issues/37708), Converted [react/fabric/interop/InteropEventEmitterTest.java](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/InteropEventEmitterTest.java) to kotlin file

## Changelog:

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

[INTERNAL] [CHANGED] - `InteropEventEmitterTest.java` file migrated from java to kotlin

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

Test Plan:
Tests should pass
```
./gradlew :packages:react-native:ReactAndroid:test
```

Reviewed By: NickGerleman

Differential Revision: D47165007

Pulled By: mdvacca

fbshipit-source-id: 459b0867810eb1b782eea354d74152306b9546ff
2023-06-30 18:57:19 -07:00
Intl Scheduler 81785c241e translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907909899955
Sandcastle Job Instance ID: 987038736
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47165666

fbshipit-source-id: 056ff6f434ba7153fde8f5de1486789ff08157dc
2023-06-30 17:55:59 -07:00
David Vacca ea48fd24ea Resorting methods in ReactHost class (#38043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38043

Resorting methods in ReactHost class, this class in very long and to make it easy to read and analyze I'm sorting methods as public -> package -> private

no changes of behavior are happening here

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D46773622

fbshipit-source-id: 4e2867930dc84ef410569532e8a195e491a6a553
2023-06-30 14:57:39 -07:00
Panagiotis Vekris 5fd32d71e9 Upgrade hermes-* packages in xplat and arvr to 0.14.0 (#38133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38133

Upgrade hermes parser packages to the latest released versions.

Changelog is here: https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md

Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D47133130

fbshipit-source-id: e1022f491feb08273fd340eb1fce7256d3a2f191
2023-06-30 11:10:35 -07:00
Rob Hogan 005d832d53 Update CLI to 12.0.0-alpha.6, Metro to 0.76.7 (#38141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38141

Bump CLI and Metro versions on main to latest.

Changelog:
[General][Fixed] - Bump CLI to 12.0.0-alpha.6, Metro to 0.76.7

Reviewed By: dmytrorykun

Differential Revision: D47153654

fbshipit-source-id: d9eff64e5539f0e577e059bce836af3c65a4a8c7
2023-06-30 09:54:17 -07:00
Pieter De Baets 0fe5ffd568 Do not create RuntimeExecutor on non-JSI executors (#38125)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38125

On Android, when using the remote debugging feature (using legacy websockets), it's not safe to assume we can get a `jsi::Runtime` from `JSExecutor`.

Changelog: [General][Fixed] Android does't crash when using remote debugger

Reviewed By: NickGerleman

Differential Revision: D47124234

fbshipit-source-id: 0542da1aca5d411964e3a0833f4c48428ed90c91
2023-06-30 08:09:30 -07:00
Intl Scheduler 2d1b459bd6 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907909617241
Sandcastle Job Instance ID: 986703379
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47154185

fbshipit-source-id: c6b975da1afe1e14f5019bacd716bdb4f81f8d6e
2023-06-30 07:49:52 -07:00
Nicola Corti c3f672cef7 Use vals inside ReactApplication (#38088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38088

For better Kotlin interop we should be using `val` in this interface rather than just `fun`.
This is not a breaking change as Java users can still use `getReactNativeHost()` as before.

Changelog:
[Internal] [Changed] -  Use vals inside ReactApplication

Reviewed By: javache

Differential Revision: D47053030

fbshipit-source-id: 4a7fbc71a76be54e1cf7daef499b9bc3e8fc615a
2023-06-30 06:02:01 -07:00
Nicola Corti 3a912a3716 Add foojay-resolver-convention to auto-download the right JDK (#38139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38139

This adds https://github.com/gradle/foojay-toolchains to our build setup.
This will make sure that if the user doesn't have JDK 17 installed, it will be
autodownloaded once they try to build the first time.

Changelog:
[Internal] [Changed] - Add foojay-resolver-convention to auto-download the right JDK

Reviewed By: sammy-SC

Differential Revision: D47129944

fbshipit-source-id: fd49f6dfe5f87ce3f01e5cce3527144fb96f032a
2023-06-30 05:30:29 -07:00
Samuel Susla 5bda54c1f1 Disable nstextstorage_caching in OSS (#38129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38129

changelog: [iOS] Disable NSTextStorage caching in OSS

A [bug was reported](https://github.com/facebook/react-native/issues/37944) for NSTextStorage caching. Even thought I fixed the bug in D47019250, I want to disable the feature in OSS until the fix is verified in Facebook app.
My plan is to pick this commit for 0.72.1 and reenable NSTextStorage caching once the fix is validated.

Reviewed By: NickGerleman

Differential Revision: D47127912

fbshipit-source-id: 97694e383eb751e89b776c0599969f2c411bac6f
2023-06-30 05:12:39 -07:00
Gabriel Donadel 835f62c189 Fix use_react_native to support absolute paths (#37545)
Summary:
While setting up a monorepo that required a custom react-native path location (react-native-macos in my case) I was getting the following error when running `pod install`

![image](https://github.com/facebook/react-native/assets/11707729/29bacfbb-78d9-49db-9c75-3e75674d87e9)

That's because `build_codegen` and `checkAndGenerateEmptyThirdPartyProvider` functions don't check if the given `react_native_path` is absolute or relative.

This PR fixes this problem by checking if `react_native_path` starts with `/`

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Fix `use_react_native` to support custom react native absolute paths

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

Test Plan:
Modify [rn-tester/Podfile](https://github.com/facebook/react-native/tree/main/packages/rn-tester/Podfile) to use an absolute path when calling `use_react_native`

E.g.

```rb
rn_path = File.dirname(`node --print "require.resolve('react-native/package.json')"`)

use_react_native!(
  path: rn_path,
  ...
)
```

then run `pod install`

Reviewed By: cortinico

Differential Revision: D46279570

Pulled By: cipolleschi

fbshipit-source-id: 0d6da12c5617cfca2c9ef9dea08ecf728a970b6f
2023-06-30 04:12:18 -07:00
Lorenzo Sciandra ed929dfd01 add 0.72.1 changelog (#38131)
Summary:
Adds changelog for new patch.

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

[Internal] [Changed] - add changelog entry for 0.72.1

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D47149515

Pulled By: cipolleschi

fbshipit-source-id: 737032c204d68749770801fa34ecb8d212b8958f
2023-06-30 04:05:49 -07:00
louiszawadzki a4a0655496 Fix pod install for swift libs using new arch (#38121)
Summary:
This fixes a bug that started with React Native 0.72.0 when using the new architecture and installing a native lib that has Swift code (in my case, `datadog/mobile-react-native`).

Running `pod install` errors with the following output (`DatadogSDKReactNative` is the pod containing the Swift code):

```
[...]
Analyzing dependencies
Downloading dependencies
Installing DatadogSDKReactNative 1.8.0-rc0
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `DatadogSDKReactNative` depends upon `React-Fabric`, `React-graphics`, `React-utils`, and `React-debug`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
```

Indeed, this pods were added as dependencies in `packages/react-native/scripts/cocoapods/new_architecture.rb` but do not define modules contrary to the other pods in the list.

This PR is solving a problem that already occured in the past and was solved here: https://github.com/facebook/react-native/pull/33743
It's a new implementation for the PR initially opened here: https://github.com/facebook/react-native/pull/38039

## Changelog:
[IOS] [FIXED] - Fix pod install for libraries using Swift code when the new architecture is enabled

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

Test Plan:
1. Clone [this](https://github.com/louiszawadzki/react-native) repo
2. From `main`, add a Swift file to the `MyNativeView` native module in the RN tester app (see inspiration from [this commit](https://github.com/fortmarek/react-native/commit/26958fccf4b4ac90d0bf9bb3699f12760a6b2b58))
3. Try to run `RCT_NEW_ARCH_ENABLED=1 USE_HERMES=0 bundle exec pod install` inside the `packages/rn-tester`
4. Observe errors
5. Apply [the commit](https://github.com/facebook/react-native/commit/7b7c3ff530cae07daccc5b5ea6b72d239f913be0) from this PR
6. Both pod install and the subsequent build should succeed.
7. Revert the changes and repeat steps 2 to 6 with `RCT_NEW_ARCH_ENABLED=1 USE_HERMES=1 bundle exec pod install`

Reviewed By: cortinico

Differential Revision: D47127854

Pulled By: cipolleschi

fbshipit-source-id: bf7f65e0d126195a76a0fafbe2f3172f00d5adc1
2023-06-30 03:07:59 -07:00
Intl Scheduler 80a2b8ea54 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907909241891
Sandcastle Job Instance ID: 4503600611310924
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47142727

fbshipit-source-id: 5889656b2714716a3b12862a898a9b1a235f3bdc
2023-06-29 18:05:01 -07:00
Luna Wei fc01ab62fd JestE2E: Add border screenshots (#38045)
Summary:
Changelog: [Internal] - Update some RNTester examples to allow for internal snapshot tests

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

From 0.72 border breakage, adding screenshot tests for our border examples in RNTester

Reviewed By: NickGerleman

Differential Revision: D46993114

fbshipit-source-id: b2d569c8a09098271ed74a6a88744ae75e373003
2023-06-29 16:56:49 -07:00
Nick Gerleman 3f6412b934 Remove YGExperimentalFeatureFixAbsoluteTrailingColumnMargin (#37374)
Summary:
X-link: https://github.com/facebook/yoga/pull/1317

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

This is edge-casey enough, and I actually broke this in D42282358 without us noticing (I changed height to width of the bottom usage, instead, copy/pasting the value of the top one).

Reviewed By: yungsters

Differential Revision: D45766764

fbshipit-source-id: b600b79b8436534fe48ef2acbfde8ba64068e593
2023-06-29 11:04:01 -07:00
Alex Hunt 29f2602ff9 Add global hook to assert that base Metro config is called (#38126)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38126

Towards https://github.com/react-native-community/cli/issues/1987. Will be paired with a CLI PR targeting React Native 0.72.1.

Changelog: None

Reviewed By: motiz88

Differential Revision: D47125080

fbshipit-source-id: b3b9d93ba747240f5168021ccb793ffe5d34251d
2023-06-29 08:51:14 -07:00
Intl Scheduler 0bd6b28b32 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907908625836
Sandcastle Job Instance ID: 985666883
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47117968

fbshipit-source-id: 66b6978e1099d9f2bba668dfd9fafadbe398eca9
2023-06-28 23:56:00 -07:00
Intl Scheduler 8d3df56d9b translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907908530012
Sandcastle Job Instance ID: 9007200235834664
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47108063

fbshipit-source-id: c355735d9db580cb63e2628ba8ab5ca1e94108fd
2023-06-28 14:42:11 -07:00
Arushi Kesarwani 15d735b35b Refactor ReactSurface to use TaskInterface (#38081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38081

Changelog: [Internal]

As part of refactoring ReactSurface, ensuring the methods expose interfaces instead of internal classes, e.g. use TaskInterface instead of Task,

Reviewed By: cortinico

Differential Revision: D47026648

fbshipit-source-id: 5fc42693b307af057b51a869133c52de0b1dca3a
2023-06-28 13:30:51 -07:00
Alex Danoff 04af0b955d W3CPointerEvents: add unit test for JSPointerDispatcher (#38114)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38114

Changelog: [Android] [Internal] - W3CPointerEvents: add unit test for JSPointerDispatcher

This adds a basic test for JSPointerDispatcher. Right now this asserts that when a MotionEvent with ACTION_DOWN is received, we send out a pointerdown event.

There's a lot to be desired here in terms of e.g. ensuring that we're dispatching the event to the right target, which we can pursue as future work (of course, more complex test cases should also be added). I suspect we'll need to do a bit more refactoring to make this code more deeply testable (e.g. right now it's not straightforward to access Event properties from the test).

Reviewed By: javache

Differential Revision: D47035119

fbshipit-source-id: 1b49e2458325d6f0cc53d3b7ade8d6328141360f
2023-06-28 13:19:55 -07:00
Lulu Wu 637ffb175d Fix setRuntimeConfigProvider multiple times error
Summary:
Fix the following error:
 {F1038388240}

Calling ```setRuntimeConfigProvider``` multiple times is not always a wrong behaviour, the following could happen and before this diff App C will raise above error:
- App A has main bundle X
- App B has main bundle Y
- App C has main bundle X and bundle Y

To fix we guarantee ```setRuntimeConfigProvider``` only called once instead of raising an error.

Changelog:
[iOS][Changed] Fix setRuntimeConfigProvider called multiple times error

Reviewed By: dmytrorykun

Differential Revision: D47094267

fbshipit-source-id: c8473f4f7d639a73e0201c6d72781c01e6cf95fd
2023-06-28 09:49:57 -07:00
Phillip Pan 3ecbc1dba1 explicitly enable ATS in app template (#37923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37923

Changelog: [Internal]

in this change, i'm looking to make sure our app template will not violate apple best practices and minimize probability of app rejection.

this change entails two guardrails:
- explicitly marking disabling ATS as disabled with a comment. even though this is already the case, this will make it more unlikely someone will override this
- replacing the localhost domain override with the apple provided NSAllowsLocalNetworking key, which is the recommendation

Reviewed By: sammy-SC

Differential Revision: D46707159

fbshipit-source-id: 8fe407d08767269a18fb15c80fdd83a58cf2a4a8
2023-06-28 09:11:58 -07:00
Phillip Pan d320334da8 tests for ats settings (#38084)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38084

Changelog: [Internal]

addings tests for D47041590

Reviewed By: cipolleschi

Differential Revision: D46961587

fbshipit-source-id: 6b93a20c8539d692db2f84836a0ab79d899197fa
2023-06-28 09:11:58 -07:00