Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39021
Changelog: [Internal] - Refactor conditional pointer event emitting to the C++ layer
Some background: early on in the implementation of Pointer Events a concern was brought up that events related to hovering pointers could saturate the JS thread if they were fired all the time unconditionally, so as a mitigation we would check in native to see if listeners in the tree were listening for those events and only fire them if there were listeners.
Now since we're going to be moving some of the event derivation logic to the C++ layer we need to receive all the events — but recreate the conditional firing in the C++ layer so we can still avoid saturating the JS thread. That's what this diff does.
The only change I see being potentially contraversial is the fact that I needed a way to turn an EventTarget (the only information I receive regarding which node the event is firing on) to its cooresponding ShadowNode which I did in the method GetShadowNodeFromEventTarget. It essentially does the exact same thing the getNodeFromInternalInstanceHandle method in ReactNativePublicCompat.js, but in C++ against the JSI API. I don't know if there's a better way to do this but this was the best one I came up with that actually works.
(This is a second attempt at landing D48288752 which had to be backed out. It should be fine this time because of D48331909 which this diff now depends on)
Reviewed By: rozele
Differential Revision: D48322586
fbshipit-source-id: 7674c123e96ae71b18c8a3a780667ffaa2f25e7c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39091
Changelog: [Internal]
Adds a simple typed logging hook to `react-native/dev-middleware`. This is intended to allow integrators to receive events from the dev server, apply any relevant sampling/processing, and log them to a backend. (To be clear, the open source version of React Native does not and will not collect any data.)
WARNING: The API will evolve over the coming weeks/months and is *not guaranteed to be stable* - it might even break between patch releases.
Reviewed By: huntie
Differential Revision: D48466760
fbshipit-source-id: ed1e21fb0dac5d6199ff1ee26017a1d33d9b7d92
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38922
Changelog: [Internal]
This diff alows react-native to use its own copy of JSI from `ReactCommom/jsi` instead of consuming headers vendored with Hermes.
Reviewed By: NickGerleman
Differential Revision: D48152876
fbshipit-source-id: 89c7eaf899b5bfc262fbb06517db260abcc18592
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38920
Maven does not provide stable URLs for stored artifacts. Instead there can be a series of redirects for the actual download URL.
CocoaPods does not follow redirects when such URL is set as a `source` in a `podspec`. To mitigate that we download Hermes prebuild manually, and that set the `source` to that file.
This diff removes this manual download step, and utilizes `curl` to resolve redirects, and then assign final endpoint to `source[:http]` of the `hermes-engine.podspec`.
Changelog: [Internal] - Resolve redirects instead of manually downloading nightly Hermes.
Reviewed By: cipolleschi
Differential Revision: D48225199
fbshipit-source-id: d13f9ef79f7c89c317b854da1170ca8321823d8a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39061
We're suppressing JVM tests using BUCK which is causing misalignment between which tests we run on Buck vs Gradle.
Instead we should be using the Ignore annotation (which we already do) to decide which tests to skip, so that Buck can just pick all the Java/Kotlin file in this folder.
Changelog:
[Internal] [Changed] - Cleanup BUCK setup for our JVM tests
Reviewed By: cipolleschi
Differential Revision: D48433432
fbshipit-source-id: 31070ef848932aefa5d2710a8e11f97646e4b51c
Summary:
For some reason, the module registry is nil inside RCTDeviceInfo.
**Hypothesis:** DeviceInfo is outliving React Native teardown (somehow).
This diff adds additional logging inside RCTDeviceInfo so that we could better undersatnd the problem.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D48237716
fbshipit-source-id: 459306dab5cddd4da50ed767087b93e33085be67
Summary:
RCTExportedDimensions doesn't need access to the ModuleRegistry, or the bridge. It just uses those two things to get the fontScale.
We could make RCTExportedDimensions easier to understand, by making it do fewer things (i.e: computing the fontScale up front, and passing it into RCTExportedDimensions). Let's just do that.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D48237715
fbshipit-source-id: b3af648d88276846742d0e1192d33d180ee49dbb
Summary:
Migrate Java tests to Kotlin for the JSDebuggerWebSocketClient class.
## Changelog:
Pick one each for the category and type tags:
[ANDROID] [CHANGED] - Update Java tests to Kotlin for the referenced file
Pull Request resolved: https://github.com/facebook/react-native/pull/38941
Test Plan: All unit tests passed.
Reviewed By: mdvacca, rshest
Differential Revision: D48354172
Pulled By: cortinico
fbshipit-source-id: e8d3c98216b4e2c3ff462433c7e37d628d06f0c6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39045
## Context
RFC: Decoupling Flipper from React Native core: https://github.com/react-native-community/discussions-and-proposals/pull/641
## Changes
- Relocates `metro-inspector-proxy` source from the Metro repo into the React Native repo as part of the `react-native/dev-middleware` package.
- Drops the `runInspectorProxy` entry point.
- Attaches the Inspector Proxy to the `createDevMiddleware()` API as the new integration point for this functionality.
- Documents migrated endpoints + usage of `createDevMiddleware()` in README.
Changelog: [Internal]
Metro changelog: None (`metro-inspector-proxy` is now an internal component of `react-native`, covered in the [release notes for 0.78.1](https://github.com/facebook/metro/releases/tag/v0.78.1))
Reviewed By: motiz88, blakef
Differential Revision: D48066213
fbshipit-source-id: 3fbef5d881f6f451cb5955dcbbc362c53347437e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39051
X-link: https://github.com/facebook/yoga/pull/1344
`YGJNILogFunc` has a bug where it uses a `va_list` to determine the length of a printf string, then reuses the same `va_list` later after it has already been iterated through. Even if no arguments are present, this may cause a crash looking something like:
```
C [libsystem_platform.dylib+0xf12] _platform_strlen+0x12
C [libsystem_c.dylib+0x31bf] __vfprintf+0x1339
C [libsystem_c.dylib+0x307ce] _vsnprintf+0x100
C [libsystem_c.dylib+0x6965] vsnprintf+0x44
C [libyoga.dylib+0x5161] YGJNILogFunc(YGConfig*, YGNode*, YGLogLevel, void*, char const*, __va_list_tag*)+0x59
```
Fixing this fixes crashing unit tests which are not explicitly disabled.
Reviewed By: yungsters
Differential Revision: D48388548
fbshipit-source-id: 492e7a89aeb5f9d15485ce31641875a295356bef
Summary:
## Summary:
The modal tester in the sandbox was lacking a bit of functionality that the Modal component exposes -- especially on Android. This change revamps the Modal page to more-closely resemble the API documentation by exposing all of the options, and annotating which ones are reserved for the different platforms.
Additionally, this change puts the modal controls into the created modal itself. This allows the user to more-easily test what happens if the props change during the lifespan of the modal (related PR: https://github.com/facebook/react-native/issues/38947).
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests -->
[INTERNAL] [CHANGED] - Revamp Modal tester in rn-tester
Pull Request resolved: https://github.com/facebook/react-native/pull/38977
Test Plan:
| Control page | Modal (with `transparent=true` on Android) |
|:--:|:--:|
|  |  |
Reviewed By: yungsters
Differential Revision: D48414351
Pulled By: NickGerleman
fbshipit-source-id: 54bece639f4c64132dfb21c54c91d46972f5a335
Summary:
An earlier [change](https://github.com/facebook/react-native/commit/8b1bf058c4bcbf4e5ca45b0056217266a1ed870c) I made (that huntie resubmitted) only works on Xcode 14.3+ (See more info [here](https://github.com/react-native-community/discussions-and-proposals/discussions/687)). This change adds the appropriate compiler checks so that the change is compatible with Xcode 14.2 and earlier, and therefore cherry-pickable to 0.71 and 0.72.
The check works by checking if iOS 16.4+ is defined, which is the closest proxy I could find for "Is this Xcode 14.3".
## Changelog:
[IOS] [CHANGED] - Guard `JSGlobalContextSetInspectable` behind a compile time check for Xcode 14.3+
Pull Request resolved: https://github.com/facebook/react-native/pull/39037
Test Plan: I can't actually test on Xcode 14.2 (it won't launch on my MacBook 😢), but I made a similar [PR](https://github.com/microsoft/react-native-macos/pull/1848) in React Native macOS, whose CI checks run against Xcode 14.2 and I'm getting passing checks there.
Reviewed By: huntie
Differential Revision: D48414196
Pulled By: NickGerleman
fbshipit-source-id: ba10a6505dd11d982cc56c02bf9f7dcdc104bbec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38937
It is a logic error to query for list metrics when a valid list content length has not yet been observed.
An invariant is meant to catch this if it happens, but a non-default orientation causes us to zero out a value which is null, and our null check does not catch this, and we return a nonsense value.
Change from zeroing out the field to nulling it out instead.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D48251645
fbshipit-source-id: 5c7e16f694db4ddb0d37b6092de2e75ee8d6c7d3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38323
This change makes the returned values from `performance.reactNativeStartupTiming` to accept null or undefined. This is done as some platforms may not have certain startup timing information, and as a default value, it's discussed that null/undefined is better than zero.
- Use `unorderedMap` instead of custom timing object for the C++ native module return value
- Use `std::nan` as initialized value for unset doubles
- Update examples to reflect the latest changes
Changelog:
[General][Internal] - Make the return values for `reactNativeStartupTiming` possible to be null or undefined
Reviewed By: mdvacca
Differential Revision: D43885535
fbshipit-source-id: f35292f2e9cdf98750d0d80b9e3bcdcddc560fb7
Summary:
Converts ReactPropConstantsTest to Kotlin, as requested in https://github.com/facebook/react-native/issues/38825
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [CHANGED] - Convert ReactPropConstantsTest to Kotlin
[INTERNAL] [CHANGED] - Add null-check to ViewManagersPropertyCache.java
Pull Request resolved: https://github.com/facebook/react-native/pull/39005
Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test`.
2. All tests should pass.
Reviewed By: mdvacca, rshest
Differential Revision: D48430460
Pulled By: cortinico
fbshipit-source-id: cc425f14bf15ec6e5a334c631d52ca962d06a2a9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38868
## Changelog:
[iOS][Breaking] - After [#38864](https://github.com/facebook/react-native/pull/38864), these are not needed anymore. there's some logic with the bridge, but since we're treating new arch as one piece moving forward, i don't really think they're that important. plus that logic is like really old.
Reviewed By: mdvacca
Differential Revision: D48140101
fbshipit-source-id: 0137becbfca493589d20f9ac8abace2b4c908ddd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38866
## Changelog:
[iOS][Breaking] - Remove sizeMeasureMode argument from RCTSurfaceHostingProxyRootView constructor
All callsites to `initWithSurface:sizeMeasureMode:moduleRegistry` pass down `RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact`. since that's the case, let's simplify the constructor since `initWithSurface:` passes that value by default.
Reviewed By: sammy-SC, cipolleschi
Differential Revision: D48140102
fbshipit-source-id: c3240ad4c1e650397844837e4a071ff7bd26ee15
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39030
D29164056 fixed `scrollTo` coordinate space in RTL, but D38499666 regressed it by adding a comparison before the RTL conversion happens.
This makes `scrollTo` no-op if we are scrolling from the beginning to the end of the list, since the end of the list is `x: 0` in cartesian coordinates, and the start of the list is `x: 0` in flow-relative coordinates.
Do coordinate conversion before the early exit check.
Changelog:
[iOS][Fixed] - Fix bad comparison in RCTScrollViewComponentView RTL
Reviewed By: rshest
Differential Revision: D48378414
fbshipit-source-id: 14b0b9bb3b22828c290bbbc93b907d8c0e264995
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38864
## Changelog:
[iOS][Breaking] - Deleting RCTFabricSurfaceHostingProxyRootView
We currently have 3 different container view classes in new architecture: `RCTFabricSurfaceHostingProxyRootView`, `RCTSurfaceHostingProxyRootView`, and `RCTSurfaceHostingView`. it's a little complicated for the current use case, so there's an opportunity to simplify.
in this PR, i get rid of `RCTFabricSurfaceHostingProxyRootView` by relying on the composable behavior of surface and host views instead of existing internal reflection logic that depends on inheritance. these are cleaned up in D48140101 and D48140317.
i checked GH search and no one is really using this in a fundamental way.
bypass-github-export-checks
Reviewed By: cipolleschi
Differential Revision: D48139820
fbshipit-source-id: 068b994a8b068a4107397f1862356b8fa1da961f
Summary:
changelog: [internal]
In D47993140 I removed FabricViewStateManager but made a mistake during refactoring in one of the conditions that detects if we are in paper or fabric.. This fixes it.
Reviewed By: cipolleschi
Differential Revision: D48390478
fbshipit-source-id: ff6e728f3eaae755b2200e9cd8edd3acdc4708aa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39022
Fixes a possible NullPointerException thrown when trying to access the binding after the instance has been destroyed to report mounts.
I added a check for the mount item just in case 😅
Changelog: [internal]
Reviewed By: lenaic
Differential Revision: D48355738
fbshipit-source-id: 401d2e0a52b0764ed89498ecc0176d160226e509
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38732
Unit tests for cell offset APIs. Mostly the same as previous UTs for VirtualizedList a layer higher.
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D47978633
fbshipit-source-id: 8cb8a2e8125bc7370eabf9f01a3f7529043171c2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38936
Unit tests that validate we continue to return correct measurement results through the lifetime of the list when cells are unmounted, or layout of the list shifts.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D47978632
fbshipit-source-id: b700fafb699e8820de6825f0ead1ef02c6d8f168
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38858
Pull Request resolved: https://github.com/facebook/react-native/pull/38328
This diff adds the two extra markers `initializeRuntimeStart` and `initializeRuntimeEnd` to the startup performance API. The runtime start time matches the existing android marker `GET_REACT_INSTANCE_MANAGER_START`, which is the first marker we have on the RN android app.
Changelog:
[Android][Added] - Add `performance.reactNativeStartupTiming.initializeRuntimeStart` and `performance.reactNativeStartupTiming.initializeRuntimeEnd` API
Reviewed By: rshest
Differential Revision: D47941110
fbshipit-source-id: d7e65f822f1c60a46dccacc8fd5bba84174f9f31
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39012
Upgrades many of our projects to `v8-compile-cache@^2.4.0`, which includes [zertosh/v8-compile-cache#45](https://github.com/zertosh/v8-compile-cache/pull/45). This fixes a very opaque segmentation fault when `v8-compile-cache` is used on Apple Silicon with mixed architecture modes.
This also upgrades our projects to `eslint@^2.3.1`, which no longer has the dependency on an outdated version of `v8-compile-cache`.
Changelog:
[Internal]
Reviewed By: zertosh, NickGerleman
Differential Revision: D48336030
fbshipit-source-id: afa73d1f00bff826a8b76fa09949b9d35a97905b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39008
Changelog: [Internal] - Adjust RawPropsPropNameLength's type to account for increased number of props
While investigating why we needed to back out D48288752 I discovered that the root cause was that the `items_` vector in `RawProsKeyMap` was now a size greater than 255 which becomes an issue because `items_`'s indices are statically cast to `RawPropsPropNameLength` (previously alias to `uint8_t`).
This diff updates `RawPropsPropNameLength` to be an alias to `uint16_t` so the current issue is resolved as well as adding an assert to ensure (however unlikely) that this happens again.
Reviewed By: rozele
Differential Revision: D48331909
fbshipit-source-id: f6bc3e4825f2f293d79d8cd90c40ced7cba0e3c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38992
This Diff publishes the Hermes dSYMs to Maven while doing a release.
These were missing and so the Stack traces can't be fully symbolicated when a crash occurs.
## Changelog:
[Internal] - Publish dSYM to Maven
Reviewed By: cortinico
Differential Revision: D48309198
fbshipit-source-id: a5514e544587daadd0a0d7614f25a30fccd16a5b