Commit Graph

997 Commits

Author SHA1 Message Date
Samuel Susla 874881e73e Bring setNativeProps to Fabric
Summary:
changelog: [internal]

This is experimental implementation of `setNativeProps` in Fabric.

This diff brings `setNativeProps` to Fabric to make migration easier. I tried to stay as close as possible to Paper's behaviour, with all of its flaws (ready CAUTION section on https://reactnative.dev/docs/direct-manipulation)

State can't be stored in views because on iOS, eventually on Android, views are not the source of truth, shadow tree is. Fabric's implementation keeps state from setNativeProps in shadow node family in very inefficient data structure folly::dynamic. It is always reconciled with new prop updates. The performance cost is only paid in case node has used `setNativeProps` before.

Reviewed By: mdvacca

Differential Revision: D41875413

fbshipit-source-id: 453a5f7612a6f86a4cece269b13bd2ffd0c0e2d1
2022-12-24 06:40:42 -08:00
Gabriel Donadel Dall'Agnol 9669c10afc feat: Add Fabric implementation of inset logical properties (#35692)
Summary:
This PR implements `inset` logical properties as requested on https://github.com/facebook/react-native/issues/34425. This implementation includes the addition of the following style properties

- `inset`, equivalent to `top`, `bottom`, `right` and `left`.
- `insetBlock`, equivalent to `top` and `bottom`.
- `insetBlockEnd`, equivalent to `bottom`.
- `insetBlockStart`, equivalent to `top`.
- `insetInline`, equivalent to `right` and `left`.
- `insetInlineEnd`, equivalent to `right` or `left`.
- `insetInlineStart`, equivalent to `right` or `left`.

## Changelog

[GENERAL] [ADDED] - Add Fabric implementation of inset logical properties

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

Test Plan:
1. Open the RNTester app and navigate to the `View` page
2. Test the new style properties through the `Insets` section

<table>
<tr>
    <td>Android</td>
    <td>iOS</td>
</tr>
  <tr>
    <td><img src="https://user-images.githubusercontent.com/11707729/208821212-fbbac6ed-09a4-43f4-ba98-dfd2cbabf044.png"  alt="1" width="360px"   />
    </td>
<td>
<img src="https://user-images.githubusercontent.com/11707729/208816997-ef044140-8824-4b1b-a77b-085f18ea9e0e.png" alt="2" width="360px"  />
</td>
   </tr>
</table>

Reviewed By: NickGerleman

Differential Revision: D42193661

Pulled By: ryancat

fbshipit-source-id: 3db8bcd2c4db0ef4886b9ec49a46424d57362620
2022-12-21 20:07:35 -08:00
Ruslan Shestopalyuk 33324b8d91 Add uint32_t as accepted data type for bridging communication
Summary:
Add `uint32_t` as a valid type for communication between C++ and JS via bridging.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D42008412

fbshipit-source-id: 2c038e37745782b677d28bcbe4cc030683b74286
2022-12-14 09:02:55 -08:00
Xin Chen cf9c7d51ef Fix edge case when delete is queued with conflict layout animation
Summary:
This is a two step (1/2) fix to a race that could caused a `DELETE`...`CREATE` mutations being sent over to the fabric mounting layer. Such combination was assumed not possible from the differ, yet it happened at least in the existence of layout animation and when certain commits happen while animation is active.

This race condition could cause a view to get deleted at the end of one UI frame, yet the mount instructions generated from animation in the next frame still need to access the deleted view and caused crashes like T112157805. Note that even though such crash is recorded as `RetryableMountingLayerException` and is a soft crash (which only gets logged but not crash in production), the out-of-order mount instructions could lead to illegal view state and make the surface unusable, like what's shown here:

{F820669000}

The diff fixes this issue by removing the `DELETE` [conflict animation](https://fburl.com/code/5ctckvz3) keyframe, as well as the `CREATE` [immediate mutations](https://fburl.com/code/txyomytd) from the layout animation. The Fabric mounting layer assumes no combination of `DELETE...CREATE` in the same frame from differ + [layout animation overrides](https://fburl.com/code/zn17uqch).

Reviewed By: sammy-SC

Differential Revision: D41895427

fbshipit-source-id: d6df02663ba707af6db4a63a325ac776ca54d18e
2022-12-13 01:17:37 -08:00
Samuel Susla 1d3fa40c59 Add setNativeProps to Fabric
Summary:
changelog: Introduce setNativeProps to Fabric

Add support for `setNativeProps` in Fabric for backwards compatibility. It is still recommended to move away from `setNativeProps` because the API will not work with future features.

We can make step [Migrating off setNativeProps](https://reactnative.dev/docs/new-architecture-library-intro#migrating-off-setnativeprops) in migration guide optional.

Reviewed By: yungsters, mdvacca

Differential Revision: D41521523

fbshipit-source-id: 4d9bbd6304b8c5ee24a36b33039ed33ae1fc21f8
2022-12-06 04:47:51 -08:00
Samuel Susla 86786f1d22 Introduce FabricUIManager.findShadowNodeByTag_DEPRECATED
Summary:
changelog: [internal]

Add findShadowNodeByTag_DEPRECATED` to Fabric's UIManager.
This API makes it possible to get ShadowNode reference for given native tag.
We will leverage this API to make UIManager.measure* calls backwards compatible in the new architecture.

Reviewed By: yungsters

Differential Revision: D41550734

fbshipit-source-id: a45b6a76634d034eac70603bad8ac60f9135ff24
2022-12-06 04:43:18 -08:00
Ruslan Shestopalyuk e2c4941c80 Add ability to schedule JS functions as tasks from turbo modules (#35525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35525

[Changelog][Internal]

Adds ability to invoke an async JS callback from a C++ native module, as a task with priority.

This will allow native modules to schedule less important calls to JS thread with lower priority. One example use case is feeding collected perf metrics back to JS.

Reviewed By: javache

Differential Revision: D41492849

fbshipit-source-id: 12f738557972dc23398d9bb9a7a01125c79da070
2022-12-01 09:49:44 -08:00
TatianaKapos 879d303fc7 Fix windows build of RectangleEdges (#35516)
Summary:
[PR: Avoid emitting mountitems for default values](https://github.com/facebook/react-native/commit/56e9aa369f5c13af38cf80ba47e9eb29d835ec89) used a constexpr in a template, which windows is unable to compile since type at this point is incomplete. Once removed, windows is able to build again. Let me know if there's a better way to fix this!

See [10072](https://github.com/microsoft/react-native-windows/issues/10072) for windows error messages

## 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
-->
[General] [Fixed] - Remove constexpr from RectangleEdges.h

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

Test Plan: Windows has forked this file and had the change for ~5 month, all tests pass on Windows side

Reviewed By: javache

Differential Revision: D41639514

Pulled By: rshest

fbshipit-source-id: fbe595f71a7ab0accb7a76edf58ffb6aeef1ae96
2022-12-01 07:43:59 -08:00
Riccardo Cipolleschi c5de1eb1ba Fix imports in React Bridging for Old Arch and frameworks
Summary:
In 0.71.0-RC.2, we had a regression in `use_frameworks!`.

The `use_frameworks! :linkage => :static` use to work fine with the Old Architecture.
We modified how the `React-bridging` pod is configured and, now those are broken.

This change make sure to use the right imports for React-bridging.

## Changelog
[iOS][Changed] - Fix imports in React Bridging for Old Arch and frameworks

Reviewed By: christophpurrer, cortinico

Differential Revision: D41551103

fbshipit-source-id: 4416fde92fef11eb801daf2302a57fe52732e4ef
2022-11-29 08:53:50 -08:00
Pieter De Baets 70bb6444aa Remove iOS TurboModuleManager experiment with shared mutex
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41551085

fbshipit-source-id: f4d1d8126529d5f384ada941f6fb140abcfd9716
2022-11-29 08:29:05 -08:00
Pieter De Baets 229a1ded15 Remove ObjCTurboModule experiments with retaining JS callbacks in custom scopes
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41551086

fbshipit-source-id: b70965bcf2af6ebac921cc627c196ec108f73944
2022-11-29 08:29:05 -08:00
Pieter De Baets cadf850ac1 Remove JavaTurboModule experiments with retaining JS callbacks in custom scopes
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41551087

fbshipit-source-id: 5bdcd5f8c9bac99603f6187a9bc387827f5321c7
2022-11-29 08:29:05 -08:00
Christoph Purrer 022e22cbd4 Replace folly::Optional with std::optional (#35436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35436

Using std::optional as react-native has been using C++17 for quite some time

changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41415031

fbshipit-source-id: d786647f64b4f90cf75409109830ae0885460c17
2022-11-28 02:08:12 -08:00
Phillip Pan e6cba99744 rename Geometry.h -> Vector.h
Summary:
Geometry only contains the Vector struct now, renaming it for accuracy

Changelog: [Internal]

Reviewed By: stephinphection

Differential Revision: D41453351

fbshipit-source-id: 973b4a03208f4eeb0e209ea0aa58f5beca17c483
2022-11-23 16:16:38 -08:00
Phillip Pan c5a8425fad more Geometry.h cleanup
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41452147

fbshipit-source-id: f427b8d95572c4b602b96962be187b62b801d62b
2022-11-23 01:41:23 -08:00
Christoph Purrer 6c315de226 Add butter/function.h (#35385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35385

In OpenSource builds folly:: types are not always easy to consume.

With butter:: we actually allow consumers to opt-into other/non folly:: types (by providing a custom butter:: implementation).

This change adds a butter::function for that purpose.

It is especially useful for react-native-windows which prefers Mso::Functor over folly::Function.

You can use it by setting those compiler flags:
-DBUTTER_FUNCTION_OVERRIDE_INCLUDE=<functional/functor.h>
-DBUTTER_FUNCTION_OVERRIDE=Mso::Functor

std::function is no option as it is not move-only and we can't wait till 2025 > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D41388193

fbshipit-source-id: 56f58b9ddc602aa4b13000031d50de5228b4a16b
2022-11-21 11:17:01 -08:00
Phillip Pan ad0c8551c2 remove all unnecessary imports to Geometry.h
Summary: Changelog: [Internal]

Reviewed By: stephinphection

Differential Revision: D41366189

fbshipit-source-id: ea4ed1f0c759b5a05012425684bfb835dbe90904
2022-11-18 11:51:39 -08:00
Christoph Purrer 1ec1785e32 Unify SystraceSection.h implementation (#35353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35353

Unfortunately we have 2 different definitions of SystraceSection.h
- xplat/js/react-native-github/ReactCommon/cxxreact/SystraceSection.h
- xplat/js/react-native-github/ReactCommon/react/renderer/debug/SystraceSection.h

The first one is the Old Arch one and the second one is the New Arch one.

As we first step, we unify the implementation

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D41307049

fbshipit-source-id: a9eb854dfcf49f87ad81fd9cc8dbe51648ecd209
2022-11-16 12:58:42 -08:00
Nick Gerleman 67b8e182fa Add Fabric implementation of flow-relative padding and margin (#35342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35342

This is a native implementation of the JS shimmed layout-specific properties in https://github.com/facebook/react-native/pull/35316.

There is an experiment splitting the prop splitting codepath in Fabric, so this change effectively has two implementations depending on whether `enablePropIteratorSetter` is enabled.

None of these changes make sense to propagate Yoga. `inlineEnd`, etc are already mapped to `YGEdgeStart` and `YGEdgeEnd`, but RN's mapping used a different name. Then `blockStart`, `blockEnd`, map directly to existing edges in all cases since we don't support a writing mode.

On web, the last value in the style which computes the given dimension is given precedence. E.g. if "left" comes after "start" it will be chosen. Yoga stylesheets are unordered, and precedence for edges is given based on specificity (left > start > horizontal > all).

We give precedence to new renamings (e.g. start to inlineStart), but to preserve consistent behavior, we give precedence to specific edges before overwriting them with flow relative ones (e.g. marginTop has precedence over marginBlockStar).

Changelog:
[General][Added] - Add Fabric implementation of flow-relative padding and margin

Reviewed By: javache

Differential Revision: D41267765

fbshipit-source-id: 896e2ed71fe8bf83aef00b0a9d70fd20b2ce47a7
2022-11-16 12:31:33 -08:00
Adam Gleitman 11c8bf3137 Add Dynamic Type support for iOS (Paper and Fabric) (#35017)
Summary:
This adds Dynamic Type support in iOS as described [here](https://github.com/react-native-community/discussions-and-proposals/issues/519).

`Text` elements have a new prop, `dynamicTypeRamp`, that allows users to specify which font ramp a particular `Text` element should take on as the OS's accessibility setting for text size. The different types line up with different values of `UIFontTextStyle`. If not specified, we default to the current behavior.

~~For the moment, this change is only for Paper. I tried applying a corresponding change to Fabric by adding an additional field to [`facebook::react::TextAttributes`](https://github.com/facebook/react-native/blob/main/ReactCommon/react/renderer/attributedstring/TextAttributes.h) and changing [`RCTEffectiveFontSizeMultiplierFromTextAttributes`](https://github.com/facebook/react-native/blob/afb124dcf0cdf0db525acc7cfd2cea2742c64068/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm#L79-L84) to use that new field, but in the process I discovered that this function doesn't seem to ever get called, hence [this bug](https://github.com/facebook/react-native/issues/34990).~~

## Changelog

[iOS] [Added] - Dynamic Type support

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

Test Plan:
Validated with a test page in RNTester. Screenshots follow:

A) Default text size
B) Largest non-accessibility text size
C) Largest accessibility text size, split across two screenshots due to size

| A | B | C |
|-|-|-|
| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 08](https://user-images.githubusercontent.com/717674/196562746-c8bbf53d-3c70-4e55-8600-0cfed8aacf5d.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 55](https://user-images.githubusercontent.com/717674/196563051-68bb0e34-c573-47ed-8c19-58ae45a7ce2b.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 33](https://user-images.githubusercontent.com/717674/196563185-61ede5ee-e79e-4af5-84a7-8f1e230a25f8.png) |
||| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 42](https://user-images.githubusercontent.com/717674/196563208-2242efa2-5f24-466d-80f5-eb57a7678a67.png) |

Reviewed By: sammy-SC

Differential Revision: D40779346

Pulled By: NickGerleman

fbshipit-source-id: efc7a8e9810a93afc82c5def97af15a2e8453d90
2022-11-15 19:03:37 -08:00
David Vacca 9ca30adff8 Exclude mapbuffer files from Mac/iOS builds
Summary:
In this diff I'm excluding mapbuffer files from Mac/iOS builds

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41309209

fbshipit-source-id: d92ae685ac05592e326ec3e046106f9a884271d6
2022-11-15 12:17:18 -08:00
Phillip Pan 9138712934 decouple various files from Geometry.h
Summary:
a lot of files were depending on Geometry even though they didn't use Vector, this will help with future modularity

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D41127194

fbshipit-source-id: 024519c638a1f0df3fdbfbdd937eac84b9adee6e
2022-11-15 08:06:45 -08:00
Christoph Purrer 19d65a2baf Update .podspec license information (#35245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35245

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41084913

fbshipit-source-id: a4ba31a19ffe515aa4e7c5a6e273a8cc4b6bc42d
2022-11-07 09:52:52 -08:00
Pieter De Baets 3e44d207a5 Shared Fabric color implementation across platforms
Summary: Changelog: [Internal] Align C++ implementations of SharedColor

Reviewed By: mdvacca

Differential Revision: D40632527

fbshipit-source-id: 8ebca5157e5898de4311015c92b5a72dca7197d3
2022-11-07 05:04:04 -08:00
Mitch Powell 44f3234d1f Clean up xplat/folly/container redirects
Summary:
Cleans up redirects for xplat/folly/container targets including:
```
//xplat/folly/container:bit_iterator
//xplat/folly/container:f14_hash
//xplat/folly/container:evicting_cache_map
//xplat/folly/container:enumerate
//xplat/folly/container:foreach
```

Reviewed By: Gownta

Differential Revision: D40954195

fbshipit-source-id: c14bfa572a9316cb0262a98f183adb457d0797f2
2022-11-04 09:44:51 -07:00
Christoph Purrer 76c7ccaa60 Enable ManagedObjectWrapper on react-native-macOS (#35146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35146

This class is used by Fabric - but does not compile on macOS yet.

Changelog:
[iOS][Fixed] Make ManagedObjectWrapper compile on macOS

Reviewed By: javache

Differential Revision: D40839241

fbshipit-source-id: 73b93a9963db89af19529fbfd60a64f4e5aaf036
2022-10-31 05:31:13 -07:00
Christoph Purrer 089684ee56 Remove remaining TV_OS fragments (#35110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35110

Changelog:
[General][Fixed] Remove remaining TV_OS fragments

Reviewed By: shwanton

Differential Revision: D40775881

fbshipit-source-id: 122ff8737de35689ee0951b068997ee546c7019c
2022-10-28 02:50:49 -07:00
Christoph Purrer d0599ac56b Back out "Add enum example to Android/iOS rn-tester TurboModule" (#35089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35089

Changelog:
[General][Fixed] - Back out "Add enum example to Android/iOS rn-tester TurboModule"

This broke the rn-tester adding due to an invalid flow-enum setup. Needs further investigation

Reviewed By: cipolleschi

Differential Revision: D40714320

fbshipit-source-id: 9831276762f90df0ffaca3304382fe5925009343
2022-10-26 06:30:14 -07:00
Christoph Purrer 02e4fcd825 Add enum example to Android/iOS rn-tester TurboModule
Summary:
Add enum example to Android/iOS rn-tester TurboModule

Changelog:
[General][Added] - Add enum example to Android/iOS rn-tester TurboModule

Reviewed By: javache

Differential Revision: D40619020

fbshipit-source-id: a113c5c78bcff3275e80d11bce8d0e6421b0b97d
2022-10-25 14:40:08 -07:00
Christoph Purrer 1d6b732496 react-native bridging > Add support for std::set
Summary:
There are use cases in which we want to pass a set of unique elements from C++ to JS and back. We can do this simple by re-using a plain JS array for these purposes.

Changelog:
[Internal][Added] react-native bridging > Add support for std::set

Reviewed By: cipolleschi

Differential Revision: D40668244

fbshipit-source-id: d06603440569e5f760c2859a54cf6e4232c7d97a
2022-10-25 12:32:30 -07:00
Samuel Susla e9b89b5ff2 Respect prop Text.allowFontScaling when sizing text
Summary:
changelog:
[iOS][Fixed] Fix Text.allowFontScaling prop in the new architecture

Reviewed By: javache

Differential Revision: D40643536

fbshipit-source-id: 1fb77b226089ce5e9ffc642b1d9a3de266d202c3
2022-10-25 05:51:25 -07:00
Phillip Pan 1bb5cca72d fix typo in LeakChecker
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D40654731

fbshipit-source-id: c72c217244d4a0d4a0467085ff604460219ade60
2022-10-24 17:49:41 -07:00
Riccardo Cipolleschi c63882238b Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_2nd_batch00" (#35065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35065

Original commit changeset: ac76ea701e3d

Original Phabricator Diff: D40611860 (https://github.com/facebook/react-native/commit/860b4d914407ef11d0d5de80e5add275f83de3fd)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40637084

fbshipit-source-id: 2be7296f859412210afe981adf500ab6540f7ee8
2022-10-24 10:44:39 -07:00
Riccardo Cipolleschi 52d37aa403 Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_batch10" (#35064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35064

Original commit changeset: 0fb0db845c04

Original Phabricator Diff: D40610875 (https://github.com/facebook/react-native/commit/d941940b4ce7ed9030be4f72980fb45d9b62365d)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40635873

fbshipit-source-id: 79ebd4db0972520fcca6ccb8c1725657a8ef7949
2022-10-24 10:44:39 -07:00
Paige Sun 880e889380 Drop using namespace in .h files
Summary:
using namespace in header file is a bad practice due to many reasons as well as discouraged by -Wheader-hygiene compiler flag which is default for many apps
https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers
https://stackoverflow.com/questions/223021/whats-the-scope-of-the-using-declaration-in-c

Changelog:
[Internal] Drop `using namespace` in .h files.

Reviewed By: christophpurrer

Differential Revision: D40628064

fbshipit-source-id: 8a032f3ab0321a531e26bd88656ad9a65b6d5154
2022-10-24 04:35:28 -07:00
Jonathan Keljo e69e6f4014 supermodule:xplat/default/public.react_native.infra
Reviewed By: javache

Differential Revision: D40376280

fbshipit-source-id: d76e692fd8a571614729d0fb15ebde8895d3de28
2022-10-23 15:55:13 -07:00
Stanley Shi 860b4d9144 add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_2nd_batch00
Reviewed By: Drizzlecrj

Differential Revision: D40611860

fbshipit-source-id: ac76ea701e3d2e30125c385ba86fae355027a92d
2022-10-22 23:52:02 -07:00
Stanley Shi d941940b4c add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_batch10
Differential Revision: D40610875

fbshipit-source-id: 0fb0db845c041265faf0a06877d05ffbb55ba648
2022-10-21 22:39:18 -07:00
TatianaKapos 950ea915be Fix windows warning/error over unsigned int (#34947)
Summary:
react-native-windows treats compiler c++ warning as errors, this is one of them. It fixes it by assigning i to unsigned instead of auto.

## 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] - Fix react-native-windows compiler warning in AttributedString

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

Test Plan: [code](https://github.com/microsoft/react-native-windows/pull/10479/files#diff-c14f3a9383607a661977aa577c75bbc547827502950e0244721ef021f549fbe2) is already merged into react-native-windows and passing all tests. The for loop changed is also used directly above in AttributedString::compareTextAttributesWithoutFrame

Reviewed By: shwanton

Differential Revision: D40459186

Pulled By: NickGerleman

fbshipit-source-id: 848375f75f3df0cd086d758a239e86f39b43aa3f
2022-10-21 17:48:28 -07:00
Nishan 9f3a3e13cc feat: flex gap bindings (#34974)
Summary:
This PR adds React native binding for https://github.com/facebook/yoga/pull/1116

## Changelog

[General] [Added] - Flex gap yoga bindings

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

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

Test Plan:
Run rn tester app and go to view example. You'll find a flex gap example. Example location - `packages/rn-tester/js/examples/View/ViewExample.js`

### Tested on
- [x] iOS Fabric
- [x] iOS non-fabric
- [x] Android Fabric
- [x] Android non-fabric

To test on non-fabric Android, I just switched these booleans. Let me know if there's anything else I might have missed.

<img width="674" alt="Screenshot 2022-10-14 at 3 30 48 AM" src="https://user-images.githubusercontent.com/23293248/195718971-7aee4e7e-dbf0-4452-9d47-7925919c61dc.png">

Reviewed By: mdvacca

Differential Revision: D40527474

Pulled By: NickGerleman

fbshipit-source-id: 81c2c97c76f58fad3bb40fb378aaf8b6ebd30d63
2022-10-20 14:53:32 -07:00
David Vacca 9578c2cadf Ship large meassure cache in all platforms
Summary:
Ship large meassure cache in all platforms

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D40356835

fbshipit-source-id: 315862d7aa705e83086e102e20fe2c20fb3210b2
2022-10-18 13:32:03 -07:00
David Vacca 22b6e1c8ec Ship and delete mapBufferSerialization for Text measurement
Summary:
In this diff I'm shipping and deleting mapBufferSerialization for Text measurement

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D40348982

fbshipit-source-id: 7336cbe055a55d7d8d4f0a723049842bae1defb5
2022-10-18 13:32:03 -07:00
bang9 048194849b feat(iOS): added lineBreakStrategy attribute to Text/TextInput (#31272)
Summary:
iOS did not support the implementation of Korean word-wrap(line-break) before iOS14.
If the attribute applied, the word-wrap of Korean will works.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] -  Line break strategy for Text and TextInput components

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

Test Plan:
1. Test build and run on above iOS 14.
2. Test it does not affect existing text components when set default(none) strategy.
3. Test whether word-wrap works with Korean when set hangul-word strategy.

<img src="https://user-images.githubusercontent.com/26326015/112963967-d7f70c00-9182-11eb-9a34-8c758b80c219.png" width="300" height="" style="max-width:100%;">

Reviewed By: javache

Differential Revision: D39824809

Pulled By: lunaleaps

fbshipit-source-id: 42cb0385221a38c84e80d3494d1bfc1934ecf32b
2022-10-17 13:14:17 -07:00
Samuel Susla 554f50b07e Delete feature flag disable_preallocation_on_clone_android
Summary:
changelog: [internal]

jest_e2e[run_all_tests]

Reviewed By: mdvacca

Differential Revision: D40304348

fbshipit-source-id: 8897bafdeedfcdc44eff5a8da1aa5028efcd0a3c
2022-10-17 05:57:32 -07:00
Samuel Susla 70cc27c901 Center text if line height isn't 0
Summary: changelog: Fix vertical text alignment in new architecture when line height is not 0.

Reviewed By: javache

Differential Revision: D40346225

fbshipit-source-id: f6282cb8df80e9a543e5602fddcca1a1a82377e3
2022-10-14 10:32:50 -07:00
Samuel Susla 51af7cdcde Use nested namespace name
Summary:
changelog: [internal]

Enable two new clang tidy checks:
- modernize-concat-nested-namespaces
- google-build-using-namespace

jest_e2e[run_all_tests]

Reviewed By: rshest

Differential Revision: D40020646

fbshipit-source-id: f3be80b5f829dd0ba376bdd70ed13332e114d48a
2022-10-13 05:07:59 -07:00
generatedunixname89002005287564 c42d82441a supermodule:ios/isolation/infra.react_native
Reviewed By: jkeljo

Differential Revision: D40294645

fbshipit-source-id: 2a80c40954a4bdf9962efc2dfeaa9913d52b5540
2022-10-12 23:18:43 -07:00
Andrew Coates 138c88c7da Fix warnings around mixing int and size_t usage in unsafe ways (#34889)
Summary:
react-native-windows builds treat a lot of c++ compiler warnings as errors.  Including ones that cause value truncation when assigning `size_t` values to an `int`.

This fixes the compiler warning, by using `size_t` as the type for `i`, which matches `size`.  I then modified the loop to avoid the value underflow that occurs when decrementing an unsigned zero value.

## Changelog
[Internal] [Changed] - Fix compiler warnings around mixing int and size_t usage in unsafe ways

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

Test Plan: This code change was made in react-native-windows when integrating latest react-native changes.  -- our fabric implementation was able to run through this code without any issues.

Reviewed By: mdvacca

Differential Revision: D40158306

Pulled By: rozele

fbshipit-source-id: b6858cb953635b37fd63a88ed1a372eb3dc394f7
2022-10-06 16:25:44 -07:00
Samuel Susla 0857238633 Pass didUserCallbackTimeout argument to Scheduler's callback
Summary:
changelog: [internal]

RuntimeScheduler's callbacks previously did not pass down argument `didUserCallbackTimeout`. This was intentionally left out because React team intended to remove it. But, as it turns out, it was not removed and it is needed for Offscreen to not enter infinite render loop. In React, it is used here: https://github.com/facebook/react/blob/main/packages/react-reconciler/src/ReactFiberWorkLoop.new.js#L1022-L1028

Reviewed By: ryancat

Differential Revision: D40060377

fbshipit-source-id: c45719fbbd0275ab2bcf9a2bbf0191aaa96010cc
2022-10-05 10:35:33 -07:00
Ruslan Shestopalyuk aa5d43fe54 Merge enablePropIteratorSetter flags into a single one in CoreFeatures (#34869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34869

Changelog: [Internal]

This merges all instances of `enablePropIteratorSetter` into a single one.

Both `AccesibilityProps` and `BaseTextProps` had their own instances if it, which is now redundant.

Reviewed By: cipolleschi

Differential Revision: D40062555

fbshipit-source-id: b6ccf5a9538612dd731a6f9c4eaceeebcb6d95be
2022-10-05 05:09:37 -07:00