Skip to content

Commit b4fcc7d

Browse files
rubennortefacebook-github-bot
authored andcommitted
Remove deprecated InteractionManager
Summary: `InteractionManager` has been marked as deprecated and has emitted a runtime warning on first access for several releases. Remove it from the public API. Accessing `InteractionManager` from `react-native` now throws a `__DEV__` invariant with a migration message pointing at `requestIdleCallback`, mirroring the pattern already used for other previously-removed legacy modules. The recommended migration is to refactor long tasks into smaller chunks and use `requestIdleCallback` / `cancelIdleCallback` instead of `runAfterInteractions` / `handle.cancel()`. Changes: - Remove the lazy getter from `index.js` and replace it with a `__DEV__` invariant stub. - Remove the `Handle`, `PromiseTask`, `SimpleTask` type re-exports and the `InteractionManager` default re-export from `index.js.flow`. - Delete `Libraries/Interaction/InteractionManager.js` and its `.d.ts`. The parent `Libraries/Interaction/` directory is kept — `PanResponder`, `TouchHistoryMath`, and `FrameRateLogger` continue to live there. Changelog: [General][Removed] - Remove deprecated `InteractionManager` (use `requestIdleCallback` instead) Differential Revision: D106640958
1 parent a88df17 commit b4fcc7d

5 files changed

Lines changed: 20 additions & 335 deletions

File tree

packages/react-native/Libraries/Interaction/InteractionManager.d.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

packages/react-native/Libraries/Interaction/InteractionManager.js

Lines changed: 0 additions & 189 deletions
This file was deleted.

packages/react-native/ReactNativeApi.d.ts

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a438af540f18c77572f05cef9481b7a6>>
7+
* @generated SignedSource<<6996c96aed9284cd96a6fa1c64d7df71>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -249,30 +249,6 @@ declare const I18nManager: {
249249
declare const Image: ImageType
250250
declare const InputAccessoryView: typeof InputAccessoryView_default
251251
declare const InputAccessoryView_default: React.ComponentType<InputAccessoryViewProps>
252-
declare const InteractionManager: typeof InteractionManagerStub_default
253-
declare const InteractionManagerStub_default: {
254-
Events: {
255-
interactionComplete: "interactionComplete"
256-
interactionStart: "interactionStart"
257-
}
258-
addListener(
259-
eventType: string,
260-
listener: (...args: any) => unknown,
261-
context: unknown,
262-
): EventSubscription
263-
clearInteractionHandle(handle: Handle): void
264-
createInteractionHandle(): Handle
265-
runAfterInteractions(task: null | Task | undefined): {
266-
cancel: () => void
267-
then: <U>(
268-
onFulfill?:
269-
| (($$PARAM_0$$: void) => (Promise<U> | U) | undefined)
270-
| undefined,
271-
onReject?: ((error: unknown) => (Promise<U> | U) | undefined) | undefined,
272-
) => Promise<U>
273-
}
274-
setDeadline(deadline: number): void
275-
}
276252
declare const Keyboard: typeof Keyboard_default
277253
declare const Keyboard_default: KeyboardImpl
278254
declare const LayoutAnimation: typeof LayoutAnimation_default
@@ -2476,7 +2452,6 @@ declare function getWithFallback_DEPRECATED<Config extends {}>(
24762452
viewConfigProvider: () => PartialViewConfig,
24772453
): React.ComponentType<Config>
24782454
declare type hairlineWidth = typeof hairlineWidth
2479-
declare type Handle = number
24802455
declare interface HardwareBackPressEvent {
24812456
readonly timeStamp: number
24822457
readonly type: string
@@ -2757,7 +2732,6 @@ declare type InstanceHandle =
27572732
| ReactNativeDocumentElementInstanceHandle
27582733
| ReactNativeDocumentInstanceHandle
27592734
declare type Int32 = number
2760-
declare type InteractionManager = typeof InteractionManager
27612735
declare type InternalInstanceHandle = symbol & {
27622736
__InternalInstanceHandle__: string
27632737
}
@@ -3876,10 +3850,6 @@ declare type ProgressBarAndroidProps =
38763850
ProgressBarAndroidBaseProps &
38773851
IndeterminateProgressBarAndroidStyleAttrProp
38783852
>
3879-
declare type PromiseTask = {
3880-
name: string
3881-
gen: () => Promise<void>
3882-
}
38833853
declare type PublicModalInstance = HostInstance
38843854
declare type PublicRootInstance = symbol & {
38853855
__PublicRootInstance__: string
@@ -4715,10 +4685,6 @@ declare type ShareOptions = {
47154685
subject?: string
47164686
tintColor?: ColorValue
47174687
}
4718-
declare type SimpleTask = {
4719-
name: string
4720-
run: () => void
4721-
}
47224688
declare interface Spec extends TurboModule {
47234689
readonly getConstants: () => {
47244690
readonly buttonClicked: DialogAction
@@ -5056,7 +5022,6 @@ declare type TargetedEvent = {
50565022
declare type TargetEvent = {
50575023
readonly target: number
50585024
}
5059-
declare type Task = (() => void) | PromiseTask | SimpleTask
50605025
declare type TaskCanceller = () => void
50615026
declare type TaskCancelProvider = () => TaskCanceller
50625027
declare type TaskProvider = () => HeadlessTask
@@ -6061,7 +6026,6 @@ export {
60616026
FontVariant, // 7c7558bb
60626027
GestureResponderEvent, // f693e9a5
60636028
GestureResponderHandlers, // cc70e4cb
6064-
Handle, // 2d65285d
60656029
HostComponent, // 16fccab5
60666030
HostInstance, // 9b5a9ec2
60676031
I18nManager, // f9870e00
@@ -6089,7 +6053,6 @@ export {
60896053
InputAccessoryViewProps, // ac36060b
60906054
InputModeOptions, // 4e8581b9
60916055
Insets, // e7fe432a
6092-
InteractionManager, // c324d6e3
60936056
KeyDownEvent, // d4971b72
60946057
KeyEvent, // 20fa4267
60956058
KeyUpEvent, // bc6bd87b
@@ -6167,7 +6130,6 @@ export {
61676130
ProcessedColorValue, // 33f74304
61686131
ProgressBarAndroid, // 00fcd180
61696132
ProgressBarAndroidProps, // f59f8f03
6170-
PromiseTask, // 5102c862
61716133
PublicRootInstance, // 8040afd7
61726134
PublicTextInstance, // cd0d8f8d
61736135
PushNotificationEventName, // 84e7e150
@@ -6213,7 +6175,6 @@ export {
62136175
ShareActionSheetIOSOptions, // eff574f5
62146176
ShareContent, // 7c627896
62156177
ShareOptions, // 800c3a4e
6216-
SimpleTask, // 0e619d11
62176178
StatusBar, // 875b4eca
62186179
StatusBarAnimation, // 7fd047e6
62196180
StatusBarProps, // b72a9127

0 commit comments

Comments
 (0)