@office-iss/react-native-win32 0.0.0-canary.245 → 0.0.0-canary.247
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 -2
- package/CHANGELOG.json +100 -1
- package/CHANGELOG.md +33 -8
- package/Libraries/Animated/createAnimatedComponent.js +20 -3
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +13 -1
- package/Libraries/Components/TextInput/TextInput.win32.js +2 -2
- package/Libraries/Components/Touchable/TouchableHighlight.d.ts +4 -10
- package/Libraries/Components/Touchable/TouchableOpacity.d.ts +4 -15
- package/Libraries/Core/Devtools/loadBundleFromServer.js +3 -3
- package/Libraries/Core/ErrorHandlers.js +116 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +70 -10
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
- package/Libraries/Inspector/ElementBox.js +2 -3
- package/Libraries/NativeComponent/NativeComponentRegistry.js +12 -5
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -21
- package/Libraries/ReactNative/RendererImplementation.js +20 -2
- package/Libraries/ReactNative/UIManager.d.ts +0 -21
- package/Libraries/ReactNative/UIManagerProperties.js +0 -3
- package/Libraries/ReactNative/getNativeComponentAttributes.js +3 -6
- package/Libraries/Renderer/shims/ReactFabric.js +3 -0
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -0
- package/Libraries/Renderer/shims/ReactNative.js +3 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +25 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -0
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +3 -3
- package/Libraries/StyleSheet/StyleSheetTypes.js +3 -3
- package/Libraries/Utilities/{LoadingView.android.js → DevLoadingView.js} +33 -11
- package/Libraries/Utilities/HMRClient.js +8 -8
- package/overrides.json +2 -8
- package/package.json +17 -16
- package/src/private/featureflags/ReactNativeFeatureFlags.js +16 -6
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +4 -2
- package/src/private/fusebox/setUpFuseboxReactDevToolsDispatcher.js +108 -0
- package/src/private/specs/modules/NativeUIManager.js +0 -7
- package/src/private/webapis/performance/PerformanceObserver.js +11 -5
- package/Libraries/Components/ScrollView/ScrollView.win32.js +0 -1983
- package/Libraries/Utilities/LoadingView.ios.js +0 -50
- package/Libraries/Utilities/LoadingView.js +0 -16
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
type JSONValue =
|
|
13
|
+
| string
|
|
14
|
+
| number
|
|
15
|
+
| boolean
|
|
16
|
+
| null
|
|
17
|
+
| {[key: string]: JSONValue}
|
|
18
|
+
| Array<JSONValue>;
|
|
19
|
+
type DomainName = 'react-devtools';
|
|
20
|
+
|
|
21
|
+
class EventScope<T> {
|
|
22
|
+
#listeners: Set<(T) => void> = new Set();
|
|
23
|
+
|
|
24
|
+
addEventListener(listener: T => void): void {
|
|
25
|
+
this.#listeners.add(listener);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
removeEventListener(listener: T => void): void {
|
|
29
|
+
this.#listeners.delete(listener);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
emit(value: T): void {
|
|
33
|
+
// Assuming that listeners won't throw.
|
|
34
|
+
for (const listener of this.#listeners) {
|
|
35
|
+
listener(value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class Domain {
|
|
41
|
+
name: DomainName;
|
|
42
|
+
onMessage: EventScope<JSONValue>;
|
|
43
|
+
|
|
44
|
+
constructor(name: DomainName) {
|
|
45
|
+
if (global[FuseboxReactDevToolsDispatcher.BINDING_NAME] == null) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Could not create domain ${name}: receiving end doesn't exist`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.name = name;
|
|
52
|
+
this.onMessage = new EventScope<JSONValue>();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
sendMessage(message: JSONValue) {
|
|
56
|
+
const messageWithDomain = {domain: this.name, message};
|
|
57
|
+
const serializedMessageWithDomain = JSON.stringify(messageWithDomain);
|
|
58
|
+
|
|
59
|
+
global[FuseboxReactDevToolsDispatcher.BINDING_NAME](
|
|
60
|
+
serializedMessageWithDomain,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
class FuseboxReactDevToolsDispatcher {
|
|
66
|
+
static #domainNameToDomainMap: Map<DomainName, Domain> = new Map();
|
|
67
|
+
|
|
68
|
+
// Referenced and initialized from Chrome DevTools frontend.
|
|
69
|
+
static BINDING_NAME: string = '__CHROME_DEVTOOLS_FRONTEND_BINDING__';
|
|
70
|
+
static onDomainInitialization: EventScope<Domain> = new EventScope<Domain>();
|
|
71
|
+
|
|
72
|
+
// Should be private, referenced from Chrome DevTools frontend only.
|
|
73
|
+
static initializeDomain(domainName: DomainName): Domain {
|
|
74
|
+
const domain = new Domain(domainName);
|
|
75
|
+
|
|
76
|
+
this.#domainNameToDomainMap.set(domainName, domain);
|
|
77
|
+
this.onDomainInitialization.emit(domain);
|
|
78
|
+
|
|
79
|
+
return domain;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Should be private, referenced from Chrome DevTools frontend only.
|
|
83
|
+
static sendMessage(domainName: DomainName, message: string): void {
|
|
84
|
+
const domain = this.#domainNameToDomainMap.get(domainName);
|
|
85
|
+
if (domain == null) {
|
|
86
|
+
throw new Error(
|
|
87
|
+
`Could not send message to ${domainName}: domain doesn't exist`,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
const parsedMessage = JSON.parse(message);
|
|
93
|
+
domain.onMessage.emit(parsedMessage);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.error(
|
|
96
|
+
`Error while trying to send a message to domain ${domainName}:`,
|
|
97
|
+
err,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
Object.defineProperty(global, '__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__', {
|
|
104
|
+
value: FuseboxReactDevToolsDispatcher,
|
|
105
|
+
configurable: false,
|
|
106
|
+
enumerable: false,
|
|
107
|
+
writable: false,
|
|
108
|
+
});
|
|
@@ -101,13 +101,6 @@ export interface Spec extends TurboModule {
|
|
|
101
101
|
+getDefaultEventTypes?: () => Array<string>;
|
|
102
102
|
+setLayoutAnimationEnabledExperimental?: (enabled: boolean) => void;
|
|
103
103
|
+sendAccessibilityEvent?: (reactTag: number, eventType: number) => void;
|
|
104
|
-
+showPopupMenu?: (
|
|
105
|
-
reactTag: number,
|
|
106
|
-
items: Array<string>,
|
|
107
|
-
error: (error: Object) => void,
|
|
108
|
-
success: (event: string, selected?: number) => void,
|
|
109
|
-
) => void;
|
|
110
|
-
+dismissPopupMenu?: () => void;
|
|
111
104
|
|
|
112
105
|
// ios only
|
|
113
106
|
+lazilyLoadView?: (name: string) => Object; // revisit return
|
|
@@ -100,11 +100,17 @@ const onPerformanceEntry = () => {
|
|
|
100
100
|
const durationThreshold = observerConfig.entryTypes.get(entry.entryType);
|
|
101
101
|
return entry.duration >= (durationThreshold ?? 0);
|
|
102
102
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
if (entriesForObserver.length !== 0) {
|
|
104
|
+
try {
|
|
105
|
+
observerConfig.callback(
|
|
106
|
+
new PerformanceObserverEntryList(entriesForObserver),
|
|
107
|
+
observer,
|
|
108
|
+
droppedEntriesCount,
|
|
109
|
+
);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(error);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
108
114
|
}
|
|
109
115
|
};
|
|
110
116
|
|