Commit Graph

27031 Commits

Author SHA1 Message Date
Luna Wei 08fc618b77 Revert "feat: Add Fabric implementation of inset logical properties (#35692)"
This reverts commit 9669c10afc.
2023-05-02 14:22:55 -07:00
Alex Hunt c068efcdae [0.72] Bump Metro to 0.76.2, cherry pick Metro config updates (#36976)
Co-authored-by: Deepak Jacob <deepakjacob@meta.com>
2023-04-21 10:50:47 +01:00
Lorenzo Sciandra 51de9e1ad6 [LOCAL] update podlock post release to fix CI 2023-04-11 12:14:51 +01:00
Distiller 30b5de04d6 [0.72.0-rc.1] Bump version numbers v0.72.0-rc.1 2023-04-05 12:16:48 +00:00
Nicola Corti f3b71f4843 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 18:36:28 +01:00
Lorenzo Sciandra c92bb3c526 [LOCAL] bump CLI to 11.1.1 2023-04-04 11:50:51 +01:00
Samuel Susla 921bbb6cf1 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 15:19:06 +01:00
Samuel Susla 6d6b6a8345 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 15:19:06 +01:00
Samuel Susla 614e4109bf 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 15:19:06 +01:00
Riccardo Cipolleschi d3c94b42f4 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-03 15:19:06 +01:00
Lorenzo Sciandra e795b534aa fix(metro-config): fix and realign the situation for metro config for 0.72 (#36746) 2023-03-31 17:44:20 +01:00
Ruslan Lesiutin 68cd44be07 Merge pull request #36573 from hoxyq/hoxyq/cherry-pick-ci-scripts-changes-to-0.72-stable
RN [refactor]: bump and realign package versions by running a single …
2023-03-31 15:53:15 +01:00
Ruslan Lesiutin a469927c16 RN [refactor]: bump and realign package versions by running a single script
Summary:
Changelog: [Internal]

Okay, so before the monorepo migration we had to use two scripts separately:
1. Bumping every package with `npm run bump-all-updated-packages`
2. Aligning other packages versions with `npm run align-package-versions`

The reason for it is that *before the monorepo* in a release branch cutoff process we had a step, which was removing `workspaces` keyword from `react-native` package. Without this keyword all new versions of packages will be resolved from npm (where they will be not available yet, because we have to publish them prior to it)

This is not the case for our current setup, and we can actually bump packages versions and they will be resolved as a workspaces successfully

Differential Revision: D44261057

fbshipit-source-id: 6095209c8183f6d84e2697fda2e9a21f8a57f73e
2023-03-31 13:44:43 +01:00
Alex Hunt c5f18de6a2 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-31 11:34:47 +01:00
Nicola Corti 1199e4764d 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-31 11:33:01 +01:00
Nicola Corti cb30323f04 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-31 11:32:52 +01:00
Nicola Corti 5299c60bdc Add Fabric Interop event example (#36692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36692

Similar to the iOS counterpart,
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:
[Internal] [Changed] - Add Fabric Interop event example

Reviewed By: cipolleschi

Differential Revision: D44467555

fbshipit-source-id: 1f1af27583c402641c549bc2926a64469dcd7b3f
2023-03-31 11:32:09 +01:00
Nicola Corti 341cda45ee Add Fabric Interop constants example (#36693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36693

Similar to #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 for Android.

Changelog:
[Android] [Added] - Add Fabric Interop constants example

Reviewed By: cipolleschi

Differential Revision: D44466391

fbshipit-source-id: 74e654319b93e60b415297dcdddc98eb100913df
2023-03-31 11:31:46 +01:00
Alex Hunt 0026f73360 Remove 'import' from default Package Exports conditions (#955)
Summary:
X-link: https://github.com/facebook/metro/pull/955

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

Changelog:
[General][Changed] - Default condition set for experimental Package Exports is now `['require', 'react-native']`

The [Exports RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md) had assumed that supporting the `"import"` condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility.

{F915841105}

This assumption is similar to [`--moduleResolution bundler` in TypeScript 5.0](https://github.com/microsoft/TypeScript/pull/51669):

> bundlers and runtimes that include a range of Node-like resolution features and ESM syntax, but do not enforce the strict resolution rules that accompany ES modules in Node or in the browser
> -- https://github.com/microsoft/TypeScript/pull/51669#issue-1467004047

However, robhogan has rightly pointed out that **we should not do this!**

- ESM (once transpiled) is **not** simply a stricter subset of in-scope features supported by CJS. For example, it supports top-level async, which would be breaking at runtime.
- We recently made the same change for our Jest environment:
    - https://github.com/facebook/react-native/commit/681d7f8113d2b5e9d6966255ee6c72b50a7d488a

As such, we are erring on the side of correctness and supporting only `['require', 'react-native']` in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS. `"exports"` will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages.

Metro changelog: [Experimental] Package Exports `unstable_conditionNames` now defaults to `['require']`

Reviewed By: robhogan

Differential Revision: D44303559

fbshipit-source-id: 0077e547e7775e53d1e4e9c3a9d01347f4fb7d4a
2023-03-31 11:28:56 +01:00
Lorenzo Sciandra 392a843494 [LOCAL] fix e2e local testing script post metro-config 2023-03-30 17:50:42 +01:00
Lorenzo Sciandra 8beed6ad08 [LOCAL] need to be in the rn-tester folder the whole time when testing rn-tester 2023-03-30 17:02:02 +01:00
Riccardo Cipolleschi a9ec217117 Fix RNTester in main (#36686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36686

After the recent changes of Metro and Metro-Config, we need to update the path used to load the bundle in RNTester

## Changelog:
[General][Fixed] - Use the right path to load RNTester bundle

Reviewed By: cortinico

Differential Revision: D44465418

fbshipit-source-id: 96170194579792f9a5d8a141328d43e45a4db973
2023-03-30 16:56:24 +01:00
Lorenzo Sciandra d0699dc428 [LOCAL] bump CLI to 11.0.1 2023-03-30 16:47:26 +01:00
Lorenzo Sciandra 73837a72f6 [LOCAL] bump js-polyfills and virtualized-lists 2023-03-30 13:54:18 +01:00
Lorenzo Sciandra 8a493af0b9 bumped packages versions
#publish-packages-to-npm
2023-03-30 13:49:52 +01:00
Nicola Corti 7b2cff831e Re-enable Fabric in the default app template/RN-Tester (#36717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36717

After D43711737 landed, it turns out that Fabric is always disabled for both
RN-Tester and new app from template (so for 0.72 also RC0).
The reason is that a new method `createRootView(Bundle)` was introduced inside
`ReactActivityDelegate`. Both RN Tester and the template were using the
old `createRootView()` method which is not called anymore at this stage
(should potentially be deprecated?).

This diff fixes it by overriding both method inside `DefaultReactActivityDelegate`
so that both methods are setting the Fabric renderer.

Changelog:
[Android] [Fixed] - Re-enable Fabric in the default app template/RN-Tester

Reviewed By: cipolleschi

Differential Revision: D44536222

fbshipit-source-id: d22a0c522f011a8fe4d27b5d8f2fcf5dd13c3058
2023-03-30 13:49:30 +01:00
Riccardo Cipolleschi 6070b58a96 Add Examples for Direct Manipulation in the Interop Layer (#36610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36610

This change add to RNTester examples of a legacy Native Component, loaded in the New Architecture through the Interop Layer, that uses the APIs described in the [Direct Manipulation](https://reactnative.dev/docs/direct-manipulation) sectioon of the website.

[iOS][Added] - Added examples of direct manipulation

Reviewed By: sammy-SC

Differential Revision: D43978674

fbshipit-source-id: 1cbc56f28034f84f309166e3e392ad97a8164e64
2023-03-30 11:11:06 +01:00
Riccardo Cipolleschi 3e079f0802 Make UIManager.dispatchViewManagerCommand work in Fabric through Interop Layer (#36578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36578

This change brings to the Fabric Interop Layer the possibility to directly call native methods on the View Manager, something that was not possible before and that we can use to simplify the migration to the New Architecture.

[iOS][Added] - Native Components can now call native methods in Fabric when they are loaded through the Interop Layer

Reviewed By: sammy-SC

Differential Revision: D43945278

fbshipit-source-id: fe67ac85a5d0db3747105f56700d1dbba7ada5f1
2023-03-30 11:10:18 +01:00
fortmarek 18137348ee Use packaged react-native in test-e2e-local script (#36703)
Summary:
The current `test-e2e-local` script had two bugs:
- On [this](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L219) line we were initializing a new RN project with the packed `react-native` created [here](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L211)
- We were updating the local RN version after running `npm pack` [here](https://github.com/facebook/react-native/blob/c1c22ebacc4097ce56f19385161ebb23ee1624b3/scripts/test-e2e-local.js#L214). This meant that the version inside the packaged `react-native-xyz.tgz` was not updated since we ran `pack` before updating it. This was fine since the `init` command was using the local `react-native` repository instead of the packed version.

## Changelog:

[INTERNAL] [FIXED] - Use packaged react-native in test-e2e-local script
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[INTERNAL] [FIXED] - Use packaged react-native in test-e2e-local script

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

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

Test Plan:
- Run `yarn test-e2e-local -t RNTestProject -p Android`. The command should succeed.

I am not completely sure how to double check that we are using the packed version. Locally, I have a `fsmonitor--daemon.ipc` in my `react-native/.git` that can't be copied. The `.git` folder would be copied only when `cli.js init` was called with the whole repository  – which is how I found out about the issue in the first place.

Reviewed By: hoxyq

Differential Revision: D44504599

Pulled By: cipolleschi

fbshipit-source-id: e57e2858bab46d4f978eed3cbaf3e504138594b8
2023-03-30 10:52:54 +01:00
Nicola Corti 14794a9946 Fix the setup to allow the build-from-source on host projects (#36702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36702

With the monorepo changes we broke the build from source for users.
This fixes it so that folks can just follow the guide:
https://reactnative.dev/contributing/how-to-build-from-source

Changelog:
[Android] [Fixed] - Fix the setup to allow the build-from-source on host projects

Reviewed By: cipolleschi

Differential Revision: D44502428

fbshipit-source-id: 3ad8fb114f5e2f7ffdf6fffa617ceaa45334f5f3
2023-03-29 17:39:30 +01:00
Nick Gerleman eae08663fe 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-29 15:48:03 +01:00
Nick Gerleman 1ebe10a4e5 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-29 15:47:56 +01:00
Nick Gerleman 1fc7693205 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-29 15:47:50 +01:00
Nick Gerleman 4e24223550 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-29 15:47:44 +01:00
Nick Gerleman 536ee8ba4c 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-29 15:47:37 +01:00
Nick Gerleman 3447fea075 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-29 15:47:15 +01:00
Nick Gerleman ea09a4701d 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-29 15:47:02 +01:00
Nick Gerleman cffdad69c3 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-29 15:46:54 +01:00
Nick Gerleman a0a81a400b 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-29 15:46:46 +01:00
Nick Gerleman b6291aacf8 Bail on realizing region around last focused cell if we don't know where it is (#36541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36541

We only know where the last focused cell lives after it is rendered. Apart from dead refs handled in D43835135, this means items added or removed before the focused cell will lead to a stale last index for the next state update.

We don't have a good way to correlate cells after data change. This effects the implementation for [`maintainVisibleContentPosition`](https://github.com/facebook/react-native/pull/35993) as well, but needs some thought on the right way to handle it. For now, we bail when we don't know where the last focused cell lives.

Changelog:
[General][Fixed] - Bail on realizing region around last focused cell if we don't know where it is

Reviewed By: yungsters

Differential Revision: D44221162

fbshipit-source-id: 8fc7e726fe13c62b98870600563857bb89290280
2023-03-29 15:46:33 +01:00
Ruslan Lesiutin 7700d7fd78 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-29 15:45:54 +01:00
Shivam Shashank 2443677fe0 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-29 15:45:44 +01:00
Samuel Susla 7c9f3ab437 Patch setNativeProps in OSS build
Summary:
changelog: [internal]

`setNativeProps` have been implemented in Fabric but require a React change to be accessible from JavaScript components. For React sync to be imported in OSS builds, React needs to have have a new release in NPM.
To work around this limitation, I manually copied over lines of code that glue together setNativeProps to OSS build.

Reviewed By: cortinico, cipolleschi

Differential Revision: D44216496

fbshipit-source-id: b34b598c1a317bdc03cc5a4cadb3f7c610059709
2023-03-29 15:45:36 +01:00
David Vacca f5fbda5e46 Improve caching of Text per shadow Node
Summary:
This diff optimizes text measurement by adding a layer of caching per shadow node.
When ReactFeatureFlags.enableTextMeasureCachePerShadowNode is enabled, we will cache and reused measurements per shadow node.
This optimization showed a 2x improvement on text rendearing when a screen contains a big amount of text components.

Changelog: [Internal] Internal

Reviewed By: sammy-SC

Differential Revision: D44221170

fbshipit-source-id: c3e7ba1ad216929826a99585874981717c90e13b
2023-03-29 15:45:27 +01:00
Samuel Susla 05ba16aa3d Enable NSTextStorage caching in OSS
Summary:
changelog: [internal]

Turn on NSTextStorage in OSS.

Reviewed By: cipolleschi

Differential Revision: D44216186

fbshipit-source-id: 7f08291dc0bc1237e72dd96235f76ed90361826b
2023-03-29 15:45:17 +01:00
Riccardo Cipolleschi 9ffe82edd3 Port changes from main into Stable to make the CI green (#36665)
Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>
Co-authored-by: Alex Hunt <alexeh@meta.com>
resolved: https://github.com/facebook/react-native/pull/36502
2023-03-28 22:32:42 +01:00
Riccardo Cipolleschi 6e04b2a717 Restore object with prerelease as string to unblock 0.72 (#36657)
Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>
2023-03-27 18:22:25 +01:00
Rob Hogan fecfd04d89 [0.72-stable] Fix localhost references in yarn.lock (#36661) 2023-03-27 17:40:32 +01:00
Riccardo Cipolleschi a4e390a188 Revert Changes to Libraries/Utilities to fix prerelease type (#36655)
Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>
2023-03-27 16:48:42 +01:00
Riccardo Cipolleschi 17a96158aa Downgrade CLI to alpha.0 to get Metro working again in CI (#36654)
Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>
2023-03-27 16:48:20 +01:00