@office-iss/react-native-win32 0.0.0-canary.299 → 0.0.0-canary.300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +3 -6
- package/CHANGELOG.json +46 -1
- package/CHANGELOG.md +19 -6
- package/IntegrationTests/IntegrationTestsApp.js +1 -1
- package/Libraries/Alert/RCTAlertManager.android.js +2 -0
- package/Libraries/Animated/Animated.d.ts +2 -0
- package/Libraries/Animated/AnimatedImplementation.js +2 -0
- package/Libraries/Animated/Easing.js +2 -0
- package/Libraries/Animated/animations/Animation.js +14 -14
- package/Libraries/Animated/animations/TimingAnimation.js +2 -0
- package/Libraries/Animated/nodes/AnimatedNode.js +7 -7
- package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
- package/Libraries/Animated/nodes/AnimatedProps.js +30 -30
- package/Libraries/Animated/nodes/AnimatedStyle.js +17 -17
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
- package/Libraries/Animated/nodes/AnimatedValue.js +18 -18
- package/Libraries/AppState/AppState.js +3 -3
- package/Libraries/BatchedBridge/MessageQueue.js +4 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +10 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
- package/Libraries/Components/StatusBar/StatusBar.js +2 -2
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/TextInput/TextInput.js +2 -2
- package/Libraries/Components/TextInput/TextInput.win32.js +2 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/View/View.js +86 -168
- package/Libraries/Core/ReactNativeVersion.js +37 -10
- package/Libraries/Core/Timers/queueMicrotask.js +1 -0
- package/Libraries/Core/setUpPerformance.js +2 -1
- package/Libraries/Interaction/InteractionManager.js +118 -171
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
- package/Libraries/LogBox/Data/LogBoxData.js +4 -1
- package/Libraries/Modal/Modal.js +1 -1
- package/Libraries/NativeComponent/ViewConfig.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +18 -5
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.win32.js +1 -1
- package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
- package/Libraries/Renderer/shims/ReactFabric.js +3 -1
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
- package/Libraries/Renderer/shims/ReactNative.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
- package/Libraries/Utilities/useMergeRefs.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +17 -31
- package/flow/HermesInternalType.js +114 -0
- package/flow/Stringish.js +14 -0
- package/flow/bom.js.flow +554 -0
- package/flow/console.js +49 -0
- package/flow/cssom.js.flow +575 -0
- package/flow/dom.js.flow +6289 -0
- package/flow/global.js +88 -0
- package/flow/prettier.js.flow +14 -0
- package/flow/streams.js.flow +140 -0
- package/index.js +5 -2
- package/index.win32.js +6 -2
- package/jest/mockComponent.js +1 -1
- package/jest/setup.js +11 -0
- package/overrides.json +11 -11
- package/package.json +19 -19
- package/src/private/animated/NativeAnimatedHelper.js +8 -1
- package/src/private/animated/NativeAnimatedHelper.win32.js +8 -1
- package/src/private/animated/createAnimatedPropsHook.js +2 -49
- package/src/private/animated/createAnimatedPropsMemoHook.js +2 -48
- package/src/private/components/virtualview/VirtualView.js +22 -6
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
- package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +71 -51
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +19 -0
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -5
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +1 -1
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +2 -2
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
- package/src/private/webapis/geometry/DOMRectList.js +2 -2
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
- package/src/private/webapis/performance/EventTiming.js +5 -9
- package/src/private/webapis/performance/Performance.js +251 -191
- package/src/private/webapis/performance/PerformanceObserver.js +8 -29
- package/src/private/webapis/performance/UserTiming.js +24 -23
- package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
- package/src/private/webapis/performance/internals/Utilities.js +9 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +19 -33
- package/src/private/webapis/structuredClone/structuredClone.js +1 -1
- package/Libraries/Interaction/InteractionManagerStub.js +0 -184
- package/Libraries/Interaction/TaskQueue.js +0 -197
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
const invariant = require('invariant');
|
|
14
|
-
|
|
15
|
-
export type SimpleTask = {
|
|
16
|
-
name: string,
|
|
17
|
-
run: () => void,
|
|
18
|
-
};
|
|
19
|
-
export type PromiseTask = {
|
|
20
|
-
name: string,
|
|
21
|
-
gen: () => Promise<void>,
|
|
22
|
-
};
|
|
23
|
-
export type Task = SimpleTask | PromiseTask | (() => void);
|
|
24
|
-
|
|
25
|
-
const DEBUG: false = false;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* TaskQueue - A system for queueing and executing a mix of simple callbacks and
|
|
29
|
-
* trees of dependent tasks based on Promises. No tasks are executed unless
|
|
30
|
-
* `processNext` is called.
|
|
31
|
-
*
|
|
32
|
-
* `enqueue` takes a Task object with either a simple `run` callback, or a
|
|
33
|
-
* `gen` function that returns a `Promise` and puts it in the queue. If a gen
|
|
34
|
-
* function is supplied, then the promise it returns will block execution of
|
|
35
|
-
* tasks already in the queue until it resolves. This can be used to make sure
|
|
36
|
-
* the first task is fully resolved (including asynchronous dependencies that
|
|
37
|
-
* also schedule more tasks via `enqueue`) before starting on the next task.
|
|
38
|
-
* The `onMoreTasks` constructor argument is used to inform the owner that an
|
|
39
|
-
* async task has resolved and that the queue should be processed again.
|
|
40
|
-
*
|
|
41
|
-
* Note: Tasks are only actually executed with explicit calls to `processNext`.
|
|
42
|
-
*/
|
|
43
|
-
class TaskQueue {
|
|
44
|
-
/**
|
|
45
|
-
* TaskQueue instances are self contained and independent, so multiple tasks
|
|
46
|
-
* of varying semantics and priority can operate together.
|
|
47
|
-
*
|
|
48
|
-
* `onMoreTasks` is invoked when `PromiseTask`s resolve if there are more
|
|
49
|
-
* tasks to process.
|
|
50
|
-
*/
|
|
51
|
-
constructor({onMoreTasks}: {onMoreTasks: () => void, ...}) {
|
|
52
|
-
this._onMoreTasks = onMoreTasks;
|
|
53
|
-
this._queueStack = [{tasks: [], popable: false}];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Add a task to the queue. It is recommended to name your tasks for easier
|
|
58
|
-
* async debugging. Tasks will not be executed until `processNext` is called
|
|
59
|
-
* explicitly.
|
|
60
|
-
*/
|
|
61
|
-
enqueue(task: Task): void {
|
|
62
|
-
this._getCurrentQueue().push(task);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
enqueueTasks(tasks: Array<Task>): void {
|
|
66
|
-
tasks.forEach(task => this.enqueue(task));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
cancelTasks(tasksToCancel: Array<Task>): void {
|
|
70
|
-
// search through all tasks and remove them.
|
|
71
|
-
this._queueStack = this._queueStack
|
|
72
|
-
.map(queue => ({
|
|
73
|
-
...queue,
|
|
74
|
-
tasks: queue.tasks.filter(task => tasksToCancel.indexOf(task) === -1),
|
|
75
|
-
}))
|
|
76
|
-
.filter((queue, idx) => queue.tasks.length > 0 || idx === 0);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Check to see if `processNext` should be called.
|
|
81
|
-
*
|
|
82
|
-
* @returns {boolean} Returns true if there are tasks that are ready to be
|
|
83
|
-
* processed with `processNext`, or returns false if there are no more tasks
|
|
84
|
-
* to be processed right now, although there may be tasks in the queue that
|
|
85
|
-
* are blocked by earlier `PromiseTask`s that haven't resolved yet.
|
|
86
|
-
* `onMoreTasks` will be called after each `PromiseTask` resolves if there are
|
|
87
|
-
* tasks ready to run at that point.
|
|
88
|
-
*/
|
|
89
|
-
hasTasksToProcess(): boolean {
|
|
90
|
-
return this._getCurrentQueue().length > 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Executes the next task in the queue.
|
|
95
|
-
*/
|
|
96
|
-
processNext(): void {
|
|
97
|
-
const queue = this._getCurrentQueue();
|
|
98
|
-
if (queue.length) {
|
|
99
|
-
const task = queue.shift();
|
|
100
|
-
try {
|
|
101
|
-
if (typeof task === 'object' && task.gen) {
|
|
102
|
-
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
103
|
-
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
104
|
-
DEBUG && console.log('TaskQueue: genPromise for task ' + task.name);
|
|
105
|
-
this._genPromise(task);
|
|
106
|
-
} else if (typeof task === 'object' && task.run) {
|
|
107
|
-
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
108
|
-
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
109
|
-
DEBUG && console.log('TaskQueue: run task ' + task.name);
|
|
110
|
-
task.run();
|
|
111
|
-
} else {
|
|
112
|
-
invariant(
|
|
113
|
-
typeof task === 'function',
|
|
114
|
-
'Expected Function, SimpleTask, or PromiseTask, but got:\n' +
|
|
115
|
-
JSON.stringify(task, null, 2),
|
|
116
|
-
);
|
|
117
|
-
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
118
|
-
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
119
|
-
DEBUG && console.log('TaskQueue: run anonymous task');
|
|
120
|
-
task();
|
|
121
|
-
}
|
|
122
|
-
} catch (e) {
|
|
123
|
-
e.message =
|
|
124
|
-
// $FlowFixMe[incompatible-type]
|
|
125
|
-
// $FlowFixMe[incompatible-use]
|
|
126
|
-
'TaskQueue: Error with task ' + (task.name || '') + ': ' + e.message;
|
|
127
|
-
throw e;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
_queueStack: Array<{
|
|
133
|
-
tasks: Array<Task>,
|
|
134
|
-
popable: boolean,
|
|
135
|
-
...
|
|
136
|
-
}>;
|
|
137
|
-
_onMoreTasks: () => void;
|
|
138
|
-
|
|
139
|
-
_getCurrentQueue(): Array<Task> {
|
|
140
|
-
const stackIdx = this._queueStack.length - 1;
|
|
141
|
-
const queue = this._queueStack[stackIdx];
|
|
142
|
-
if (
|
|
143
|
-
queue.popable &&
|
|
144
|
-
queue.tasks.length === 0 &&
|
|
145
|
-
this._queueStack.length > 1
|
|
146
|
-
) {
|
|
147
|
-
this._queueStack.pop();
|
|
148
|
-
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
149
|
-
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
150
|
-
DEBUG &&
|
|
151
|
-
console.log('TaskQueue: popped queue: ', {
|
|
152
|
-
stackIdx,
|
|
153
|
-
queueStackSize: this._queueStack.length,
|
|
154
|
-
});
|
|
155
|
-
return this._getCurrentQueue();
|
|
156
|
-
} else {
|
|
157
|
-
return queue.tasks;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
_genPromise(task: PromiseTask) {
|
|
162
|
-
// Each async task pushes it's own queue onto the queue stack. This
|
|
163
|
-
// effectively defers execution of previously queued tasks until the promise
|
|
164
|
-
// resolves, at which point we allow the new queue to be popped, which
|
|
165
|
-
// happens once it is fully processed.
|
|
166
|
-
this._queueStack.push({tasks: [], popable: false});
|
|
167
|
-
const stackIdx = this._queueStack.length - 1;
|
|
168
|
-
const stackItem = this._queueStack[stackIdx];
|
|
169
|
-
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
170
|
-
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
171
|
-
DEBUG && console.log('TaskQueue: push new queue: ', {stackIdx});
|
|
172
|
-
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
173
|
-
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
174
|
-
DEBUG && console.log('TaskQueue: exec gen task ' + task.name);
|
|
175
|
-
task
|
|
176
|
-
.gen()
|
|
177
|
-
.then(() => {
|
|
178
|
-
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
|
179
|
-
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
|
180
|
-
DEBUG &&
|
|
181
|
-
console.log('TaskQueue: onThen for gen task ' + task.name, {
|
|
182
|
-
stackIdx,
|
|
183
|
-
queueStackSize: this._queueStack.length,
|
|
184
|
-
});
|
|
185
|
-
stackItem.popable = true;
|
|
186
|
-
this.hasTasksToProcess() && this._onMoreTasks();
|
|
187
|
-
})
|
|
188
|
-
.catch(ex => {
|
|
189
|
-
setTimeout(() => {
|
|
190
|
-
ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`;
|
|
191
|
-
throw ex;
|
|
192
|
-
}, 0);
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export default TaskQueue;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export type FeatureFlags = {
|
|
12
|
-
/**
|
|
13
|
-
* Function used to enable / disable W3C pointer event emitting in React Native.
|
|
14
|
-
* If enabled you must also flip the equivalent native flags on each platform:
|
|
15
|
-
* iOS -> RCTSetDispatchW3CPointerEvents
|
|
16
|
-
* Android -> ReactFeatureFlags.dispatchPointerEvents
|
|
17
|
-
*/
|
|
18
|
-
shouldEmitW3CPointerEvents: () => boolean,
|
|
19
|
-
/**
|
|
20
|
-
* Function used to enable / disable Pressibility from using W3C Pointer Events
|
|
21
|
-
* for its hover callbacks
|
|
22
|
-
*/
|
|
23
|
-
shouldPressibilityUseW3CPointerEventsForHover: () => boolean,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const ReactNativeFeatureFlags: FeatureFlags = {
|
|
27
|
-
shouldEmitW3CPointerEvents: () => false,
|
|
28
|
-
shouldPressibilityUseW3CPointerEventsForHover: () => false,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default ReactNativeFeatureFlags;
|