Commit Graph

38536 Commits

Author SHA1 Message Date
David Vacca 28d5c15cb9 Remove lint warning on ReactInstance (#37038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37038

ez diff to remove warning on ReactInstance

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D45198113

fbshipit-source-id: 936d5e5d159b0e7995d1048ba6f98a0608a1af7c
2023-04-22 14:39:51 -07:00
David Vacca 01d80c1285 Refactor ReactInstance to reduce visibility (#37039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37039

ReactInstance is not meant to be used outside of bridgless package, this diff reduces its visibility.

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D45197462

fbshipit-source-id: e2fa8ed145a05882d8f5384d4e4e17a3d6d984ac
2023-04-22 10:14:55 -07:00
David Vacca 932150eb94 Refactor BridgelessReactStateTracker (#37040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37040

Refactor BridgelessReactStateTracker to remove unused methods and reduce visibility

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D45192192

fbshipit-source-id: 34f523ac2f1e45ea2ab4acb94134cfd1879a01db
2023-04-22 10:14:55 -07:00
David Vacca f530c32a98 Reduce visibility of BridgelessReactStateTracker class (#37037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37037

Reduce visibility of BridgelessReactStateTracker class to package only

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D45192194

fbshipit-source-id: 3bd57f0fa228af1ca997ed454b067e89ff89fc7b
2023-04-22 08:15:19 -07:00
David Vacca 20e1ecf282 Reduce visibility of BridgelessDevSupportManager class (#37036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37036

This diff I'm reducing visibility of BridgelessDevSupportManager to package only

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D45192195

fbshipit-source-id: d1cfb31005f6181118928705c03c2536e448a02a
2023-04-22 08:15:19 -07:00
David Vacca 6542cf9ccc Reduce visibility of BridgelessAtomicRef to package (#37042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37042

BridgelessAtomicRef is only used in com.facebook.react.bridgeless, we reduce visibility to package only

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D45192193

fbshipit-source-id: 12253a2a8acd3c2edd550650f5f04a0346694b3e
2023-04-22 08:15:19 -07:00
Tim Yung cff4bc8eea RN: Silently Fail onRequestPermissionsResult for Invalid Activities (#37047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37047

We're seeing scenarios where `onRequestPermissionsResult` is being invoked but the current activity does not implement `PermissionAwareActivity`. This should not crash the app.

Changelog:
[Android][Fixed] - Fix crash when Android requests permission with activity that does not implement `PermissionAwareActivity`

Reviewed By: mdvacca

Differential Revision: D45203319

fbshipit-source-id: 4a6eb67ad67ae5c731c27301967b837b1286ccbb
2023-04-21 22:31:00 -07:00
Ramanpreet Nara 555014a634 Emit logs in "module not found" scenarios
Summary:
In the TurboModule interop layer, several modules are appearing as null. It's unclear why. We landed a few module resolution simplification diffs, to *attempt* to mitigate the problem: D45131297. But we're not sure if those diffs will be 100% successful.

So, this diff inserts two logs into the TurboModule system, for scenarios we know could lead to TurboModules being null. The hope: this helps us understand the actual problem, in case our earlier fix attempt (i.e: D45131297) fails.

Notes:
- These logs are temporary.
- These logs will only run in the TurboModule interop's test group.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D45197703

fbshipit-source-id: 4401a6111492444cc4b405c52183d02df94c3828
2023-04-21 16:37:04 -07:00
Ramanpreet Nara af5c2d2c75 Only create TurboModules, if they're registered (#37032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37032

Before, calling into global.turboModuleProxy would kickstart the  module creation algorithm, **even if the module wasn't registered.**

Now, if the module isn't registered, TurboModuleManager will just early return null.

NOTE: When an unregistered module is requested from Java via TurboModuleManager.getModule(moduleName), the module algorithm will **still** run.

This fixes a bug:
- global.**native**ModuleProxy will no longer kickstart **turbo** module creation.
- global.**turbo**ModuleProxy will no longer kickstart **legacy** module creation.

NOTE: This **might** improve fb4a performance **a bit**: The TurboModule creation algorithm is *probably* expensive to run. 44 NativeModules are loaded at startup by Fb4a; 8 of them aren't registered with the app: [pastry](https://www.internalfb.com/phabricator/paste/view/P701125588?lines=2%2C4%2C5%2C7%2C9%2C16%2C18%2C24). Those 8 NativeModule creates will now shortcircuit to null faster.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D45195578

fbshipit-source-id: cb09bdc059b3651b02447b7c2e37ef3f4ca2f92b
2023-04-21 16:37:04 -07:00
Ramanpreet Nara 215e574373 Switch to lambdas within ReactPackageTurboModuleManagerDelegate
Summary: Changelog: [Internal]

Reviewed By: cortinico, mdvacca

Differential Revision: D45158030

fbshipit-source-id: 4919d0d28874cf12acc3dc8baa2df752c5e2a3d5
2023-04-21 16:37:04 -07:00
Ramanpreet Nara 6f10110555 Remove Deprecated TurboModuleManagerDelegate APIs
Summary:
This deprecated API makes TurboModuleManager's module creation algorithm harder to follow. Let's remove it.

Changelog: [Android][Removed] - Remove TurboModuleManagerDelegate.getLegacyCxxModule

Reviewed By: mdvacca

Differential Revision: D45158031

fbshipit-source-id: f72af3d62e51a4c8427d41975f51d1c9dd31c6c8
2023-04-21 16:37:04 -07:00
Ramanpreet Nara ac2a4d8e6c Remove getNative* TurboModuleRegistry APIs
Summary:
These getNative* TurboModuleRegistry APIs make the TurboModuleManager harder to understand. They should have never been introduced.

Let's remove them for added clarity.

Changelog: [Android][Removed] - Remove TurboModuleManager.getNativeModule,getNativeModules,hasNativeModule

Reviewed By: mdvacca

Differential Revision: D45158032

fbshipit-source-id: 6f904dfe43fe7b2c215070a19f474acceddbf2f8
2023-04-21 16:37:04 -07:00
Nick Gerleman 1f1918e473 Remove C++ form of YGNodeSetChildren (#37013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37013

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

Brings Yoga public interface back to a nice pure C ABI.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D45138827

fbshipit-source-id: 8df7e4fd03afcda9a714d193b0430c122a7a7574
2023-04-21 15:36:17 -07:00
David Vacca 43c202fa95 Fix lint warnings in Drawer classes (#37024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37024

Fix lint warnings in Drawer classes

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D45123914

fbshipit-source-id: 46d2f6326b4231dcefb42f286437daec53c51fae
2023-04-21 15:17:29 -07:00
Nick Gerleman f3abf4243c Remove YGNode "reserved_" field (#36991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36991

D15296732 added a byte to each YGNode exposed via private API, to stash random junk in. At the time, not adding to node size because of how fields ended up aligning. I'm not sure if this is still the case, but this is subject to change (e.g. adding a single extra flag).

There is a per-node "context" already that can store arbitrary data, and this reserved space isn't public, so this API is already a bit suspect.

The only place it is used is in instrumentation in fbandroid, enabled only in benchmarks, to store an enum to forward to QPL for what framework it thinks created the Yoga Node.

This is already broken for React Native (worked for Paper only), and afaict isn't used anywhere. But it also has little reason to be caching more information on the node (beyond maybe saving a couple memory accesses) since it derives this information from the node config already.

This removes the field.

Changelog:
[Internal]

Reviewed By: rshest

Differential Revision: D45137133

fbshipit-source-id: 75755b21102f7928b3ad947051c35b1a6566ef40
2023-04-21 13:54:50 -07:00
Samuel Susla bd64699f0a Reset internal state of RCTScrollViewComponentView in scrollViewDidEndDragging
Summary:
changelog: [internal]

`_isUserTriggeredScrolling` must be NO when user interaction stops. This was not the case when user scrolled -> lifted finger but the scroll did not decelerate into position. The case with deceleration is handled in method `scrollViewDidEndDecelerating`.

Reviewed By: javache

Differential Revision: D45147325

fbshipit-source-id: 1b55dc708c4c7d6cffa917a822eb2b569b22dbb2
2023-04-21 10:43:17 -07:00
Samuel Susla 81d8992ceb Fix outdated viewport offset on Fabric surface (#37020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37020

changelog: [internal]

if host view's position on screen changes, `RootShadowNode` has to be notified of this. Otherwise the state of UI is not correctly reflected in ShadowTree, leading to inconsistencies. For example, when trying to get views position in window, it won't be correct when hosting view isn't full screen.
Overriding `setFrame` only works for cases where it is hosting view's parent changing its position. But there are other cases where the position may change on the screen, like when hosting view's parent is moved by movable navigation bar. This does not affect frame of hosting view but it does change its position on the screen. To know about this event, we need to override `layoutSubviews`. `layoutSubviews` is called by UIKit whenever its internal flag `_needsLayout` is set to YES.

Reviewed By: javache

Differential Revision: D45122502

fbshipit-source-id: b7b1b08a8b3accffce7e3c71f7d19887caf6462f
2023-04-21 10:43:17 -07:00
Nick Gerleman 516642c101 Remove YGTraversePreOrder (#37014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37014

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

This is unused, and kinda missed the intent of Yoga.h and YG* functions being a C ABI.

Reviewed By: rshest

Differential Revision: D45138646

fbshipit-source-id: 743e7d0f43c122932c3a6f43ce564c0f209b4771
2023-04-21 09:58:07 -07:00
Nicola Corti e242a65c5b Update actOnLabel to include the official reproducer (#37023)
Summary:
I'm adding a reference to our official template in the Needs: Repro label response

## Changelog:

[INTERNAL] - Update actOnLabel to include the official reproducer

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

Test Plan: n/a

Reviewed By: mdvacca

Differential Revision: D45183426

Pulled By: cortinico

fbshipit-source-id: cd97981eda49ff7123f6beb05b6eb64b4899ded0
2023-04-21 09:35:16 -07:00
Ruslan Shestopalyuk 2058da8f20 Unrevert "use stable sort for performance entries" (#37017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37017

Changelog: [Internal]

Re-submitting https://github.com/facebook/react-native/pull/36998, which was reverted earlier due to the internal compatibility check issues.

Reviewed By: cipolleschi

Differential Revision: D45177862

fbshipit-source-id: f47ef496e3d7531b5e077310c72def80b024be6e
2023-04-21 05:14:11 -07:00
Ruslan Shestopalyuk 10aad32bef Re-submit Performance.mark/duration argument removal from the API (#37016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37016

Changelog: [Internal]

Re-submitting https://github.com/facebook/react-native/pull/36997, which was reverted earlier due to the internal compatibility check issues.

Reviewed By: cipolleschi

Differential Revision: D45177697

fbshipit-source-id: 9a4a55e45d4530770b16247374d03bd4ccc7fa21
2023-04-21 05:14:11 -07:00
Nicola Corti 74f256b6f0 Gradle to 8.1 (#37018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37018

Just bumping Gradle version to the latest stable.
This brings configuration caching as stable, which is quite of a big deal.

Changelog:
[Android] [Changed] - Gradle to 8.1

Reviewed By: yungsters

Differential Revision: D45177537

fbshipit-source-id: 6a47208b69d5591d299451e5a610cc3f5e9afe66
2023-04-21 04:52:54 -07:00
Christoph Purrer 57c36927f7 Fix jsErrorHandler/JsErrorHandler.h import error on Windows (#37012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37012

Changelog: [Internal]

Our default clang compiler setting on Windows doesn't allow to mismatch folder and headername space naming conventions

Reviewed By: yungsters

Differential Revision: D45165950

fbshipit-source-id: 459848960513bd06ad0c2dbaef5d8c44305e4567
2023-04-21 01:33:20 -07:00
David Vacca 363224ea62 Deprecate EventBeatManager constructor (#36905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36905

In this diff I'm deprecating EventBeatManager constructor that receives a Context as a parameter.

bypass-github-export-checks

changelog: [Android][Deprecated] deprecating EventBeatManager constructor that receives a Context as a parameter.

Reviewed By: fkgozali

Differential Revision: D44759827

fbshipit-source-id: cb117c26af0a43fe245f8778a55dfbea756b3ce6
2023-04-20 19:43:33 -07:00
Nick Gerleman 4ae77c0ad4 Remove BitUtils Usage in YGNode (#1250)
Summary:
X-link: https://github.com/facebook/yoga/pull/1250

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

BitUtils functions in Yoga are like bit fields, with more steps, and more error prone (you need to work with explicit offsets which can be tricky for anything variable length). Replace usage with a bitfield struct. Eventually I'd like to remove the BitUtils functions in general.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D45133645

fbshipit-source-id: aa1430df5e2fb71ed9d2a5f5b1a35429b71c7069
2023-04-20 17:38:55 -07:00
David Vacca 4260494574 Refactor FabricUIManager (#37011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37011

Refactor FabricUIManager to use labmda and remove lint warnings

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D45164998

fbshipit-source-id: 56ee5b4d9d2c234c517757a8963f03443e5935d4
2023-04-20 17:18:51 -07:00
Phillip Pan 2fe14df09a properly format pragma marks
Summary:
Changelog: [Internal]

so ANNOYING

Reviewed By: christophpurrer, sammy-SC

Differential Revision: D45022199

fbshipit-source-id: 367a9b652987e1590a966928870de1ba61a4bad3
2023-04-20 16:26:38 -07:00
Phillip Pan 5a7799eead make getModuleInstanceFromClass: required
Summary:
Changelog: [iOS][Breaking]

continuing getting rid of optional methods, but this does have a behavioral change. if the delegate does not provide the module instance, then we lazily create it. before we were returning nil, idk why. this will be a breaking change if you have any classes that conform to `RCTTurboModuleManagerDelegate`

#saynotoruntimechecks

Reviewed By: cipolleschi

Differential Revision: D45022139

fbshipit-source-id: 9635332caf3db7bb9306f99ee5c0d577091d38ea
2023-04-20 16:26:38 -07:00
Phillip Pan fbf196dd05 make getModuleClassFromName: required (#36968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36968

Changelog: [iOS][Breaking]

we should be using `optional` never. this will be a breaking change if you have any class that conform to `RCTTurboModuleManagerDelegate`

#saynotoruntimechecks

Reviewed By: cipolleschi

Differential Revision: D45022003

fbshipit-source-id: d1b3cf72bae82070704f20de4558949189da462a
2023-04-20 16:26:38 -07:00
David Vacca fce5aa7c5f Reduce Visibility of public API (#37008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37008

Reduce Visibility of public methods that should be private

changelog: [Internal] internal

Reviewed By: luluwu2032

Differential Revision: D45153669

fbshipit-source-id: 2177a114eaa701d79a21d8a25bd299bf681dc4b8
2023-04-20 16:11:54 -07:00
Oleksandr Melnykov 9e0d198727 Back out "Clean up uneeded "duration" parameter from the Performance.mark API"
Summary:
Changelog: [Internal]

Original commit changeset: ce3d14940124

Original Phabricator Diff: D45141978

Reviewed By: GijsWeterings

Differential Revision: D45161958

fbshipit-source-id: 22d79e8e8d0670fd220391f7e5ea92ca257ff982
2023-04-20 15:36:16 -07:00
Oleksandr Melnykov d77798b270 Back out "Use stable sort for performance entries"
Summary:
Changelog: [Internal]

Original commit changeset: 77ff0093bead

Original Phabricator Diff: D45142500

Reviewed By: GijsWeterings

Differential Revision: D45161907

fbshipit-source-id: 546d36a8d1f2bf8c8e26279b172f62e303b51dc0
2023-04-20 15:36:16 -07:00
Christoph Purrer 65f5cd7995 Use C++17 namespace format everywhere (#36987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36987

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D45130727

fbshipit-source-id: 66f9fbd2a3a5f4d637b59bee77d085a35117d69d
2023-04-20 14:19:50 -07:00
Nick Gerleman da71c40f81 Undeprecate Config setting APIs (#1251)
Summary:
X-link: https://github.com/facebook/yoga/pull/1251

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

YGNode::setConfig was deprecated as part of D15416474 in an apparent goal to remove config pointers per-Node.

While I don't know the history of the motivation here, these config pointers were never removed, and we will be doubling down on per-node configs for StrictLayout, so we will want to undeprecate this.

This also exposes functions to the public C ABI, but I didn't spend the effort to create language projections for it.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D45133646

fbshipit-source-id: 2bb15c4825717793529cdad8542447d11e723e35
2023-04-20 14:01:14 -07:00
Tim Yung f84256a924 RN: Upgrade to deprecated-react-native-prop-types@4.1.0
Summary:
Upgrades React Native to `deprecated-react-native-prop-types@4.1.0`, which includes many of the new prop types in React Native v0.72.

See: https://github.com/facebook/react-native-deprecated-modules/blob/main/deprecated-react-native-prop-types/CHANGELOG.md

Changelog:
[General][Changed] - Upgrade to deprecated-react-native-prop-types@4.1.0

Reviewed By: rickhanlonii

Differential Revision: D45155955

fbshipit-source-id: 36e715c2338b667755bd1e522b7d5a2611103779
2023-04-20 13:19:41 -07:00
Ramanpreet Nara eab32f19af Report loaded modules when first module load fails (#36980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36980

With the TurboModule interop layer, some modules aren't being loaded at all. This logging will help us root cause the problem: is the issue with the TurboModule system, or with instantiating a particular module.

Changelog: [Internal]

Reviewed By: cortinico, mdvacca

Differential Revision: D45102812

fbshipit-source-id: 5c5f55d5857c694270a83c38b68cae0fdb2c3b50
2023-04-20 11:58:26 -07:00
Ramanpreet Nara 963739047b Separate turbo and legacy module caches (#36986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36986

global.nativeModuleProxy and global.__turboModuleProxy should not share the same cache.

Otherwise, global.nativeModuleProxy could return TurboModules, and global.__turboModuleProxy could return legacy native modules.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D45131296

fbshipit-source-id: 472059dc95d760a5eb8fc376606b30e614ee86c5
2023-04-20 11:42:21 -07:00
Ramanpreet Nara 0c1b7d374c Simplify the gating for the Fb4a TurboModule interop test (#36985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36985

This diff simplifies TurboModuleManagerDelegate. Now, it doesn't do any filtering.

What TurboModuleManagerDelegate does:
- If the TurboModule interop layer is on, getLegacyModule(moduleName) starts returning legacy modules.
- If the TurboModule interop layer is off, getLegacyModule(moduleName) returns null.

This should help with T144183369. In that crash, some native modules are returned as null. And complicated filtering could be a contributor to that problem. So, simplifying filtering might mitigate that issue.

Even if it doesn't, this makes the TurboModuleManager easier to understand, which makes root causing/mitigating that problem easier.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D45131297

fbshipit-source-id: 9e37804e09c9f04ab0610f5b444574ae65c9d638
2023-04-20 11:42:21 -07:00
Oleksandr Melnykov 53d3629a65 Back out "Link to fbsource"
Summary: Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D45149829

fbshipit-source-id: 915ddb7d3027cff822aff57a5b8abaca1d6cb12e
2023-04-20 11:15:51 -07:00
yaqi.liu 5059ddc5ce KeyboardAvoidingView: update bottom height when frame height is changed (#36970)
Summary:
Fix this issue: https://github.com/facebook/react-native/issues/29499

- We should change the bottom height if the frame height of KeyboardAvoidingView is changed

In some scenarios, the height of `KeyboardAvoidingView` would be changed because its container is re-layouted. So `onLayout` of `KeyboardAvoidingView` may be triggered more than once.

https://github.com/facebook/react-native/blob/bbc3657ff4efd0218e02ad9a3c73725a7f8a366c/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js#L114-L125

But at line 122 above, `_updateBottomIfNecessary ` would be called only for the first trigger of `onLayout`. That means, if the height of `KeyboardAvoidingView` is changed, the bottom height can't be updated.

#### See the videos below:

##### before

In this video, `KeyboardAvoidingView ` is rendered twice, and the height is changed from 844 to 753, `bottomHeight ` is not updated when the height changed, so there is a white gap below the `continue` button. Once I re-open the keyboard, `_updateBottomIfNecessary` is called again, then the white gap disappeared.

https://user-images.githubusercontent.com/25719782/232962924-c69adc11-deb9-4426-9b5c-4e990a0470db.mp4

##### after

https://user-images.githubusercontent.com/25719782/232962956-a163020f-5f40-4d82-9f6c-5ee67416c489.mp4

## Changelog:

[GENERAL] [CHANGED] - change `_onLayout` to update bottom height when frame height is changed

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

Reviewed By: rshest

Differential Revision: D45138176

Pulled By: NickGerleman

fbshipit-source-id: b7ce6d75622ed6e8f104ae0d8441e1cb97cfa15b
2023-04-20 10:46:54 -07:00
Nick Gerleman 290774fd80 Do not run OSS changelog validator on diffs exported from Phabricator (#36994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36994

We already run changelog validation internally which has specific exemptions for codemods and dirsynced directories. Do not run twice, now that we need to export diffs.

An alternative solution would be to port the logic to the OSS changelog generator and stop running the internal one, but that would increase latency, and we have made fixes to the internal once as recent as two weeks ago in D44746795.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D45135111

fbshipit-source-id: e23c2613b183f75a148d1b38b31c259acc9c9fc5
2023-04-20 10:11:43 -07:00
Ruslan Shestopalyuk 8e046cbbd7 Use stable sort for performance entries (#36998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36998

For performance entries that have the same start/end time it makes more sense to report them back to `PerformanceObserver` in the same order they were logged.

This kind of determinism is arguably better both in terms of API, and from the point of view of testing.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D45142500

fbshipit-source-id: 77ff0093bead45dc2f15efc4b903dc181927565a
2023-04-20 10:05:53 -07:00
Samuel Susla 1250b8afb1 Revert D45145742: Synchronously flush the transition lane scheduled in a popstate event (#26025)
Differential Revision:
D45145742

Original commit changeset: 196fe3539ee8

Original Phabricator Diff: D45145742

fbshipit-source-id: ad9e911cf702f539e44d785db030d664a48ebe42
2023-04-20 09:11:41 -07:00
acdlite 7f495a3cf2 Synchronously flush the transition lane scheduled in a popstate event (#26025)
Summary:
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn debug-test --watch TestName`, open
`chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

Browsers restore state like forms and scroll position right after the
popstate event. To make sure the page work as expected on back or
forward button, we need to flush transitions scheduled in a popstate
synchronously, and only yields if it suspends.
This PR adds a new HostConfig method to check if `window.event ===
'popstate'`, and `scheduleMicrotask` if a transition is scheduled in a
`PopStateEvent`.

## How did you test this change?

yarn test

DiffTrain build for commit https://github.com/facebook/react/commit/d121c67004a2e6b0bb5d341843663ef213f64863.

Reviewed By: kassens

Differential Revision: D45145742

Pulled By: sammy-SC

fbshipit-source-id: 196fe3539ee8588a31012d6af86a5ce0cd7fc973
2023-04-20 07:53:57 -07:00
Lulu Wu 8f0307b124 Add bolts task files as internal dependency (#36824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36824

After this diff, RNTester Android can build successfully, and it should be safe to land this stack to move Venice Android to OSS folders

Changelog:
[Android][Changed] - Add bolts task files as internal dependency

Reviewed By: cortinico

Differential Revision: D44729814

fbshipit-source-id: 80926dc548bb269bb9c69efab4c7620a3fb9fdc2
2023-04-20 07:53:37 -07:00
Facebook Community Bot 5428b55113 Re-sync with internal repository (#37005)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2023-04-20 19:14:31 +01:00
Samuel Susla 2d9c81780c Initialise ScrollView state with content offset from props (#36961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36961

changelog: [internal]

Initial state must reflect content offset, otherwise ShadowTree will not know about the contentOffset until user scrolls.

This was affecting both, iOS and Android.

Reviewed By: mdvacca

Differential Revision: D45087358

fbshipit-source-id: 8812c2d3fe97e017938a9a81acbb31d579a00d45
2023-04-20 07:36:59 -07:00
Alex Hunt 6971540c90 Rename "Debug Menu" title to "Dev Menu" on iOS (#36981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36981

We are (following a quick internal RFC) looking to standardise the term "[in-app] [Developer|Debug] menu" to "Dev Menu" in the React Native Debugging docs (and all docs references). (Indeed, the prevalent existing use in docs was already "Developer menu".) This PR aligns naming in the `RCTDevMenu` component on iOS.

See also https://github.com/facebook/react-native-website/pull/3692.

Changelog:
[iOS][Changed] - Rename "Debug Menu" title to "Dev Menu"

Reviewed By: christophpurrer

Differential Revision: D44872456

fbshipit-source-id: c222bb2c551a4f434a1dc0efbb8d4f75c785aa11
2023-04-20 07:16:02 -07:00
Ruslan Shestopalyuk dec8562494 Clean up uneeded "duration" parameter from the Performance.mark API (#36997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36997

I've noticed that `Performance.mark`, for some reason, has been using an explicit `duration` parameter throughout, whereas it doesn't really make sense - neither from the web standard perspective, nor in general.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D45141978

fbshipit-source-id: ce3d149401249882f673c4bb6727eb1560469fa3
2023-04-20 06:31:27 -07:00
Lulu Wu 244c9ff549 Move QPL bindings to internal
Summary:
Changelog:
[Android][Changed] - Move QPL bindings to internal

Reviewed By: RSNara

Differential Revision: D45046703

fbshipit-source-id: 6383c718bf75dd6436136cdc881c9f59f18a452f
2023-04-20 04:39:08 -07:00