GeezerVison is showing github.com — Event Replaying (#16725) · react/react@0a52770
File treeExpand file treeCollapse file tree Open diff view settings react-native-renderer/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/legacy-events/EventPluginHub.js +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,6 +22,7 @@ import type {ReactSyntheticEvent} from './ReactSyntheticEventType'; | 22 | 22 | import type {Fiber} from 'react-reconciler/src/ReactFiber'; | 23 | 23 | import type {AnyNativeEvent} from './PluginModuleType'; | 24 | 24 | import type {TopLevelType} from './TopLevelEventTypes'; | | 25 | +import type {EventSystemFlags} from 'legacy-events/EventSystemFlags'; | 25 | 26 |
| 26 | 27 | function isInteractive(tag) { | 27 | 28 | return ( | @@ -131,6 +132,7 @@ export function getListener(inst: Fiber, registrationName: string) { | 131 | 132 | */ | 132 | 133 | function extractPluginEvents( | 133 | 134 | topLevelType: TopLevelType, | | 135 | + eventSystemFlags: EventSystemFlags, | 134 | 136 | targetInst: null | Fiber, | 135 | 137 | nativeEvent: AnyNativeEvent, | 136 | 138 | nativeEventTarget: EventTarget, | @@ -142,6 +144,7 @@ function extractPluginEvents( | 142 | 144 | if (possiblePlugin) { | 143 | 145 | const extractedEvents = possiblePlugin.extractEvents( | 144 | 146 | topLevelType, | | 147 | + eventSystemFlags, | 145 | 148 | targetInst, | 146 | 149 | nativeEvent, | 147 | 150 | nativeEventTarget, | @@ -156,12 +159,14 @@ function extractPluginEvents( | 156 | 159 |
| 157 | 160 | export function runExtractedPluginEventsInBatch( | 158 | 161 | topLevelType: TopLevelType, | | 162 | + eventSystemFlags: EventSystemFlags, | 159 | 163 | targetInst: null | Fiber, | 160 | 164 | nativeEvent: AnyNativeEvent, | 161 | 165 | nativeEventTarget: EventTarget, | 162 | 166 | ) { | 163 | 167 | const events = extractPluginEvents( | 164 | 168 | topLevelType, | | 169 | + eventSystemFlags, | 165 | 170 | targetInst, | 166 | 171 | nativeEvent, | 167 | 172 | nativeEventTarget, | |
Collapse file Copy file name to clipboardExpand all lines: packages/legacy-events/EventSystemFlags.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,3 +14,4 @@ export const RESPONDER_EVENT_SYSTEM = 1 << 1; | 14 | 14 | export const IS_PASSIVE = 1 << 2; | 15 | 15 | export const IS_ACTIVE = 1 << 3; | 16 | 16 | export const PASSIVE_NOT_SUPPORTED = 1 << 4; | | 17 | +export const IS_REPLAYED = 1 << 5; |
Collapse file Copy file name to clipboardExpand all lines: packages/legacy-events/PluginModuleType.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,7 @@ import type { | 13 | 13 | ReactSyntheticEvent, | 14 | 14 | } from './ReactSyntheticEventType'; | 15 | 15 | import type {TopLevelType} from './TopLevelEventTypes'; | | 16 | +import type {EventSystemFlags} from 'legacy-events/EventSystemFlags'; | 16 | 17 |
| 17 | 18 | export type EventTypes = {[key: string]: DispatchConfig}; | 18 | 19 |
| @@ -24,6 +25,7 @@ export type PluginModule<NativeEvent> = { | 24 | 25 | eventTypes: EventTypes, | 25 | 26 | extractEvents: ( | 26 | 27 | topLevelType: TopLevelType, | | 28 | + eventSystemFlags: EventSystemFlags, | 27 | 29 | targetInst: null | Fiber, | 28 | 30 | nativeTarget: NativeEvent, | 29 | 31 | nativeEventTarget: EventTarget, | |
Collapse file Copy file name to clipboardExpand all lines: packages/legacy-events/ResponderEventPlugin.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -504,6 +504,7 @@ const ResponderEventPlugin = { | 504 | 504 | */ | 505 | 505 | extractEvents: function( | 506 | 506 | topLevelType, | | 507 | + eventSystemFlags, | 507 | 508 | targetInst, | 508 | 509 | nativeEvent, | 509 | 510 | nativeEventTarget, | |
Collapse file Copy file name to clipboardExpand all lines: packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 | 'use strict'; | 11 | 11 |
| 12 | 12 | const {HostComponent} = require('shared/ReactWorkTags'); | | 13 | +const {PLUGIN_EVENT_SYSTEM} = require('legacy-events/EventSystemFlags'); | 13 | 14 |
| 14 | 15 | let EventBatching; | 15 | 16 | let EventPluginUtils; | @@ -313,6 +314,7 @@ const run = function(config, hierarchyConfig, nativeEventConfig) { | 313 | 314 | // Trigger the event | 314 | 315 | const extractedEvents = ResponderEventPlugin.extractEvents( | 315 | 316 | nativeEventConfig.topLevelType, | | 317 | + PLUGIN_EVENT_SYSTEM, | 316 | 318 | nativeEventConfig.targetInst, | 317 | 319 | nativeEventConfig.nativeEvent, | 318 | 320 | nativeEventConfig.target, | |
|