Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37744
This diff introduces the new generic class BoltsFutureTask<> that will be used by ReactHost to expose async task in its API.
The goal of BoltsFutureTask is to avoid leadking the bolts.Task dependency into the ReactHost API.
Public methods of this class follow the spec defined in the Future interface, see: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html. I didn't add javadocs to avoid duplicated documentation with Future and also
becuase this is private class.
Task Cancellation follows the patters defined in bolts documentation: https://github.com/BoltsFramework/Bolts-Android#cancelling-tasks
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D46170466
fbshipit-source-id: eed92584bcd3ff0145e7cbb5d735139fbb6b0f33
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37638
Changelog: [Android] [Fixed] - W3CPointerEvents: properly update hit path during native gestures
Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).
Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).
Reviewed By: javache
Differential Revision: D46226021
fbshipit-source-id: de796217bac27b169ccf9ed5e0df85f7b63d8c5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37626
`inspector_->connect` can return `null` when the connection fails. Check for `null` and raise an exception (preventing a later crash when the `null` connection is used).
Changelog: [Internal]
Reviewed By: voideanvalue
Differential Revision: D46126080
fbshipit-source-id: 42e08687b4d425dd87642cf6b61f675e77c738ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37687
We end up creating a stub RuntimeExecutor wherever we configure this, and might as well pass in the runtime directly, to match the other binding installer signatures.
Changelog: [iOS][Deprecated] Use -[RCTTurboModuleManager installJSBindings:] instead of -[RCTTurboModuleManager installJSBindingWithRuntimeExecutor:]
Reviewed By: philIip
Differential Revision: D46390501
fbshipit-source-id: df7644ccbd04462dbbe752c60e5d5961ab50dff5
Summary:
We haven't really used this macro, so it's safe to remove as of now.
Changelog:
[Internal] [Changed] - Remove CircularDepsValidator.cmake as is not needed
Reviewed By: javache
Differential Revision: D46443083
fbshipit-source-id: 2a48749d7af31c393828668006d53c7a6755ac5d
Summary:
[Codegen 132] This PR introduces `emitMixedProp` to parser-primitives and abstracts the logic out of typescript and parser events as requested on https://github.com/facebook/react-native/issues/34872
## Changelog:
[Internal] [Changed] - Add emitMixedProp to parser-primitives and update usages.
Pull Request resolved: https://github.com/facebook/react-native/pull/37608
Test Plan:
Run yarn jest react-native-codegen and ensure CI is green
## Screenshot of tests passing locally:
<img width="1182" alt="Screenshot 2023-05-28 at 12 46 49 PM" src="https://github.com/facebook/react-native/assets/64726664/dbea4daf-d954-4c7f-b121-c6aad1fb318e">
Reviewed By: dmytrorykun
Differential Revision: D46275638
Pulled By: cipolleschi
fbshipit-source-id: 803d82055c7925e49aca1f408b5c7a50c687349a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37667
Changelog:
[Android][Fixed] - Fixing line truncation issue in Text containing /n when numberOfLines = {1}
When the text has multiple lines (with new line characters \n to hard-break the lines), and the first line is short enough to fit, Text component with `numberOfLines = {1}` doesn't display "..." at the end and rather disrespects the /n character.
With `numberOfLines = {1}`, On iOS it translates to
`line 1`, on Android & Web it translates to `line 1 line 2...`
**Expected Behavior :**
`line 1...`
Reviewed By: javache, NickGerleman
Differential Revision: D46175963
fbshipit-source-id: 3377c38ab65e6801bddb1f262432f8d156a2641f
Summary:
Changelog: [Internal]
it appears that having some access to jsi in userland will be necessary for framework developers, so i'm moving this API to the public header.
bypass-github-export-checks
Reviewed By: mdvacca
Differential Revision: D46385184
fbshipit-source-id: 7261c0a8ba8c8c9302f65d440a3a3fb2782c0666
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37712
This diff is reverting a change on ReactHostDelegate (D45662329) that caused MobileConfig to not being properly initialize in fb4a.
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D46468413
fbshipit-source-id: 4013ba1b5bdfa50e4cf500bb1524e92303826d90
Summary:
Changelog: [Internal]
now that we've wrapped up the first iteration of the venice stable apis, let's clean up old comments and reorganize things to prepare this header for documentation.
bypass-github-export-checks
Reviewed By: mdvacca
Differential Revision: D46334662
fbshipit-source-id: 68d6d2e41d7f7c5b1c69f3bb72482c418e771f72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37703
Changelog: [Internal]
i did too good of a job refactoring that these functions don't abstract any arguments away anymore, so let's just delete it
Reviewed By: javache
Differential Revision: D46303713
fbshipit-source-id: 7e0508a7296ebc3d5c62cf0824071bd2ef041193
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37702
Changelog: [Internal]
the context container is a DI object in our internal infra. the delegate method `createContextContainer` is used to pass down internal implementations that may be used in our infra, notably the `ReactNativeConfig`. this API used to be required for the app delegate to implement.
in this change, i introduce a protocol, `RCTContextContainerHandling`, where we shift the burden of creating the DI container to our internal infra where userland can now optionally add dependencies to this.
this also removes more C++ boilerplate for the bridgeless setup.
Reviewed By: sammy-SC
Differential Revision: D46245433
fbshipit-source-id: 552a9ab0b6a178bab592743863694ff886b152f8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37604
Changelog: [Internal]
this isn't needed anymore, so we can delete it and remove it from our public api
Reviewed By: javache
Differential Revision: D46215054
fbshipit-source-id: 97bc7821aeea47223a4b10684efe750ff1899fa2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37605
Changelog: [Internal]
in this stack, i remove the `bindingsInstallFunc` argument from `RCTHost`'s public API.
the bindingsInstallFunc is a lambda that provides a runtime parameter, which the consumer can "install bindings" to. we have our specific use case for this internally, but there's no need to expose this.
in this change, i introduce a delegate callback path that notifies an internal delegate that the react runtime has been created.
Reviewed By: javache
Differential Revision: D46215051
fbshipit-source-id: 732d6949064b0948b5cf883dc3c0ab494c2ecd94
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