Граф коммитов

26342 Коммитов

Автор SHA1 Сообщение Дата
Neil Dhar 03b17d9af7 Clarify const-ness of JSI references
Summary:
Many operations on references in JS can modify the referent by
executing additional JS, including operations that we currently mark as
const such as `getProperty`. Because of this, the current distinction
between const and non-const operations on references like `jsi::Object`
is somewhat arbitrary.

A more consistent approach is to mark all operations as const, so that
it is clear that the const-ness applies to the reference and not the
referent. This is analogous to how smart pointers work, since something
like `const shared_ptr<T>` only makes the pointer const, as opposed to
`shared_ptr<const T>`.

This also gives users better guarantees and more flexibility in where
these references may be used.

Changelog:
[General][Changed] - Mark methods on JSI references as const.

Reviewed By: fbmal7

Differential Revision: D41599116

fbshipit-source-id: 40b1537581b09c5a34d0928ee04e7db2b50d26ea
2022-12-15 19:18:15 -08:00
Nick Gerleman c4862a2322 Fix Errors with TypeScript Tests
Summary:
This fixes some style errors found by dtslint, along with some test cases for StyleSheet.compose() where the recent change made it slightly too permissive when explicit return types are given. I also added runs of the TS tests to a script which runs in sandcastle so we can catch this at diff-submission time in the future.

Changelog:
[General][Fixed] - Fix Errors with TypeScript Tests

Reviewed By: lunaleaps

Differential Revision: D42085257

fbshipit-source-id: 7e6ca49d3c3aef822c61c97ecc07b55b0a949d51
2022-12-15 19:17:58 -08:00
Nishan d867ec0abb fix: remove gap if its last element in line (fix flex gap extra spacing when children determine parents main axis size) (#1188)
Summary:
Fixes - https://github.com/facebook/react-native/issues/35553

## Approach
We're using `betweenMainDim` to add [gap between](bbeede82d3/yoga/Yoga.cpp (L2495)) items in main axis. This is resulting in increased [main axis](bbeede82d3/yoga/Yoga.cpp (L2598)) dimension of the container as it gets added even for the last element. One solution is to keep using it and subtract the gap when last element is reached.

## Aside
Mutating this value feels weird, but I think `betweenMainDim` gets initialized for every line so should be fine? I did some manual tests to verify. I tried running tests but I'll have to downgrade the java version. Let me know if anything fails. Thanks! 🙏

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

Reviewed By: necolas

Differential Revision: D42078162

Pulled By: NickGerleman

fbshipit-source-id: 0e535618350422e001141a8786a83fc81651afe9
2022-12-15 16:30:37 -08:00
Nick Gerleman 621969b8d8 Add missing VirtualizedList Imperative Types
Summary:
Adds some imperative VirtualizedList methods to the TS types which are documented on the website and are public enough. Also explicitly add `viewOffset` to `scrollToItem` since `scrollToItem` params are indefinite in flow and are passed to `scrollToIndex` (which supports the prop).

Changelog:
[General][Fixed] - Add missing VirtualizedList Imperative Types

Reviewed By: GijsWeterings

Differential Revision: D42047674

fbshipit-source-id: 60f7b35b049853d9fcb724918b3a0008a75ea573
2022-12-15 12:41:38 -08:00
Nick Gerleman 8d6e2f86f5 Add missing types for AppRegistry
Summary:
These are all documented on the website and seem to likely work in OSS to at least some extent. Add the missing types corresponding to functions exported from AppRegistry.

Changelog:
[General][Fixed] - Add missing types for AppRegistry

Reviewed By: GijsWeterings

Differential Revision: D42036018

fbshipit-source-id: 0728d6c5602a50e50f1eaf7f76c54ab47dcb0124
2022-12-15 10:22:43 -08:00
Nick Gerleman 4e5421fd9a Add type for RootTagContext
Summary:
This is exported from the RN entrypoint and documented on the RN website, so we should give types for it.

Changelog:
[General][Fixed] - Add type for RootTagContext

Reviewed By: christophpurrer

Differential Revision: D42040806

fbshipit-source-id: cb8cdf557098ddbe33c143b7ab5d80bda7f80a6e
2022-12-15 10:04:11 -08:00
Nick Gerleman 079312895b Add missing types to PushNotificationIOS
Summary:
Adds some types referenced on the React Native webpage that aren't part of the typings.

Changelog:
[General][Fixed] - Add missing types to PushNotificationIOS

Reviewed By: christophpurrer

Differential Revision: D42040583

fbshipit-source-id: be7b86a02e30b99231f3ab35afc3222954f41cf0
2022-12-15 09:54:03 -08:00
Nick Gerleman b15be0eaa3 Fix missing animation type (CircleCI Break)
Summary:
Accidentally added a reference to a flow type that doesn't exist in TS. This should fix the issue.

Changelog:
[General][Fixed] - Fix missing animation type

Reviewed By: christophpurrer

Differential Revision: D42043293

fbshipit-source-id: 03470aa25f503337e9e2b79cf74cff96c15a4ad8
2022-12-15 09:52:24 -08:00
malacca c0834b884b fix RCTNetworking contentType issue (#35640)
Summary:
96027f787a/Libraries/Network/RCTNetworking.mm (L418)

because  `RCTNullIfNil(response.MIMEType)`,  `contentType` may be `[NSNull null]`

96027f787a/Libraries/Network/RCTNetworking.mm (L114)

Here only check `partContentType` is not nil, This causes the custom type never used

96027f787a/Libraries/Network/RCTNetworking.mm (L334)

more serious here, if `dataContentType` is `[NSNull null]` ,  it will crash the application

`-[NSNull hasPrefix:]: unrecognized selector sent to instance 0x7fff8004b700`

## Changelog

[iOS] [Fixed] - fix dataContentType may be [NSNull null] issue

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

Reviewed By: cipolleschi

Differential Revision: D42067206

Pulled By: dmytrorykun

fbshipit-source-id: 073e6589111f5117486b69b8206a07ef1995c5b8
2022-12-15 08:14:38 -08:00
Nicola Corti 3487640512 Fix prefab prefix for fabricjni (#35648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35648

The `fabricjni` prefab module was missing the `react/fabric` prefix.
I'm adding it here.
Ref: https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4402506

Changelog:
[Internal] [Changed] - Fix prefab prefix for fabricjni

Reviewed By: cipolleschi

Differential Revision: D42047434

fbshipit-source-id: 202db49cd1ada2462652dbd7e56bad6779c263ac
2022-12-15 04:54:14 -08:00
Evan Yeung 62d100aaa9 Deploy 0.196.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D42061181

fbshipit-source-id: 7198ebbc41b1e9c6eba015bcc0c231b7066ef0b6
2022-12-15 03:32:40 -08:00
Ruslan Shestopalyuk 14307b8212 Setup a global Performance singleton, according to the standard
Summary:
Makes sure that the global (standard) `performance` instance is initialized to still both provide `Performance.now()` as before, but also allows for the newly implemented functionality from the WebPerf API, such as marks/measures.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D42017812

fbshipit-source-id: ddbe79e91b45a84871de94018305f2a4536ada4b
2022-12-14 22:38:12 -08:00
Christoph Purrer 61c6788a3a Replace folly::Optional with std::optional in hermes/inspector (#35613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35613

Changelog: [Internal]

Reviewed By: mattbfb

Differential Revision: D41918823

fbshipit-source-id: b783fd550c27533306e165ea98647d133a90874c
2022-12-14 16:22:13 -08:00
Nick Gerleman 0d091318ed Fix types for deprecated scrollTo fields
Summary:
This was renamed in Flow but not in TS.

Changelog:
[General][Fixed] - Fix types for deprecated scrollTo fields

Reviewed By: christophpurrer

Differential Revision: D42040913

fbshipit-source-id: 5d9746be7b785bea8613f199d39940c4d5d7d138
2022-12-14 15:38:03 -08:00
Nick Gerleman 2c2cb09c00 Fix Vibration.vibrate() allowing null params
Summary:
The flow type allows these parameters to be optional but not null. Make TS the same.

Changelog:
[General][Fixed] - Fix Vibration.vibrate() allowing null params

Reviewed By: christophpurrer

Differential Revision: D42046301

fbshipit-source-id: a030d4f141a526dfe2f0fb3a90e36e641fa6d789
2022-12-14 15:23:12 -08:00
Nick Gerleman e1af6302fc Mark scrollToEnd animated as optional
Summary:
The flow type and inheriting TS types mark animated as optional, mark it here as well.

Changelog:
[General][Fixed] - Mark scrollToEnd animated as optional

Reviewed By: christophpurrer

Differential Revision: D42036647

fbshipit-source-id: 59d408adc639ee1e0ca040301511c64d7ba55bfe
2022-12-14 15:04:55 -08:00
Nick Gerleman 1752fdc0f5 Fix type for `StyleSheet.compose()`
Summary:
This was flagged when typechecking the existing examples. The current type enforces that both stylesheets overlap, meaning composed stylesheets with distinct props cause a typechecking error. This changes the signature so that each style can be different, and the intersection type of the two is returned.

Changelog:
[General][Fixed] - Fix type for `StyleSheet.compose()`

Reviewed By: christophpurrer

Differential Revision: D42008355

fbshipit-source-id: 238971a61b387c09be001d5df50fe3db70df566f
2022-12-14 14:59:05 -08:00
Michael Anthony Leon 56636718f6 Retain usage of HERMES_ENABLE_DEBUGGER flag (#35646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35646. Even though the RN code itself does not need `HERMES_ENABLE_DEBUGGER` anymore since the `ifdef`s are gone, the Hermes' headers it includes *do* still need that flag. This is because they were compiled with `HERMES_ENABLE_DEBUGGER` to set true, so that compile flag must match later on when importing the headers.

Changelog:
[Internal][Fixed] - We erroneously deleted usage of the HERMES_ENABLE_DEBUGGER flag, add it back.

Reviewed By: cortinico, mattbfb

Differential Revision: D42041827

fbshipit-source-id: db875f40a067c09aba37ab1b07422157f63b3700
2022-12-14 13:32:49 -08:00
Nick Gerleman 454f9dc396 Remove testID from TS ViewStyle
Summary:
testID isn't a valid prop to exist on a style.

Changelog:
[General][Fixed] - Remove testID from TS ViewStyle

Reviewed By: necolas

Differential Revision: D42040627

fbshipit-source-id: d51b0dc7abff14ac72f71753ea1ae708e0858590
2022-12-14 13:23:57 -08:00
Nicola Corti 52f4ff7bbf Expose `react_render_animations` via prefab. (#35643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35643

The `react_render_animations` was not exposed via prefab. I'm adding it to make possible for
Reanimated to integrate on top of us via prefab.
Ref https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4398084

Changelog:
[Internal] [Changed] - Expose `react_render_animations` via prefab.

Reviewed By: cipolleschi

Differential Revision: D42033642

fbshipit-source-id: da4b3665f4fb1c7f8266fa6896585176504435c3
2022-12-14 11:33:48 -08:00
Nicola Corti 51a48d2e2c Remove unnecessary repositories{} block from top level build.gradle (#35644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35644

The `repositories{}` block in the top level build.gradle is not needed anymore
The React Native Gradle Plugin is taking care of it.
Users can still specify if they need to provide custom repositories.

Changelog:
[Android] [Changed] - Remove unnecessary repositories{} block from top level build.gradle

Reviewed By: cipolleschi

Differential Revision: D42033953

fbshipit-source-id: 8ec1c12147fae68302ab47c60045869c72d1812c
2022-12-14 11:25:57 -08:00
Nick Gerleman 25a25ea234 Add missing type for AnimatedValue.resetAnimation() and AnimatedValue.animate()
Summary:
See https://www.internalfb.com/code/fbsource/[d96fd0b6ac13]/xplat/js/react-native-github/Libraries/Animated/nodes/AnimatedValue.js?lines=207

Changelog:
[General][Fixed] - Add missing type for AnimatedValue.resetAnimation() and AnimatedValue.animate()

Reviewed By: christophpurrer

Differential Revision: D42034719

fbshipit-source-id: 40e25940e04bdf296c8b5e4bf39bee2e4baeae07
2022-12-14 10:51:00 -08:00
Abdelhafidh Belalia 64475aeb3b Switch order of onSelectionChange and onChange events on iOS (#35603)
Summary:
Switched order of onSelectionChange and onChange events on iOS

This was already fixed but for fabric only https://github.com/facebook/react-native/blob/main/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm#L36-L46

This PR is a complementary of 7b4889937c

Fixes https://github.com/facebook/react-native/issues/28865

## Changelog

[IOS] [FIXED] - onSelectionChange() is fired before onChange() on multiline TextInput

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

Test Plan:
Reproduce the minimal example provided here https://github.com/facebook/react-native/issues/28865
Verify that the events order is onChange then onSelectionChange with no duplicates

Reviewed By: cipolleschi

Differential Revision: D41947673

Pulled By: dmytrorykun

fbshipit-source-id: cf452a6101400b1b54295c83fa7735449d91e781
2022-12-14 09:17:54 -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
Nicola Corti 46ffeca3b0 De-bump AGP to 7.3.1 and do not use `addGeneratedSourceDirectory` (#35631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35631

Fixes #35592
I'm de-bumping AGP from 7.4 to 7.3 as per #35592. There is no stable release
of AGP that is working fine with the `addGeneratedSourceDirectory` API for resources.
Here I'm reverting to use the older APIs.

Changelog:
[Internal] [Changed] - De-bump AGP to 7.3.1 and do not use `addGeneratedSourceDirectory`

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D42004813

fbshipit-source-id: f1a2b0f7c2233402749a3e4f3828be80111ad3a7
2022-12-14 03:33:58 -08:00
Ruslan Lesiutin 7f29357c7c refactor(scripts): use forEachPackage instead of `yarn workspaces info` (#35633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35633

Changelog: [Internal]

These changes add usage of `forEachPackage` as a replacement for `yarn --json workspaces info`.

This is because at some point in release cycle there is a script which removed `workspaces` block from react-native's `package.json`, so `yarn --info workspaces info` produces an error

Reviewed By: cortinico

Differential Revision: D41996732

fbshipit-source-id: 2c62c1a5eb41d711c563f9f7b0de3d67fc11823d
2022-12-14 03:04:06 -08:00
Riccardo be895c870c Properly support both libraries and use_frameworks (#35624) (#35637)
Summary:
Backporting a [fix](c6fa633597) on the `ReactCommon.podspec` to properly support static libraries and
static frameworks
## Changelog

[IOS][FIXED] - Properly support static libraries and static frameworks

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

Test Plan: Tested in 0.71-RC4

Reviewed By: christophpurrer

Differential Revision: D42029571

Pulled By: cipolleschi

fbshipit-source-id: e562fe211931a0aebba282057589e5dd4fafe3ba
2022-12-14 02:24:07 -08:00
Ruslan Lesiutin 83afdafae4 feat(react-native-github): automate publishing bumped packages via circleci (#35621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35621

Changelog: [Internal]

1. Added `for-each-package.js` script. This can be used to iterate through all of the packages inside `/packages` with the access to package manifest. This soon can be used as a replacement for `yarn workspaces --info`
2. Added `find-and-publish-all-bumped-packages.js` script. This script iterates through all the packages and detects if the version was changed via `git log -p` (same as `git diff`). If so, it tries to publish it to npm.
3. Added corresponding job and workflow to CircleCI config, which will use this script

Reviewed By: cortinico

Differential Revision: D41972733

fbshipit-source-id: c5d0ed5b852b744a699ecb88861ea3e82200e1f3
2022-12-14 02:17:16 -08:00
Sam Zhou 9f9111bd7b Deploy 0.195.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: mroch, jbrown215

Differential Revision: D42023901

fbshipit-source-id: e3fe3720e82f6857e7be5198a400011917012dff
2022-12-13 20:03:15 -08:00
Ruslan Shestopalyuk 963e45afd1 Recursively pass invoker into ::toJS data structures for generated C++ modules
Summary:
While working on D42008409 I found out that codegen for pure C++ modules doesn't work with container types that are nested inside generated data structures, which happens because they don't have a specialization of `bridging::toJS` that wouldn't pass the `invoker` instance through.

It looks like an easiest option would be just to use `invoker` in codegen for `toJS` as well, which this diff does.

Note that I also experimented with removing `invoker` from being used in the `::toJS` specializations for containers altogether (see D42008410), as there doesn't seem to be a single use case when `invoker` would be ever needed in any `::toJS` specialization (and imagining such a scenario would be a stretch, tbh - why a conversion function would invoke anything running on JS side, given that invoker provides no return values anyway?..)

But since I am still not 100% about the invoker purpose there, I went with the codegen change.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D42008724

fbshipit-source-id: 6302d3ceacdfc8fed296ee1ef1a985f7273c2261
2022-12-13 17:07:13 -08:00
Sam Zhou fc3565ce8d Pre-suppress errors before the next Flow release
Summary: Changelog: [Internal]

Reviewed By: fred2028

Differential Revision: D42006446

fbshipit-source-id: de6c327a540e5085ac196679cf7db7db8a681298
2022-12-13 16:50:33 -08:00
Samuel Susla 455ca8cfaf Make UIManager.measure* compatible with Fabric
Summary:
changelog: [internal]

To make migration to the new architecture more straight forward, this change makes `UIManager.measure`,  `UIManager.measureInWindow`, `UIManager.measureLayout` and `UIManager.measureLayoutRelativeToParent` functions backwards compatible. Users will not have to make any change to continue using the APIs.

This will make [Migrating .measure*()
](https://reactnative.dev/docs/new-architecture-library-intro#migrating-measure) in the migration guide optional.

Reviewed By: yungsters

Differential Revision: D41613050

fbshipit-source-id: 3c65ced231590243d118fbc120a87b08d5261da0
2022-12-13 11:43:05 -08:00
Lorenzo Sciandra 326109ba5d fix(metro): realign "leftover" metro packages from 0.73.3 to 0.73.5 (#35625)
Summary:
I just noticed while working on 0.71 that the PR https://github.com/facebook/react-native/pull/35580 was incomplete. This PR takes care of re-aligning the leftovers. (in 0.71 I've taken care of the changes locally)

## Changelog

<!-- 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
-->

[INTERNAL] [FIXED] - realign "leftover" metro packages from 0.73.3 to 0.73.5

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

Test Plan: N/A

Reviewed By: cortinico, cipolleschi

Differential Revision: D41996338

Pulled By: dmytrorykun

fbshipit-source-id: bc1c95b0159f639e33835b922555d2f5b8c22c66
2022-12-13 09:52:30 -08:00
MaeIg 3f2691cf84 Extract the parseFile function in the typescript and flow parsers (#35318)
Summary:
This PR aims to extract  the parseFile function in the typescript and flow parsers.  This is to solve the problem described [here](https://github.com/facebook/react-native/pull/35158#issuecomment-1298330753) and help with the work done in https://github.com/facebook/react-native/issues/34872.

## 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] - Extract the parseFile function in the typescript and flow parsers

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

Test Plan:
yarn flow:
<img width="496" alt="image" src="https://user-images.githubusercontent.com/40902940/206518024-83084c3d-ab0d-4a04-810a-d40270add4b0.png">

yarn lint:
<img width="495" alt="image" src="https://user-images.githubusercontent.com/40902940/206518076-9e07eafe-db61-4c6e-8aaa-f92f190cf4f3.png">

yarn test:
<img width="389" alt="image" src="https://user-images.githubusercontent.com/40902940/206518118-5633b28c-b79b-4421-80f7-de1e03fb8ff2.png">

Reviewed By: cortinico

Differential Revision: D41248581

Pulled By: cipolleschi

fbshipit-source-id: f5b878a28a7de612fcdd1528f064b44f668503af
2022-12-13 09:00:46 -08:00
Dmitry Rykun 234486068e Prepare dummy hermes.xcframework before pod install
Summary:
This diff adds prepare command to hermes-engine.podspec. That command creates dummy `universal/hermes.xcframework` and `maocosx/hermes.framework`. This allow us to utilise CocoaPods auto-linking, and remove manual linking/cleanup code.
Also we now do not pollute user project with "Copy Hermes Framework" script phase. Which was quite bad on its own, and also caused annoying bugs on the CI.
allow-large-files

Changelog:
[iOS][Changed] - Prepare dummy hermes.xcframework before pod install.

Reviewed By: cipolleschi

Differential Revision: D41533994

fbshipit-source-id: d7d098ba5e882ac2d036335c23d7cda447d75b8d
2022-12-13 08:42:09 -08:00
Dmitry Rykun 65e0f79f69 Backport fix: update CircleCI config to use the RN version in Hermes workspace caching (#35617)
Summary:
This is a backport of 0edcbc30c8. It fixes inconsistencies in caching strategies of Hermes tarball and Hermes workspace on CircleCI.

## Changelog

[INTERNAL] [FIXED] - Update CircleCI config to use the RN version in Hermes workspace caching.

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

Test Plan:
1. Create and push a new branch.
2. Change version in. react-native/package.json
3. Push those changes.

Before:
CircleCI restores cached Hermes workspace for the old version.

After:
CircleCI creates new workspace for the new version.

Reviewed By: cipolleschi

Differential Revision: D41970943

Pulled By: dmytrorykun

fbshipit-source-id: 7e343b7a8d4b1c5a63016ec53538abe4ad7808cc
2022-12-13 04:19:43 -08:00
Zihan Chen (MSFT) f07490b1f1 Fix codegen output for object with indexer (#35344)
Summary:
The current implementation think `{[key:T]:U}` and `{key:object}` are the same type, which is semantically wrong.

This pull request fixes the problem and return `{type:'GenericObjectTypeAnnotation'}`, so that `{[key:T]:U}` is `Object`. The current schema cannot represent dictionary type, `Object` is the closest one.

The previous incorrect implementation actually bring in code with logic that doesn't make sense (treating indexer as property), those and related unit test are all undone.

## Changelog

[General] [Changed] - Fix codegen output for object with indexer

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

Test Plan: `yarn jest react-native-codegen` passed

Reviewed By: rshest

Differential Revision: D41304475

Pulled By: cipolleschi

fbshipit-source-id: caab8e458d83f9850c5c28b67cc561a764738372
2022-12-13 03:21:02 -08:00
Moti Zilberman 9b280ad1c5 Replace matchAll with exec
Summary:
When using the `g` modifier on the regex, match and matchAll's behaviour is equivalent, and match has better backwards compatibility on older iOS versions.

Changelog: [General][Fixed] Fixed a backwards compatibility issue with AnimatedInterpolation

Reviewed By: yungsters

Differential Revision: D41879036

fbshipit-source-id: 240dda85ef0de8e27452846c77114ac46823f74f
2022-12-13 02:45:49 -08:00
Nicola Corti 822396d1ff Expose ReactAndroid/src/main/jni/react/cxxcomponents via prefab (#35619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35619

Reference https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4353534
I'm exposing `ReactAndroid/src/main/jni/react/cxxcomponents` to be consumed via prefab.
It will be available to both: `react_nativemodule_core` and `reactnativejni`

Changelog:
[Internal] [Changed] - Expose ReactAndroid/src/main/jni/react/cxxcomponents via prefab

Reviewed By: cipolleschi

Differential Revision: D41965512

fbshipit-source-id: 3a5a7473267e2e161d9d7fb0e8dfa74593b47b6e
2022-12-13 02:22:32 -08:00
Nicola Corti bb5fee8f59 Expose ReactCommon/cxxreact headers via Prefab
Summary:
Reference https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4353534
I'm exposing the headers inside `ReactCommon/cxxreact` to be access via the Prefab API.

Changelog:
[Internal] [Changed] - Expose ReactCommon/cxxreact headers via Prefab

Reviewed By: cipolleschi

Differential Revision: D41965511

fbshipit-source-id: 726b2948262b4b07cb40996fa1ccf9726a5197ce
2022-12-13 02:22:32 -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
David Vacca a120679619 Add support for String props on C++ Components
Summary:
This diff adds support for String props on C++ Components

changelog: [internal] internal

Reviewed By: genkikondo

Differential Revision: D41784029

fbshipit-source-id: 3065186074e1feca3dd0dd724105f1596146ee1d
2022-12-12 20:05:23 -08:00
Xin Chen a3c47d3baa Replace RN Dev Tool perf logger usage of API 24 method in java.util.Comparator.naturalOrder
Summary:
Previous diff D41486648 is causing crashes and a sev S311353, which is due to usages of an old Android API that only work after level 24 (D36500518 (0fc42fd35c)). ~~This diff updates the implementation to use a compatible API, but with worse runtime complexity.~~

~~https://fburl.com/txd0r89e is a good explanation on the two algorithm to calculate a streaming median value. This diff uses the approach described in https://stackoverflow.com/a/4903642.~~

## Update
Following suggestion from sshic, I preserved the existing algorithm but with a custom comparator approach.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D41505143

fbshipit-source-id: 494e07fa627b5cf8bad7971fa5de86d270a7412c
2022-12-12 13:50:44 -08:00
generatedunixname89002005325672 0f089ea2db Daily `arc lint --take KTFMT`
Reviewed By: adamjernst

Differential Revision: D41833756

fbshipit-source-id: 0ecc95aff3bdadadb0769dec55d27fb84fe50e95
2022-12-12 07:51:03 -08:00
Ruslan Shestopalyuk 41c17ddd56 Batch/throttle reporting of the performance entries
Summary:
Makes sure that we don't spam too often the JS performance entry reporting callback, which further dispatches entries to `PerformanceObserver` instances.

The logic is as following:
* ~~~If internal buffer of entries reaches the limit, we schedule the callback (with background priority)~~~
*~~~ Once the callback is processed, we schedule the next flush after a timeout of 500ms, this will also be scheduled from native with background priority~~~
* ~~~Whenever new performance type starts to be observed, we also schedule the callback, in order to prime the above~~~
* Schedule the flush with low priority, whenever there is the first entry coming into an empty buffer, and rely on the Scheduler to "do the right thing" when asked to flush it with background priority and not doo it exceedingly often (see the prolonged discussion)

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D41875085

fbshipit-source-id: 368b525203215350ceabb43d5e9e8e3bd5242aca
2022-12-12 04:53:31 -08:00
Christoph Purrer e327f9e20c BUCK > Enable ObjectiveC TM for MacOS (#35609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35609

Changelog: [Internal]

Reviewed By: shwanton, cortinico

Differential Revision: D41893371

fbshipit-source-id: c60ca66d6c3957dd7850a14a1394a6b5227ff415
2022-12-12 03:23:45 -08:00
David Vacca 1a514e514b Refactor ReactNativeFeatureFlags
Summary:
Refactor ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41750644

fbshipit-source-id: 43fdd7758e68a578afdb799488fda9f8bdf0ddb4
2022-12-10 15:42:08 -08:00
David Vacca 57ffa12a08 Delete references of CppComponentRegistry from FabricJSIModuleProvider
Summary:
Delete references of CppComponentRegistry from FabricJSIModuleProvider since it's not necessary anymore

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41638893

fbshipit-source-id: 8a7b032ead5972609dd4d3c1e40d9d60299c6480
2022-12-10 15:42:08 -08:00
David Vacca 4ab125961b Delete references of CppComponentRegistry from the internals of React Native Android renderer
Summary:
Delete references of CppComponentRegistry from the internals of React Native Android renderer, since it's not necessary anymore

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41638890

fbshipit-source-id: c4b08853722874dbb21891817836862225469dd9
2022-12-10 15:42:08 -08:00
Lulu Wu 11b53908a7 Remove atomic fix
Summary:
Changelog:
[Android][Changed] - Remove testing code for atomic fix

Reviewed By: fkgozali

Differential Revision: D41730846

fbshipit-source-id: e73e3b9530969683d4247759f3923f105d79cd34
2022-12-10 14:45:22 -08:00