Commit Graph

84 Commits

Author SHA1 Message Date
Riccardo Cipolleschi 6668e7bd03 Add support to build hermes from a specific commit (#36681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36681

This change is needed to add some E2E tests on the Hermes repo so that we can test Hermes against iOS other than android.

## Changelog:
[Internal][Added] - Add possibility to download Hermes from a specific commit

Reviewed By: cortinico

Differential Revision: D44460479

fbshipit-source-id: 89c196aa7c38533e4904444f7f17eb3236fc6356
2023-03-28 10:06:26 -07:00
Ruslan Shestopalyuk 4a5f55031c Don't cache UIManager type inside the Event data structure (#36677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36677

## Changelog:

[Internal] - Don't cache UIManager type inside the Event data structure

A follow up to https://github.com/facebook/react-native/pull/36659

It's redundant, and it's good to have fewer "sources of truth" and keep the notion of UIManagerType separate from Event data structures.

Reviewed By: javache

Differential Revision: D44453812

fbshipit-source-id: 4efc0bb115bb4750e27afb2390afc9736ae67469
2023-03-28 09:39:39 -07:00
Ruslan Shestopalyuk 9ccf85e240 Fix hashing function in event name mapping in PerformanceEntryReporter (#36682)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36682

## Changelog:

[Internal][Fix] - Fix hashing function in event name mapping in PerformanceEntryReporter

A textbook mistake, when mapping event names via the constant lookup table, only the first 8 characters were effectively taken into account, thus mixing names of some events.

Reviewed By: rubennorte

Differential Revision: D44462195

fbshipit-source-id: 273891d92251014661af731618d8a549627b2983
2023-03-28 09:16:36 -07:00
Ramanpreet Nara 83056947aa Setup TurboModule interop test in Fb4a (#36669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36669

The test: Route all TurboModules in Fb4a through the interop layer.

So now, instead of using the C++ codegen for method dispatch, TurboModules will instead be using JavaInteropTurboModule, which uses the ReactMethod annotations for method dispatch.

MobileConfig actualization diff: D44405316.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D44405336

fbshipit-source-id: 3b00028e26cdcd229e64630eef73409a3264636a
2023-03-28 09:11:56 -07:00
Ramanpreet Nara 1f7daf988b Finish the JS-facing side of the TurboModule interop layer (#36630)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36630

## Changes
This diff hooks up global.nativeModuleProxy to the TurboModule interop layer.

Now, when you call NativeModules.Foo, the TurboModule system will create the Foo interop module, and return it to JavaScript.

|**Language**|**Abstraction**|**Description**|
|Java/C++|MethodDescriptor| The information needed by JavaTurboModule::invokeJavaMethod() to execute a module method: [example](https://www.internalfb.com/code/fbsource/[78577e97310db97c489e976168ca6ddf4cb894c3]/xplat/js/react-native-github/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp?lines=34-36).|
|Java|TurboModuleInteropUtils| Takes the interop module object, and parses out MethodDescriptors from the methods annotated with ReactMethod|
|C++|JavaInteropTurboModule| Facilitates JavaScript -> Java method dispatch for interop modules. Extends [JavaTurboModule](https://www.internalfb.com/code/fbsource/[6f0698784af39dd0e881d9a69087ae6ac5e9cdc4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.h?lines=28). Needs to be created with a list of MethodDescriptors.|

Shape of MethodDescriptor:
```
class MethodDescriptor {
    String methodName;
    String jniSignature;
    String jsiReturnKind;
    int jsArgCount;
}
```

## Example
global.nativeModuleProxy.Foo:
1. **Java:** Use TurboModuleManager to create the Java interop module for Foo
2. **Java:** Use TurboModuleInteropUtils to generate Foo's MethodDescriptors
3. **C++:** Use Foo's MethodDescriptors to create, cache, and return a JavaInteropTurboModule object to JavaScript.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D43918998

fbshipit-source-id: 562d3d7dc7f2ddb085dea6e94d72e1601012b741
2023-03-28 09:11:56 -07:00
Ramanpreet Nara 185bc248e4 Finish the Java-facing side of the TurboModule interop layer (#36627)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36627

## Changes
Now, when you call TurboModuleManager.getModule(interopModuleName), the TurboModuleManager will create and return that interop module to you.

Changes in this diff:
1. Forward interop NativeModules from app's ReactPackages to the TurboModuleManager
2. Extend TurboModule system's module creation algorithm to create interop NativeModules.

## Details
TurboModuleManagerDelegate's capabilities:
||API| Without Interop | With Interop |
|same|getModule()|Java [NativeModule](https://www.internalfb.com/code/fbsource/[e5db2a0dc412f0656f7eeec1db9d2da4aab61f40]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java?lines=21) that also implements [TurboModule](https://www.internalfb.com/code/fbsource/[c7089c1408eda109f342a1f33252533e743614ed]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.java?lines=11) |Java [NativeModule](https://www.internalfb.com/code/fbsource/[e5db2a0dc412f0656f7eeec1db9d2da4aab61f40]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java?lines=21) that also implements [TurboModule](https://www.internalfb.com/code/fbsource/[c7089c1408eda109f342a1f33252533e743614ed]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.java?lines=11) |
|new|getLegacyModule()| |Java [NativeModule](https://www.internalfb.com/code/fbsource/[e5db2a0dc412f0656f7eeec1db9d2da4aab61f40]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java?lines=21) that **doesn't** implement [TurboModule](https://www.internalfb.com/code/fbsource/[c7089c1408eda109f342a1f33252533e743614ed]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.java?lines=11)|

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D43751055

fbshipit-source-id: 75afb6f836b8ec270bb916525ff2fc9030d34012
2023-03-28 09:11:56 -07:00
Ramanpreet Nara 7a08fbb088 Deprecate TurboModuleManagerDelegate.getLegacyCxxModule (#36667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36667

## Context
TurboModuleManagerDelegate exposes two methods that create TurboModules:
- TurboModule getModule()
- CxxModuleWrapper getLegacyCxxModule()

## Problem
TurboModuleManagerDelegate.getLegacyCxxModule() is redundant: getModule() could just return all the modules that getLegacyCxxModule() returns: getLegacyCxxModule returns modules that implement TurboModule.

## Changes
So, let's deprecate getLegacyCxxModule(). This will simplify the implementation of TurboModuleManager.

Changelog: [Android][Deprecated] - Deprecate TurboModuleManager.getLegacyCxxModule

Reviewed By: cortinico

Differential Revision: D44407802

fbshipit-source-id: 88a6cf6597db76d8a74fd777d68ccf4f43aa6811
2023-03-28 09:11:56 -07:00
Ramanpreet Nara 3af66bf7fb Java: Make TurboModuleManager's APIs use NativeModule interface (#36629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36629

The scope of TurboModuleManager is increasing:
- Eventually, it'll be capable of creating interop NativeModules (i.e: NativeModules that don't implement TurboModule).

So, instead of creating duplicate methods for NativeModules on the TurboModuleManager, this diff changes the APIs of TurboModuleManager to work with the NativeModule interface.

Thoughts?

## Questions
**Question:** Is this a breaking change for open source?
- Technically, yes. This diff changes the public interface of TurboModuleManager.

**Question:** How large of a thrash will this cause for open source apps?
- The thrash should be minimal. People in open source shouldn't be creating their own TurboModuleManager. They also shouldn't be directly accessing the TurboModuleManager object either.

**Question:** Is this change safe?
- Yeah. All the code that calls into TurboModuleRegistry converts TurboModules it returns into NativeModules.

**Question:** Is this change move us in the right direction?
- Long term, the TurboModule system will support legacy modules as well as TurboModules.
- I think it makes a lot of sense to have one Java-facing registry: after all, Java will just treat these NativeModules/TurboModules as regular Java objects, and call public methods on them. It doesn't care if the module is TurboModule-compatible or not.
- As for the TurboModuleRegistry abstraction, I think we should eventually rename this to NativeModuleRegistry after we delete the current NativeModuleRegistry.
- Still thinking about this though. I will leave this diff in review to welcome comments.

Changelog: [Android][Deprecated] - Deprecate TurboModuleRegistry.getModule(), getModules(), hasModule(),

Reviewed By: mdvacca

Differential Revision: D43801531

fbshipit-source-id: 4af7cbc2e2dc7c1d664acbd38c83aa93aae23c9f
2023-03-28 09:11:56 -07:00
Ramanpreet Nara cb07358b12 Make TurboModule system support int/float args/returns (#36628)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36628

The legacy NativeModule system supports integer and float in NativeModule method arguments and returns. This diff extends the TurboModule system for the same functionality. T

his is necessary because the TurboModule system will now need to dispatch method calls to legacy NativeModules.

NOTE: We can't actually test these changes until we run interop modules.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D44000389

fbshipit-source-id: 92282d582a0f98fcb88d83e460d4860a64fe1117
2023-03-28 09:11:56 -07:00
Ramanpreet Nara 51893c4e9f Make JS Representation cache all TurboModule properties (#36625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36625

## Context
Previously, jsRepresentation would only cache the **HostFunctions** returned from TurboModule::createHostFunction().

## Changes
This diff replaces TurboModule::createHostFunction() with TurboModule::create().

Now, jsRepresentation will cache **all** the **properties** returned from TurboModule::create().

## Motivation
For interop modules, constants will be exported as properties on the TurboModule HostObject. This diff allows those constants (which are non HostFunctions) to be cached.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D44253229

fbshipit-source-id: d3dd042f4ccb6c076b83503f3712e4d1609388ce
2023-03-28 09:11:56 -07:00
Ramanpreet Nara 70239629e4 Attach Bridgeless nativeModuleProxy in TurboModuleBinding (#36626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36626

In Bridgeless mode, With the TurboModule interop layer, the TurboModule system will need to customize the nativeModuleProxy global.

This customization would be much easier if the nativeModuleProxy global were installed by the TurboModule system (and not the Bridgeless core).

So, this diff moves nativeModuleProxy installation into the TurboModule system.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D43993197

fbshipit-source-id: 9361340c02e2d82c4e5f373f234f41dc9d72cbe4
2023-03-28 09:11:56 -07:00
Pieter De Baets a83c192550 Remove AllocInYoung/RevertToYGAtTTI from OSS Hermes config (#36679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36679

We expose a variant of `HermesExecutor.java` which allows you to set a custom max heap size. This variant also sets the `AllocInYoung/RevertToYGAtTTI`, which should never really be used without a matching call to `HermesInternal.ttiReached()`, which is not documented.

Changelog: [Internal]

Reviewed By: jpporto

Differential Revision: D44457318

fbshipit-source-id: e91b377cbc0ac596cfbe7d1178e2657b868c1067
2023-03-28 08:28:32 -07:00
Rubén Norte 4e0dfedd51 Move ReactFabricPublicInstance out of the Renderer directory
Summary:
The `Renderer` directory is supposed to be only for files synced from the React repo. This moves the `public` directory that was added to it recently to the `ReactNative` directory.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44421951

fbshipit-source-id: d098970b80cd467b5c772c3ae91ce716be373484
2023-03-28 04:31:49 -07:00
Ruslan Shestopalyuk 871f294bcb Fix dispatching into incorrect UIManager type when event's target is a root view (#36659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36659

## Changelog:

[Android][Fixed] - Fix dispatching into incorrect UIManager type when event's target is a root view

There is a function, called [ViewUtil.getUIManagerType](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.java#L22), which infers whether we are using the new or old architecture, given a View tag ID, with the assumption being that all New Architecture tags are even (and therefore, we are in the New Architecture iff the view tag is even). See [here for more context](https://github.com/facebook/react/pull/12587/files).

This function was used to find out which type of event dispatcher to dispatch to, when going down the chain of event dispatching function calls on Android.

The problem is, that there may be cases, when this odd/even assumption breaks, in particular when the target view ID is equal to `1`, meaning that it's a root view ID and there is nothing else mounted there yet.

It's very rare that this happens in practice, but still is possible that user interacts with the screen before anything is mounted there (or if there is nothing mounted there by design).

Reviewed By: javache

Differential Revision: D44421739

fbshipit-source-id: fd5ba3c882f6c7d3c9543ebc2ec30ba000f7ca4f
2023-03-28 03:08:13 -07:00
Pieter De Baets ae0d714bbd Fix normalization of degrees in AnimatedInterpolation (#36645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36645

This broke while changing the AnimatedInterpolation back in D40571873 and D40632443, as I assumed the native side would be able to correctly handle values such as '1rad'. However these were being sent over as strings, and were thus using the string interpolation path, which does not work here.

Instead, handle both `deg` and `rad` explicitly when generating the config in JS.

Resolves issue https://github.com/facebook/react-native/issues/36608

Changelog: [General][Fixed] Resolves Animated.Value.interpolate results in NaN when output is in radians

Reviewed By: yungsters

Differential Revision: D44406034

fbshipit-source-id: fe0f3df16f2b8ec6c31f9359e4706cacc72b9951
2023-03-27 12:38:16 -07:00
Genki Kondo 33612906d9 Trigger pointer leave when active controller switched (#36662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36662

For VR, JSPointerDispatcher skips calculating the delta of hit targets (which happens in onMove) on the frame in which the active controller is switched because the motion event is a DOWN event, not a MOVE event in that specific frame.

This diff fixes the issue by just calling onMove in addition to onDown for DOWN motion events. Unfortunately we do not have separate pointer IDs for each controller.

This won't change the behavior for non-hoverable pointers. For hoverable pointers, it will dispatch an extra pointer_enter if the hit path has changed between the last move event and the down event.

Changelog:
[Internal][Fixed] - Trigger pointer leave when active controller switched

Reviewed By: lunaleaps, javache

Differential Revision: D44377324

fbshipit-source-id: 9f668e64f486b9a12ab36563ec2b7cf93f208a54
2023-03-27 12:31:37 -07:00
Pieter De Baets 406f9fc37b Make FabricUIManager's Binding an interface (#36613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36613

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D44340265

fbshipit-source-id: 1ab4e434fa20840a40590ac2157fd7f817807990
2023-03-27 10:19:45 -07:00
Nick Gerleman 92b8981499 Mimimize EditText Spans 9/9: Remove addSpansForMeasurement() (#36575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36575

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

D23670779 addedd a previous mechanism to add spans for measurement caching, like we needed to do as part of this change. It is called in more specific cases (e.g. when there is a text hint but no text), but it edits the live EditText spannable instead of the cache copy, and does not handle nested text at all.

We are already adding spans back to the input after this, behind everything else, and can replace it with the code we have been adding.

Changelog:
[Android][Fixed] - Mimimize EditText Spans 9/9: Remove `addSpansForMeasurement()`

Reviewed By: javache

Differential Revision: D44298159

fbshipit-source-id: 1af44a39de7550b7e66e45db9ebc3523ae9ff002
2023-03-24 23:43:32 -07:00
George Zahariev 2222b81ec2 Codemod long deprecated * type to any (#36634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36634

X-link: https://github.com/facebook/metro/pull/957

The existential type `*` has been deprecated and just an alias for `any` since version 0.163. Codemod usage of it to `any`.
This helps with diff D44276187, which makes it always an error to use `*`.

Changelog: [internal]

Reviewed By: pieterv, SamChou19815

Differential Revision: D44358809

fbshipit-source-id: c6bb55430edd086958e16989c60bc2a0a131a3fe
2023-03-24 13:45:38 -07:00
Nick Gerleman b384bb613b Minimize EditText Spans 8/9: CustomStyleSpan (#36577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36577

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

This change allows us to strip CustomStyleSpan. We already set all but `fontVariant` on the underlying EditText, so we just need to route that through as well.

Note that because this span is non-parcelable, it is seemingly not subject to the buggy behavior on Samsung devices of infinitely cloning the spans, but non-parcelable spans have different issues on the devices (they disappear), so moving `fontVariant` to the top-level makes sense here.

Changelog:
[Android][Fixed] - Minimize EditText Spans 8/N: CustomStyleSpan

Reviewed By: javache

Differential Revision: D44297384

fbshipit-source-id: ed4c000e961dd456a2a8f4397e27c23a87defb6e
2023-03-24 12:31:22 -07:00
Nick Gerleman 104cb7f81e Minimize EditText Spans 7/9: Avoid temp list (#36576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36576

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

This change addresses some minor CR feedback and removes the temporary list of spans in favor of applying them directly.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D44295190

fbshipit-source-id: bd784e2c514301d45d0bacd8ee6de5c512fc565c
2023-03-24 12:31:22 -07:00
Nick Gerleman 5791cf1f7b Minimize EditText Spans 6/9: letterSpacing (#36548)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36548

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

This change lets us set `letterSpacing` on the EditText instead of using our custom span.

Changelog:
[Android][Fixed] - Minimize EditText Spans 6/N: letterSpacing

Reviewed By: rshest

Differential Revision: D44240777

fbshipit-source-id: 9bd10c3261257037d8cacf37971011aaa94d1a77
2023-03-24 12:31:22 -07:00
Nick Gerleman 0869ea29db Minimize EditText Spans 5/9: Strikethrough and Underline (#36544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36544

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

This change makes us apply strikethrough and underline as paint flags to the underlying EditText, instead of just the spans. We then opt ReactUnderlineSpan and ReactStrikethroughSpan into being strippable.

This does actually create visual behavior changes, where child text will inherit any underline or strikethrough of the root EditText (including if the child specifies `textDecorationLine: "none"`. The new behavior is consistent with both iOS and web though, so it seems like more of a bugfix than a regression.

Changelog:
[Android][Fixed] - Minimize Spans 5/N: Strikethrough and Underline

Reviewed By: rshest

Differential Revision: D44240778

fbshipit-source-id: d564dfc0121057a5e3b09bb71b8f5662e28be17e
2023-03-24 12:31:22 -07:00
Alex Hunt 155591bfad Hotfix: Lock RN CLI to 11.0.0-alpha.0 in template (#36631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36631

Changelog: [Internal]

Hotfix for `main` branch CI stability after RN CLI `11.0.0` — the template as bootstrapped in CI needs to reference an exact version.

There is no published version (any more) for `11.0.0-alpha.2` (or `11.0.0-alpha.1`).

This is a temporary hotfix (we are trying to land https://github.com/facebook/react-native/pull/36623, but are stuck on infra issues).

- `11.0.0-alpha.0` includes `metro@0.75.0` (compatible).

More info: https://github.com/facebook/react-native/pull/36623#issuecomment-1482745547

Reviewed By: robhogan, NickGerleman

Differential Revision: D44371406

fbshipit-source-id: 870a59da521b55f957c8602125aecefb846e6ced
2023-03-24 11:48:50 -07:00
Genki Kondo ebc97a6c0f Revert D44307457: fix: make cursor center for different line height
Differential Revision:
D44307457

Original commit changeset: afeea5605ed8

Original Phabricator Diff: D44307457

fbshipit-source-id: 71423b895fb541584a322129e05223c8af7c4886
2023-03-24 09:34:44 -07:00
Nick Gerleman 8c9c8ba5ad Minimize EditText Spans 4/9: ReactForegroundColorSpan (#36545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36545

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

This adds ReactForegroundColorSpan to the list of spans eligible to be stripped.

Changelog:
[Android][Fixed] - Minimize Spans 4/N: ReactForegroundColorSpan

Reviewed By: javache

Differential Revision: D44240780

fbshipit-source-id: d86939cc2d7ed9116a4167026c7d48928fc51757
2023-03-24 05:24:09 -07:00
Nick Gerleman cc0ba57ea4 Minimize EditText Spans 3/9: ReactBackgroundColorSpan (#36547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36547

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

This adds `ReactBackgroundColorSpan` to the list of spans eligible to be stripped.

Changelog:
[Android][Fixed] - Minimize Spans 3/N: ReactBackgroundColorSpan

Reviewed By: javache

Differential Revision: D44240782

fbshipit-source-id: 2ded1a1687a41cf6d5f83e89ffadd2d932089969
2023-03-24 05:24:09 -07:00
Nick Gerleman b9e2627d1c Minimize EditText Spans 2/9: Make stripAttributeEquivalentSpans generic (#36546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36546

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

This change generalizes `stripAttributeEquivalentSpans()` to allow plugging in different spans.

Changelog:
[Internal]

Reviewed By: rshest

Differential Revision: D44240781

fbshipit-source-id: 89005266020f216368e9ad9ce382699bd8db85a8
2023-03-24 05:24:09 -07:00
Nick Gerleman 1743dd7ab4 Minimize EditText Spans 1/9: Fix precedence (#36543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36543

This is part of a series of changes to minimize the number of spans committed to EditText, as a mitigation for platform issues on Samsung devices. See this [GitHub thread]( https://github.com/facebook/react-native/issues/35936#issuecomment-1411437789) for greater context on the platform behavior.

We cache the backing EditText span on text change to later measure. To measure outside of a TextInput we need to restore any spans we removed. Spans may overlap, so base attributes should be behind everything else.

The logic here for dealing with precedence is incorrect, and we should instead accomplish this by twiddling with the `SPAN_PRIORITY` bits.

Changelog:
[Android][Fixed] - Minimize Spans 1/N: Fix precedence

Reviewed By: javache

Differential Revision: D44240779

fbshipit-source-id: f731b353587888faad946b8cf1e868095cdeced3
2023-03-24 05:24:09 -07:00
Nick Gerleman 05fd10d12f Fix default shadow radius in TextAttributeProps (#36621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36621

After D44302691 enabled textShadow, there was a subtle 1px shadow on any new text which I did't spot, but screenshot tests did (after commit which is non-ideal, but there is more work to make these land blocking).

This is because unlike `ReactBaseTextShadowNode` in paper which defaults to a radius of zero (no shadow), `TextAttributes` in Fabric defaults to a radius of 1px. Just previously never displayed.

Without shadow:
https://pxl.cl/2z2wX

With shadow:
https://pxl.cl/2z2x0

This changes the default to zero, which will cause us to skip adding the span, and matches previous behavior in Paper.

I double-checked the other props are defaulted the same way between `BaseTextShadowNode` (Paper) and `TextAttributes` (Fabric).

Changelog:
[Android][Fixed] - Fix default shadow radius in TextAttributeProps

Reviewed By: javache

Differential Revision: D44364446

fbshipit-source-id: d207367608291048001403d292f881c0842113f9
2023-03-24 04:31:06 -07:00
Nick Gerleman aab47634ad Fix textShadow on Android Fabric (#36585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36585

1. We don't add `ShadowStyleSpan` unless an offset is set. This is incorrect, and less permissive than `BaseTextShadowNode` in Paper.
2. We don't serialize textShadowOffset to MapBuffer

Changelog:
[Android][Fixed] - Fix textShadow on Android Fabric

Reviewed By: javache

Differential Revision: D44302691

fbshipit-source-id: 2cfd3bff3d0e4f329c98d1ed2defff94ad3b7dc3
2023-03-23 21:39:20 -07:00
Soumyajit Behera 987c6fd298 fix: make cursor center for different line height (#36586)
Summary:
Currently in multiline input the cursor touches the previous line.
So this reduces its height sets its position so that I does not touch previous line.
This PR will also fix the issue https://github.com/facebook/react-native/issues/28012 (Problem with TextInput lineHeight on iOS)
This RP will fix the issue caused in
[PR](https://github.com/facebook/react-native/pull/36484)

Changelog:
[iOS][Added] - Fixed cursor height on multiline text input

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

Test Plan:
Tested for different cursor height

https://user-images.githubusercontent.com/46092576/227004355-3886a0b5-7cdb-4fdc-a16b-3c4abb729737.mov

https://user-images.githubusercontent.com/46092576/227004361-48099f81-9f52-460d-8ae8-d0ddb09dc47d.mov

Reviewed By: javache

Differential Revision: D44307457

Pulled By: genkikondo

fbshipit-source-id: afeea5605ed8557cdeec1e62324c85665ce367d6
2023-03-23 11:37:01 -07:00
Riccardo Cipolleschi a45d346823 Fixed script for Packager.sh in RNTester (#36582)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36582

This change should fix the path to run packager.sh directly from Xcode, this was broken after the Monorepo work.

## Changelog:
[internal] - update path to run packager.sh

Reviewed By: huntie, hoxyq

Differential Revision: D44292167

fbshipit-source-id: 90e0291aa7a15189c72cae99c5d38c84c7243a80
2023-03-23 10:46:25 -07:00
Pieter De Baets 7259cb342e Forward-declare imports in Binding and FabricMountingManager (#36609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36609

Some random cleanup as I prepare to make these classes a better injection point for future experiments.

* Forward-declare classes where possible to reduce header import
* Return references to shared_ptr instead of copies when there are no lifetime concerns
* Use a shared JClass instance in JFabricUIManager

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D44221018

fbshipit-source-id: 1660cac964abd10ce798473e26841503430efdfe
2023-03-23 10:34:33 -07:00
Lulu Wu 928f4fb9b4 Degrade debugging log to avoid confusion over warning
Summary:
To avoid unnecessary confusion caused by the warning here. Context https://fb.workplace.com/groups/rn.support/permalink/24454205640868054/

Changelog:
[Internal][Changed] - Degrade debugging log to avoid confusion

Reviewed By: genkikondo

Differential Revision: D44293359

fbshipit-source-id: 55480e6c9d04f56308f4320045e18a99ad111fa6
2023-03-23 06:51:45 -07:00
Pieter De Baets dd6d57eea1 Fix cxx codegen handling of optional return types (#36581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36581

Found that the current codegen did not properly handle a return type of `?bool` because the branch of `constexpr (is_optional_v<T>)` assumed that T was always a JSI value that needed conversion, and `supportsToJs<bool, bool>` is false.

Changelog: [General][Fixed] Issue with TurboModule C++ codegen with optional return types

Reviewed By: christophpurrer

Differential Revision: D44302352

fbshipit-source-id: 0863de06da4e5e3c18f8a1ced7179d76d8e87b99
2023-03-23 03:10:25 -07:00
David Richey da027dd2fd Pre-suppress unused-promise lint errors in xplat/js (#36590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36590

Pre-suppress unused-promise lint errors in xplat/js. The next diff enables the lint.

See https://flow.org/en/docs/linting/rule-reference/#toc-unused-promise for more details.

Changelog: [Internal]

drop-conflicts
bypass-lint

Reviewed By: pieterv

Differential Revision: D43967290

fbshipit-source-id: f36242a732dbc18bf7482adfb46ca2b77e1b1493
2023-03-22 18:24:22 -07:00
Ruslan Lesiutin cf43f9c24b fix: update paths in React-rncore.podspec (#36571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36571

Changelog: [Internal]

The problem is related to the way we use `js_srcs_dir` & `output_dir` options, one requires just relative path from current ruby script, other requires relative path from iOS root project (where the Podfile located)

output_dir was introduced in D43304641
resulted into the issue, described in https://discord.com/channels/514829729862516747/1087736932953509958

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D44294112

fbshipit-source-id: 47fcf510e203d0880e1f92ab6ead09f4b79cb4dd
2023-03-22 10:21:14 -07:00
Pieter De Baets 8313f2382e Revert D44130814: reduce cursor size for multiline(TextInput)
Differential Revision:
D44130814

Original commit changeset: 09d53ecee681

Original Phabricator Diff: D44130814

fbshipit-source-id: 33c6fac5cb1f48a6e2461ff81564075eec466fb8
2023-03-22 08:40:27 -07:00
Rubén Norte ee76107d74 Bring ReactFabricHostComponent back to react-native (#36570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36570

I'm doing some preparations to implement this proposal to bring some DOM APIs to React Native refs: https://github.com/react-native-community/discussions-and-proposals/pull/607

To make it easier to iterate on the proposal, and to improve the separation of concerns between React and React Native, I'm moving the definition of `ReactFabricHostComponent` (the public instance provided by React when using refs on host conmponents) to the `react-native` package.

I already did some steps in the React repository to simplify this:
* Removing unused imperative events that caused increased coupling: https://github.com/facebook/react/pull/26282
* Extracting the definition of the public instance to a separate module: https://github.com/facebook/react/pull/26291

In this case, in order to be able to move the definition from React to React Native, we need to:
1. Create the definition in React Native and export it through `ReactNativePrivateInterface`.
2. Update React to use that definition instead of the one in its own module.

This diff implements the first step.

`ReactNativeAttributePayload` is required by this definition and by the one for Paper that still exists in React. I moved it here so we only define it where we use it when we remove Paper. Paper will access it through `ReactNativePrivateInterface` as well. That will also allow us to remove a few other fields in that interface.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: yungsters

Differential Revision: D43772356

fbshipit-source-id: 78dac152f415f19316ec90887127bf9861fe3110
2023-03-22 06:50:46 -07:00
Ruslan Lesiutin 64ea075141 RN [fix]: updated path to hermes-inspector-msggen package from react-native/ReactCommon (#36567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36567

Changelog: [Internal]

Relative path has changed after the monorepo migration, but was overlooked

Reviewed By: cipolleschi

Differential Revision: D44290877

fbshipit-source-id: 4a5e45acf02624b11d513d56c49824a2c9ccc59e
2023-03-22 06:43:52 -07:00
Soumyajit Behera e1885853ac reduce cursor size for multiline(TextInput) (#36484)
Summary:
Currently in multiline input the cursor touches the previous line.
So this reduces its height sets its position so that I does not touch previous line.
This PR will also fix the issue https://github.com/facebook/react-native/issues/28012 (Problem with TextInput lineHeight on iOS)
## Changelog

[IOS] [ADDED] - Fixed cursor height on multiline text input
<!-- 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/36484

Test Plan:
UI Before the change
<img width="379" alt="Screenshot 2023-03-15 at 10 16 07 PM" src="https://user-images.githubusercontent.com/46092576/225380938-23b9b8a4-4b8a-45e1-bbf1-4af8ac8d9183.png">

UI After the change
<img width="509" alt="Screenshot 2023-03-14 at 1 57 27 AM" src="https://user-images.githubusercontent.com/46092576/225380930-77ca853c-fae5-4bfa-82cf-03b2e22bf8da.png">

Reviewed By: dmytrorykun

Differential Revision: D44130814

Pulled By: javache

fbshipit-source-id: 09d53ecee6812e9a875dc5364bd91b76cc2bc1f5
2023-03-22 05:32:09 -07:00
Ruslan Shestopalyuk 70b5cb8530 Find and fix typos in yoga code (#36560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36560

X-link: https://github.com/facebook/litho/pull/935

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

Changelog:
[Internal] -

A follow-up to D44172494, I've run a pass of [typos](https://github.com/crate-ci/typos) on the Yoga code to detect/fix typos in comments and identifiers (with a manual review afterwards).

Reviewed By: javache

Differential Revision: D44254911

fbshipit-source-id: 6e8bfe83ec2f963108450cdcb8c79dfc8d1a7375
2023-03-21 16:29:09 -07:00
Moti Zilberman 6abc097bf3 Remove dev-mode Hermes bytecode experiment
Summary:
Changelog: [General][Removed] Remove experimental support for loading bytecode from Metro

Removes the experimental bundling strategy that offloads Hermes bytecode compilation to the packager server. The React Native parts of this experiment were never part of the public API, and the Metro parts never fully shipped in open source.

Followup from D43597007.

Reviewed By: robhogan

Differential Revision: D43604705

fbshipit-source-id: db3be553750ccbf286d876f75858299c5b750f19
2023-03-21 09:52:50 -07:00
Moti Zilberman 6dcdb93ec0 Remove DevSplitBundleLoader
Summary:
Changelog: [General][Removed] Remove internal DevSplitBundleLoader native module

`DevSplitBundleLoader` was part of an experimental bundling strategy that offloaded Hermes bytecode compilation to the packager server. The React Native parts of this experiment were never part of the public API, and the Metro parts never fully shipped in open source.

As part of implementing the simpler and more general [lazy bundling RFC](https://github.com/react-native-community/discussions-and-proposals/pull/605), we are removing `DevSplitBundleLoader` and associated code from React Native's internals.

Reviewed By: robhogan

Differential Revision: D43597007

fbshipit-source-id: 1460e9045cd7a0f5ef43144b10afb932172e223c
2023-03-21 09:52:50 -07:00
Shivam Shashank fdb2af5bf1 Support to enable/disable Fabric in ReactFragment (#36263)
Summary:
New Architecture Support missing in React Native Fragment, added same.

Changelog:
[Android] [Added] - Support to enable/disable Fabric in ReactFragment

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

Test Plan:
<details>
  <summary>Kotlin Code Snippet to test:</summary>
  <p>

```kotlin
supportFragmentManager
  .beginTransaction()
  .add(android.R.id.content,
     ReactFragment.Builder()
       .setComponentName("componentName")
       .setFabricEnabled(true)
       .build())
  .commit()
```

  </p>
</details>

Reviewed By: mdvacca

Differential Revision: D43701078

Pulled By: cortinico

fbshipit-source-id: 659ed2b4cf6619c6d64b803a198a93ff84b574fe
2023-03-21 06:30:55 -07:00
Rubén Norte d136c088ae React Native sync for revisions fccf3a9...3554c88
Summary:
This sync includes the following changes:
- **[3554c8852](https://github.com/facebook/react/commit/3554c8852 )**: Clean interface for public instances between React and React Native ([#26416](https://github.com/facebook/react/pull/26416)) //<Rubén Norte>//
- **[db281b3d9](https://github.com/facebook/react/commit/db281b3d9 )**: Feature: Suspend commit without blocking render ([#26398](https://github.com/facebook/react/pull/26398)) //<Andrew Clark>//
- **[55308554e](https://github.com/facebook/react/commit/55308554e )**: [www] enable enableFilterEmptyStringAttributesDOM flag ([#26410](https://github.com/facebook/react/pull/26410)) //<Jan Kassens>//
- **[163d86e19](https://github.com/facebook/react/commit/163d86e19 )**: Updated comment message ([#26158](https://github.com/facebook/react/pull/26158)) //<Ibrahim Amin>//
- **[108aed083](https://github.com/facebook/react/commit/108aed083 )**: Fix use of stale props in Fabric events ([#26408](https://github.com/facebook/react/pull/26408)) //<Rubén Norte>//
- **[8fa41ffa2](https://github.com/facebook/react/commit/8fa41ffa2 )**: Don't "fix up" mismatched text content with suppressedHydrationWarning ([#26391](https://github.com/facebook/react/pull/26391)) //<Sebastian Markbåge>//
- **[05777ffb0](https://github.com/facebook/react/commit/05777ffb0 )**: Setting transition pending flag shouldn't be part of a surrounding transition ([#26243](https://github.com/facebook/react/pull/26243)) //<Sophie Alpert>//
- **[99aa082be](https://github.com/facebook/react/commit/99aa082be )**: Remove unstable_flushControlled ([#26397](https://github.com/facebook/react/pull/26397)) //<Jan Kassens>//
- **[47cf4e578](https://github.com/facebook/react/commit/47cf4e578 )**: Restore some guards in ReactFabricGlobalResponderHandler after refactor ([#26394](https://github.com/facebook/react/pull/26394)) //<Rubén Norte>//
- **[cfc1274e3](https://github.com/facebook/react/commit/cfc1274e3 )**: Disable IE innerHTML workaround behind a flag ([#26390](https://github.com/facebook/react/pull/26390)) //<Sebastian Markbåge>//
- **[a57f40d83](https://github.com/facebook/react/commit/a57f40d83 )**: Undo dependency injection of batching ([#26389](https://github.com/facebook/react/pull/26389)) //<Sebastian Markbåge>//
- **[d310d654a](https://github.com/facebook/react/commit/d310d654a )**: Avoid meta programming to initialize functions in module scope  ([#26388](https://github.com/facebook/react/pull/26388)) //<Sebastian Markbåge>//
- **[21aee59e4](https://github.com/facebook/react/commit/21aee59e4 )**: Delete unused DOM files ([#26387](https://github.com/facebook/react/pull/26387)) //<Sebastian Markbåge>//
- **[6bd53a5bd](https://github.com/facebook/react/commit/6bd53a5bd )**: Remove FeatureFlags fork for `react-dom/unstable_testing` ([#26383](https://github.com/facebook/react/pull/26383)) //<Sebastian Markbåge>//
- **[2788d0d8d](https://github.com/facebook/react/commit/2788d0d8d )**: Allow empty string to be passed to formAction ([#26379](https://github.com/facebook/react/pull/26379)) //<Sebastian Markbåge>//
- **[f828bad38](https://github.com/facebook/react/commit/f828bad38 )**: Extracted definition and access to public instances to a separate module in Fabric ([#26321](https://github.com/facebook/react/pull/26321)) //<Rubén Norte>//
- **[131768166](https://github.com/facebook/react/commit/131768166 )**: Support Context as renderable node ([#25641](https://github.com/facebook/react/pull/25641)) //<Andrew Clark>//
- **[d4f58c3b8](https://github.com/facebook/react/commit/d4f58c3b8 )**: Support Promise as a renderable node  ([#25634](https://github.com/facebook/react/pull/25634)) //<Andrew Clark>//
- **[633461486](https://github.com/facebook/react/commit/633461486 )**: Add disableLegacyContext test gates where needed ([#26371](https://github.com/facebook/react/pull/26371)) //<Andrew Clark>//
- **[432ffc9d0](https://github.com/facebook/react/commit/432ffc9d0 )**: Convert more Scheduler.unstable_flushAll in tests to new test utils ([#26369](https://github.com/facebook/react/pull/26369)) //<Tianyu Yao>//
- **[69fd78fe3](https://github.com/facebook/react/commit/69fd78fe3 )**: Update Float tests to check for specific errors ([#26367](https://github.com/facebook/react/pull/26367)) //<Andrew Clark>//
- **[93c10dfa6](https://github.com/facebook/react/commit/93c10dfa6 )**: flushSync: Exhaust queue even if something throws ([#26366](https://github.com/facebook/react/pull/26366)) //<Andrew Clark>//
- **[be353d251](https://github.com/facebook/react/commit/be353d251 )**: [Flight Reply] Add undefined and Iterable Support ([#26365](https://github.com/facebook/react/pull/26365)) //<Sebastian Markbåge>//
- **[ef8bdbecb](https://github.com/facebook/react/commit/ef8bdbecb )**: [Flight Reply] Add Reply Encoding ([#26360](https://github.com/facebook/react/pull/26360)) //<Sebastian Markbåge>//
- **[a8875eab7](https://github.com/facebook/react/commit/a8875eab7 )**: Update more tests to not rely on sync queuing ([#26358](https://github.com/facebook/react/pull/26358)) //<Andrew Clark>//
- **[d1ad984db](https://github.com/facebook/react/commit/d1ad984db )**: [Flight] Add support for returning `undefined` from render ([#26349](https://github.com/facebook/react/pull/26349)) //<Sebastian Silbermann>//
- **[39d4b9365](https://github.com/facebook/react/commit/39d4b9365 )**: [Internal tests] Close MessageChannel port to prevent leak ([#26357](https://github.com/facebook/react/pull/26357)) //<Andrew Clark>//
- **[3706edb81](https://github.com/facebook/react/commit/3706edb81 )**: [Float][Fizz]: Don't preload nomodule scripts ([#26353](https://github.com/facebook/react/pull/26353)) //<Josh Story>//
- **[2b003a5cc](https://github.com/facebook/react/commit/2b003a5cc )**: Split out ServerReferenceMetadata into Id and Bound Arguments ([#26351](https://github.com/facebook/react/pull/26351)) //<Sebastian Markbåge>//
- **[62cd5af08](https://github.com/facebook/react/commit/62cd5af08 )**: Codemod redundant async act scopes ([#26350](https://github.com/facebook/react/pull/26350)) //<Andrew Clark>//
- **[037378202](https://github.com/facebook/react/commit/037378202 )**: Internal `act`: Call scope function after an async gap ([#26347](https://github.com/facebook/react/pull/26347)) //<Andrew Clark>//
- **[d8e49f2af](https://github.com/facebook/react/commit/d8e49f2af )**: Use setTimeout to schedule work on the server in Edge environments ([#26348](https://github.com/facebook/react/pull/26348)) //<Sebastian Markbåge>//
- **[83643778b](https://github.com/facebook/react/commit/83643778b )**: Internal test helpers: Use Node's MessageChannel to queue task ([#26345](https://github.com/facebook/react/pull/26345)) //<Andrew Clark>//
- **[44d380794](https://github.com/facebook/react/commit/44d380794 )**: Move internalAct to internal-test-utils package ([#26344](https://github.com/facebook/react/pull/26344)) //<Andrew Clark>//
- **[d81447304](https://github.com/facebook/react/commit/d81447304 )**: [Internal API only] Delete non-awaited form of act ([#26339](https://github.com/facebook/react/pull/26339)) //<Andrew Clark>//
- **[702fc984e](https://github.com/facebook/react/commit/702fc984e )**: Codemod act -> await act (4/?) ([#26338](https://github.com/facebook/react/pull/26338)) //<Andrew Clark>//
- **[9fb2469a6](https://github.com/facebook/react/commit/9fb2469a6 )**: Restore definition of NativeMethods as an object for React Native ([#26341](https://github.com/facebook/react/pull/26341)) //<Rubén Norte>//
- **[161f6ae42](https://github.com/facebook/react/commit/161f6ae42 )**: Codemod act -> await act (3/?) ([#26336](https://github.com/facebook/react/pull/26336)) //<Andrew Clark>//
- **[58605f798](https://github.com/facebook/react/commit/58605f798 )**: Codemod act -> await act (2/?) ([#26335](https://github.com/facebook/react/pull/26335)) //<Andrew Clark>//
- **[703c67560](https://github.com/facebook/react/commit/703c67560 )**: Codemod act -> await act (1/?) ([#26334](https://github.com/facebook/react/pull/26334)) //<Andrew Clark>//
- **[b380c2485](https://github.com/facebook/react/commit/b380c2485 )**: Convert class equivlance tests to flushSync ([#26333](https://github.com/facebook/react/pull/26333)) //<Andrew Clark>//
- **[8f812e75d](https://github.com/facebook/react/commit/8f812e75d )**: Refactor ReactFabricHostComponent ([#26323](https://github.com/facebook/react/pull/26323)) //<Rubén Norte>//
- **[978fae4b4](https://github.com/facebook/react/commit/978fae4b4 )**: [Float][Fiber] implement a faster hydration match for hoistable elements ([#26154](https://github.com/facebook/react/pull/26154)) //<Josh Story>//
- **[8a9f82ed5](https://github.com/facebook/react/commit/8a9f82ed5 )**: [Float][Fizz][Fiber] - Do not hoist elements with `itemProp` & hydrate more tolerantly in hoist contexts ([#26256](https://github.com/facebook/react/pull/26256)) //<Josh Story>//
- **[3cad3a54e](https://github.com/facebook/react/commit/3cad3a54e )**: Use content hash for facebook-www builds ([#26331](https://github.com/facebook/react/pull/26331)) //<Jan Kassens>//
- **[ba353a50a](https://github.com/facebook/react/commit/ba353a50a )**: Build: make version in build artifacts match ([#26329](https://github.com/facebook/react/pull/26329)) //<Jan Kassens>//
- **[6e1756a5a](https://github.com/facebook/react/commit/6e1756a5a )**: Move suspended render logic to ensureRootIsScheduled ([#26328](https://github.com/facebook/react/pull/26328)) //<Andrew Clark>//
- **[1528c5ccd](https://github.com/facebook/react/commit/1528c5ccd )**: SchedulerMock.unstable_yieldValue -> SchedulerMock.log ([#26312](https://github.com/facebook/react/pull/26312)) //<Andrew Clark>//
- **[4bbac04cd](https://github.com/facebook/react/commit/4bbac04cd )**: Upgrade Flow to 0.201 ([#26326](https://github.com/facebook/react/pull/26326)) //<Jan Kassens>//
- **[eb616a12f](https://github.com/facebook/react/commit/eb616a12f )**: Extract duplicated methods in Fabric and the legacy renderer to a shared module ([#26319](https://github.com/facebook/react/pull/26319)) //<Rubén Norte>//
- **[49f741046](https://github.com/facebook/react/commit/49f741046 )**: Fix: Infinite act loop caused by wrong shouldYield ([#26317](https://github.com/facebook/react/pull/26317)) //<Andrew Clark>//
- **[106ea1c58](https://github.com/facebook/react/commit/106ea1c58 )**: Support Iterables in Flight ([#26313](https://github.com/facebook/react/pull/26313)) //<Sebastian Markbåge>//
- **[f905da227](https://github.com/facebook/react/commit/f905da227 )**: [Flight] Send server reference error chunks to the client ([#26293](https://github.com/facebook/react/pull/26293)) //<Hendrik Liebau>//
- **[e0241b660](https://github.com/facebook/react/commit/e0241b660 )**: Simplify Webpack References by encoding file path + export name as single id ([#26300](https://github.com/facebook/react/pull/26300)) //<Sebastian Markbåge>//
- **[25685d8a9](https://github.com/facebook/react/commit/25685d8a9 )**: Codemod tests to waitFor pattern (9/?) ([#26309](https://github.com/facebook/react/pull/26309)) //<Andrew Clark>//
- **[64dde7082](https://github.com/facebook/react/commit/64dde7082 )**: Codemod tests to waitFor pattern (8/?) ([#26308](https://github.com/facebook/react/pull/26308)) //<Andrew Clark>//
- **[3cb5afb82](https://github.com/facebook/react/commit/3cb5afb82 )**: Codemod tests to waitFor pattern (7/?) ([#26307](https://github.com/facebook/react/pull/26307)) //<Andrew Clark>//
- **[e98695db9](https://github.com/facebook/react/commit/e98695db9 )**: Codemod tests to waitFor pattern (6/?) ([#26305](https://github.com/facebook/react/pull/26305)) //<Andrew Clark>//
- **[9a52cc8bc](https://github.com/facebook/react/commit/9a52cc8bc )**: Convert ReactLazy-test to waitFor pattern ([#26304](https://github.com/facebook/react/pull/26304)) //<Andrew Clark>//
- **[03462cfc7](https://github.com/facebook/react/commit/03462cfc7 )**: [Fizz] External runtime: fix bug in processing existing elements ([#26303](https://github.com/facebook/react/pull/26303)) //<mofeiZ>//
- **[faacefb4d](https://github.com/facebook/react/commit/faacefb4d )**: Codemod tests to waitFor pattern (4/?) ([#26302](https://github.com/facebook/react/pull/26302)) //<Andrew Clark>//
- **[06460b6fb](https://github.com/facebook/react/commit/06460b6fb )**: Remove unnecessary (and incorrect) code for compatibility with Paper in the Fabric version of GlobalResponderHandler ([#26290](https://github.com/facebook/react/pull/26290)) //<Rubén Norte>//
- **[ce8a72fd4](https://github.com/facebook/react/commit/ce8a72fd4 )**: Codemod tests to waitFor pattern (2/?) ([#26296](https://github.com/facebook/react/pull/26296)) //<Andrew Clark>//
- **[1f1f8eb55](https://github.com/facebook/react/commit/1f1f8eb55 )**: [Float][Fizz][Fiber]: Refactor <style> Resource implementation to group on flush ([#26280](https://github.com/facebook/react/pull/26280)) //<Josh Story>//
- **[5c633a48f](https://github.com/facebook/react/commit/5c633a48f )**: Add back accidentally deleted test comments ([#26294](https://github.com/facebook/react/pull/26294)) //<Andrew Clark>//
- **[b72ed698f](https://github.com/facebook/react/commit/b72ed698f )**: Fixed incorrect value returned as public instance from reconciler ([#26283](https://github.com/facebook/react/pull/26283)) //<Rubén Norte>//
- **[25a8b9735](https://github.com/facebook/react/commit/25a8b9735 )**: Codemod tests to waitFor pattern (1/?) ([#26288](https://github.com/facebook/react/pull/26288)) //<Andrew Clark>//
- **[e52446733](https://github.com/facebook/react/commit/e52446733 )**: New internal testing helpers: waitFor, waitForAll, waitForPaint ([#26285](https://github.com/facebook/react/pull/26285)) //<Andrew Clark>//
- **[d49e0e0be](https://github.com/facebook/react/commit/d49e0e0be )**: Removed unused imperative events implementation from React Native renderer ([#26282](https://github.com/facebook/react/pull/26282)) //<Rubén Norte>//
- **[41110021f](https://github.com/facebook/react/commit/41110021f )**: Fix: Selective hydration causing incorrect thenable type passed to DevTools ([#26275](https://github.com/facebook/react/pull/26275)) //<Andrew Clark>//
- **[67a61d5bd](https://github.com/facebook/react/commit/67a61d5bd )**: [Flight Fixture] Show SSR Support with CSS ([#26263](https://github.com/facebook/react/pull/26263)) //<Sebastian Markbåge>//
- **[40755c01a](https://github.com/facebook/react/commit/40755c01a )**: [Flight Fixture] Proxy requests through the global server instead of directly ([#26257](https://github.com/facebook/react/pull/26257)) //<Sebastian Markbåge>//
- **[b2ae9ddb3](https://github.com/facebook/react/commit/b2ae9ddb3 )**: Cleanup enableSyncDefaultUpdate flag ([#26236](https://github.com/facebook/react/pull/26236)) //<Jan Kassens>//
- **[6ff1733e6](https://github.com/facebook/react/commit/6ff1733e6 )**: [Float][Fizz][Fiber] support type for ReactDOM.preload() options ([#26239](https://github.com/facebook/react/pull/26239)) //<Josh Story>//
- **[1173a17e6](https://github.com/facebook/react/commit/1173a17e6 )**: [Float][Fizz][Fiber] implement preconnect and prefetchDNS float methods ([#26237](https://github.com/facebook/react/pull/26237)) //<Josh Story>//
- **[a8f971b7a](https://github.com/facebook/react/commit/a8f971b7a )**: Switch to mount dispatcher after use() when needed ([#26232](https://github.com/facebook/react/pull/26232)) //<Sophie Alpert>//
- **[96cdeaf89](https://github.com/facebook/react/commit/96cdeaf89 )**: [Fizz Node] Fix null bytes written at text chunk boundaries ([#26228](https://github.com/facebook/react/pull/26228)) //<Sophie Alpert>//
- **[c04b18070](https://github.com/facebook/react/commit/c04b18070 )**: Remove eventTime field from class Update type ([#26219](https://github.com/facebook/react/pull/26219)) //<Andrew Clark>//
- **[60144a04d](https://github.com/facebook/react/commit/60144a04d )**: Split out Edge and Node implementations of the Flight Client ([#26187](https://github.com/facebook/react/pull/26187)) //<Sebastian Markbåge>//
- **[70b0bbda7](https://github.com/facebook/react/commit/70b0bbda7 )**: [fizz][external-runtime] Fix: process mutation records before disconnecting ([#26169](https://github.com/facebook/react/pull/26169)) //<mofeiZ>//
- **[c7967b194](https://github.com/facebook/react/commit/c7967b194 )**: Distribute bundles more evenly into CI shards ([#26208](https://github.com/facebook/react/pull/26208)) //<Sebastian Silbermann>//
- **[bb1e3d0e1](https://github.com/facebook/react/commit/bb1e3d0e1 )**: Fail yarn build if any bundle fails to build ([#26207](https://github.com/facebook/react/pull/26207)) //<Sebastian Silbermann>//
- **[62e6c4612](https://github.com/facebook/react/commit/62e6c4612 )**: Move Mutation/Persistence fork inline into the functions ([#26206](https://github.com/facebook/react/pull/26206)) //<Sebastian Markbåge>//
- **[80cf4a099](https://github.com/facebook/react/commit/80cf4a099 )**: Update Closure Compiler ([#26205](https://github.com/facebook/react/pull/26205)) //<Sebastian Markbåge>//
- **[6b6d0617e](https://github.com/facebook/react/commit/6b6d0617e )**: Update Rollup and related plugins to their most recent versions ([#24916](https://github.com/facebook/react/pull/24916)) //<Glenn 'devalias' Grant>//
- **[bc38a3dfa](https://github.com/facebook/react/commit/bc38a3dfa )**: Update rollup config to use moduleSideEffects ([#26199](https://github.com/facebook/react/pull/26199)) //<Ming Ye>//
- **[c9d9f524d](https://github.com/facebook/react/commit/c9d9f524d )**: Make enableCustomElementPropertySupport a dynamic flag in www build ([#26194](https://github.com/facebook/react/pull/26194)) //<Andrew Clark>//
- **[189f70e17](https://github.com/facebook/react/commit/189f70e17 )**: Create a bunch of custom webpack vs unbundled node bundles ([#26172](https://github.com/facebook/react/pull/26172)) //<Sebastian Markbåge>//
- **[fbf3bc315](https://github.com/facebook/react/commit/fbf3bc315 )**: Add `scale` as a unitless property ([#25601](https://github.com/facebook/react/pull/25601)) //<Jonny Burger>//

Changelog:
[General][Changed] - React Native sync for revisions fccf3a9...3554c88

jest_e2e[run_all_tests]
bypass-github-export-checks

@public

Fixes tests for current React version.

Reviewed By: sammy-SC

Differential Revision: D44216371

fbshipit-source-id: a569c9aeaf2d96d150219e148f06dcde9ba6f7cd
2023-03-21 06:13:42 -07:00
Rubén Norte 70a5d6fcd7 Prepare for next React Native sync with new instance format (v2)
Summary:
We made some changes to the new instance format, so need to adapt this again after D43980374.

The previous format was never synced so we don't need to keep compatibility.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D44137324

fbshipit-source-id: bb08141674e2385934772f241acb863f9050b671
2023-03-21 06:13:42 -07:00
Nacho López d92cfd56f5 Only reset textAncesor when is a child of text (#36520)
Summary:
Text need to know if is a descendant of a text in order to proper render nested text. For this react-native uses the textAncestor provider https://github.com/facebook/react-native/pull/29736#issuecomment-681116943.

This provides a not so ideal DX when profiling/Debugging as the view is polluted with TextAncestor.provider on each view render (As is the main render piece this happens quite often).

The idea behind of this PR is to just reset the context when view is a descendant of a text (Not so common case) rather than resetting all the time.

| Before  | After |
| ------------- | ------------- |
| ![Screenshot 2023-03-08 at 23 06 12](https://user-images.githubusercontent.com/6432326/226111157-d8af7990-2584-46b6-8f02-8583a84c2994.png)  |  ![Screenshot 2023-03-08 at 23 07 11](https://user-images.githubusercontent.com/6432326/226111222-65e8ac86-8ac8-4499-a725-c2f5ed2a2c99.png)  |

From my understanding of how hooks works this shouldn't degrade the performance and didn't spot any diff profiling my app (For better or worse).

## Changelog

[INTERNAL] [CHANGED] - Only reset textAncesor when is a child of text

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

Test Plan: https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Text/TextExample.ios.js

Reviewed By: necolas

Differential Revision: D44213843

Pulled By: javache

fbshipit-source-id: 246ac22557dc7794741fd9732d399fe8b9256f11
2023-03-21 04:47:39 -07:00
Jiamin Zhu 6956d4f261 Remove dependency on use-sync-external-store
Summary:
Changelog: [Internal]

React Native requires React 18 which includes `useSyncExternalStore`, so we can remove the shim. It was only used in one place (`useColorScheme`).

Reviewed By: motiz88

Differential Revision: D44163914

fbshipit-source-id: 3a94466b3d5ae8aa43e9236acb8c92fbefd04180
2023-03-20 16:08:15 -07:00