Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50433
Make React imports consistent across react-native source code to also align with Flow tooling.
flow-api-translator adds `import * as React from 'react';` if there is no React import and React namespace has to be used after translation.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D72238732
fbshipit-source-id: 5f8cfeab26f397684b1d802731729be7071b5da7
Summary:
This method is redundant. You could just call RCTScreenScale()
Changelog: [iOS][Removed] Delete RCTComputeScreenScale
Reviewed By: philIip
Differential Revision: D72258778
fbshipit-source-id: 0b469169efc4f2def85b2e6b736f3c4570e6b428
Summary:
This is dead code. Let's remove this for now.
This api is unsafe: if it's called from a non-ui thread, it may dispatch to the ui thread synchronously.
Changelog: [iOS][Removed] - Remove RCTFloorPixelValue
Reviewed By: NickGerleman
Differential Revision: D72260694
fbshipit-source-id: d032917643c957a395ee380ef925a047abd5dace
Summary:
## Problem
If RCTScreenScale() is called from a non-ui thread, it will synchronously dispatch to the ui thread.
If the calling thread is the javascript thread, this could deadlock React Native.
## Changes
Move the method calls to the ui thread.
In the future, once all call-sites are migrated to the ui thread, we will just make these methods assert that they're being called from the ui thread.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D72177192
fbshipit-source-id: daadf713f059d33e8fff4559b4184f9d4b6b420d
Summary:
In expo-updates, we would like to handle exceptions on app launch. We used to do this by reassigning our own `DefaultJSExceptionHandler` to the property on the `ReleaseDevSupportManager `. This class has been migrated to kotlin and is now final so we can no longer do this. Instead of having the `defaultJSExceptionHandler` typed as `DefaultJSExceptionHandler` we'd like to change it to the interface, `JSExceptionHandler` so we can do this https://github.com/expo/expo/blob/93b7e9b1724a7be11b9d79c0313a2e5a2fd5e5bf/packages/expo-updates/android/src/main/java/expo/modules/updates/errorrecovery/ErrorRecovery.kt#L118C82-L118C97
## Changelog:
[ANDROID] [CHANGED] Change `defaultJSExceptionHandler`'s type to `JSExceptionHandler` on the `ReleaseDevSupportManager`
Pull Request resolved: https://github.com/facebook/react-native/pull/50400
Test Plan: RNTester runs without issue in a release build.
Reviewed By: huntie
Differential Revision: D72173667
Pulled By: cortinico
fbshipit-source-id: 978fd696322432e638a90014ff3c8c2b09fae761
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50392
## This diff
Defines an exports field for the "react-native/virtualized-lists" package. Limits internal use of subpath
imports to virtualized-lists package, and exports all currently used APIs one the root level.
Changelog:
[General][Breaking] - Subpath imports to the internal react-native/virtualized-lists package are not allowed.
Reviewed By: huntie
Differential Revision: D72162344
fbshipit-source-id: 828dab8e569f019fc48084af475e152b898f5bb5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50391
No need for the indirection here of a heap allocated pointer.
Since we have the RootComponentDescriptor we generally don't need it in any other component registry.
Changelog: [Internal]
Reviewed By: philIip
Differential Revision: D72058916
fbshipit-source-id: 0c29f26f4c56c4353eda251fe06a475e3b6085da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50379
## Changelog:
[Android] [Added] - Allow invoking `synchronouslyUpdateViewOnUIThread` from c++ via `UIManager`
implementation is provided by SchedulerDelegate on the platform
Reviewed By: javache
Differential Revision: D71648772
fbshipit-source-id: bba0f7e9e2deafd074d28ff5cece6b7738c4d123
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50320
Define `"exports"` field on the main `react-native` package.
**Notes**
Module resolution should be equivalent to the previous implicit `"main"` field (backwards compatible).
- Exports all module subpaths to JavaScript (Flow) source files, with and without `.js` suffix (unchanged ✅)
- These are restricted to the `flow/` and `Libraries/` subdirectories (ℹ️ this should be unchanged, matching any JS imports apps may have today)
- Still includes 3P integration scripts such as `./jest-preset.js` and `./rn-get-polyfills.js` (unchanged ✅)
- Exports `./package.json` (unchanged ✅)
- TypeScript should:
- fall back to the `"types"` field (unchanged ✅)
- OR to `"."`,`"./*"` when Package Exports support is enabled via `compilerOptions`, and use the *adjacent `.d.ts` file* (unchanged ✅)
Changelog:
[General][Breaking] - The `react-native` package now defines package.json `"exports"`.
- While these expose existing JavaScript and TypeScript modules, this change may affect deep imports of non-JS files via Node in third party tools.
- Imports from `src/` and `src/private/` directories are disallowed.
Reviewed By: robhogan
Differential Revision: D71968187
fbshipit-source-id: 28ff941692d1822a916457c4fb891e200e3bca61
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50308
CxxCallbackImpl is used in new architecture, in this diff i'm removing LegacyArchitecture annotation from CxxCallbackImpl class
changelog: [internal] internal
Reviewed By: alanleedev
Differential Revision: D71820292
fbshipit-source-id: 54748cc23aa7091841a025e41ad43dcaa60923cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50376
This makes a couple of tweaks to `SafeReleaseJniRef` to let it be used in more places:
1. Add a default ctor for null state
2. Bridge `get()` to return raw JNI ref, for use when calling Java functions directly (compared to current use case of hybrid objects)
3. Keep JNI environment attached to thread longer term, instead of repeated attach/detach, to allow use for higher frequency objects.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D71933838
fbshipit-source-id: 622cc70d2d7483475406314abcbcf92d3d2ff227
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50330
Changelog: [Internal]
Make the error reported when a debugger is created for a device that does not exist generic, and not including any specific details to make them easier to aggregate
Reviewed By: hoxyq
Differential Revision: D71979796
fbshipit-source-id: 88badc51043e35ff91d7db81c5966ed5ffce9109
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50341
Ships tge `scheduleAnimatedCleanupInMicrotask` feature flag, which changes the cleanup of `AnimatedProps` to occur in a microtask instead of synchronously during effect cleanup (for unmount) or subsequent mounts (for updates).
Changelog:
[General][Changed] - When an `Animated` component is unmounted, any completion callbacks will now be called in a microtask instead of during the commit phase.
Reviewed By: javache
Differential Revision: D71942778
fbshipit-source-id: cbe636d5cff84dfeca2f21ead374609c536e91ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50339
Explicitly sets the default `reactRuntimeTarget` when invoking `require('hermes-parser').parse` so that it'll be easier to find these configurations when upgrading to `'19'`.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D72006705
fbshipit-source-id: 4994917152a2a4a767b871d4a36092c0c5391324
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50337
# Changelog: [Internal]
This should not have any functional changes, it only prevents the WebSocket from being killed on Android, when we are sending Profile-related Trace Events.
For large traces, a single message could be more than 16MB, because we send a unique string url for every call frame.
Reviewed By: huntie
Differential Revision: D71993748
fbshipit-source-id: f0bfddfb0bb87631e72b573142abdf0d7d87ba48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50335
Changelog: [internal]
This defines the internal technical documentation for the MutationObserver API, as an example of how to define docs using the new strategy and structure.
Reviewed By: javache
Differential Revision: D71890748
fbshipit-source-id: 3ef19c784dff7aea7a2e2d08302640d5eefacc30
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50334
Changelog: [internal]
This updates the documentation for the feature flag system to adhere to the new documentation strategy and structure.
Reviewed By: javache, rshest
Differential Revision: D71889753
fbshipit-source-id: 7ff47cf613ac01012e7329485d2b97e997a97c07
Summary:
Regression introduced in D71735505 where I tried to ensure fabricEventEmitter was always non-null. Instead log a soft error when this happens, so we don't drop the event silently.
Changelog: [Android][Fixed] Fixed crash when event is emitted after instance is shutdown
Reviewed By: mdvacca
Differential Revision: D71967092
fbshipit-source-id: 990b6414b41a2709d70a6deae38f5aa043203a20
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50325
axOrderViews is an optimization I came up with so that we could find and queue all the views on a single tree traversal. It initializes the array with the size of the accessibilityOrder array and places each view where its nativeID is. If there is no view corresponding to the nativeID then that axOrderViews element will be null. So to fully ignore nativeIDs that don't correspond to any View we can just filter the nulls
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D71977739
fbshipit-source-id: a3f2138eebe06808ce413355df5d9beb2f4ff388