Summary:
[Codegen 138] This PR introduces `getProperties` to Parser base class and implements the function in Typescript and Flow Parsers.
This PR also gets rid of `getProperties` from :
- `packages/react-native-codegen/src/parsers/typescript/components/componentsUtils.js`
- `packages/react-native-codegen/src/parsers/flow/components/componentsUtils.js`
and updates the usages with `getProperties` from the respective parser objects as requested on https://github.com/facebook/react-native/issues/34872
## Changelog:
[Internal] [Changed] - Add getProperties to Parsers base class and update usages.
Pull Request resolved: https://github.com/facebook/react-native/pull/37633
Test Plan:
Run yarn jest react-native-codegen and ensure CI is green
## Screenshot of tests passing locally:
![Screenshot 2023-05-31 at 4 38 41 PM](https://github.com/facebook/react-native/assets/64726664/dd660369-eabd-4c2e-a440-a41ed6f9d47a)
Reviewed By: cipolleschi
Differential Revision: D46322882
Pulled By: rshest
fbshipit-source-id: 5506ce5ff395946ea8c1258b152716fea0142b95
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37681
User who run their applications using `npx react-native ios` have the application going into the
background if there is inactivity on the device. This is common for users developing on device (why touch
the device if you're tweaking background colours, etc...).
If the application is build with Xcode directly, this is already managed. This change prevents the idle
timer from running in DEBUG builds.
## Changelog:
[iOS][Fixed] - Debug builds from cli disable idle to stop application going into background
Reviewed By: cipolleschi
Differential Revision: D46427401
fbshipit-source-id: 45969cd506a1b76bde3be81d27808bf0e792a817
Summary:
It is generally recommended to use "===" instead of "==" when comparing two strings
Pull Request resolved: https://github.com/facebook/react-native/pull/37673
Test Plan:
## Changelog:
[Internal] [Changed] - use TripleEqual instead of doubleEqual when comparing two string
Reviewed By: cipolleschi
Differential Revision: D46434681
Pulled By: cortinico
fbshipit-source-id: 70522a28799699854d2a4ab814e34ce796082025
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37685
I'm backporting this comming `60a452b4853dc5651c465867344904dd6fc86703`
from the release branch of 0.72-stable to main which fixes this issue
in the Android NDK:
https://github.com/android/ndk/issues/1740#issuecomment-1198438260
Changelog:
[Internal] [Changed] - Backport Hermes release fix on `main`
Reviewed By: mdvacca
Differential Revision: D46398346
fbshipit-source-id: 593ca9523cb223e7c2d9fe6cccc1abb3ed331203
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37309
### Stack
ARIA roles in React Native are implemented on top of accessibilityRole. This is lossy because there are many more ARIA roles than accessibilityRole. This is especially true for RN on desktop where accessibilityRole was designed around accessibility APIs only available on mobile.
This series of changes aims to change this implementation to instead pass the ARIA role to native, alongside any existing accessibilityRole. This gives the platform more control in exactly how to map an ARIA role to native behavior.
As an example, this would allow mapping any ARIA role to AutomationControlType on Windows without needing to fork to add new options to accessibilityRole.
It also allows greater implementation flexibility for other platforms down the line, but for now, iOS and Android behave the same as before (though with their implementation living in native).
### Diff
This enables the `role` prop in iOS. ARIA role strings become convertible to `UIAccessibilityTrait`, which is the sink of most of the roles. We keep a list of traits derived from `role` vs `accessibilityRole` on the view, then inval and apply the result any time the prop for either is set.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D45432530
fbshipit-source-id: ced5be06e319c0b967d7511293e14e05147e5759
Summary:
If an accessible link is ellipsized out of being rendered, the AccessibilityDelegate will still attempt to populate an accessibility node for it; doing so results in an invalid request to a TextLayout API, however, causing a crash. This crash occurs as soon as the element is rendered, so long as a Screen Reader (or app using similar a11y APIs) is enabled. This change uses a technique similar to those existing to make the node "blank" in such cases, so Talkback can filter it out—and, more importantly, not crash.
## Changelog:
[Android] [Fixed] - Fix links hidden via ellipsis crashing screen readers
Pull Request resolved: https://github.com/facebook/react-native/pull/37050
Test Plan:
- Added a block to the "Accessibility Android APIs" page in the rn-tester app. Without the changes to `ReactAccessibilityDelegate`, this component crashes the app; with the changes, the component renders without problem.
- You can also see the crash "in the wild" using [this Expo Snack](https://snack.expo.dev/dhleong/2d1407) that I put together when trying to isolate this issue.
Reviewed By: rshest
Differential Revision: D46206673
Pulled By: NickGerleman
fbshipit-source-id: 0eb3e735202ee6be5f931bbb4bb92c24e7458ea6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37556
Changelog: [Internal]
Before making this change, we need to publish `nightly` versions of all existing monorepo dependencies.
Reviewed By: hoxyq
Differential Revision: D46117197
fbshipit-source-id: bcf6364e068579e63ca19e8161dcd32de4353e56
Summary:
This diff fixes more bad type definitions that are previously hidden but will be exposed in the upcoming Flow 0.208.0
Changelog: [Internal]
Reviewed By: panagosg7
Differential Revision: D46382788
fbshipit-source-id: 50337ce5bc0f07ac5916a2d4b75eabf5e8e2e427
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37657
changelog: [internal]
Make React-debug into its own pod to align BUCK and cocoapods.
This is needed to reland RuntimeScheduler in the old architecture on iOS.
Reviewed By: rickhanlonii
Differential Revision: D46357876
fbshipit-source-id: 035aaaee8b4b106f873b4b30c8cb424867be066a
Summary:
When reverting the runtimescheduler fix, we forgot to remove some lines from the React-Fabric dependencies. This broke pod install and we have a red ci since then.
bypass-github-export-checks
## Changelog:
[iOS][Fixed] - fix React-Fabric dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/37652
Test Plan: CircleCI is green
Reviewed By: cipolleschi
Differential Revision: D46349504
Pulled By: sammy-SC
fbshipit-source-id: 8fc1bca7838a913adba702033d06dd02b93c31f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37646
I'm re-enabling a test that got disabled due to us not using mock-maker-inline in OSS. I'm also adding `mock-maker-inline` for OSS so it will be easier to convert tests to Kotlin as classes in Kotlin are final by default.
Changelog:
[Internal] [Changed] - Enable mock-maker-inline for Android JVM tests
Reviewed By: NickGerleman
Differential Revision: D46222913
fbshipit-source-id: b7da0616994888c2800c193a1bb8e233d2c18288
Summary:
The TurboModule interop layer on iOS will ship with a Bridge proxy.
The Bridge proxy is an object (see D46084318) that will try to simulate the Bridge's APIs, whenever possible, by delegating to Bridgeless abstractions.
## Changes
**Fact:** All FBiOS modules work with/without the bridge.
So, let's break down the Interop layer test group (i.e: interop on) into two groups:
- interop on, bridge proxy off
- interop on, bridge proxy on
## Benefits
This will speed up the production test, by allowing us to:
1. Isolate Interop issues to the bridge proxy faster.
2. Stabilize the TurboModule interop layer faster.
NOTE: This flag is temporary, and should be removed long-term: The TurboModule interop layer should ship with the bridge proxy enabled by default.
Changelog: [Internal]
Reviewed By: philIip
Differential Revision: D46088752
fbshipit-source-id: 1e161d49382635a44194166645c1a5d56d37b4de
Summary:
## Context
Product code can query the Bridge, or the TurboModuleManager, to see whether a native module has been initialized or not. But, this API doesn't exist in RCTModuleRegistry.
## Changes
This diff exports moduleIsInitialized: from RCTModuleRegistry. That way, RCTBridgeProxy (introduce in D46088752) can more easily implement the moduleIsInitialized: API.
Changelog:
[iOS][Added] - Introduce RCTModuleRegistry moduleIsInitialized:
Reviewed By: cortinico
Differential Revision: D46166548
fbshipit-source-id: c9954273e511083276aeb911dd58719cf4a11f10
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37643
We needed this change for offline mirrors which we don't use anymore, so we can remove
this extra dependency (it will make the build a little faster also which is never bad).
Changelog:
[Internal] [Changed] - Remove unnecessary dependency on aapt2-linux
Reviewed By: mdvacca
Differential Revision: D46318725
fbshipit-source-id: a86b43fff6a11844acff88791af0578d79d7fdbf
Summary:
As far as I'm aware, there's no way to know/guarantee whether a JavaScript callback can throw an exception or not.
So, all UIManager methods that synchronously invoke JavaScript callbacks cannot use noexcept.
If they do use noexcept, and the JavaScript callback (i.e: product code) throws an exception, the app will crash.
Changelog: [Internal]
Created from CodeHub with https://fburl.com/edit-in-codehub
Reviewed By: javache
Differential Revision: D46122985
fbshipit-source-id: 2f4356c7dbab1b3a5e0549f58e73f6de1b626ce9
Summary:
In this diff I analyzed bolts.Task class to ensure it's ready to be used from kotlin.
I won't convert bolts.Task to kotlin, but this is necessary to be able to convert its callsites (ReactHost) to kotlin
This is a 'continuation' of the previous diff, I splitted in 2 because Task is a very large class and it's worth analyzing separately.
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D46194126
fbshipit-source-id: 765af7683fa62814747c7d8516d311cffabac3c1
Summary:
In this diff I analyzed bolts library to ensure it's ready to be used from kotlin.
I won't convert bolts to kotlin, but this is necessary to be able to convert its callsites (ReactHost) to kotlin
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: fkgozali
Differential Revision: D46194127
fbshipit-source-id: 609e356230b1c87fe26571b811d23430d0168276
Summary:
Native error: `Declaration of 'atomic_bool' must be imported from module 'std.atomic' before it is required.`
## Changelog:
[IOS] [FIXED] - Add missing `atomic` import
Pull Request resolved: https://github.com/facebook/react-native/pull/37621
Test Plan: This build error appears to only occur when other build errors occur, but it supersedes the other build errors, increasing the difficulty of debugging the root build error(s).
Reviewed By: NickGerleman
Differential Revision: D46284208
Pulled By: sammy-SC
fbshipit-source-id: b36cb3a9166b1e7cef0121a2e635a191bd7c3a5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37522
This diff adds cross-platform Cxx binding helper and iOS specific implementation of `__nativeComponentRegistry__getNativeViewConfig` to JS runtime. This function provides native view config for a native component in bridgeless mode.
Changelog:
[Internal] - Introduce `__nativeComponentRegistry__getNativeViewConfig` in iOS.
Reviewed By: javache
Differential Revision: D43538804
fbshipit-source-id: 0aeca40c1c2a625eca5d60e466eb24df30453ba7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37410
Incremental adoption of new bridgeless API's, where they are semantically equivalent to the old one.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D45736529
fbshipit-source-id: e41f6840e7c329f6051530e53773fae760584842
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37616
Add tests in CircleCI to avoid that changes in Hermes can break the Xcode integration.
## Changelog:
[Internal] - Add CI tests to avoid to break the Hermes-Xcode integration
Reviewed By: cortinico
Differential Revision: D46265656
fbshipit-source-id: 176f1a33fe6944a68fb14b62e5c626fe30d296cc
Summary:
This (`greet.yml`) action requires some _changes_ to "repo" settings which are _out of maintainers' controls_.
So, instead of wasting compute; let's just delete this action :(
🤗🌏
## Changelog:
[GENERAL] [REMOVED] - [Actions] Remove `greet.yml` action
Pull Request resolved: https://github.com/facebook/react-native/pull/37587
Test Plan: - Not needed.
Reviewed By: cortinico
Differential Revision: D46275607
Pulled By: cipolleschi
fbshipit-source-id: 80880568cbae1158006445e078e638e4e375cb73
Summary:
In Xcode projects with multiple targets, and in particular when targets are for different platforms (e.g. iOS and macOS), Cocoapods may add a suffix to a Pod name like `React-Core`.
When this happens, the code in `new_architecture.rb` (which was looking for a pod with exact name `React-Core`) would not add the preprocessor definitions for Fabric as expected.
This change fixes this issue. Fixes https://github.com/facebook/react-native/issues/37102 .
## Changelog:
[iOS] [Fixed] - Fix Fabric issue with React-Core pod when Xcode project has multiple targets
Pull Request resolved: https://github.com/facebook/react-native/pull/37581
Test Plan: Tested that this change fixes this issue which occurs 100% of the time in React Native TV projects.
Reviewed By: dmytrorykun
Differential Revision: D46264704
Pulled By: cipolleschi
fbshipit-source-id: 8dfc8e342b5a110ef1f028636e01e5c5f2b6e2f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37614
changelog: [internal]
We do not control what `vImageBoxConvolve_ARGB8888` returns, it may return 0. If it does return 0, we will allocate memory chunk of size 0. Yes, malloc will let you do that. Well, it depends on the implementation, but according to the spec it is legal. The only requirement is to by able to call free on that without crash.
If `vImageBoxConvolve_ARGB8888` does return 0 and we allocate memory of size 0. Call to `vImageBoxConvolve_ARGB8888` with tempBuffer of size 0 will lead to a crash.
[The documentation](https://developer.apple.com/documentation/accelerate/1515945-vimageboxconvolve_argb8888#discussion) for `vImageBoxConvolve_ARGB8888` and tempBuffer states:
> To determine the minimum size for the temporary buffer, the first time you call this function pass the kvImageGetTempBufferSize flag. Pass the same values for all other parameters that you intend to use in for the second call. The function returns the required minimum size, which **should be a positive value**. (A negative returned value indicates an error.) The kvImageGetTempBufferSize flag prevents the function from performing any processing other than to determine the minimum buffer size.
I think the keyword word there is "should be a positive value". 0 is not a positive value.
Reviewed By: javache, yungsters
Differential Revision: D46263204
fbshipit-source-id: baa8fac5b3be6fb5bed02800cd725cc4cf43485a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37596
This commit is a backport of this [commit](32327cc177) so that we build the right version of hermes in CI.
This also bumps the hermes keys to make sure that we are building it properly from now on.
## Changelog:
[Internal] - Fix Hermes versioning and bump hermes workspace keys
Reviewed By: cortinico
Differential Revision: D46225179
fbshipit-source-id: f00c9d20d37f3bd5689e0742063f98e3bfe373c2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37572
Currently, RNTester was using a completely custom AppDelegate and not leveraging the RCTAppDelegate we use in the OSS. This resulted in a misalignment between the two setups and duplicated work to test stuff internally furst and then in the OSS, with some more time needed to understand why one setup was working and the other wasn't.
With this change, we are aligning the two, bringing RNTester closer to the OSS setup. There are still small differences, but we can iterate over those.
## Changelog:
[iOS][Changed] - Make RNTester use RCTAppDelegate
Reviewed By: cortinico
Differential Revision: D46182888
fbshipit-source-id: 7c55b06de1a317b1f2d4ad0d18a390dc4d3356a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37609
changelog: [internal]
Moving LayoutMetrics and LayoutPrimitives from core to graphics module.
This is to enable different implementation for different platforms.
Reviewed By: rubennorte
Differential Revision: D45904748
fbshipit-source-id: a4e666d7c7390e87abdb09235f96655b63f451f9
Summary:
I noticed this file was 4 years old in both React Native and React Native macOS, and figured it was safe to delete ¯\_(ツ)_/¯
Note from Eli: I wrote this thing years ago to see if we could generate docs based on our components. Never moved forward, lets delete it.
## Changelog:
[INTERNAL] [REMOVED] - Remove stale generated doc file
Pull Request resolved: https://github.com/facebook/react-native/pull/37053
Test Plan: N/A
Reviewed By: yungsters
Differential Revision: D46231152
Pulled By: TheSavior
fbshipit-source-id: c36a26ae7d7526305f73f1bd63f9d7223889e109
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37598
changelog: [internal]
This diff does three things:
- Makes dependency on `mapbuffer:jni` explicit for modules that were accessing it through `react:utils` module.
- `renderer:core` now depends on `mapbuffer:mapbuffer`.
- Moved `PropsMapBuffer` inside of `Props`.
Reviewed By: rubennorte
Differential Revision: D46223390
fbshipit-source-id: 2dca1a034f991afd3e9531c4c7fcc7b99239dabe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37588
The `const` modified in UIManagerCommitHook prevents us from mutating the commit hook itself (which doesn't make any sense as commit hooks might want to update their internal state as response to new commits).
This removes the constraint so we can remove the `const` modifier from `MutationObserverManager` in a future diff.
Changelog: [internal]
Reviewed By: sammy-SC
Differential Revision: D46149085
fbshipit-source-id: d3bf24f1125ad3878ca36a6ceb9dd509c3cf7b1e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37460
## Context
This implements the concept of mount hooks in UIManager which, similarly to commit hooks, receive a notification when a root shadow tree has been mounted in the host platform.
This is meant to be used internally in React Native, not by user-land libraries or products.
This will be used to implement `IntersectionObserver` in a following diff.
Changelog: [Internal]
Reviewed By: javache, sammy-SC
Differential Revision: D45866244
fbshipit-source-id: 4df48bf237a5cc89e37709faaeaa0ce582c0d0cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37461
This adds a feature flag to dispatch state updates for scroll position in every scroll position update in iOS, as opposed to only at the beginning, end and other specific moments.
This is necessary to implement features like `IntersectionObserver`, but we want to test the performance impact of this change before rolling it out completely.
Changelog: [internal]
Reviewed By: javache
Differential Revision: D45916675
fbshipit-source-id: 00a2b1c5ea03e45141bb2d81e4e5fb8c198de1ff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37435
We're implementing the `IntersectionObserver` API in React Native. That API reports the bounding rectangle of the root node and the target node (which we already implement in React Native via `LayoutableShadowNode::computeRelativeLayoutMetrics`), plus the intersection rectangle.
This adds a new option in `LayoutInspectingPolicy` so we can get the layout metrics when clipping is applied (e.g.: if a parent node has `overflow: hidden` and we get the layout metrics of one of its children that extends beyond the limits of the parent, it would report only the rectangle that's visible for that node).
Changelog: [internal]
Reviewed By: sammy-SC
Differential Revision: D45866245
fbshipit-source-id: ed3bfc2021e6b7819b8efea6fa3a81ed9d0bb181
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37436
When testing the reported intersections from `IntersectionObserver` I realized that the reported rectangles were incorrect when using `scale` in a parent. This is because `scale` transforms use the center of the node as the origin, and when applying the transform on its children we were using the center of the children instead of the center of the same node.
This fixes that issue by using the center of the parent when applying the transform on the children.
Changelog: [General][Fixed] - Fixed computation of layout via `ref.measureRelative` and `ref.measureInWindow` for nodes with scale/rotate transforms in their parents.
Reviewed By: sammy-SC
Differential Revision: D45866231
fbshipit-source-id: 68928cbaca28c21155657d276cf8ddd2129d9668
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37434
We'll be using this method in IntersectionObserver to avoid having to get the list of ancestor multiple times when calling computeRelativeLayoutMetrics for the target bounding rect and for the intersection rect.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D45866232
fbshipit-source-id: 0efa165b780e819bf19028fecd22b303ca6f52ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37594
This change add a test in circleCI to make sure that we don't break the integration between RNTester Hermes and Xcode
## Changelog:
[Internal] - Add circleci test to track the integration between Xcode and Hermes
Reviewed By: dmytrorykun
Differential Revision: D46225044
fbshipit-source-id: 265364a0b4c187ba20b5591b83c63896935a5184