Commit Graph

26899 Commits

Author SHA1 Message Date
Ramanpreet Nara aa28ea01d2 Refactor: Simplify signature of TurboModuleBinding::getModule
Summary:
Previously, the signature of TurboModuleBinding::getModule was

https://www.internalfb.com/code/fbsource/[839b8756fb58bf8cfa38a7d9f90b4b2b99889a37]/xplat/jsi/jsi/jsi.h?lines=111-112

**Problem:** TurboModuleBinding::getModule couldn't be called from [global.nativeModuleProxy](https://www.internalfb.com/code/fbsource/[cacaf79996c24c52fcedc90933b77dcf3411cf54]/xplat/ReactNative/venice/ReactInstance.cpp?lines=25-46) (i.e: jsi::HostObject::get), where only the prop name was available:

https://www.internalfb.com/code/fbsource/[839b8756fb58bf8cfa38a7d9f90b4b2b99889a37]/xplat/jsi/jsi/jsi.h?lines=133

## Changes
This diff simplifies the signature of TurboModuleBinding::getModule to accept only what it needs: a jsi::Runtime, and moduleName

This way, TurboModuleBinding::getModule can be called from:
- jsi::HostFunction (for [global.__turboModuleProxy](https://www.internalfb.com/code/fbsource/[cc6106d532afd3f179b586d6acb4e99edb09bb96]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=34-48))
- **new:** jsi::HostObject::get (for [global.nativeModuleProxy](https://www.internalfb.com/code/fbsource/[cacaf79996c24c52fcedc90933b77dcf3411cf54]/xplat/ReactNative/venice/ReactInstance.cpp?lines=25-46)).

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D43993198

fbshipit-source-id: e1207a129b1033f96d2753c88d372bb7eb4364f3
2023-03-14 21:16:22 -07:00
Nick Gerleman 2d41e6642e Fix types + documentation for CellRendererComponent
Summary:
CellRendererComponent can be given a more useful description, and more constrained type, to ensure it is used more correctly.

Changelog:
[General][Fixed] - Fix types + documentation for CellRendererComponent

Reviewed By: yungsters

Differential Revision: D43925572

fbshipit-source-id: 26aae6a2df989993c97709ffbf1544df7cbae036
2023-03-14 15:32:05 -07:00
Grisha Pushkov ccbbcaab9c Fix layout width calculation in onTextLayout (#36222)
Summary:
There is a rounding issue in layout calculation when using onTextLayout method in Text component on Android.
As you can see in the example below onTextLayout returns 3 lines, but in fact text is rendered in 2 lines:

<img width="775" alt="Screenshot 2023-02-19 at 23 48 53" src="https://user-images.githubusercontent.com/8476339/220177419-de183ccd-a250-4131-ad05-907fdb791c75.png">

This happens because `(int) width` casting works like `Math.floor`, but after changing it to `Math.round` we get correct result:

<img width="775" alt="Screenshot 2023-02-19 at 23 51 11" src="https://user-images.githubusercontent.com/8476339/220177859-93474c43-ed87-4c1b-986c-2817b29b78be.png">

## Changelog

[ANDROID] [FIXED] - Fix layout width calculation in onTextLayout

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

Pick one each for the category and type tags:

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

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

Test Plan:
This issue can be tricky to reproduce as width calculation depends on device width. I'm attaching code that I used to reproduce it. You need to tap on the screen to run through different sentences and sooner or later you will get the one with this rounding issue.

<details>
  <summary>Code to reproduce</summary>

```js
import React, { useState, useEffect } from 'react'
import { SafeAreaView, Text, View } from 'react-native'

function App() {
  const [state, setState] = useState({
    index: 0,
    lines: [],
    sentences: [],
  })

  const onTextLayout = (event) => {
    const lines = event.nativeEvent.lines
    console.log(JSON.stringify(lines, null, 2))

    setState(state => ({ ...state, lines }))
  }

  useEffect(() => {
    fetch('https://content.duoreading.io/20-the-adventures-of-tom-sawyer/translations/english.json')
      .then(response => response.text())
      .then(response => {
        setState(state => ({ ...state, sentences: JSON.parse(response) }))
      })
  }, [])

  return (
    <SafeAreaView style={{ flex: 1, padding: 30 }}>
      <View style={{ flex: 1 }} onTouchStart={() => setState(state => ({ ...state, index: state.index + 1 }))}>
        <Text style={{ fontSize: 22 }} onTextLayout={onTextLayout}>
          {state.sentences[state.index]}
        </Text>

        {state.lines.map((line, index) => (
          <View
            key={index}
            style={{
              position: 'absolute',
              top: line.y,
              left: line.x,
              width: line.width,
              height: line.height,
              opacity: 0.3,
              backgroundColor: ['red', 'yellow', 'blue'][index % 3],
            }}>
          </View>
        ))}
      </View>
    </SafeAreaView>
  )
}

export default App
```
</details>

Reviewed By: christophpurrer

Differential Revision: D43907184

Pulled By: javache

fbshipit-source-id: faef757e77e759b5d9ea26da21c9e2b396dc9ff1
2023-03-14 12:24:02 -07:00
Pieter Vanderwerff 19cf5c9af7 Update the hermes packages to 0.10.0 in 'fbsource'
Reviewed By: yungsters

Differential Revision: D43959013

fbshipit-source-id: f785209f5dfe3e76f96525cc96f6cc399f8e7f5f
2023-03-14 12:21:15 -07:00
SheetJS 5b597b5ff9 FileReader#readAsArrayBuffer (#36332)
Summary:
Fixes a number of issues with third party libraries that use `Blob#arrayBuffer` or `FileReader#readAsArrayBuffer`, including https://github.com/facebook/react-native/issues/30769 #34402 https://github.com/facebook/react-native/issues/20091 #21209

## Changelog

[INTERNAL] [FIXED] - Implemented FileReader#readAsArrayBuffer

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

Test Plan: Added a test which fails against current release but passes after code changes.

Reviewed By: christophpurrer

Differential Revision: D43907171

Pulled By: javache

fbshipit-source-id: 73d622ec569a282b6394732b9a0dc687b447fb62
2023-03-14 11:58:11 -07:00
Riccardo Cipolleschi 58d88ec91c Mitigate issues with Sandcastle simulators
Summary:
This change updates the offline mirrors and remove the need for destinations in Sandcastle jobs, to mitigate the problem with the oss jobs we are facing.

allow-large-files

## Changelog:
[internal] - update offline mirror and don't run tests on simulators

Reviewed By: robhogan, dmytrorykun

Differential Revision: D44056468

fbshipit-source-id: c4db37a715eb1307a01a33b1917573f67ed0e2a7
2023-03-14 11:07:02 -07:00
Nick Gerleman d595fbcc5a Allow out-of-range initialScrollIndex after first scroll
Summary:
The contract here is that `initialScrollIndex` only applies once, right after the components mount. There is other code still relying on live `initialScrollIndex`, which is allowed to become stale. E.g. after removing items.

I looked at a larger change of only ever using `initialScrollIndex` in the start, so we have a consistent value. We also ideally should fix up the logic relying on it for the scroll to top optimization.

That series of changes is more involved than I want to spend time on, so this just avoids the check once we have triggered a scroll, where the rest of the code is UT'd to be permissive if it drifts out of allowed.

Changelog:
[General][Fixed] - Allow out-of-range initialScrollIndex after first scroll

Reviewed By: yungsters

Differential Revision: D43926656

fbshipit-source-id: bd09bd9a9aa6b3b5f07209dac8652c9374a762c4
2023-03-14 09:47:56 -07:00
Nick Gerleman d8b4737ca6 Fix duplicate [RCTConvert UIUserInterfaceStyle:]
Summary:
After https://github.com/facebook/react-native/pull/36122 we have two of these. This change consolidates the two category methods to be part of the base RCTConvert class instead.

Changelog:
[iOS][Fixed] - Fix duplicate [RCTConvert UIUserInterfaceStyle:]

Reviewed By: cipolleschi

Differential Revision: D44050929

fbshipit-source-id: dd216545e6194446c593cd693072f3959d653d7f
2023-03-14 09:30:07 -07:00
Rubén Norte 01f2936de1 Create feature flag for DOM trees in Fabric
Summary:
This adds a feature flag to enable all the new DOM traversal and layout APIs (in https://github.com/react-native-community/discussions-and-proposals/pull/607).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D43981608

fbshipit-source-id: 77bb1ee4faaaf30cfc8bb2e493763b168702f498
2023-03-14 08:48:24 -07:00
Rubén Norte aee7d96fcd Remove direct references to the global and untyped nativeFabricUIManager
Summary:
We shouldn't be accessing `nativeFabricUIManager` directly because it's untyped and makes it harder to mock the values.

This migrates all existing usages to the `FabricUIManager` module.

In the long term, we should refactor this global binding as a TurboModule.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D44029301

fbshipit-source-id: d8300acb5dabe4ba27c7f0242230e203c0e8c674
2023-03-14 08:48:24 -07:00
Rubén Norte ea57c923b4 React Native sync for revisions fccf3a9...f828bad
Summary:
This sync includes the following changes:
- **[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...f828bad

jest_e2e[run_all_tests]

Reviewed By: robhogan, rshest

Differential Revision: D44024996

fbshipit-source-id: 8ac9754c5ffe12bd5d9c3499515c0925bd411f70
2023-03-14 08:48:24 -07:00
David Vacca ca0d565a3c Back out "1/2 TextInput accessibilityErrorMessage (Talkback, Android)"
Summary:
This diff is reverting PR https://github.com/facebook/react-native/pull/33468

Due to an increase of java.lang.IllegalStateException caused by the PR

Original commit changeset: cd80e9a1be8f

Original Phabricator Diff: D38410635

Changelog:
[Android][Fixed] - removed logic that calls the [AccessibilityNodeInfo#setError][10] and [#setContentInvalid][13] method to display the error message in the TextInput - Revert of PR https://github.com/facebook/react-native/pull/33468

Reviewed By: NickGerleman, makovkastar

Differential Revision: D44032331

fbshipit-source-id: 732ed0cf23e4f30ae00c51dace851a3fdfe65c01
2023-03-14 05:42:06 -07:00
Riccardo Cipolleschi 21d530208f Extracting Platform Specific TM code to break dependency cycle between ReactCommon and React-Core (#36461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36461

This change breaks a dependency cycle between `ReactCommon` and `React-Core`.

`React-Core` depends on `ReactCommon` to have access to the various `TurboModule` native files.

`ReactCommon` depends on `React-Core` because the content of the `core/platform/ios` folder and the `samples` folder needs to access the `RCTBridge` and other files in Core.

To break the circular dependency, we introduced two new `podspecs`:

* `React-NativeModulesApple` for the content of `core/platform/ios`.
* `ReactCommon-Samples` for the content of the `samples` folder.

In this way, the new dependencies are linear as `React-NativeModulesApple` and `ReactCommon-Samples` depends on `React-Core` and `ReactCommon` and `React-Core` only depends on  `ReactCommon`.

While doing this, we also make sure that all the include path are aligned, to limit the amount of breaking changes.

## Changelog:
[iOS][Breaking] - Split the `ReactCommon/react/nativemodule/core/platform/ios` and `ReactCommon/react/nativemodule/samples` in two separate pods to break circular dependencies.

Reviewed By: mdvacca

Differential Revision: D44023865

fbshipit-source-id: a97569506350db5735ac5534b1592471de196cbe
2023-03-14 05:31:16 -07:00
Marco Caldera 320e51f4c4 Unify findComponentConfig return statement (#36446)
Summary:
> [Codegen 100] Create a createComponentConfig function in the parser-commons.js file. It takes the foundConfig and the commandTypeNames as parameters and returns the component config object. Extract the return statements ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L115-L126) [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L116-L127)) and use those implementations in that function.

Part of Issue https://github.com/facebook/react-native/issues/34872

In case I should already add better typing I can update the PR while clarifying the type definitions.

## Changelog

[INTERNAL] [CHANGED] - Move the return statement of `findComponentConfig` to `parsers-commons.js` merging Flow and TS implementation.

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

Test Plan: `yarn lint && yarn run flow && yarn test react-native-codegen`

Reviewed By: cortinico

Differential Revision: D44005899

Pulled By: rshest

fbshipit-source-id: 19a4a05476156cbc2d824c9c32a7909c06a382ff
2023-03-14 05:30:39 -07:00
Ruslan Shestopalyuk dc7941d732 Shim implementation for NativePerformance on JS side
Summary:
Changelog: [Internal]

Implements a shim for the NativePerformance TurboModule, which can be used as a mock to unit test the JS side of WebPerformance functionality (in particular, the higher level API logic of `Performance` and `PerformanceObserver` implementations in JS) without need to have the native NativePerformance implementation available (which would otherwise require running some heavy weight e2e tests).

Reviewed By: rubennorte

Differential Revision: D43985454

fbshipit-source-id: da10387c1d70cb0300c077972d3925bc2fad4f5e
2023-03-14 04:48:02 -07:00
Rubén Norte 803bb16531 Prepare for next React Native sync with new instance format (#36438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36438

This makes the `react-native` repository compatible with the next sync from react after the changes in https://github.com/facebook/react/pull/26321 land.

That PR is changing the format of the Fabric instance and we have a few instances where we assume the internal structure of that instance in the repository.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D43980374

fbshipit-source-id: 718b504ff7c5bb6088c553e0256489b04d92b653
2023-03-13 05:47:18 -07:00
Rubén Norte 4ffe69db10 Improve type definition for FabricUIManager
Summary:
This migrates FabricUIManager to Flow strict.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D43773032

fbshipit-source-id: 45484f9b710d8de92bbfa6b58ced4209afee437e
2023-03-13 05:47:18 -07:00
Riccardo Cipolleschi 348a99a7c8 Fix CircleCI removing lambda in Java (#36458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36458

Our CircleCI infra does not support lambda yet.
Over the weekend, a stack of multiple Android changes landed and one of those diff had a lambda that was not fixed. See this [workflow](https://app.circleci.com/pipelines/github/facebook/react-native/20276/workflows/e73bf98e-12e0-47e3-8bff-a42f6c40798e/jobs/474761).

After the lambda was fixed, another issue related to the `reactApplicationContext` being accessed from an inner class without being `final` [occurred](https://app.circleci.com/pipelines/github/facebook/react-native/20286/workflows/70dab2f0-ee71-4510-8611-c5d29ea4cfae/jobs/475379).

This change should fix these problems.

## Changelog
[Android][Fixed] - Make CircleCI green

Reviewed By: cortinico

Differential Revision: D44019871

fbshipit-source-id: 1a6e39446b0ba2f5a395f54b58a70b67590ee154
2023-03-13 04:59:22 -07:00
Ramanpreet Nara cfa03db98b Refactor: In JavaTurboModule, use jobject to hold module object
Summary:
## Rationale
JavaTurboModule holds the module object as a JTurboModule. With the TurboModule inteorp layer, JavaTurboModule will also need to hold NativeModule objects.

## Changes
So, this diff makes JavaTurboModule hold the module object as a jobject instead.

This shouldn't impact method dispatch, because method dispatch doesn't rely on the JTurboModule interface.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43918939

fbshipit-source-id: 7cc43dfe2df7571e39bcf4d6f362dde0e500e2fe
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 43ef2ffe78 Refactor: Move HostFunction management logic to TurboModule::get()
Summary:
## Rationale
Better separation of concerns. Less confusion. All the logic around TurboModule HostFunction management is in TurboModule::get(). And TurboModule::createHostFunction() is only responsible for creating the HostFunction. Also, there aren't two TurboModule::get functions, each with different/unclear responsibilities.

## Motivation
The interop layer (i.e: D43918998) will have to override TurboModule::createHostFunction():
- TurboModule::createHostFunction() relies on static functions for method dispatch.
- The interop layer cannot use static functions for method dispatch: interop modules' methods are only be discoverable at runtime.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43918940

fbshipit-source-id: f2ffd210329a10967e9b2f0c925f4990cb470083
2023-03-11 16:59:39 -08:00
Ramanpreet Nara cb18bf8c09 Refactor: Make getOrCreateModule() return NativeModule
Summary:
TurboModuleManager.getOrCreateModule() is responsible for creating TurboModules.

In the future, we'll need this method to create interop NativeModules (i.e: NativeModules that don't implement TurboModule). So, this diff changes the implementation of the method to create NativeModule objects.

In the future, we'll extend the TurboModule create algorithm to create legacy NativeModules, by integrating with TurboModuleManager.getLegacyModule(): D43751055

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D43801536

fbshipit-source-id: d86ef915248d40bea56c6103796a37dd7fb5992a
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 6b42b86620 Refactor: Rename TurboModule create method to getOrCreateModule()
Summary:
Readability.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D43801530

fbshipit-source-id: c33ac91af4614804c5b6566776a1650d4f7855f4
2023-03-11 16:59:39 -08:00
Ramanpreet Nara c1c17e299e Refactor: Make ModuleHolder hold NativeModules vs TurboModules
Summary:
We'll re-use the ModuleHolder inside TurboModuleManager to cache legacy NativeModules (i.e: NativeModules that don't implement TurboModule).

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D43801533

fbshipit-source-id: 160c6be06fe148595de89770ed78f51248fcda37
2023-03-11 16:59:39 -08:00
Ramanpreet Nara c338ae64e7 Refactor: Rename TurboModuleProvider -> ModuleProvider<T>
Summary:
In the future, we'll re-use this interface to create NativeModule objects as well.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D43801529

fbshipit-source-id: 90376086744dc996274663792289e3eba7be56c1
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 1b73d1142c Refactor: Rename mTurboModuleCleanupStarted -> mModuleCleanupStarted
Summary:
- Right now, in the TurboModuleManager, "module" refers to TurboModules.
- In the future, we'll use this cleanup lock for interop modules as well (i.e: NativeModules that don't conform to TurboModule).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43801535

fbshipit-source-id: cecccf8d0005ef11bb0c864515fd284292582e64
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 842800f83c Refactor: Rename mTurboModuleCleanupLock to mModuleCleanupLock
Summary:
- Right now, in the TurboModuleManager, "module" refers to TurboModules.
- In the future, we'll use this cleanup lock for interop modules as well (i.e: NativeModules that don't conform to TurboModule).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D43801534

fbshipit-source-id: 1ece9faa1ed564b7024098406deaa60b8a904478
2023-03-11 16:59:39 -08:00
Ramanpreet Nara b6b28d084d Refactor: Rename TurboModuleHolder -> ModuleHolder
Summary:
- Right now, in the TurboModuleManager, "module" refers to TurboModules.
- In the future, we'll use this cleanup lock for interop modules as well (i.e: NativeModules that don't conform to TurboModule).

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D43784169

fbshipit-source-id: dca227374e8d7de319f4fd5556d200ba8b9ac77c
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 5a5aa30f70 Add todo: Output validation log when ReactInstancePackages are detected
Summary:
The New Architecture Validation logging should output an error whenever ReactInstancePackages are used. These packages get access to the ReactInstanceManager, which isn't available in Bridgeless mode.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D43255702

fbshipit-source-id: 1df8c2941805bb773a127408fbf7871674b0cb7c
2023-03-11 16:59:39 -08:00
Ramanpreet Nara a09a6d4d44 Add ReactPackage support to TurboModule system
Summary:
Make the TurboModule system understand ReactPackages.

**Note:** The TurboModule system can only create TurboModules in LazyReactPackages.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D43255701

fbshipit-source-id: 74d034732d0a6fb32197b15bb54cac9161abc294
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 1c5ba299b3 Add LazyReactPackage support to TurboModule system
Summary:
Make the TurboModule system understand LazyReactPackages.

**Note:** The TurboModule system can only create TurboModules in LazyReactPackages.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D43254982

fbshipit-source-id: 4260cc7dc1d28b1ad6268087720c6e02cfc20d32
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 5097763f53 Refactor: Make RPTMMD generic to all ReactPackages
Summary:
## Problem
The TurboModule system can only create modules in TurboReactPackages. We want to change this. The TurboModule system should integrate with all of React Native's ReactPackages.

## Changes
ReactPackageTurboModuleManagerDelegate integrates the TurboModule system with React Native's ReactPackage infra.

This diff refactors ReactPackageTurboModuleManagerDelegate, so that it can eventually support many different types of ReactPackages.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43066961

fbshipit-source-id: d793e14353382dc4cf9ea4af5a7ffe5c83e3baf6
2023-03-11 16:59:39 -08:00
Ramanpreet Nara 355e7c4c76 Create a feature flag for the TurboModule interop layer
Summary:
The TurboModule interop layer is a new mode for the TurboModule system.

Goal: Make the TurboModule system incrementally adoptable in **Bridgeless mode.**

What it does: Run all legacy modules through the TurboModule system in Bridgeless mode.

How to enable it:
1. Enable Bridgeless Mode: ReactFeatureFlags.enableBridgelessArchitecture = true.
2. Set ReactFeatureFlags.useTurboModuleInterop = true.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D43715758

fbshipit-source-id: 89470a28d1f37b9010beb84e43f62425473de8b5
2023-03-11 16:59:39 -08:00
Ruslan Shestopalyuk 48c7adc3bf Logging in GlobalPerformanceLogger via WebPerformance API (#36402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36402

## Changelog:

[Internal] -

Makes `GlobalPerformanceLogger` (`IPerformanceLogger` API), additionally use the native WebPerformance implementation (`Performance` and `PerformanceObserver` APIs) to log points/timespans as marks/measures correspondingly.

This will ultimately help to converge performance logging facilities across platforms and language boundaries.

In a shorter term, it can serve as a good case study of using the Web Performance API implementation.

Note that this implementation is disabled by default (controlled by the RN feature flag), and will be enabled separately via na experiment.

Reviewed By: rubennorte

Differential Revision: D43873560

fbshipit-source-id: 22e2d787c8f22d2f67556dfe4bf175743eca2caf
2023-03-10 12:37:51 -08:00
Tarun Chauhan 3cd97e4994 extract buildModuleSchema to parsers-commons (#36330)
Summary:
> Extract the buildModuleSchema function ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L571), [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L584))in the parsers-commons.js function. The two functions are almost identical except for the filter(property =>) at the end of the function, which is different based on the language.

Part of Codegen Issue https://github.com/facebook/react-native/issues/34872
Depends on Codegen 74, Codegen 84.

## 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 buildModuleSchema from Flow and TypeScript parsers modules to parsers-commons

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

Test Plan:
`yarn lint && yarn run flow && yarn test react-native-codegen
`

Reviewed By: christophpurrer

Differential Revision: D43833653

Pulled By: cipolleschi

fbshipit-source-id: 4d67cb5ef746ecd7ace4b91eb30d36e96252e779
2023-03-10 07:58:32 -08:00
Lulu Wu e68f513879 Fix circleCI failure
Summary:
Fix circle CI failure, error:
```
stderr: : warning: unknown enum constant androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX

: warning: unknown enum constant kotlin.annotations.jvm.MigrationStatus.STRICT

  reason: class file for kotlin.annotations.jvm.MigrationStatus not found
/root/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java:105: error: local variable launchOptions is accessed from within inner class; needs to be declared final
            return ReactActivityDelegate.this.createRootView(launchOptions);
                                                             ^
/root/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java👎 note: Some input files use or override a deprecated API.

/root/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java👎 note: Recompile with -Xlint:deprecation for details.

/root/react-native/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java👎 note: Some input files use unchecked or unsafe operations.

/root/react-native/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java👎 note: Recompile with -Xlint:unchecked for details.

Errors: 1. Warnings: 2.

```
https://app.circleci.com/pipelines/github/facebook/react-native/20239/workflows/31711cb5-6603-432e-a869-d76c9391536e/jobs/473257?invite=true#step-107-261

Changelog:
[Android][Changed] - Fix circle CI failure

Reviewed By: cipolleschi

Differential Revision: D43976548

fbshipit-source-id: 2d50d37bbc78cb1264af9d6fffbfe60f24326cec
2023-03-10 05:40:24 -08:00
Riccardo Cipolleschi a5866ca3aa Add Fabric Interop constants example (#36417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36417

This changes adds an example to RNTester to verify that the Interop Layer can process constants in Fabric as it used to do in Paper.

## Changelog:
[iOS][Added] - Add example in the Interop Layer to use constants

Reviewed By: cortinico

Differential Revision: D43911916

fbshipit-source-id: 1d4b630d45d21904c53d85b97607ebb7fb8a62fc
2023-03-10 04:52:44 -08:00
Riccardo Cipolleschi c005830958 Add Fabric Interop event example
Summary:
This changes adds an example to RNTester to verify that the Interop Layer can process bubbling events in Fabric as it used to do in Paper.

## Changelog:
[iOS][Added] - Add example in the Interop Layer to use events

Reviewed By: sammy-SC

Differential Revision: D43911390

fbshipit-source-id: ae75db25078669676e5a609e090f1e9674026391
2023-03-10 04:52:44 -08:00
Lulu Wu e26092aec3 Enable Venice
Summary:
Make Venice available in Catalyst Android, to enable set ```ReactFeatureFlags.enableBridgelessArchitecture``` to true in CatalystApplication.java

**Note**: right now not every piece works with Venice enabled, but the main functionalities (Fabric components, playground) mostly work, the rest issues will be gradually fixed.

Changelog:
[Internal][Changed] - Enable Venice in Catalyst Android

Reviewed By: NickGerleman

Differential Revision: D43711737

fbshipit-source-id: 6ecb7e2b09c5b7feaa00b90076a2a894c08affc9
2023-03-09 15:10:00 -08:00
Lulu Wu ad7bf51b7b Reland "[Catalyst][Android] Migrate packages to not eager initialize view managers"
Summary:
The original diff D43711708 was reverted due to a problem caused on Ads Manager App Android. Re-land while make sure Ads Manager not broken.

Changelog:
[Android][Changed] - Re-land "Migrate packages to not eager initialize view managers"

Reviewed By: RSNara

Differential Revision: D43907600

fbshipit-source-id: 92f99fd3f9ba90d1798d4ec9c03feff00070a47c
2023-03-09 15:10:00 -08:00
Sam Zhou af86b4a56f Remove inference_mode config now that LTI is the default
Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D43850503

fbshipit-source-id: d95206ad63ec034aab0edad55cd77e5f85deadc9
2023-03-09 11:01:31 -08:00
Ruslan Lesiutin 8d8b44a5e3 Add option to commit with generic message (#36421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36421

Changelog: [Internal]

Adding an extra choice for commit question, user can now choose between three options:
1. Commit with generic message, no further actions needed
2. Commit with custom message, intercative VIM input will open
3. Not committing anything

Reviewed By: cortinico

Differential Revision: D43943526

fbshipit-source-id: 014215105d192961486b7d1c697f491697492812
2023-03-09 09:19:17 -08:00
Riccardo Cipolleschi 50068d0070 Improve robustness of iOS CircleCI Pipelines (#36419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36419

After migrating to Xcode 14.2.0, some contributors were receiving CircleCI Machines that were not able to install Ruby 3.2.0.

This change should improve the robustness of the pipelines, ensuring that `ruby-build` can always find the version of Ruby it needs

## Changelog:
[internal] - Make sure CircleCI always find the right version of Ruby

Reviewed By: cortinico

Differential Revision: D43944878

fbshipit-source-id: 89d9fcc6ae346003e96c2a8f4103a83a7d2f3204
2023-03-09 08:40:05 -08:00
Xin Chen 0018a695da Refactor startup performance API implementation
Summary:
Refactor the startup performance API so that we are not using a vector to store only a few startup metrics values. This makes the metrics more strictly typed and concise.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43860049

fbshipit-source-id: 2c2102de2b64e2c5cda509ac26f0d1d072287083
2023-03-09 08:34:58 -08:00
Lorenzo Sciandra bcec590071 add 0.71.4 changelog (#36405)
Summary:
Adds changelog for new patch.

## Changelog

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

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

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D43910075

Pulled By: cipolleschi

fbshipit-source-id: 4f0b7fb45c07895dbddedd08553b84460043c948
2023-03-09 01:27:43 -08:00
Nick Gerleman c376e78224 Delete refs to unmounted CellRenderers
Summary:
VirtualizedList today will keep refs to cells around, long after they have been unmounted. This leaks memory, and is not needed.

Changelog:
[General][Fixed] - Delete refs to unmounted CellRenderers

Reviewed By: yungsters

Differential Revision: D43835135

fbshipit-source-id: 2104cae977a4e2e9e1a2738e1523ac1796293b4f
2023-03-08 18:59:13 -08:00
Nicola Corti 5ac7c7f9a5 RNGP - Add librrc_legacyviewmanagerinterop to pickfirst config block
Summary:
This adds `librrc_legacyviewmanagerinterop.so` to the pickFirst block inside RNGP.
While testing the Fabric Interop layer, I realized that I forgot to add it here and now the build
fires a warning as follows:

```
> Task :app:mergeDebugNativeLibs
2 files found for path 'lib/arm64-v8a/librrc_legacyviewmanagerinterop.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /private/tmp/RNNightly/android/app/build/intermediates/cxx/Debug/194810a4/obj/arm64-v8a/librrc_legacyviewmanagerinterop.so
 - /Users/ncor/.gradle/caches/transforms-3/ba1c1d3560a64e70d8218910c5a43605/transformed/jetified-react-android-0.0.0-20230302-2110-caf80d442-SNAPSHOT-debug/jni/arm64-v8a/librrc_legacyviewmanagerinterop.so
```

Changelog:
[Internal] [Changed] - RNGP - Add librrc_legacyviewmanagerinterop to pickfirst config block

Reviewed By: cipolleschi

Differential Revision: D43772845

fbshipit-source-id: cf34bb128b76f18e802a94c41c773f7cb2b7ec4a
2023-03-08 15:08:15 -08:00
Nick Gerleman a37163f21b Allow RNTester Jest E2E Examples to Run in Paper + Catalyst
Reviewed By: rshest

Differential Revision: D43718044

fbshipit-source-id: baee21db05100e8ef113fb70aac6dc83828d829f
2023-03-08 14:58:36 -08:00
Nick Gerleman 3f54d95e12 Wrap ReactNativeCoreE2E Surface in ScrollView
Summary:
Faacebook:
For both Paper and Fabric, at least on Android, RNTester TextInputs using the default style render as collapsed. This seems to be an interaction between the TextInputs being set as `flex: 1`, and being rooted in a ScrollView.

The issue still seems to happen when the outer container is large enough, but non-scrolling, which seems like a layout bug. But we can for now root the E2E container in a ScrollView (which we probably want to do anyway to allow long examples).

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D43714494

fbshipit-source-id: ef1f8929ceeaef0d2c87262cf0446e0c6644cc9d
2023-03-08 14:58:36 -08:00
Samuel Susla d41e95fb1a Cache NSTextStorage
Summary:
changelog: [internal]

This diff introduces a mechanism to cache NSTextStorage on Paragraph's state. The old renderer already has caching for NSTextStorage: https://github.com/facebook/react-native/blob/main/Libraries/Text/Text/RCTTextShadowView.m#L21

Fabric will store `NSTextStorage` inside `ParagraphLayoutManager` which is owned by state.

There is one notable change which is not gated: Paragraph's state strongly owns `TextLayoutManager`, not `ParagraphShadowNode` like previously. This shouldn't change anything

Reviewed By: mdvacca

Differential Revision: D43692171

fbshipit-source-id: efe6077222a30ab6d89abd9916534b9a96e745d4
2023-03-08 08:36:08 -08:00
Saad Najmi a5bc6f0574 Remove assumptions on super's description (#36374)
Summary:
This is a change upstreamed from our fork, React Native macOS: https://github.com/microsoft/react-native-macos/pull/1088

Original description:

>We hit some crashes where replacing the chars in the string in the description was happening at an invalid range. That caused investigation into what these description methods are doing. We shouldn't have code assuming super's description will return in a certain format. Instead, just append any additional info we want to add to the end of the description.

## Changelog

[IOS] [CHANGED] -Remove assumptions on super's description

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

Test Plan: CI should pass

Reviewed By: cipolleschi

Differential Revision: D43906367

Pulled By: javache

fbshipit-source-id: f83a67c5890ad1f8a73bc644be1f0f8b22b1a371
2023-03-08 07:41:07 -08:00