@office-iss/react-native-win32 0.0.0-canary.259 → 0.0.0-canary.260
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 +1 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/animations/Animation.js +10 -0
- package/Libraries/Animated/animations/TimingAnimation.js +1 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +2 -2
- package/Libraries/Animated/createAnimatedComponent.js +1 -1
- package/Libraries/Animated/useAnimatedProps.js +71 -4
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollView.js +5 -5
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -3
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +3 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +19 -10
- package/Libraries/Components/TextInput/TextInput.win32.js +19 -10
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +11 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +2 -0
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +6 -0
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.win32.js +14 -0
- package/Libraries/Core/InitializeCore.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.win32.js +10 -21
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +3 -0
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +1 -1
- package/Libraries/Lists/SectionListModern.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +30 -4
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +4 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +4 -0
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +24 -2
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +11 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +14 -2
- package/Libraries/StyleSheet/processBackgroundImage.js +286 -0
- package/Libraries/Text/Text.js +7 -6
- package/Libraries/Text/Text.win32.js +7 -6
- package/Libraries/Text/TextNativeComponent.js +7 -0
- package/Libraries/Text/TextNativeComponent.win32.js +7 -0
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/flow/jest.js +2 -2
- package/index.js +1 -0
- package/index.win32.js +1 -0
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +8 -8
- package/overrides.json +12 -12
- package/package.json +13 -13
- package/src/private/{core/components → components}/HScrollViewNativeComponents.js +8 -8
- package/src/private/{core/components → components}/VScrollViewNativeComponents.js +7 -7
- package/src/private/{core/components → components}/useSyncOnScroll.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +84 -7
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -2
- package/src/private/hooks/DebouncedEffectImplementation.js +148 -0
- package/src/private/hooks/useDebouncedEffect.js +23 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +5 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeDebuggerSessionObserver.js +23 -0
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +1 -1
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +5 -8
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +1 -1
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +5 -5
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +35 -17
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +19 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/types/experimental.d.ts +10 -2
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /package/src/private/{core → styles}/composeStyles.js +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
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-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
// $FlowFixMe[untyped-type-import] used as an opaque type
|
|
15
|
+
import type {Task} from 'scheduler';
|
|
16
|
+
// $FlowFixMe[untyped-type-import] used as an opaque type
|
|
17
|
+
import typeof Scheduler from 'scheduler';
|
|
18
|
+
|
|
19
|
+
import {useCallback, useEffect, useRef} from 'react';
|
|
20
|
+
|
|
21
|
+
type EffectStatus =
|
|
22
|
+
// The effect is scheduled but has not yet run. The cleanup function is from
|
|
23
|
+
// the last execution, if there was one. If the effect gets rescheduled, the
|
|
24
|
+
// cleanup function must be propagated so that it can run before the updated
|
|
25
|
+
// effect
|
|
26
|
+
| {
|
|
27
|
+
kind: 'scheduled',
|
|
28
|
+
// $FlowFixMe[value-as-type] Task is opaque
|
|
29
|
+
task: Task,
|
|
30
|
+
previousCleanup: null | (() => void),
|
|
31
|
+
}
|
|
32
|
+
// The effect has been executed and returned a cleanup function. If it ran
|
|
33
|
+
// but didn't return a cleanup function, the effect status is set to null.
|
|
34
|
+
| {
|
|
35
|
+
cleanup: () => void,
|
|
36
|
+
kind: 'executed',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Similar to `useEffect`, this hook schedules a passive effect (@param fn) to
|
|
41
|
+
* run on mount and whenever the dependency array (@param deps) changes.
|
|
42
|
+
* However, unlike `useEffect` the effect is debounced so that it runs after
|
|
43
|
+
* a delay (idle priority callback), reseting if another render occurs. Another
|
|
44
|
+
* render can occur for example when a layout effect runs and sets state.
|
|
45
|
+
* Updates triggered in layout effects cause the next render to flush
|
|
46
|
+
* synchronously and will by default run passive effects first before the
|
|
47
|
+
* re-render (to flush effects with the original state), and then again after
|
|
48
|
+
* the re-render (to flush effects with the updated state).
|
|
49
|
+
*
|
|
50
|
+
* Instead, this hook will run the effect once per batched render, after it has
|
|
51
|
+
* committed/painted. The effect is scheduled at idle priority, and if another
|
|
52
|
+
* render occurs in the meantime it reschedules the effect. Thus the effect
|
|
53
|
+
* will only run when the component stops re-rendering. When the effect does
|
|
54
|
+
* run, it is guaranteed to be the latest version of the effect.
|
|
55
|
+
*
|
|
56
|
+
* @see https://react.dev/reference/react/useEffect for more on normal passive
|
|
57
|
+
* effect behavior.
|
|
58
|
+
*/
|
|
59
|
+
export default function useDebouncedEffectImplementation(
|
|
60
|
+
fn: () => void | (() => void),
|
|
61
|
+
deps?: ?$ReadOnlyArray<mixed>,
|
|
62
|
+
// $FlowFixMe[value-as-type] used as an opaque type
|
|
63
|
+
scheduler: Scheduler,
|
|
64
|
+
): void {
|
|
65
|
+
const statusRef = useRef<null | EffectStatus>(null);
|
|
66
|
+
|
|
67
|
+
const scheduleTask = useCallback(
|
|
68
|
+
(
|
|
69
|
+
effectFn: null | (() => void | (() => void)),
|
|
70
|
+
previousCleanup: null | (() => void),
|
|
71
|
+
): void => {
|
|
72
|
+
const status = statusRef.current;
|
|
73
|
+
if (status != null && status.kind === 'scheduled') {
|
|
74
|
+
scheduler.unstable_cancelCallback(status.task);
|
|
75
|
+
}
|
|
76
|
+
if (effectFn == null && previousCleanup == null) {
|
|
77
|
+
statusRef.current = null;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const task = scheduler.unstable_scheduleCallback(
|
|
81
|
+
scheduler.unstable_IdlePriority,
|
|
82
|
+
() => {
|
|
83
|
+
if (previousCleanup != null) {
|
|
84
|
+
previousCleanup();
|
|
85
|
+
}
|
|
86
|
+
let cleanup = null;
|
|
87
|
+
if (effectFn != null) {
|
|
88
|
+
cleanup = effectFn() ?? null;
|
|
89
|
+
}
|
|
90
|
+
if (cleanup == null) {
|
|
91
|
+
statusRef.current = null;
|
|
92
|
+
} else {
|
|
93
|
+
statusRef.current = {
|
|
94
|
+
kind: 'executed',
|
|
95
|
+
cleanup,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
statusRef.current = {
|
|
101
|
+
kind: 'scheduled',
|
|
102
|
+
task,
|
|
103
|
+
previousCleanup,
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
+
[],
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
const statusInEffect = statusRef.current;
|
|
112
|
+
if (statusInEffect == null) {
|
|
113
|
+
scheduleTask(fn, null);
|
|
114
|
+
} else if (statusInEffect.kind === 'scheduled') {
|
|
115
|
+
// Need to cancel & reschedule, maintaining the same cleanup function.
|
|
116
|
+
scheduleTask(fn, statusInEffect.previousCleanup);
|
|
117
|
+
} else {
|
|
118
|
+
// Already executed, we need to schedule a new task and call the cleanup
|
|
119
|
+
// function from the last execution
|
|
120
|
+
scheduleTask(fn, statusInEffect.cleanup);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return () => {
|
|
124
|
+
// Rather than immediately run cleanup, we schedule the cleanup task.
|
|
125
|
+
// If the effect is about to update, then we'll cancel this task and
|
|
126
|
+
// reschedule with both the cleanup and the new effect function (see above)
|
|
127
|
+
const statusAtCleanup = statusRef.current;
|
|
128
|
+
if (statusAtCleanup == null) {
|
|
129
|
+
// nothing to do, nothing is scheduled and if the task ran already, it
|
|
130
|
+
// didn't have a cleanup function
|
|
131
|
+
return;
|
|
132
|
+
} else if (statusAtCleanup.kind === 'scheduled') {
|
|
133
|
+
// The task is scheduled but has not yet run. Reschedule just the
|
|
134
|
+
// cleanup function (the effect function portion may be
|
|
135
|
+
// overridden momentarily if the effect is about to update, but that's
|
|
136
|
+
// okay).
|
|
137
|
+
// Note that if cleanup is null, this will just clear the pending task
|
|
138
|
+
// and not schedule a new one
|
|
139
|
+
scheduleTask(null, statusAtCleanup.previousCleanup);
|
|
140
|
+
} else {
|
|
141
|
+
// If kind === executed, then we know there is a cleanup function that
|
|
142
|
+
// still needs to run so schedule it
|
|
143
|
+
scheduleTask(null, statusAtCleanup.cleanup);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
147
|
+
}, deps);
|
|
148
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
import useDebouncedEffectImplementation from './DebouncedEffectImplementation';
|
|
15
|
+
// $FlowFixMe[untyped-import] used as an opaque type
|
|
16
|
+
import Scheduler from 'scheduler';
|
|
17
|
+
|
|
18
|
+
export default function useDebouncedEffect(
|
|
19
|
+
fn: () => void | (() => void),
|
|
20
|
+
deps?: ?$ReadOnlyArray<mixed>,
|
|
21
|
+
): void {
|
|
22
|
+
return useDebouncedEffectImplementation(fn, deps, Scheduler);
|
|
23
|
+
}
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import type {ExtendedError} from '../../../../Libraries/Core/ExtendedError';
|
|
12
12
|
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import {
|
|
14
|
+
SyntheticError,
|
|
15
|
+
handleException,
|
|
16
|
+
} from '../../../../Libraries/Core/ExceptionsManager';
|
|
16
17
|
|
|
17
18
|
type ErrorInfo = {
|
|
18
19
|
+componentStack?: ?string,
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
import DOMRect from '../webapis/dom/geometry/DOMRect';
|
|
12
|
+
import DOMRectReadOnly from '../webapis/dom/geometry/DOMRectReadOnly';
|
|
13
|
+
|
|
14
|
+
let initialized = false;
|
|
15
|
+
|
|
16
|
+
export default function setUpDOM() {
|
|
17
|
+
if (initialized) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
initialized = true;
|
|
22
|
+
|
|
23
|
+
// $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it
|
|
24
|
+
global.DOMRect = DOMRect;
|
|
25
|
+
|
|
26
|
+
// $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it
|
|
27
|
+
global.DOMRectReadOnly = DOMRectReadOnly;
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {polyfillGlobal} from '../../../Libraries/Utilities/PolyfillFunctions';
|
|
12
|
+
|
|
13
|
+
let initialized = false;
|
|
14
|
+
|
|
15
|
+
export default function setUpIntersectionObserver() {
|
|
16
|
+
if (initialized) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
initialized = true;
|
|
21
|
+
|
|
22
|
+
polyfillGlobal(
|
|
23
|
+
'IntersectionObserver',
|
|
24
|
+
() =>
|
|
25
|
+
require('../webapis/intersectionobserver/IntersectionObserver').default,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {polyfillGlobal} from '../../../Libraries/Utilities/PolyfillFunctions';
|
|
12
|
+
|
|
13
|
+
let initialized = false;
|
|
14
|
+
|
|
15
|
+
export default function setUpMutationObserver() {
|
|
16
|
+
if (initialized) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
initialized = true;
|
|
21
|
+
|
|
22
|
+
polyfillGlobal(
|
|
23
|
+
'MutationObserver',
|
|
24
|
+
() => require('../webapis/mutationobserver/MutationObserver').default,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {polyfillGlobal} from '../../../Libraries/Utilities/PolyfillFunctions';
|
|
12
|
+
|
|
13
|
+
let initialized = false;
|
|
14
|
+
|
|
15
|
+
export default function setUpPerformanceObserver() {
|
|
16
|
+
if (initialized) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
initialized = true;
|
|
21
|
+
|
|
22
|
+
polyfillGlobal(
|
|
23
|
+
'PerformanceObserver',
|
|
24
|
+
() =>
|
|
25
|
+
require('../webapis/performance/PerformanceObserver').PerformanceObserver,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
polyfillGlobal(
|
|
29
|
+
'PerformanceObserverEntryList',
|
|
30
|
+
() =>
|
|
31
|
+
require('../webapis/performance/PerformanceObserver')
|
|
32
|
+
.PerformanceObserverEntryList,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
polyfillGlobal(
|
|
36
|
+
'PerformanceEntry',
|
|
37
|
+
() => require('../webapis/performance/PerformanceEntry').PerformanceEntry,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
polyfillGlobal(
|
|
41
|
+
'PerformanceMark',
|
|
42
|
+
() => require('../webapis/performance/UserTiming').PerformanceMark,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
polyfillGlobal(
|
|
46
|
+
'PerformanceMeasure',
|
|
47
|
+
() => require('../webapis/performance/UserTiming').PerformanceMeasure,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
polyfillGlobal(
|
|
51
|
+
'PerformanceEventTiming',
|
|
52
|
+
() => require('../webapis/performance/EventTiming').PerformanceEventTiming,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
polyfillGlobal(
|
|
56
|
+
'TaskAttributionTiming',
|
|
57
|
+
() => require('../webapis/performance/LongTasks').TaskAttributionTiming,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
polyfillGlobal(
|
|
61
|
+
'PerformanceLongTaskTiming',
|
|
62
|
+
() => require('../webapis/performance/LongTasks').PerformanceLongTaskTiming,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
|
|
13
|
+
|
|
14
|
+
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
15
|
+
|
|
16
|
+
export interface Spec extends TurboModule {
|
|
17
|
+
+hasActiveSession: () => boolean;
|
|
18
|
+
+subscribe: (callback: (hasActiveSession: boolean) => void) => () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default (TurboModuleRegistry.get<Spec>(
|
|
22
|
+
'NativeDebuggerSessionObserverCxx',
|
|
23
|
+
): ?Spec);
|
|
@@ -304,8 +304,10 @@ function setInstanceHandle(
|
|
|
304
304
|
export function getShadowNode(node: ReadOnlyNode): ?ShadowNode {
|
|
305
305
|
// Lazy import Fabric here to avoid DOM Node APIs classes from having side-effects.
|
|
306
306
|
// With a static import we can't use these classes for Paper-only variants.
|
|
307
|
-
const
|
|
308
|
-
return
|
|
307
|
+
const RendererProxy = require('../../../../../Libraries/ReactNative/RendererProxy');
|
|
308
|
+
return RendererProxy.getNodeFromInternalInstanceHandle(
|
|
309
|
+
getInstanceHandle(node),
|
|
310
|
+
);
|
|
309
311
|
}
|
|
310
312
|
|
|
311
313
|
export function getChildNodes(
|
|
@@ -349,9 +351,9 @@ export function getPublicInstanceFromInternalInstanceHandle(
|
|
|
349
351
|
): ?ReadOnlyNode {
|
|
350
352
|
// Lazy import Fabric here to avoid DOM Node APIs classes from having side-effects.
|
|
351
353
|
// With a static import we can't use these classes for Paper-only variants.
|
|
352
|
-
const
|
|
354
|
+
const RendererProxy = require('../../../../../Libraries/ReactNative/RendererProxy');
|
|
353
355
|
const mixedPublicInstance =
|
|
354
|
-
|
|
356
|
+
RendererProxy.getPublicInstanceFromInternalInstanceHandle(instanceHandle);
|
|
355
357
|
// $FlowExpectedError[incompatible-return] React defines public instances as "mixed" because it can't access the definition from React Native.
|
|
356
358
|
return mixedPublicInstance;
|
|
357
359
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type IntersectionObserverEntry from './IntersectionObserverEntry';
|
|
14
14
|
import type {IntersectionObserverId} from './IntersectionObserverManager';
|
|
15
15
|
|
|
16
|
-
import ReactNativeElement from '
|
|
16
|
+
import ReactNativeElement from '../dom/nodes/ReactNativeElement';
|
|
17
17
|
import * as IntersectionObserverManager from './IntersectionObserverManager';
|
|
18
18
|
|
|
19
19
|
export type IntersectionObserverCallback = (
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
// flowlint unsafe-getters-setters:off
|
|
12
12
|
|
|
13
|
-
import type ReactNativeElement from '
|
|
14
|
-
import type {NativeIntersectionObserverEntry} from './NativeIntersectionObserver';
|
|
13
|
+
import type ReactNativeElement from '../dom/nodes/ReactNativeElement';
|
|
14
|
+
import type {NativeIntersectionObserverEntry} from './specs/NativeIntersectionObserver';
|
|
15
15
|
|
|
16
|
-
import DOMRectReadOnly from '
|
|
16
|
+
import DOMRectReadOnly from '../dom/geometry/DOMRectReadOnly';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)
|
|
@@ -18,20 +18,17 @@
|
|
|
18
18
|
* the notifications together.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import type ReactNativeElement from '
|
|
21
|
+
import type ReactNativeElement from '../dom/nodes/ReactNativeElement';
|
|
22
22
|
import type IntersectionObserver, {
|
|
23
23
|
IntersectionObserverCallback,
|
|
24
24
|
} from './IntersectionObserver';
|
|
25
25
|
import type IntersectionObserverEntry from './IntersectionObserverEntry';
|
|
26
26
|
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from '../../src/private/webapis/dom/nodes/ReadOnlyNode';
|
|
31
|
-
import * as Systrace from '../Performance/Systrace';
|
|
32
|
-
import warnOnce from '../Utilities/warnOnce';
|
|
27
|
+
import * as Systrace from '../../../../Libraries/Performance/Systrace';
|
|
28
|
+
import warnOnce from '../../../../Libraries/Utilities/warnOnce';
|
|
29
|
+
import {getInstanceHandle, getShadowNode} from '../dom/nodes/ReadOnlyNode';
|
|
33
30
|
import {createIntersectionObserverEntry} from './IntersectionObserverEntry';
|
|
34
|
-
import NativeIntersectionObserver from './NativeIntersectionObserver';
|
|
31
|
+
import NativeIntersectionObserver from './specs/NativeIntersectionObserver';
|
|
35
32
|
|
|
36
33
|
export type IntersectionObserverId = number;
|
|
37
34
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {TurboModule} from '
|
|
11
|
+
import type {TurboModule} from '../../../../../Libraries/TurboModule/RCTExport';
|
|
12
12
|
|
|
13
|
-
import * as TurboModuleRegistry from '
|
|
13
|
+
import * as TurboModuleRegistry from '../../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
14
14
|
|
|
15
15
|
export type NativeIntersectionObserverEntry = {
|
|
16
16
|
intersectionObserverId: number,
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type ReactNativeElement from '../../../
|
|
12
|
-
import type IntersectionObserver from '
|
|
11
|
+
import type ReactNativeElement from '../../../dom/nodes/ReactNativeElement';
|
|
12
|
+
import type IntersectionObserver from '../../IntersectionObserver';
|
|
13
13
|
import type {
|
|
14
14
|
NativeIntersectionObserverEntry,
|
|
15
15
|
NativeIntersectionObserverObserveOptions,
|
|
16
16
|
Spec,
|
|
17
17
|
} from '../NativeIntersectionObserver';
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import {getFabricUIManager} from '../../../../../../Libraries/ReactNative/__mocks__/FabricUIManager';
|
|
20
|
+
import {getShadowNode} from '../../../dom/nodes/ReadOnlyNode';
|
|
21
21
|
import invariant from 'invariant';
|
|
22
22
|
import nullthrows from 'nullthrows';
|
|
23
23
|
|
package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js
RENAMED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type {MutationObserverId} from './MutationObserverManager';
|
|
14
14
|
import type MutationRecord from './MutationRecord';
|
|
15
15
|
|
|
16
|
-
import ReactNativeElement from '
|
|
16
|
+
import ReactNativeElement from '../dom/nodes/ReactNativeElement';
|
|
17
17
|
import * as MutationObserverManager from './MutationObserverManager';
|
|
18
18
|
|
|
19
19
|
export type MutationObserverCallback = (
|
|
@@ -18,20 +18,20 @@
|
|
|
18
18
|
* the notifications together.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import type ReactNativeElement from '
|
|
21
|
+
import type ReactNativeElement from '../dom/nodes/ReactNativeElement';
|
|
22
22
|
import type MutationObserver, {
|
|
23
23
|
MutationObserverCallback,
|
|
24
24
|
} from './MutationObserver';
|
|
25
25
|
import type MutationRecord from './MutationRecord';
|
|
26
26
|
|
|
27
|
+
import * as Systrace from '../../../../Libraries/Performance/Systrace';
|
|
28
|
+
import warnOnce from '../../../../Libraries/Utilities/warnOnce';
|
|
27
29
|
import {
|
|
28
30
|
getPublicInstanceFromInternalInstanceHandle,
|
|
29
31
|
getShadowNode,
|
|
30
|
-
} from '
|
|
31
|
-
import * as Systrace from '../Performance/Systrace';
|
|
32
|
-
import warnOnce from '../Utilities/warnOnce';
|
|
32
|
+
} from '../dom/nodes/ReadOnlyNode';
|
|
33
33
|
import {createMutationRecord} from './MutationRecord';
|
|
34
|
-
import NativeMutationObserver from './NativeMutationObserver';
|
|
34
|
+
import NativeMutationObserver from './specs/NativeMutationObserver';
|
|
35
35
|
|
|
36
36
|
export type MutationObserverId = number;
|
|
37
37
|
|
package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js
RENAMED
|
@@ -10,13 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
// flowlint unsafe-getters-setters:off
|
|
12
12
|
|
|
13
|
-
import type ReactNativeElement from '
|
|
14
|
-
import type ReadOnlyNode from '
|
|
15
|
-
import type {NativeMutationRecord} from './NativeMutationObserver';
|
|
13
|
+
import type ReactNativeElement from '../dom/nodes/ReactNativeElement';
|
|
14
|
+
import type ReadOnlyNode from '../dom/nodes/ReadOnlyNode';
|
|
15
|
+
import type {NativeMutationRecord} from './specs/NativeMutationObserver';
|
|
16
16
|
|
|
17
|
-
import NodeList, {
|
|
18
|
-
createNodeList,
|
|
19
|
-
} from '../../src/private/webapis/dom/oldstylecollections/NodeList';
|
|
17
|
+
import NodeList, {createNodeList} from '../dom/oldstylecollections/NodeList';
|
|
20
18
|
|
|
21
19
|
export type MutationType = 'attributes' | 'characterData' | 'childList';
|
|
22
20
|
|
package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js
RENAMED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {TurboModule} from '
|
|
11
|
+
import type {TurboModule} from '../../../../../Libraries/TurboModule/RCTExport';
|
|
12
12
|
|
|
13
|
-
import * as TurboModuleRegistry from '
|
|
13
|
+
import * as TurboModuleRegistry from '../../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
14
14
|
|
|
15
15
|
export type MutationObserverId = number;
|
|
16
16
|
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
* JavaScript as an integration test using only public APIs.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import type {NodeSet} from '
|
|
19
|
-
import type {RootTag} from '
|
|
18
|
+
import type {NodeSet} from '../../../../../../Libraries/ReactNative/FabricUIManager';
|
|
19
|
+
import type {RootTag} from '../../../../../../Libraries/ReactNative/RootTag';
|
|
20
20
|
import type {
|
|
21
21
|
InternalInstanceHandle,
|
|
22
22
|
Node,
|
|
23
|
-
} from '
|
|
23
|
+
} from '../../../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
24
24
|
import type {
|
|
25
25
|
MutationObserverId,
|
|
26
26
|
NativeMutationObserverObserveOptions,
|
|
@@ -28,14 +28,14 @@ import type {
|
|
|
28
28
|
Spec,
|
|
29
29
|
} from '../NativeMutationObserver';
|
|
30
30
|
|
|
31
|
-
import ReadOnlyNode from '../../../src/private/webapis/dom/nodes/ReadOnlyNode';
|
|
32
31
|
import {
|
|
33
32
|
type NodeMock,
|
|
34
33
|
type UIManagerCommitHook,
|
|
35
34
|
fromNode,
|
|
36
35
|
getFabricUIManager,
|
|
37
36
|
getNodeInChildSet,
|
|
38
|
-
} from '
|
|
37
|
+
} from '../../../../../../Libraries/ReactNative/__mocks__/FabricUIManager';
|
|
38
|
+
import ReadOnlyNode from '../../../dom/nodes/ReadOnlyNode';
|
|
39
39
|
import invariant from 'invariant';
|
|
40
40
|
import nullthrows from 'nullthrows';
|
|
41
41
|
|