Commit Graph

12270 Commits

Author SHA1 Message Date
Janic Duplessis 1f384f75da Add fabric support for maintainVisibleContentPosition on Android (#35994)
Summary:
Implement a few missing bits for `maintainVisibleContentPosition` to work with fabric. The main thing needed is to add 2 fabric renderer listener methods to allow to hook into specific parts of the rendering process. We need some code to execute before view updates are executed and after view updates are executed. The current methods that are exposed do not work for this case. `willDispatchViewUpdates` is called from JS thread, and there doesn't seem to be a way to add UI blocks that will be executed at the right time like we do in paper. `didDispatchMountItems` is called for every frame which we don't want and will cause lots of overhead.

After that we simply need to call the right methods in the new renderer listener methods.

## Changelog

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

Pick one each for the category and type tags:

[ANDROID] [ADDED] - Add fabric support for maintainVisibleContentPosition on Android

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

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

Test Plan: Tested in RN tester maintainVisibleContentPosition example on Android with fabric enabled.

Reviewed By: cipolleschi

Differential Revision: D44131763

Pulled By: cortinico

fbshipit-source-id: 32c0b5867d460537b18a70d472fd58052da6cf80
2023-04-05 07:09:33 -07:00
Antoine Doubovetzky 8fbcfcea8d Extract throwIfConfigNotfound and throwIfMoreThanOneConfig from findComponentConfig function (#36719)
Summary:
This PR contains tasks 96 and 97 from https://github.com/facebook/react-native/issues/34872:

>[Codegen 96 - assigned to AntoineDoubovetzky] Create a throwIfConfigNotfound in the error-utils.js file and extract the error code from [Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L61-L63) and [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L62-L64)
 [Codegen 97 - assigned to AntoineDoubovetzky] Create a throwIfMoreThanOneConfig in the error-utils.js file and extract the error code from [Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L64-L66) and [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L65-L67)

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

[Internal] [Changed] - Extract throwIfConfigNotfound and throwIfMoreThanOneConfig from findComponentConfig function

bypass-github-export-checks

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

Test Plan: I tested using Jest and Flow commands.

Reviewed By: rshest

Differential Revision: D44539681

Pulled By: cipolleschi

fbshipit-source-id: c778ad1620d1c3f60b10c25c51efcb11173b3037
2023-04-05 06:55:47 -07:00
Finn Pauls f0893cf72f Support font-variant-ligatures values (#36740)
Summary:
The text style prop `fontVariant` in React Native is supposed to map to the CSS `font-variant` property. The CSS property is a short-hand for the following CSS properties:

- [font-variant-alternates](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-alternates)
- [font-variant-caps](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-caps)
- [font-variant-east-asian](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-east-asian)
- [font-variant-emoji](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-emoji)
- [font-variant-ligatures](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures) 👈
- [font-variant-numeric](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric)
- [font-variant-position](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-position)

Currently React Native only supports a subset of the values from `font-variant-numeric` and `font-variant-caps`.

This change increases the `font-variant` support by adding all values from `font-variant-ligatures`.

## Changelog:

[iOS] [Added] - Add all fontVariant values for font-variant-ligatures
[Android] [Added] - Add all fontVariant values for font-variant-ligatures

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

Test Plan:
See https://github.com/facebook/react-native/pull/36740#issuecomment-1492546631
## Resources
- [Apple True Type Reference](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html)
- [Webkit Source Code](https://opensource.apple.com/source/WebCore/WebCore-7602.1.50.1.1/platform/graphics/cocoa/FontCacheCoreText.cpp)
- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures)
- [Android TextView Documentation](https://developer.android.com/reference/android/widget/TextView#setFontFeatureSettings(java.lang.String))

Reviewed By: cipolleschi

Differential Revision: D44705513

Pulled By: cortinico

fbshipit-source-id: 1cde5fcc23ba99fd2f98fa73d934c8e51b0d292e
2023-04-05 06:16:15 -07:00
Rubén Norte 1476d99048 Extract ReactFabricHostComponent into a separate module
Summary:
Small refactor in preparation for adding `ReactNativeElement` as an alternative implementation for `ReactFabricHostComponent`.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: yungsters

Differential Revision: D44299619

fbshipit-source-id: b1bc43f6a6ae5b75dca43d7e08cd15acdc49bb79
2023-04-05 04:59:46 -07:00
Rubén Norte 4bff977869 Add behavior from React repo to FabricUIManager mock
Summary:
We recently added an implementation of the native binding for UIManager (`global.nativeFabricUIManager`) in JavaScript. This brings the logic we had in that mock in the React repository so we can properly use it for testing (as integration tests instead of unit tests).

Changelog: [internal]

bypass-github-export-checks

Reviewed By: yungsters

Differential Revision: D44298377

fbshipit-source-id: 6085df93993302c2ddce7220c73e614ad6301667
2023-04-05 04:59:46 -07:00
Pieter De Baets 58ee6b2f7a Remove unused fields from AndroidTextInputState (#36797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36797

defaultParentShadowView and defaultTextAttributes are never used

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D44665067

fbshipit-source-id: 5e607ab323020bef5c9708a6e683582ac47acb2a
2023-04-05 02:33:21 -07:00
Samuel Susla deaef09d7f Avoid double assignment of runtime scheduler (#36801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36801

changelog: [internal]

This looks like a typo.

Reviewed By: cipolleschi

Differential Revision: D44670852

fbshipit-source-id: 59891a6256be366601e4791a733df9b68e8c2a68
2023-04-05 01:45:32 -07:00
Genki Kondo 7aa9936835 Modify AnimatedProps and AnimatedStyle to use AnimatedObject (#36798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36798

AnimatedObject is a more generic version of AnimatedTransform, able to handle animated values within arrays and objects. This is useful for props of native components that may need to be animated per field.

This diff hooks up AnimatedObject to AnimatedProps and AnimatedStyle for values that are arrays or objects.

Changelog:
[Internal][Added] - Modify AnimatedProps and AnimatedStyle to use AnimatedObject

Reviewed By: rshest

Differential Revision: D44637985

fbshipit-source-id: c70b9d40e40d0782c2c1a332f1f22358fe0abe64
2023-04-04 18:37:20 -07:00
Brian Long 816598975c ObjectPreview support (#36785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36785

D43553742 adds support for ObjectPreviews in CDP messages; this diff implements support in the Inspector for honoring generatePreview requests and returning ObjectPreviews in the relevant request messages.

Changelog: [Internal]

Reviewed By: mattbfb

Differential Revision: D44522932

fbshipit-source-id: 216debe36b4e61c822fa3ae513e5eba399fad019
2023-04-04 18:29:08 -07:00
Dmitry Rykun fdbc89d10b Re-land "[react-native][PR] [Upstream][Security] Use execFileSync over exec for cases with uncontrolled absolute paths" (#36791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36791

This is a re-land of D44635949. It was reverted as it was a suspected cause of CircleCI fails. It turned out the diff was unrelated, and the cause was something else.

## Changelog
[Internal][Security] - Use execFileSync over exec for cases with uncontrolled absolute paths

Reviewed By: cortinico

Differential Revision: D44663132

fbshipit-source-id: dfb3d09dbfbe3312ef54bcbbc43c8b4062d787a8
2023-04-04 15:17:44 -07:00
Brian Long de35e2881e msggen support for cdp previews (#36781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36781

----

Add support to msggen for types like:

* Runtime.CustomPreview
* Runtime.EntryPreview
* Runtime.ObjectPreview
* Runtime.PropertyPreview

And their related use as properties.

There was quite a gap here. The work involves:

* Upgrade devtools-protocol to 0.0.1107588 even pick up the schema definitions in the first place.
* Next problem: all the preview stuff is experimental. Had to add support to --include-experimental flag for targeting types AND properties.
* Next problem: the protocol schema for previews is cyclical. ObjectPreview refers to PropertyPreview and EntryPreview, which both refer back to ObjectPreview. msggen only allowed for DAGs. Added support for allowing cycles.
* Next problem: Forward declarations are not enough to compensate for the cyclical references, because of the incomplete type definitions. This breaks optional, vector, and simple containment. To address this:
  * In the graph traversal code, where before we would error if the graph had a cycle, we allow for the cycle, but record the cyclical reference from a property on Type B's to Type A.
  * Whenever we emit the definition of Type B, its references to Type A are not naked, they are now wrapped in a unique_ptr.
  * However, because the unique_ptr only has a forward declaration, and not a complete type, we need to specify a custom deleter.
* Next problem: There are lots of cases where these types that now contain unique_ptrs were being copied, which no longer works. So, make all these codegen'd types move-only, and change a few places where were copying root objects, to move them instead.
* Many tests required changes to avoid copy construction/assignment that were occuring. MessageTypes are not copyable construcrtible/assignable now.

Changelog: [Internal]

Reviewed By: jpporto

Differential Revision: D43553742

fbshipit-source-id: 1e4c495aa600feb6f1901e6bc013d517ba8d8a2d
2023-04-04 14:17:43 -07:00
Phillip Pan aa15fd44a6 decouple DialogModuleTest from PowerMock (#36778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36778

Changelog: [Internal]

we can just use mockito for this suite

Reviewed By: mdvacca

Differential Revision: D44603023

fbshipit-source-id: b8f6f37fccba38990fe498d8f5e479f174ff93af
2023-04-04 13:49:37 -07:00
David Vacca c0b4883058 Deprecate and mark for removal com.facebook.react.common.StandardCharsets (#36779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36779

Deprecate and mark for removal com.facebook.react.common.StandardCharsets, this class was originally created because java.nio.charset.StandardCharsets only exists in Android API level 19+

As part of this diff I also migrate all internal usages of  com.facebook.react.common.StandardCharsets

Changelog:
[Android][Deprecated] - Deprecate and mark for removal com.facebook.react.common.StandardCharsets, please use java.nio.charset.StandardCharsets instead

Reviewed By: rshest

Differential Revision: D44592721

fbshipit-source-id: c3f4286766209a733b466d19dc36891f12d69be1
2023-04-04 10:43:56 -07:00
Nicola Corti 990971186f Fix a crash new app template when createRootView is invoked with null bundle (#36796)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36796

As the title says, this fixes a instacrash on template when `createRootView` is invoked with
a bundle being null. The crash was happening as the parameter, despite being not used, is
specified as `Bundle` and is not nullable. When the Java caller passes `null`, the app crashes.

Changelog:
[Android] [Fixed] - Fix a crash new app template when `createRootView` is invoked with null bundle

Reviewed By: cipolleschi

Differential Revision: D44668305

fbshipit-source-id: 1150ddac26f19765e7340878c8850d8462c6f3fd
2023-04-04 09:40:57 -07:00
Rubén Norte 28dac6108f Implement ReactNativePrivateInterface.createPublicTextInstance
Summary:
This exposes a new method in the private interface used by React so we can merge https://github.com/facebook/react/pull/26516

We're adding support for text instances in React Native (as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607). See D44632362 for the full implementation.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44663223

fbshipit-source-id: 70ca3ca9d2edefaa73a396f43c2d560c6d1422f1
2023-04-04 06:34:55 -07:00
Riccardo Cipolleschi 904d56cfa3 bump CLI to 12.0.0-alpha.0 (#36793)
Summary:
Yesterday, CLI published version 11.1.1 which has a strong dependency on `react-native/metro-config` 0.72.
On `main`, all the packages we publish to test the template have version 0.73.
So, when running tests on the template, the cli was looking for a `metro-config` version 0.72, but it could not find it as verdaccio
only has version 0.73.

Together with Callstack, we released a version 12.0.0-alpha.0 of the CLI which have the right dependency on metro-config v0.73, so that
our CI can be green again.

bypass-github-export-checks

## Changelog:

[General][Fixed] - Bumped CLI dependency on main to 12.0.0-alpha.0

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

Test Plan: CircleCI must be green

Reviewed By: huntie

Differential Revision: D44663381

Pulled By: cipolleschi

fbshipit-source-id: 30d341d55243318ce278a6e67a9e77ccfb90cafd
2023-04-04 06:14:35 -07:00
Phillip Pan bece6500f7 Back out "Use execFileSync over exec for cases with uncontrolled absolute paths" (#36780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36780

Original commit changeset: 8e0ebb070768

Original Phabricator Diff: D44131032

Changelog: [Internal]

all the circleCI template tests started failing after this commit, revert!

Reviewed By: jacdebug, cortinico

Differential Revision: D44635949

fbshipit-source-id: 429167acdbee3ebf6d81491ac65896c534c18fd0
2023-04-03 14:14:09 -07:00
Krystof Woldrich 12a102b926 Add error reporting examples to rn-tester turbo modules (#36729)
Summary:
This PR is adding examples of Turbo Modules functions throwing runtime exceptions and asserts. This should make it easier to collaborate and develop the error reporting for a new architecture that is being discussed in the React Native New Architecture Working Group -> https://github.com/reactwg/react-native-new-architecture/discussions/122.

I'm not sure what return type should be used for the JS function returning `Promise<void>` in Cxx, I used [`AsyncPromise<jsi::Value>`](https://github.com/facebook/react-native/pull/36729/files#diff-9cebc75f48fd35fd6fef71138f98dfd0ba28a754b2aab0d6fe44fd685f74ce16R135), what would you use, I've not found `void` type to use?

### Added functions

The table shows the current behavior.

<table>
<tr>
	<td> Function
	<td> Description
	<td> Turbo Module
	<td> Cxx Module
<tr>
	<td> voidFuncThrows
	<td> function with return type void throws a runtime exception
	<td> platform error no JS stack trace
	<td> JS error no native stack trace
<tr>
	<td> getObjectThrows
	<td> function with return type object throws a runtime exception
	<td> JS error no platform stack trace
	<td> JS error no native stack trace
<tr>
	<td> promiseThrows
	<td> function with return type promise throws a runtime exception before settling the promise
	<td> platform error no JS stack trace
	<td> JS error no native stack trace
<tr>
	<td> voidFuncAssert
	<td> function with return type void asserts
	<td> platform error no JS stack trace
	<td> native error no JS stack trace
<tr>
	<td> getObjectAssert
	<td> function with return type object asserts
	<td> JS error no platform stack trace
	<td> native error no JS stack trace
<tr>
	<td> promiseAssert
	<td> function with return type promise asserts before settling the promise
	<td> platform error no JS stack trace
	<td> native error no JS stack trace
</table>

## 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] - Error reporting examples in rn-tester turbo modules

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

Test Plan:
This PR doesn't change any RN behavior. Only shows the current state by adding an example to rn-tester.

I'm happy to add these examples to the unit/integration test, just point me to where would be a good place.

Reviewed By: rshest

Differential Revision: D44623027

Pulled By: javache

fbshipit-source-id: d9cc04852b05d810ed11d7a94f1b2d455ef554a5
2023-04-03 08:34:59 -07:00
Saad Najmi dc289737a8 Use execFileSync over exec for cases with uncontrolled absolute paths (#36491)
Summary:
In our fork React Native macOS, we run [Github's CodeQL ](https://codeql.github.com) to analyze for vulnerabilities. One common one that comes up is the use of `exec` with an uncontrolled absolute path (Example: https://github.com/microsoft/react-native-macos/security/code-scanning/14). The very simple fix to this is to replace calls to `exec` with `execFileSync`, which more or less does the same thing (but more securely!).

## Changelog

[INTERNAL] [SECURITY] - Use `execFileSync` over `exec` for cases with uncontrolled absolute paths

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

Test Plan: CI should pass

Reviewed By: cipolleschi

Differential Revision: D44131032

Pulled By: dmytrorykun

fbshipit-source-id: 8e0ebb07076838216f878f802ec937d2df44f33a
2023-04-03 08:32:30 -07:00
Ruslan Shestopalyuk 950472018d Separate buffering per entry type in WebPerformance (#36737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36737

## Changelog:
[Internal] - Use `BoundedConsumableBuffer` in WebPerformance

This makes use of the `BoundedConsumableBuffer` container type, introduced in D44544057, for buffering/observing arbitrary performance entry types in `WebPerformance/PerformanceEntryReporter`, thus generalizing what was earlier done in an ad-hoc way for marks and measures, and also allowing to have both observable/retrievable/buffered property for arbitrary performance entry type (with the ultimate goal of adding custom entry types, related to e.g. startup timing, something that we currently have an ad hoc API for).

Reviewed By: sammy-SC

Differential Revision: D44574241

fbshipit-source-id: a858712ff1cf468914a80c99f6b82d060cb0b702
2023-04-03 06:13:16 -07:00
Ruslan Shestopalyuk 1387179b89 Implement specialized container type for performance entry buffering (#36726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36726

## Changelog:
[Internal] -

This implements (together with unit tests) a generic container type, `BoundedConsumableBuffer` with the following properties:

 * It can only grow up to a specified max size
 * It's a circular buffer (the oldest elements are dropped if reached max size and adding a new element)
 * The entries can be "consumed" (once), which from the point of view of the consumer effectively clears the buffer
 * Even after the entries are consumed, all of the non-overwritten entries can still be independently retrieved an arbitrary amount of times

The buffer effectively wraps around when adding new elements. Once an element added, it becomes "consumable" (or "observable") and remains such, until all of the current outstanding elements are explicitly "consumed". It doesn't get immediately removed from the buffer, however (if max buffer size allows), and can be later retrieved via the `getEntries` API, until eventually overwritten.

{F928241747}

The goal is to use it for buffering performance entries in the native WebPerformance implementation, where the model is that the performance entries should be both buffered/observable, but also for certain performance entry types (such as marks, measures and potentially certain event types) should be possible to retrieve all of them at any time (regardless of whether they have already been observed or not).

In fact, this container is factoring that behavior, which is already there in `PerformanceEntryObserver` (but in an ad-hoc manner and only applicable to marks/measures), with the goal of being able to do it for any performance entry type.

Reviewed By: sammy-SC

Differential Revision: D44544057

fbshipit-source-id: 5b7d055a6fc813ebb0fb30f9b346723161774260
2023-04-03 06:13:16 -07:00
Samuel Susla 8b72c33742 Correct offset when drawing text to TextStorage coordinate system. (#36771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36771

Changelog: [internal]

Previously, when `NSTextStorage` was cached, we were not accounting for case where text which was aligned to centre or left, was used to size its container.
The result was that it was painted outside of its container, therefore invisible. To fix this, we adjust the offset to make sure text is painted correctly.

This bug only happens if:
- Text is not aligned to left in right to left writing system.
- The canvas where text is drawn is not stretched to full width of its parent.
- The offset needs to be large enough for this to matter, otherwise the text is just slightly off.
- Because of the caching mechanism, it had to be a piece of text that was rendered before. Otherwise it would work.

This complexity is worth the trouble to avoid invalidation of layout inside NSTextContainer, which is expensive.

Reviewed By: cipolleschi

Differential Revision: D44624085

fbshipit-source-id: 1bb8ef88933a49b478a2606dba6bf16b4e728b2b
2023-04-03 05:19:28 -07:00
Samuel Susla a675dd7faf Only create NSAttributedString if NSTextStorage is nil (#36773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36773

Changelog: [internal]

Do not construct `NSAttributedString` if `NSTextStorage` exists. Creating `NSAttributedString` is expensive and it isn't needed to measure text if `NSTextStorage` `exists`

Reviewed By: cipolleschi

Differential Revision: D44620292

fbshipit-source-id: 0827c514e40fcbd9626d2b7d7b6d28a3332d9aa1
2023-04-03 05:19:28 -07:00
Samuel Susla 9952dc2cc3 Extract NSTextStorage measure into a helper method (#36772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36772

changelog: [internal]

Move NSTextStorage into a private method.

Reviewed By: cipolleschi

Differential Revision: D44620262

fbshipit-source-id: 4855879f3c3a09b2f352ab84c906c7bd106aebda
2023-04-03 05:19:28 -07:00
Riccardo Cipolleschi cb88e75cf1 Fix Cocoapods for Xcode 14.3.0 (#36759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36759

On Thursday the 30th, Apple Released Xcode 14.3.0.
This Version of Xcode enforce some version checks for which React-Codegen, which supported iOS 11 as minimum supported version, could not be build anymore.

This change ensue that React-Codegen is always aligned to the min version supported by React Native.
Plus, it moves CircleCI's Xcode to 14.3.0, to keep this problem in Check.

While working on this, I figured that, with the monorepo, Ruby tests stopped working because they were in the wrong folder: I moved them in the right one.

## Changelog:
[iOS][Fixed] - Make React Native build with Xcode 14.3.0 and fix tests

Reviewed By: blakef

Differential Revision: D44605617

fbshipit-source-id: 3ec1f5b36858ef07d9f713d74eb411a1edcccd45
2023-04-02 03:32:15 -07:00
generatedunixname89002005232357 a2d2696e43 Revert D44153451: Multisect successfully blamed D44153451 for test or build failures (#36756)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36756

This diff is reverting D44153451
Depends on D44602279
D44153451: [Fabric][Android] Reduce visibility of FabricSoLoader by mdvacca has been identified to be causing the following test or build failures:

Tests affected:
- [xplat/endtoend/jest-e2e/apps/fb4a/__tests__/consumerwifi/venice/fb4aVeniceAddressSearch-e2e.js](https://www.internalfb.com/intern/test/281475007251570/)

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

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

Reviewed By: mdvacca

Differential Revision: D44602284

fbshipit-source-id: 50b3b0f131c6c8c1eec3c23156b33559ffc3931e
2023-03-31 22:18:07 -07:00
Phillip Pan 86859e3e38 decouple ShareModuleTest from PowerMock (#36752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36752

Changelog: [Internal]

as title! i'm not actually familiar enough with junit as to why the test infra cannot find `Arguments.java` since it is part of our framework, not something externally linked or an under the hood library, so if someone wants to explain that to me that'd be great

Reviewed By: cortinico, mdvacca

Differential Revision: D44527486

fbshipit-source-id: d94f4eebdb6b7cdf7e40e44bfec8703615b96963
2023-03-31 16:48:14 -07:00
Genki Kondo bee4ac85ae Revert D44315336: Modify AnimatedProps and AnimatedStyle to use AnimatedObject
Differential Revision:
D44315336

Original commit changeset: 4d543550f24a

Original Phabricator Diff: D44315336

fbshipit-source-id: 7a383ef3b42cbcf3d3db87fef5ebf3120ef47c38
2023-03-31 16:11:03 -07:00
David Vacca d2d2a8a598 Introduce NO_SURFACE constant to specify the lack of surfaces used by legacy system (#36747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36747

Introduce NO_SURFACE constant to specify the lack of surfaces used by legacy system

changelog: [internal] internal

Reviewed By: sshic

Differential Revision: D44563649

fbshipit-source-id: 99c7028c5ee508c2982cefc9b3199a332c2346c7
2023-03-31 15:34:45 -07:00
David Vacca d2e591cb2b Fix lint warns (#36748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36748

EZ refactor fixing some lint warnings

changelog: [internal] internal

Reviewed By: sshic

Differential Revision: D44465379

fbshipit-source-id: c02f1c8c2bb48c630a71362781c4c5c1093961ed
2023-03-31 15:34:45 -07:00
David Vacca fb920217a9 Reduce visibility of FabricSoLoader (#36749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36749

Reduce visibility of FabricSoLoader

This is a breaking change, but nobody should be using this class

Changelog: [internal] internal

Reviewed By: javache, cortinico

Differential Revision: D44153451

fbshipit-source-id: 942c80da3987d3639b055804c24fc34543a99907
2023-03-31 15:34:45 -07:00
Enrico Bern Hardy Tanuwidjaja 2ab750f7bb Changing tab bar controller orientation to portrait
Summary:
Applying orientation from navigationOptions to the TabBarController

## Changelog
[iOS][Added] - Added conversion helper for UIInterfaceOrientationMask to RCTConvert

Reviewed By: philIip

Differential Revision: D44553533

fbshipit-source-id: e57c68c56f1184346bf02f5a915d7722660902ff
2023-03-31 14:06:28 -07:00
Phillip Pan 4890d50edd introduce shadows helper library for robolectric (#36733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36733

Changelog:
[Android][Added] - Added testing shadow helpers for robolectric

in this change, i'm creating a centralized place for test writers to add their shadows in robolectric. as we start deprecating powermock, we can expect that common infra classes will be needed to be stubbed out, so we can leverage this library in order to do so.

Reviewed By: javache

Differential Revision: D44565806

fbshipit-source-id: 2e322861e8e2f49ede21e4a000495d5f06b911d3
2023-03-31 12:47:40 -07:00
Genki Kondo 47149d2e44 Calculate entered/exited views during handling of all MotionEvents (#36666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36666

Modify JSPointerDispatcher to dispatch out/over/leave/enter events on handing of any MotionEvent. This functionality is in parity with [how touch events are handled in iOS](https://www.internalfb.com/code/fbsource/[cdfd2520a4d43b3a46104ecbf437bb792460e3f7]/xplat/js/react-native-github/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm?lines=780).

handleMotionEvent updates the last hit path upon any MotionEvent, so we want to make sure that we handle any out/over/leave/enter dispatches in this method. This diff just extracts the dispatching of out/over/leave/enter from onMove() to handleMotionEvent().

Changelog:
[Internal] - Calculate entered/exited views on all touch/move events

Reviewed By: javache, mdvacca

Differential Revision: D44426524

fbshipit-source-id: 5225c54c2c995440ac766c6fbc99c08f05c70a92
2023-03-31 12:01:24 -07:00
Genki Kondo d194ec8c11 Modify AnimatedProps and AnimatedStyle to use AnimatedObject (#36741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36741

AnimatedObject is a more generic version of AnimatedTransform, able to handle animated values within arrays and objects. This is useful for props of native components that may need to be animated per field.

This diff hooks up AnimatedObject to AnimatedProps and AnimatedStyle for values that are arrays or objects.

Changelog:
[Internal][Added] - Modify AnimatedProps and AnimatedStyle to use AnimatedObject

Reviewed By: rshest

Differential Revision: D44315336

fbshipit-source-id: 4d543550f24adbfc2ce4b15640df03f260da6106
2023-03-31 11:58:04 -07:00
Genki Kondo 80fb995fac Modify Arguments.makeNativeObject to handle JavaOnlyMap and JavaOnlyArray (#36743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36743

Changelog:
[Internal] - Modify Arguments.makeNativeObject to handle JavaOnlyMap and JavaOnlyArray

Reviewed By: mdvacca

Differential Revision: D44516305

fbshipit-source-id: 22a4de4ae1b231078e7cd59cda3993b9f6343f7d
2023-03-31 11:13:19 -07:00
Genki Kondo d0fcd43f1a Introduce AnimatedObject JS node (#36688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36688

AnimatedObject is a more generic version of AnimatedTransform, able to handle animated values within arrays and objects. This is useful for props of native components that may need to be animated per field.

I considered flattening the node graph by removing AnimatedStyle and AnimatedTransform. However, this would add significant complexity in AnimatedProps because prop and style values depend on being submitted together on an animation tick (such as transform) using native driver; also, we'll have to special case style anyway.

Changelog:
[Internal][Added] - Introduce AnimatedObject JS node for handling array and object prop values

Reviewed By: rshest

Differential Revision: D44279594

fbshipit-source-id: 9504d841dc9196e51d09a0247601de4d4f991a49
2023-03-31 10:16:36 -07:00
Pieter De Baets 64033637e2 Align Android EventEmitter naming (#36718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36718

`EventEmitterWrapper` uses "invoke", while the event is still being queued and the event handler will only actually be "invoked" in another async step. Instead, align with the wrapped object and use "dispatch".

Also small optimization to construct the EventEmitterWrapper object fully in C++, without Java having to call back into C++ again by using `newObjectCxxArgs`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D44536400

fbshipit-source-id: 7b14acf3629944f4a20ab4f509fbae7f58de98e0
2023-03-31 07:14:10 -07:00
Lulu Wu 606946ddad Check nullability for current context (#36721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36721

We check RN instance immediately when onGlobalLayout is called in ReactRootView
https://www.internalfb.com/code/fbsource/[1f189dbb7238aa69319925bdc6a9e5389e160ad8]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java?lines=903-907

but the RN instance could be destroyed due to exception, so when emitUpdateDimensionsEvent is called down the line there could be NPE which results in this [Logview](https://www.internalfb.com/logview/details/facebook_android_crashes/0f56580ff7b95827c8d4f932f2358841), we need to double check nullability in emitUpdateDimensionsEvent to avoid this

Changelog:
[Fixed][Android] - Check nullability for current context

Reviewed By: cipolleschi

Differential Revision: D44539899

fbshipit-source-id: c2587e92c1b8ca451420d340ac474860174d7a09
2023-03-31 03:03:33 -07:00
David Vacca b1b118d0f6 Refactor of IntBufferBatchMountItem class (#36728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36728

This diff refactors the creation and visibility of IntBufferBatchMountItem

This is not a breaking compatibility change because nobody should be using this class

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D44115916

fbshipit-source-id: f0b0464483cafe55ffaf661b18c692be0df41199
2023-03-30 23:58:25 -07:00
David Vacca ed448b5ba4 Refactor preallocation of views (#36606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36606

This diff refactors the preallocation of views to minimize visibility of PreAllocateViewMountItem

this is not a backward compatible change because nobody should be using this class

Changelog: [Internal] Internal

Reviewed By: javache

Differential Revision: D44115487

fbshipit-source-id: 2d00f9f5edbe0517c3c5fcef94290180fa418fb3
2023-03-30 21:30:51 -07:00
David Vacca 817db84c6b Refactor creation of SendAccessibilityEventMountItem (#36607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36607

In this I'm refactoring the creation of SendAccessibilityEventMountItem to reduce visibility of classes

Changelog: [Internal] Internal

Reviewed By: javache

Differential Revision: D44115052

fbshipit-source-id: 021f59a65aed152324a13947609e23c0191ca0e8
2023-03-30 20:06:20 -07:00
David Vacca aa3e087be1 Refactor creation of MountItems (#36605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36605

This diff introduces the class MountItemFactory that will be used to create MountItems in Fabric.
The purpose of this refactor is to reduce visibility for custom implementations of MountItems

This should not be a breaking change, because nobody should be using these classes

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D44115053

fbshipit-source-id: a62d0a42239d29380aa10d5eab428af90c313d00
2023-03-30 18:32:12 -07:00
David Vacca c76ab8d01d Small refactor to log state data during development (#36603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36603

Small refactor to log state data during development for preallocation of items

Changelog: [Internal] Internal

Reviewed By: javache

Differential Revision: D44112419

fbshipit-source-id: 290fbf0db3ea3f9863e7c86249dd1e6943556baa
2023-03-30 16:22:48 -07:00
Ruslan Lesiutin 8a18b53bcd bump packages for 0.73 (#36556)
Summary:
Changelog: [Internal]

Publishing to check CI if bumping and aligning in the same commit will work, since these new versions are not available on npm yet, but maybe our new monorepo setup will resolve this

**Adding back `react-native/virtualized-lists` as a workspace to `xplat/js` so that it won't be resolved from npm**

#publish-packages-to-npm

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

Reviewed By: cipolleschi

Differential Revision: D44255353

Pulled By: hoxyq

fbshipit-source-id: 21372487d6e9c0b2382b7cd9af835beed46b8ce1
2023-03-30 15:55:58 -07:00
Phillip Pan 5457811a16 don't pass around react context in react package if it's not needed (#36711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36711

Changelog: [Internal]

minimizing callsites to the react context, which has turned into a bloated toolbox class

Reviewed By: javache

Differential Revision: D44493500

fbshipit-source-id: 7272b18af96103dee3658d151fd8e9f03846bd09
2023-03-30 15:20:59 -07:00
David Vacca c62fca7525 Reduce visibility of FabricComponentName mappings (#36602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36602

This diff refactors and reduces visibility of the legacy class FabricComponents. This should not be a breaking change because nobody should be using it (there is no purpose to be used externally)

changelog: [internal] internal change on the APIs

Reviewed By: javache

Differential Revision: D44112418

fbshipit-source-id: 5608d682ca4fddb8e50db82ff23668fd82dccfb6
2023-03-30 14:26:43 -07:00
Alex Hunt f67bd676e5 Update template metro.config.js, remove transitive metro dep from main package (#36723)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36723

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D44542544

fbshipit-source-id: 70807edc8a183c28e1f0018a5426f4f2e29580a0
2023-03-30 12:48:46 -07:00
Nicola Corti 7449fad587 Add examples of Direct Manipulation in Fabric Intrerop (#36724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36724

Similarly to iOS, this adds some examples of direct manipulation on Android using
all the various methods.

Changelog:
[Internal] [Changed] - Add examples of Direct Manipulation in Fabric Intrerop

Reviewed By: cipolleschi

Differential Revision: D44541437

fbshipit-source-id: b6e10ac0a815f41ff3c980236b7d8c6937e92065
2023-03-30 11:46:27 -07:00
Nicola Corti 97a9d3c01b Add example for dispatchViewManagerCommand on Fabric Interop (#36725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36725

This diff adds an example of using `dispatchViewManagerCommand` for the Fabric Intreop on Android.

Changelog:
[Android] [Added] - Add example for dispatchViewManagerCommand on Fabric Interop

Reviewed By: cipolleschi

Differential Revision: D44540951

fbshipit-source-id: 85bc65ad0eb3a951fbb37d61ca26532ec3cc53b7
2023-03-30 11:46:27 -07:00