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

27784 Коммитов

Автор SHA1 Сообщение Дата
Pranav Yadav 50992be405 Remove `greet.yml` action (#37587)
Summary:
This (`greet.yml`) action requires some _changes_ to "repo" settings which are _out of maintainers' controls_.
So, instead of wasting compute; let's just delete this action :(
🤗🌏

## Changelog:

[GENERAL] [REMOVED] - [Actions] Remove `greet.yml` action

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

Test Plan: - Not needed.

Reviewed By: cortinico

Differential Revision: D46275607

Pulled By: cipolleschi

fbshipit-source-id: 80880568cbae1158006445e078e638e4e375cb73
2023-05-30 07:14:25 -07:00
Douglas Lowder d3e35992e9 Fix Fabric issue with React-Core pod when Xcode project has multiple targets (#37581)
Summary:
In Xcode projects with multiple targets, and in particular when targets are for different platforms (e.g. iOS and macOS), Cocoapods may add a suffix to a Pod name like `React-Core`.

When this happens, the code in `new_architecture.rb` (which was looking for a pod with exact name `React-Core`) would not add the preprocessor definitions for Fabric as expected.

This change fixes this issue. Fixes https://github.com/facebook/react-native/issues/37102 .

## Changelog:

[iOS] [Fixed] - Fix Fabric issue with React-Core pod when Xcode project has multiple targets

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

Test Plan: Tested that this change fixes this issue which occurs 100% of the time in React Native TV projects.

Reviewed By: dmytrorykun

Differential Revision: D46264704

Pulled By: cipolleschi

fbshipit-source-id: 8dfc8e342b5a110ef1f028636e01e5c5f2b6e2f0
2023-05-30 06:44:49 -07:00
Samuel Susla 5eadd935e8 Attempt at fixing crash when blurring image on iOS (#37614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37614

changelog: [internal]

We do not control what `vImageBoxConvolve_ARGB8888` returns, it may return 0. If it does return 0, we will allocate memory chunk of size 0. Yes, malloc will let you do that. Well, it depends on the implementation, but according to the spec it is legal. The only requirement is to by able to call free on that without crash.

If `vImageBoxConvolve_ARGB8888` does return 0 and we allocate memory of size 0. Call to `vImageBoxConvolve_ARGB8888` with tempBuffer of size 0 will lead to a crash.

[The documentation](https://developer.apple.com/documentation/accelerate/1515945-vimageboxconvolve_argb8888#discussion) for `vImageBoxConvolve_ARGB8888` and tempBuffer states:
> To determine the minimum size for the temporary buffer, the first time you call this function pass the kvImageGetTempBufferSize flag. Pass the same values for all other parameters that you intend to use in for the second call. The function returns the required minimum size, which **should be a positive value**. (A negative returned value indicates an error.) The kvImageGetTempBufferSize flag prevents the function from performing any processing other than to determine the minimum buffer size.

I think the keyword word there is "should be a positive value". 0 is not a positive value.

Reviewed By: javache, yungsters

Differential Revision: D46263204

fbshipit-source-id: baa8fac5b3be6fb5bed02800cd725cc4cf43485a
2023-05-30 04:12:38 -07:00
Riccardo Cipolleschi 323b7f8536 Backporting a fix for hermesc on linux (#37596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37596

This commit is a backport of this [commit](32327cc177) so that we build the right version of hermes in CI.

This also bumps the hermes keys to make sure that we are building it properly from now on.

## Changelog:
[Internal] - Fix Hermes versioning and bump hermes workspace keys

Reviewed By: cortinico

Differential Revision: D46225179

fbshipit-source-id: f00c9d20d37f3bd5689e0742063f98e3bfe373c2
2023-05-30 04:10:17 -07:00
Riccardo Cipolleschi 680cbe757b Make RNTester use RCTAppDelegate (#37572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37572

Currently, RNTester was using a completely custom AppDelegate and not leveraging the RCTAppDelegate we use in the OSS. This resulted in a misalignment between the two setups and duplicated work to test stuff internally furst and then in the OSS, with some more time needed to understand why one setup was working and the other wasn't.

With this change, we are aligning the two, bringing RNTester closer to the OSS setup. There are still small differences, but we can iterate over those.

## Changelog:
[iOS][Changed] - Make RNTester use RCTAppDelegate

Reviewed By: cortinico

Differential Revision: D46182888

fbshipit-source-id: 7c55b06de1a317b1f2d4ad0d18a390dc4d3356a4
2023-05-30 04:10:17 -07:00
Intl Scheduler 551bbbc234 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907889493757
Sandcastle Job Instance ID: 36028797978627335
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46270525

fbshipit-source-id: 26beec108aa03c970338fdc4561af24798813acf
2023-05-29 21:34:22 -07:00
Riccardo Cipolleschi 9084ee133a Revert D45904748: Move LayoutMetrics and LayoutPrimitives from core to graphics folder
Differential Revision:
D45904748

Original commit changeset: a4e666d7c739

Original Phabricator Diff: D45904748

fbshipit-source-id: c2da28836cb51966854c81d4e380a2abeb742cda
2023-05-29 07:27:36 -07:00
Samuel Susla ce3ade82bf Move LayoutMetrics and LayoutPrimitives from core to graphics folder (#37609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37609

changelog: [internal]

Moving LayoutMetrics and LayoutPrimitives from core to graphics module.
This is to enable different implementation for different platforms.

Reviewed By: rubennorte

Differential Revision: D45904748

fbshipit-source-id: a4e666d7c7390e87abdb09235f96655b63f451f9
2023-05-29 06:52:31 -07:00
Saad Najmi 594cf1f647 Delete stale file `generatedComponentApiDocs.js` (#37053)
Summary:
I noticed this file was 4 years old in both React Native and React Native macOS, and figured it was safe to delete  ¯\_(ツ)_/¯

Note from Eli: I wrote this thing years ago to see if we could generate docs based on our components. Never moved forward, lets delete it.

## Changelog:

[INTERNAL] [REMOVED] - Remove stale generated doc file

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

Test Plan: N/A

Reviewed By: yungsters

Differential Revision: D46231152

Pulled By: TheSavior

fbshipit-source-id: c36a26ae7d7526305f73f1bd63f9d7223889e109
2023-05-28 16:20:02 -07:00
Samuel Susla db121c845d Make dependency on mapbuffer:jni and mapbuffer:mapbuffer explicit (#37598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37598

changelog: [internal]

This diff does three things:
- Makes dependency on `mapbuffer:jni` explicit for modules that were accessing it through `react:utils` module.
- `renderer:core` now depends on `mapbuffer:mapbuffer`.
- Moved `PropsMapBuffer` inside of `Props`.

Reviewed By: rubennorte

Differential Revision: D46223390

fbshipit-source-id: 2dca1a034f991afd3e9531c4c7fcc7b99239dabe
2023-05-28 14:42:42 -07:00
Riccardo Cipolleschi 20e66db0be Revert D46225044: Add tests in CI not to break Hermes-Xcode integration
Differential Revision:
D46225044

Original commit changeset: 265364a0b4c1

Original Phabricator Diff: D46225044

fbshipit-source-id: bd3e903f973ad8989a4b05f3bf787cc1c01f0573
2023-05-26 09:26:51 -07:00
Rubén Norte 3afb5b8241 Remove incorrect const constraint from UIManager commit hooks (#37588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37588

The `const` modified in UIManagerCommitHook prevents us from mutating the commit hook itself (which doesn't make any sense as commit hooks might want to update their internal state as response to new commits).

This removes the constraint so we can remove the `const` modifier from `MutationObserverManager` in a future diff.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D46149085

fbshipit-source-id: d3bf24f1125ad3878ca36a6ceb9dd509c3cf7b1e
2023-05-26 09:06:00 -07:00
Rubén Norte 32bd60f863 Implement mount hooks in UIManager (#37460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37460

## Context

This implements the concept of mount hooks in UIManager which, similarly to commit hooks, receive a notification when a root shadow tree has been mounted in the host platform.

This is meant to be used internally in React Native, not by user-land libraries or products.

This will be used to implement `IntersectionObserver` in a following diff.

Changelog: [Internal]

Reviewed By: javache, sammy-SC

Differential Revision: D45866244

fbshipit-source-id: 4df48bf237a5cc89e37709faaeaa0ce582c0d0cc
2023-05-26 09:06:00 -07:00
Rubén Norte f30716323a Add flag to do granular state updates in scroll views in iOS (#37461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37461

This adds a feature flag to dispatch state updates for scroll position in every scroll position update in iOS, as opposed to only at the beginning, end and other specific moments.

This is necessary to implement features like `IntersectionObserver`, but we want to test the performance impact of this change before rolling it out completely.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D45916675

fbshipit-source-id: 00a2b1c5ea03e45141bb2d81e4e5fb8c198de1ff
2023-05-26 09:06:00 -07:00
Rubén Norte 0abd065b15 Create new option in LayoutInspectingPolicy to apply parent clipping to layout metrics (#37435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37435

We're implementing the `IntersectionObserver` API in React Native. That API reports the bounding rectangle of the root node and the target node (which we already implement in React Native via `LayoutableShadowNode::computeRelativeLayoutMetrics`), plus the intersection rectangle.

This adds a new option in `LayoutInspectingPolicy` so we can get the layout metrics when clipping is applied (e.g.: if a parent node has `overflow: hidden` and we get the layout metrics of one of its children that extends beyond the limits of the parent, it would report only the rectangle that's visible for that node).

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D45866245

fbshipit-source-id: ed3bfc2021e6b7819b8efea6fa3a81ed9d0bb181
2023-05-26 09:06:00 -07:00
Rubén Norte 64416d9503 Fix LayoutableShadowNode::computeRelativeLayoutMetrics when using scale on a parent node (#37436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37436

When testing the reported intersections from `IntersectionObserver` I realized that the reported rectangles were incorrect when using `scale` in a parent. This is because `scale` transforms use the center of the node as the origin, and when applying the transform on its children we were using the center of the children instead of the center of the same node.

This fixes that issue by using the center of the parent when applying the transform on the children.

Changelog: [General][Fixed] - Fixed computation of layout via `ref.measureRelative` and `ref.measureInWindow` for nodes with scale/rotate transforms in their parents.

Reviewed By: sammy-SC

Differential Revision: D45866231

fbshipit-source-id: 68928cbaca28c21155657d276cf8ddd2129d9668
2023-05-26 09:06:00 -07:00
Rubén Norte 912bca05b1 Create version of LayoutableShadowNode::computeRelativeLayoutMetrics that works with an ancestor list (#37434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37434

We'll be using this method in IntersectionObserver to avoid having to get the list of ancestor multiple times when calling computeRelativeLayoutMetrics for the target bounding rect and for the intersection rect.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D45866232

fbshipit-source-id: 0efa165b780e819bf19028fecd22b303ca6f52ad
2023-05-26 09:06:00 -07:00
Riccardo Cipolleschi 37d582dccd Add tests in CI not to break Hermes-Xcode integration (#37594)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37594

This change add a test in circleCI to make sure that we don't break the integration between RNTester Hermes and Xcode

## Changelog:
[Internal] - Add circleci test to track the integration between Xcode and Hermes

Reviewed By: dmytrorykun

Differential Revision: D46225044

fbshipit-source-id: 265364a0b4c187ba20b5591b83c63896935a5184
2023-05-26 08:29:43 -07:00
Riccardo Cipolleschi 18a13381d2 Fix Hermes-Xcode integration (#37595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37595

Following D46097200, the integration between Hermes and Xcode got broken as Hermes is creating the framework in a different folder.

This is a patch to unblock people internally to build RNTester with Hermes and to run it on a simulator.
We should find a way to parametrize this, passing the target from Xcode to this script, after checking where Hermes is built

## Changelog:
[internal] - Fix RNTester-Hermes-Xcode integration for testing locally on simulators

Reviewed By: dmytrorykun

Differential Revision: D46224915

fbshipit-source-id: 9d682983c7990f8efa7c07f62191782dce317cbb
2023-05-26 08:29:43 -07:00
Pieter De Baets ff849fd175 Revert changes to getters in Binding (#37589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37589

In D44221018, I changed this to return a ref to the smart pointer, and even made it a raw pointer in D45948987, but this is not thread-safe: the uninstallFabricUIManager happens on a different thread from the accesses to these pointers on the JS thread, so we actually need to use the shared pointer here to be safe.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D46221511

fbshipit-source-id: d8080042d6f1dbf5550a09b77f1090f78ec82455
2023-05-26 06:54:24 -07:00
Facebook Community Bot 5441a6b565
Re-sync with internal repository (#37593)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2023-05-26 13:31:15 +01:00
Samuel Susla a244209230 Do not use setNativeState in RuntimeScheduler::Task
Summary:
changelog: [internal]

`setNativeState` is not implemented in JSC. Let's stick to host objects for now.

Reviewed By: cipolleschi

Differential Revision: D46193786

fbshipit-source-id: 9d36801bb9faa5c144a461bcbe623762bf6947b1
2023-05-26 00:08:59 -07:00
Jakub Trzebiatowski dcb4eb050a Fixed random styling for text nodes with many children (#36656)
Summary:
Attempting to fix the issue https://github.com/facebook/react-native/issues/33418

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

[ANDROID] Fixed inconsistent styling for text nodes with many children

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

Test Plan:
No test plan yet. I'd like to ask for help with creating one.

##

Putting template aside, I'd like to ask for a review of the approach I'm suggesting.

React Native as-is (at least in some cases) [messes up the styles](https://github.com/facebook/react-native/issues/33418#issuecomment-1485305556) for text nodes with more than 85 children, just like that.

![image](https://user-images.githubusercontent.com/2590174/227981778-7ef6e7e1-00ee-4f67-bcf1-d452183ea33d.png)

All of this text should be blue.

The root cause is that code (on Android) assumes it can assign as many `Spannable` span priority values as we'd like, while in reality, it has to be packed in an 8-bit-long section of the flags mask. So 255 possible values. In the scenario I produced, React generates three spans per text node, and for 85 text nodes, it sums up to 255. For each span, a new priority value is assigned.

As I understand it, we don't need that many priority values. If I'm not mistaken, these priorities are crucial only for ensuring that nested styles have precedence over the outer ones. I'm proposing to calculate the priority value "vertically" (based on the node's depth in the tree) not "horizontally" (based on its position).

It would be awesome if some core engineer familiar with `ReactAndroid` shared their experience with this module, especially if there are any known cases when we _know_ that we'd like to create overlapping spans fighting over the same aspects of the style.

Reviewed By: cortinico

Differential Revision: D46094200

Pulled By: NickGerleman

fbshipit-source-id: aae195c71684fe50469a1ee1bd30625cbfc3622f
2023-05-25 17:09:21 -07:00
Alex Danoff 76d41864a2 W3CPointerEvents: emit click events based on pointerDown/pointerUp (#37541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37541

This diff makes changes to emit bubbling click events (i.e. [these](https://www.w3.org/TR/uievents/#click)) based on the existing pointer-down/pointer-up events. As per the [pointer events spec](https://www.w3.org/TR/pointerevents3/#the-click-auxclick-and-contextmenu-events), click events are still dispatched as PointerEvents (i.e. conform to the PointerEvent interface).

Changelog: [Internal] [Added] - W3CPointerEvents: emit click events based on pointerDown/pointerUp

Reviewed By: NickGerleman

Differential Revision: D45666344

fbshipit-source-id: 08829d3a24fef6851c1c3c29d4fa51b31ec68931
2023-05-25 16:38:53 -07:00
David Vacca 2f1c94efb1 Disable ReactHostDelegateTest.testDefaultReactHostDelegateCreation test
Summary:
Disable ReactHostDelegateTest.testDefaultReactHostDelegateCreation test

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: NickGerleman, GijsWeterings

Differential Revision: D46204169

fbshipit-source-id: 152ceab773568453c0ab07f2d8c0cb9353b4e8d5
2023-05-25 16:23:30 -07:00
Nick Gerleman 2558c3d4f5 Allow string `transform` style in TypeScript (#37569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37569

Fixes https://github.com/facebook/react-native/issues/37543

Missed as part of D39423409 (or maybe we didn't have TS types inline yet?)

Changelog:
[General][Fixed] - Allow string `transform` style in TypeScript

Reviewed By: cortinico

Differential Revision: D46161450

fbshipit-source-id: 24ee9e19365b7209ec0a2c8fb5a5d7ac78203f4d
2023-05-25 16:09:56 -07:00
Nick Gerleman dfd445cbc6 Terminate instead of throwing if TurboModule callback double-called (#37570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37570

If a TM calls a completion callback, or resolves or rejects a promise multiple times, a C++ exception is thrown.

For an in the wild crash, we are getting this signal as:
1. `libdispatch` calls std::terminate while pumping a thread's message queue
2. The hooked FB app termination handler is called, which introspects for the currently handled exception
4. We are handling this TurboModule C++ exception being thrown, suggesting `libdispatch` termination may be due to catching this C++ exception which was not otherwise handled
4. We have by this point lost the stack trace of the code invoking the callback

I think if we change the timing of `abort()` to when the callback is called, we might be able to preserve the stack trace of module code calling the callback.

Reviewed By: javache

Differential Revision: D46175685

fbshipit-source-id: 680aa9aa5e4ca6d8dd04dfe34ec870b86c7640ef
2023-05-25 15:26:12 -07:00
Ramanpreet Nara 169180100c Temp: Always report debug info on module not found error
Summary:
The TurboModule interop layer causes a surge in "module not found" exceptions: T154044825.

After D45102812, this exception **should** have included debug info. But, it didn't.

## Problems
So, there are two problems:
1. No debug logs are getting printed.
2. In the TurboModule interop test group, global.RN$TurboInterop is false **for some reason.** This is **very** strange.

## Changes
1. **Always** print the debug logs.
2. Add more flag-related debug information to the "module not found" debug logs. This will help us validate whether global.RN$TurboInterop is truely false.

## Concerns
> **Always** print the debug logs on Android.

**Question:** Won't this be really expensive?

This shouldn't be too expensive: There are about ~50 native module requires in Fb4a. So: (1) the exception message shouldn't grow to an unreasonable size, (2) we'll only use enough memory to store ~50 strings in the JS VM.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D46195117

fbshipit-source-id: 8215c7339d16a1adc063b674805063865d1f7ab6
2023-05-25 14:58:11 -07:00
Alex Danoff 58ef9e92de W3CPointerEvents: add missing attributes to pointer events (#37537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37537

Changelog: [Internal] [Changed] - W3CPointerEvents: add missing attributes to pointer events

The [PointerEvent interface](https://www.w3.org/TR/pointerevents/#pointerevent-interface) includes some additional properties which we weren't including in the events we dispatched.

This diff adds them (set to default values):
- twist
- tangentialPressure

In the future, we can try to set reasonable values for these properties based on the underlying native events.

Reviewed By: NickGerleman

Differential Revision: D45747033

fbshipit-source-id: 529f9d90299f33bc04eae3fb85ddd7eac3d61c5b
2023-05-25 13:22:56 -07:00
David Vacca 20808b5eb5 Document ReactHostDelegate (#37562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37562

Add documentation for ReactHostDelegate

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D45717674

fbshipit-source-id: e0d6d70edf4f4cf70b53807732b35f5fda917fc3
2023-05-25 10:29:01 -07:00
David Vacca cd71a71ad1 Add documentation into DefaultReactHostDelegate (#37561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37561

Add documentation into DefaultReactHostDelegate

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D45717456

fbshipit-source-id: b9485db26fa8a6c0e9a2267915e3269276e8138d
2023-05-25 10:29:01 -07:00
David Vacca 5b78608495 Migrate Shadows -> Kotlin (#37563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37563

This diff migrates the Shadows project into kotlin

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D45679204

fbshipit-source-id: eede61e725d6f4dc21d23176d2e9f72f3726f1c8
2023-05-25 10:29:01 -07:00
David Vacca d45d15f4ae Introduce DefaultReactHostDelegate (#37565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37565

Introduce DefaultReactHostDelegate class that will be used to simplify creation of ReactHostDelegate in React Native Android

changelog: [internal] internal

Reviewed By: cortinico, philIip

Differential Revision: D45665528

fbshipit-source-id: 154f4a2f0916c6f1cb846bc052a86dfc72f04dd7
2023-05-25 10:29:01 -07:00
David Vacca c99d6f6077 Reduce dependencies on ReactHostDelegate (#37564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37564

In this diff I'm refactoring ReactHostDelegate to reduce API dependencies.
As part of this diff I'm also refactoring callsites to ensure everything works as expected.

changelog: [internal] internal

Reviewed By: cortinico, yungsters

Differential Revision: D45662329

fbshipit-source-id: 1cab4331b2636b9a5d0d48085b68610153bcf0c5
2023-05-25 10:29:01 -07:00
David Vacca 8ae084675b Add ReactNativeConfig.DEFAULT_CONFIG as default parameter for ReactNativeConfig (#37560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37560

Add ReactNativeConfig.DEFAULT_CONFIG as default parameter for ReactNativeConfig

changelog: [internal] internal

Reviewed By: cortinico, philIip

Differential Revision: D45662330

fbshipit-source-id: 9feccc2c75cb89c6782a235efe9b880c9b08ad89
2023-05-25 10:29:01 -07:00
David Vacca ee1180dfe0 Mark BindingsInstaller as optional parameter in ReactHostDelegate (#37321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37321

BindingsInstaller is not required to initialize react native, marking this as optional parameter in ReactHostDelegate

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D45578882

fbshipit-source-id: a1b07af10f4f535e5e42acbd3710b0b93187daaf
2023-05-25 10:29:01 -07:00
Samuel Susla 05defecab2 Add TextLayoutManager as explicit dependency
Summary:
changelog: [internal]

Add import to explicitly express dependency on TextLayoutManager.

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D45904690

fbshipit-source-id: 6d486a2275da1c9e637f15cd2a75f7ef36e2e017
2023-05-25 10:00:15 -07:00
Alex Danoff 61eb9b4453 W3CPointerEvents: change click event from direct to bubbling (#37539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37539

AFAICT this was added in https://github.com/facebook/react-native/pull/24359 to support accessibility, however per [the spec](https://www.w3.org/TR/uievents/#event-type-click) the click event is supposed to bubble up.

This change updates the necessary configs so that `click` is treated as a bubbling event and not as a direct-dispatch event.

Changelog: [Android] [Breaking] - W3CPointerEvents: change click event from direct to bubbling

Reviewed By: yungsters

Differential Revision: D45745906

fbshipit-source-id: 2649375b322037fe7ab20b800daae150640dbede
2023-05-25 09:39:53 -07:00
Samuel Susla 7211ef1962 Enable RuntimeScheduler in old architecture (#37523)
Summary:
## Changelog:

[IOS] [FIXED] - unexpected useEffects flushing semantics

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

Test Plan: Run RNTester with old architecture and make sure RuntimeScheduler is used.

Reviewed By: cipolleschi

Differential Revision: D46078324

Pulled By: sammy-SC

fbshipit-source-id: 5f18cbe60e6c9c753c373f175ba413b79288a928
2023-05-25 08:38:54 -07:00
acdlite b98de92ad0 Lower Suspense throttling heuristic to 300ms (#26803)
Summary:
Now that the throttling mechanism applies more often, we've decided to
lower this a tad to ensure it's not noticeable. The idea is it should be
just large enough to prevent jank when lots of different parts of the UI
load in rapid succession, but not large enough to make the UI feel
sluggish. There's no perfect number, it's just a heuristic.

DiffTrain build for commit f8de255e94.

Reviewed By: sammy-SC

Differential Revision: D45922304

fbshipit-source-id: 8a219f4fdf6a5a56ee4c3d7c5c130b68900b2937
2023-05-25 08:08:04 -07:00
Riccardo Cipolleschi bdeb09bada Re-enable iOS integration tests (#37571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37571

During the RC.0 of 0.72, we disabled the iOS integration tests because they were not working with Metro and the new Monorepo setup.

This change tries to re-enable them so we can be more protected in CI

## Changelog:
[internal] - Re-enable integration tests

Reviewed By: cortinico

Differential Revision: D46178840

fbshipit-source-id: a5239fa7067b8fb68d997dd0cc63b67fb54d2d7e
2023-05-25 06:28:29 -07:00
foestauf 1a1e399466 Create a function emitFloatProp (#37500)
Summary:
part of https://github.com/facebook/react-native/issues/34872

> Create a function emitFloatProp(name: string, optional: boolean) in parser-primitives.js. Factor out the code from [Flow](d8ced6f895/packages/react-native-codegen/src/parsers/flow/components/events.js (L69-L75)) and [TypeScript](d8ced6f895/packages/react-native-codegen/src/parsers/typescript/components/events.js (L79-L85)) into that function. Use that function in the original call site.

bypass-github-export-checks
## Changelog:

[INTERNAL] [ADDED] - emitFloatProp in parser primitves

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

Test Plan: `yarn jest packages/react-native-codegen`

Reviewed By: dmytrorykun

Differential Revision: D46073527

Pulled By: cipolleschi

fbshipit-source-id: 556b3aa0e0d330929e006758ec88d0a6889f87bc
2023-05-25 02:59:23 -07:00
Leonardo Rota-Rossi 8ca085c09c Create a function emitDoubleProp (#37515)
Summary:
> Create a function emitDoubleProp(name: string, optional: boolean) in parser-primitives.js. Factor out the code from [Flow](d8ced6f895/packages/react-native-codegen/src/parsers/flow/components/events.js (L61-L67)) and [TypeScript](d8ced6f895/packages/react-native-codegen/src/parsers/typescript/components/events.js (L71-L77)) into that function. Use that function in the original call site.

bypass-github-export-checks

## Changelog:

[INTERNAL][ADDED] - emitDoubleProp in parser primitves

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

Test Plan: yarn jest packages/react-native-codegen

Reviewed By: cortinico

Differential Revision: D46149450

Pulled By: cipolleschi

fbshipit-source-id: 78381214a79c33d975dff490599d510e8001254e
2023-05-25 02:59:23 -07:00
Luiz Ozorio 706239814e Create emitStringProp function (#37527)
Summary:
> Create a function emitStringProp(name: string, optional: boolean) in parser-primitives.js. Factor out the code from [Flow](d8ced6f895/packages/react-native-codegen/src/parsers/flow/components/events.js (L45-L51)) and [TypeScript](d8ced6f895/packages/react-native-codegen/src/parsers/typescript/components/events.js (L57-L61)) into that function. Use that function in the original call site.

bypass-github-export-checks

## Changelog:

[INTERNAL][ADDED] - emitStringProp in parser-primitves

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

Test Plan: `yarn jest packages/react-native-codegen`

Reviewed By: cortinico

Differential Revision: D46144200

Pulled By: cipolleschi

fbshipit-source-id: 076b530905ba7c28cfb2151e29e589026010c3c3
2023-05-25 02:59:23 -07:00
Frank Calise 66f4a9168b Codegen 123: add parser-primitive function for emitBoolProp (#37488)
Summary:
Part of https://github.com/facebook/react-native/issues/34872, Improving Codegen

Reduces code duplication by creating a helper function `emitBoolProp(name: string, optional: boolean)` in `parser-primitives.js`. Refactors the code from [Flow](d8ced6f895/packages/react-native-codegen/src/parsers/flow/components/events.js (L37-L43)) and [TypeScript](d8ced6f895/packages/react-native-codegen/src/parsers/typescript/components/events.js (L47-L53)) to utilize the new function.

bypass-github-export-checks

## Changelog:

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

Pick one each for the category and type tags:

[INTERNAL] [CHANGED] - Extract contents of the case `BooleanTypeAnnotation` and `TSBooleanKeyword` into a single `emitBoolProp` function

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

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

Test Plan:
Run `yarn jest react-native-codegen`

<img width="392" alt="image" src="https://github.com/facebook/react-native/assets/374022/79dae56d-e12d-4be2-9426-50a72e893dfe">

Reviewed By: dmytrorykun

Differential Revision: D46073996

Pulled By: cipolleschi

fbshipit-source-id: 4af67e7e9c3ee1712159c7a647790cb431cfb17a
2023-05-25 02:59:23 -07:00
shubham0142 af8b03d805 refactor(codegen): add throwIfTypeAliasIsNotInterface in error-utils (#37530)
Summary:
part of codegen issue https://github.com/facebook/react-native/issues/34872

> Extract the code that checks whether typeAlias.type is an InterfaceDeclaration ([Flow](d8ced6f895/packages/react-native-codegen/src/parsers/flow/components/index.js (L76-L80)), [TypeScript](d8ced6f895/packages/react-native-codegen/src/parsers/typescript/components/index.js (L76-L80))) into a throwIfTypeAliasIsNotInteface error. Create this new function in the error-utils.js file.

bypass-github-export-checks

## 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][Added]: Add throwIfTypeAliasIsNotInterface in error-utils

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

Test Plan: yarn test react-native-codegen

Reviewed By: dmytrorykun

Differential Revision: D46143299

Pulled By: cipolleschi

fbshipit-source-id: 3eb0f5d687d3a4f64822540f4f572d872b81828f
2023-05-25 02:59:23 -07:00
Pranav Yadav e240879057 Refactor: Extract `findComponentConfig(...)` to `parsers-commons.js` (#37547)
Summary:
This PR extracts the `findComponentConfig(...)` Flow and TS from the `index.js`'s files to the `parser-commons.js` file.

bypass-github-export-checks

## Changelog:

[INTERNAL][CHANGED] - Refactor: Extract `findComponentConfig(...)` from Flow & TS to `parsers-commons.js`

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

Test Plan: - `yarn flow && yarn test packages/react-native-codegen`  → should be green.

Reviewed By: cortinico

Differential Revision: D46143481

Pulled By: cipolleschi

fbshipit-source-id: f9a456b1d58312422b17463ed2b60ee5fda16462
2023-05-25 02:59:23 -07:00
shubham0142 cf8184d5ab refactor(codegen): add undefinedLiteralTypeAnnotation prop in parsers (#37450)
Summary:
part of codegen issue https://github.com/facebook/react-native/issues/34872

> Add an undefinedLiteralTypeAnnotation: string property into the Parser object and implement it in the FlowParser (returning VoidLiteralTypeAnnotation) and in the TypeScriptPArser(returning TSUndefinedKeyword). Replace them in and [parsers/typescript/components/events.js](e133100721/packages/react-native-codegen/src/parsers/typescript/components/events.js (L158)).

bypass-github-export-checks

## 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][Added]: Add undefinedLiteralTypeAnnotation property in parsers

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

Test Plan: yarn test

Reviewed By: dmytrorykun

Differential Revision: D45904567

Pulled By: cipolleschi

fbshipit-source-id: edd26198e4c8b191a473d5b0ff96a6dc1fec8576
2023-05-25 02:59:23 -07:00
Siddarth Kumar fc927d1fb7 Add `getProps` to Parsers and fix up usages (#37504)
Summary:
[Codegen 87] This PR introduces `getProps` to the Parser class and implements this function in Typescript and Flow Parsers.

We also get rid of the following files from :
- `packages/react-native-codegen/src/parsers/typescript/components/props.js`
-  `packages/react-native-codegen/src/parsers/flow/components/props.js`

as requested on https://github.com/facebook/react-native/issues/34872

bypass-github-export-checks

## Changelog:

[Internal] [Changed] - Add `getProps ` to Parsers and update usages.

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

Test Plan: Run yarn jest react-native-codegen and ensure CI is green

Reviewed By: cortinico

Differential Revision: D46074152

Pulled By: cipolleschi

fbshipit-source-id: aa6a1a556c9b4a4a6209221f70c8add46ed2d08b
2023-05-25 02:59:23 -07:00
Phillip Pan 992c45c0e1 introduce a private API for RCTHost to refresh its bundle url (#37567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37567

Changelog: [Internal]

in the situation where we want to refresh the bundle url due to developer mode, we add a private API that allows the host to refresh its bundle URL if needed. this private API will be called on cmd + R, which is the only case that supports the changing bundle URL in the middle of the app session.

Reviewed By: cipolleschi

Differential Revision: D45937856

fbshipit-source-id: 718047abcbce983c4f820eb550d6fce05d03bfee
2023-05-25 00:37:37 -07:00