react-native-windows 0.67.0-preview.6 → 0.67.2
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/CHANGELOG.json +198 -0
- package/CHANGELOG.md +82 -5
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/Pressable/Pressable.windows.js +33 -0
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Pressability/HoverState.js +4 -0
- package/Microsoft.ReactNative/JsiApi.cpp +3 -3
- package/Microsoft.ReactNative/JsiApi.h +4 -4
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/ReactHost/ReactContext.h +2 -2
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +17 -7
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +2 -2
- package/Microsoft.ReactNative.Cxx/NativeModules.h +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/Shared/ChakraRuntimeHolder.cpp +4 -0
- package/Shared/ChakraRuntimeHolder.h +2 -1
- package/Shared/DevSettings.h +3 -5
- package/Shared/HermesRuntimeHolder.cpp +4 -0
- package/Shared/HermesRuntimeHolder.h +2 -1
- package/Shared/JSI/NapiJsiV8RuntimeHolder.cpp +6 -2
- package/Shared/JSI/NapiJsiV8RuntimeHolder.h +2 -1
- package/Shared/JSI/RuntimeHolder.h +5 -4
- package/Shared/OInstance.cpp +17 -4
- package/Shared/V8JSIRuntimeHolder.cpp +4 -0
- package/Shared/V8JSIRuntimeHolder.h +2 -1
- package/jest/preprocessor.js +7 -75
- package/package.json +8 -8
- package/template/shared-app/proj/NuGet.Config +2 -0
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,204 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Mon, 21 Feb 2022 16:17:54 GMT",
|
|
6
|
+
"tag": "react-native-windows_v0.67.2",
|
|
7
|
+
"version": "0.67.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
12
|
+
"package": "react-native-windows",
|
|
13
|
+
"commit": "51ab377259fd27cfec658ea8e2c694f9d432e90a",
|
|
14
|
+
"comment": "Use temporary folder to store V8 JS bytecode"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "react-native-windows",
|
|
19
|
+
"comment": "Bump @react-native-windows/cli to v0.67.1",
|
|
20
|
+
"commit": "51ab377259fd27cfec658ea8e2c694f9d432e90a"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Mon, 07 Feb 2022 16:12:57 GMT",
|
|
27
|
+
"tag": "react-native-windows_v0.67.1",
|
|
28
|
+
"version": "0.67.1",
|
|
29
|
+
"comments": {
|
|
30
|
+
"patch": [
|
|
31
|
+
{
|
|
32
|
+
"author": "anandrag@microsoft.com",
|
|
33
|
+
"package": "react-native-windows",
|
|
34
|
+
"commit": "not available",
|
|
35
|
+
"comment": "Hermes inspector is not starting when Hermes engine is used (#9426)"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "julio.rocha@microsoft.com",
|
|
39
|
+
"package": "react-native-windows",
|
|
40
|
+
"commit": "not available",
|
|
41
|
+
"comment": "Replace __APPLE__ with __clang__ where applicable (#9461)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
45
|
+
"package": "react-native-windows",
|
|
46
|
+
"commit": "not available",
|
|
47
|
+
"comment": "UI Manager module is not being destroyed on the UI thread"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"date": "Mon, 07 Feb 2022 16:12:39 GMT",
|
|
54
|
+
"tag": "react-native-windows_v0.67.1",
|
|
55
|
+
"version": "0.67.1",
|
|
56
|
+
"comments": {
|
|
57
|
+
"patch": [
|
|
58
|
+
{
|
|
59
|
+
"author": "anandrag@microsoft.com",
|
|
60
|
+
"package": "react-native-windows",
|
|
61
|
+
"commit": "81a6b931d7df9db4d5667c4961e22707d5238194",
|
|
62
|
+
"comment": "Hermes inspector is not starting when Hermes engine is used (#9426)"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "julio.rocha@microsoft.com",
|
|
66
|
+
"package": "react-native-windows",
|
|
67
|
+
"commit": "8c8248af3d324b55adce0d4e41bfc2957a3f4446",
|
|
68
|
+
"comment": "Replace __APPLE__ with __clang__ where applicable (#9461)"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
72
|
+
"package": "react-native-windows",
|
|
73
|
+
"commit": "d57cded6b8bef14f8a0b2d24ab978eaf8f290354",
|
|
74
|
+
"comment": "UI Manager module is not being destroyed on the UI thread"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"date": "Mon, 24 Jan 2022 16:13:22 GMT",
|
|
81
|
+
"tag": "react-native-windows_v0.67.0",
|
|
82
|
+
"version": "0.67.0",
|
|
83
|
+
"comments": {
|
|
84
|
+
"patch": [
|
|
85
|
+
{
|
|
86
|
+
"author": "jthysell@microsoft.com",
|
|
87
|
+
"package": "react-native-windows",
|
|
88
|
+
"commit": "not available",
|
|
89
|
+
"comment": "[0.67] Remove ADO NuGet feed from config for new projects"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "ngerlem@microsoft.com",
|
|
93
|
+
"package": "react-native-windows",
|
|
94
|
+
"commit": "not available",
|
|
95
|
+
"comment": "Promote 0.67 to latest"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "react-native-windows",
|
|
100
|
+
"comment": "Bump @react-native-windows/cli to v0.67.0",
|
|
101
|
+
"commit": "f3ec055a5554558b61b538fcb405719a00249bef"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"author": "beachball",
|
|
105
|
+
"package": "react-native-windows",
|
|
106
|
+
"comment": "Bump @react-native-windows/virtualized-list to v0.67.0",
|
|
107
|
+
"commit": "f3ec055a5554558b61b538fcb405719a00249bef"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"author": "beachball",
|
|
111
|
+
"package": "react-native-windows",
|
|
112
|
+
"comment": "Bump @react-native-windows/codegen to v0.67.0",
|
|
113
|
+
"commit": "f3ec055a5554558b61b538fcb405719a00249bef"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"date": "Mon, 24 Jan 2022 16:12:32 GMT",
|
|
120
|
+
"tag": "react-native-windows_v0.67.0",
|
|
121
|
+
"version": "0.67.0",
|
|
122
|
+
"comments": {
|
|
123
|
+
"patch": [
|
|
124
|
+
{
|
|
125
|
+
"author": "jthysell@microsoft.com",
|
|
126
|
+
"package": "react-native-windows",
|
|
127
|
+
"commit": "a1a4439e47c2a98356d7b9b1af765d3907567e16",
|
|
128
|
+
"comment": "[0.67] Remove ADO NuGet feed from config for new projects"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"author": "ngerlem@microsoft.com",
|
|
132
|
+
"package": "react-native-windows",
|
|
133
|
+
"commit": "56818ebc599aa084aa9ffc949691f1be71da169a",
|
|
134
|
+
"comment": "Promote 0.67 to latest"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"author": "beachball",
|
|
138
|
+
"package": "react-native-windows",
|
|
139
|
+
"comment": "Bump @react-native-windows/cli to v0.67.0",
|
|
140
|
+
"commit": "56818ebc599aa084aa9ffc949691f1be71da169a"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"author": "beachball",
|
|
144
|
+
"package": "react-native-windows",
|
|
145
|
+
"comment": "Bump @react-native-windows/virtualized-list to v0.67.0",
|
|
146
|
+
"commit": "56818ebc599aa084aa9ffc949691f1be71da169a"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"author": "beachball",
|
|
150
|
+
"package": "react-native-windows",
|
|
151
|
+
"comment": "Bump @react-native-windows/codegen to v0.67.0",
|
|
152
|
+
"commit": "56818ebc599aa084aa9ffc949691f1be71da169a"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"date": "Mon, 17 Jan 2022 16:12:54 GMT",
|
|
159
|
+
"tag": "react-native-windows_v0.67.0-preview.7",
|
|
160
|
+
"version": "0.67.0-preview.7",
|
|
161
|
+
"comments": {
|
|
162
|
+
"prerelease": [
|
|
163
|
+
{
|
|
164
|
+
"author": "saadnajmi2@gmail.com",
|
|
165
|
+
"package": "react-native-windows",
|
|
166
|
+
"commit": "not available",
|
|
167
|
+
"comment": "Fork HoverState.js to allow hover events on Pressable"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"date": "Mon, 17 Jan 2022 16:12:13 GMT",
|
|
174
|
+
"tag": "react-native-windows_v0.67.0-preview.7",
|
|
175
|
+
"version": "0.67.0-preview.7",
|
|
176
|
+
"comments": {
|
|
177
|
+
"prerelease": [
|
|
178
|
+
{
|
|
179
|
+
"author": "saadnajmi2@gmail.com",
|
|
180
|
+
"package": "react-native-windows",
|
|
181
|
+
"commit": "b58a8738eecd8a3d6a2b918fc35d9a7b93b4437a",
|
|
182
|
+
"comment": "Fork HoverState.js to allow hover events on Pressable"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"date": "Mon, 03 Jan 2022 16:12:09 GMT",
|
|
189
|
+
"tag": "react-native-windows_v0.67.0-preview.6",
|
|
190
|
+
"version": "0.67.0-preview.6",
|
|
191
|
+
"comments": {
|
|
192
|
+
"prerelease": [
|
|
193
|
+
{
|
|
194
|
+
"author": "julio.rocha@microsoft.com",
|
|
195
|
+
"package": "react-native-windows",
|
|
196
|
+
"commit": "not available",
|
|
197
|
+
"comment": "[0.67] Avoid capturing raw this pointer in WebSocket module"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
},
|
|
4
202
|
{
|
|
5
203
|
"date": "Mon, 03 Jan 2022 16:11:53 GMT",
|
|
6
204
|
"tag": "react-native-windows_v0.67.0-preview.6",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,94 @@
|
|
|
1
1
|
# Change Log - react-native-windows
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon,
|
|
3
|
+
This log was last generated on Mon, 21 Feb 2022 16:17:54 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.67.
|
|
7
|
+
## 0.67.2
|
|
8
8
|
|
|
9
|
-
Mon,
|
|
9
|
+
Mon, 21 Feb 2022 16:17:54 GMT
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Patches
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- Use temporary folder to store V8 JS bytecode (30809111+acoates-ms@users.noreply.github.com)
|
|
14
|
+
- Bump @react-native-windows/cli to v0.67.1
|
|
14
15
|
|
|
16
|
+
## 0.67.1
|
|
17
|
+
|
|
18
|
+
Mon, 07 Feb 2022 16:12:57 GMT
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- Hermes inspector is not starting when Hermes engine is used (#9426) (anandrag@microsoft.com)
|
|
23
|
+
- Replace __APPLE__ with __clang__ where applicable (#9461) (julio.rocha@microsoft.com)
|
|
24
|
+
- UI Manager module is not being destroyed on the UI thread (30809111+acoates-ms@users.noreply.github.com)
|
|
25
|
+
|
|
26
|
+
## 0.67.1
|
|
27
|
+
|
|
28
|
+
Mon, 07 Feb 2022 16:12:39 GMT
|
|
29
|
+
|
|
30
|
+
### Patches
|
|
31
|
+
|
|
32
|
+
- Hermes inspector is not starting when Hermes engine is used (#9426) (anandrag@microsoft.com)
|
|
33
|
+
- Replace __APPLE__ with __clang__ where applicable (#9461) (julio.rocha@microsoft.com)
|
|
34
|
+
- UI Manager module is not being destroyed on the UI thread (30809111+acoates-ms@users.noreply.github.com)
|
|
35
|
+
|
|
36
|
+
## 0.67.0
|
|
37
|
+
|
|
38
|
+
Mon, 24 Jan 2022 16:13:22 GMT
|
|
39
|
+
|
|
40
|
+
### Patches
|
|
41
|
+
|
|
42
|
+
- [0.67] Remove ADO NuGet feed from config for new projects (jthysell@microsoft.com)
|
|
43
|
+
- Promote 0.67 to latest (ngerlem@microsoft.com)
|
|
44
|
+
- Bump @react-native-windows/cli to v0.67.0
|
|
45
|
+
- Bump @react-native-windows/virtualized-list to v0.67.0
|
|
46
|
+
- Bump @react-native-windows/codegen to v0.67.0
|
|
47
|
+
|
|
48
|
+
## 0.67.0
|
|
49
|
+
|
|
50
|
+
Mon, 24 Jan 2022 16:12:32 GMT
|
|
51
|
+
|
|
52
|
+
### Patches
|
|
53
|
+
|
|
54
|
+
- [0.67] Remove ADO NuGet feed from config for new projects (jthysell@microsoft.com)
|
|
55
|
+
- Promote 0.67 to latest (ngerlem@microsoft.com)
|
|
56
|
+
- Bump @react-native-windows/cli to v0.67.0
|
|
57
|
+
- Bump @react-native-windows/virtualized-list to v0.67.0
|
|
58
|
+
- Bump @react-native-windows/codegen to v0.67.0
|
|
59
|
+
|
|
60
|
+
## 0.67.0-preview.7
|
|
61
|
+
|
|
62
|
+
Mon, 17 Jan 2022 16:12:54 GMT
|
|
63
|
+
|
|
64
|
+
### Changes
|
|
65
|
+
|
|
66
|
+
- Fork HoverState.js to allow hover events on Pressable (saadnajmi2@gmail.com)
|
|
67
|
+
|
|
68
|
+
## 0.67.0-preview.7
|
|
69
|
+
|
|
70
|
+
Mon, 17 Jan 2022 16:12:13 GMT
|
|
71
|
+
|
|
72
|
+
### Changes
|
|
73
|
+
|
|
74
|
+
- Fork HoverState.js to allow hover events on Pressable (saadnajmi2@gmail.com)
|
|
75
|
+
|
|
76
|
+
## 0.67.0-preview.6
|
|
77
|
+
|
|
78
|
+
Mon, 03 Jan 2022 16:12:09 GMT
|
|
79
|
+
|
|
80
|
+
### Changes
|
|
81
|
+
|
|
82
|
+
- [0.67] Avoid capturing raw this pointer in WebSocket module (julio.rocha@microsoft.com)
|
|
83
|
+
|
|
84
|
+
## 0.67.0-preview.6
|
|
85
|
+
|
|
86
|
+
Mon, 03 Jan 2022 16:11:53 GMT
|
|
87
|
+
|
|
88
|
+
### Changes
|
|
89
|
+
|
|
90
|
+
- [0.67] Avoid capturing raw this pointer in WebSocket module (julio.rocha@microsoft.com)
|
|
91
|
+
|
|
15
92
|
## 0.67.0-preview.5
|
|
16
93
|
|
|
17
94
|
Mon, 06 Dec 2021 16:10:50 GMT
|
|
@@ -141,9 +141,9 @@ class Keyboard {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* @deprecated Use `remove` on the EventSubscription from `
|
|
144
|
+
* @deprecated Use `remove` on the EventSubscription from `addListener`.
|
|
145
145
|
*/
|
|
146
|
-
|
|
146
|
+
removeListener<K: $Keys<KeyboardEventDefinitions>>(
|
|
147
147
|
eventType: K,
|
|
148
148
|
listener: (...$ElementType<KeyboardEventDefinitions, K>) => mixed,
|
|
149
149
|
): void {
|
|
@@ -25,6 +25,7 @@ import usePressability from '../../Pressability/usePressability';
|
|
|
25
25
|
import {normalizeRect, type RectOrSize} from '../../StyleSheet/Rect';
|
|
26
26
|
import type {
|
|
27
27
|
LayoutEvent,
|
|
28
|
+
MouseEvent,
|
|
28
29
|
PressEvent,
|
|
29
30
|
// [Windows
|
|
30
31
|
BlurEvent,
|
|
@@ -72,6 +73,16 @@ type Props = $ReadOnly<{|
|
|
|
72
73
|
*/
|
|
73
74
|
children: React.Node | ((state: StateCallbackType) => React.Node),
|
|
74
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Duration to wait after hover in before calling `onHoverIn`.
|
|
78
|
+
*/
|
|
79
|
+
delayHoverIn?: ?number,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Duration to wait after hover out before calling `onHoverOut`.
|
|
83
|
+
*/
|
|
84
|
+
delayHoverOut?: ?number,
|
|
85
|
+
|
|
75
86
|
/**
|
|
76
87
|
* Duration (in milliseconds) from `onPressIn` before `onLongPress` is called.
|
|
77
88
|
*/
|
|
@@ -98,6 +109,16 @@ type Props = $ReadOnly<{|
|
|
|
98
109
|
*/
|
|
99
110
|
onLayout?: ?(event: LayoutEvent) => mixed,
|
|
100
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Called when the hover is activated to provide visual feedback.
|
|
114
|
+
*/
|
|
115
|
+
onHoverIn?: ?(event: MouseEvent) => mixed,
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Called when the hover is deactivated to undo visual feedback.
|
|
119
|
+
*/
|
|
120
|
+
onHoverOut?: ?(event: MouseEvent) => mixed,
|
|
121
|
+
|
|
101
122
|
/**
|
|
102
123
|
* Called when a long-tap gesture is detected.
|
|
103
124
|
*/
|
|
@@ -201,9 +222,13 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
201
222
|
android_ripple,
|
|
202
223
|
cancelable,
|
|
203
224
|
children,
|
|
225
|
+
delayHoverIn,
|
|
226
|
+
delayHoverOut,
|
|
204
227
|
delayLongPress,
|
|
205
228
|
disabled,
|
|
206
229
|
focusable,
|
|
230
|
+
onHoverIn,
|
|
231
|
+
onHoverOut,
|
|
207
232
|
onLongPress,
|
|
208
233
|
onPress,
|
|
209
234
|
onPressIn,
|
|
@@ -267,8 +292,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
267
292
|
hitSlop,
|
|
268
293
|
pressRectOffset: pressRetentionOffset,
|
|
269
294
|
android_disableSound,
|
|
295
|
+
delayHoverIn,
|
|
296
|
+
delayHoverOut,
|
|
270
297
|
delayLongPress,
|
|
271
298
|
delayPressIn: unstable_pressDelay,
|
|
299
|
+
onHoverIn,
|
|
300
|
+
onHoverOut,
|
|
272
301
|
onLongPress,
|
|
273
302
|
onPress,
|
|
274
303
|
onPressIn(event: PressEvent): void {
|
|
@@ -301,9 +330,13 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
301
330
|
android_disableSound,
|
|
302
331
|
android_rippleConfig,
|
|
303
332
|
cancelable,
|
|
333
|
+
delayHoverIn,
|
|
334
|
+
delayHoverOut,
|
|
304
335
|
delayLongPress,
|
|
305
336
|
disabled,
|
|
306
337
|
hitSlop,
|
|
338
|
+
onHoverIn,
|
|
339
|
+
onHoverOut,
|
|
307
340
|
onLongPress,
|
|
308
341
|
onPress,
|
|
309
342
|
onPressIn,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @generated by scripts/
|
|
2
|
+
* @generated by scripts/set-rn-version.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
5
|
*
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
exports.version = {
|
|
13
13
|
major: 0,
|
|
14
14
|
minor: 67,
|
|
15
|
-
patch:
|
|
16
|
-
prerelease:
|
|
15
|
+
patch: 1,
|
|
16
|
+
prerelease: null,
|
|
17
17
|
};
|
|
@@ -49,6 +49,10 @@ if (Platform.OS === 'web') {
|
|
|
49
49
|
document.addEventListener('touchmove', disableHover, true);
|
|
50
50
|
document.addEventListener('mousemove', enableHover, true);
|
|
51
51
|
}
|
|
52
|
+
// [Windows
|
|
53
|
+
} else if (Platform.OS === 'windows') {
|
|
54
|
+
isEnabled = true;
|
|
55
|
+
// Windows]
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
export function isHoverEnabled(): boolean {
|
|
@@ -395,7 +395,7 @@ facebook::jsi::JSError const &jsError) { \
|
|
|
395
395
|
}
|
|
396
396
|
|
|
397
397
|
/*static*/ ReactNative::JsiRuntime JsiRuntime::GetOrCreate(
|
|
398
|
-
std::shared_ptr
|
|
398
|
+
std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
|
|
399
399
|
std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept {
|
|
400
400
|
{
|
|
401
401
|
std::scoped_lock lock{s_mutex};
|
|
@@ -409,7 +409,7 @@ facebook::jsi::JSError const &jsError) { \
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
/*static*/ ReactNative::JsiRuntime JsiRuntime::Create(
|
|
412
|
-
std::shared_ptr
|
|
412
|
+
std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
|
|
413
413
|
std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept {
|
|
414
414
|
// There are some functions that we cannot do using JSI such as
|
|
415
415
|
// defining a property or using Symbol as a key.
|
|
@@ -445,7 +445,7 @@ ReactNative::JsiRuntime JsiRuntime::MakeChakraRuntime() {
|
|
|
445
445
|
}
|
|
446
446
|
|
|
447
447
|
JsiRuntime::JsiRuntime(
|
|
448
|
-
std::shared_ptr
|
|
448
|
+
std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> &&runtimeHolder,
|
|
449
449
|
std::shared_ptr<facebook::jsi::Runtime> &&runtime) noexcept
|
|
450
450
|
: m_runtimeHolder{std::move(runtimeHolder)},
|
|
451
451
|
m_runtime{std::move(runtime)},
|
|
@@ -58,16 +58,16 @@ struct RuntimeAccessor;
|
|
|
58
58
|
|
|
59
59
|
struct JsiRuntime : JsiRuntimeT<JsiRuntime> {
|
|
60
60
|
JsiRuntime(
|
|
61
|
-
std::shared_ptr
|
|
61
|
+
std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> &&runtimeHolder,
|
|
62
62
|
std::shared_ptr<facebook::jsi::Runtime> &&runtime) noexcept;
|
|
63
63
|
~JsiRuntime() noexcept;
|
|
64
64
|
|
|
65
65
|
static ReactNative::JsiRuntime FromRuntime(facebook::jsi::Runtime &runtime) noexcept;
|
|
66
66
|
static ReactNative::JsiRuntime GetOrCreate(
|
|
67
|
-
std::shared_ptr
|
|
67
|
+
std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
|
|
68
68
|
std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept;
|
|
69
69
|
static ReactNative::JsiRuntime Create(
|
|
70
|
-
std::shared_ptr
|
|
70
|
+
std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> const &jsiRuntimeHolder,
|
|
71
71
|
std::shared_ptr<facebook::jsi::Runtime> const &jsiRuntime) noexcept;
|
|
72
72
|
|
|
73
73
|
public: // JsiRuntime
|
|
@@ -168,7 +168,7 @@ struct JsiRuntime : JsiRuntimeT<JsiRuntime> {
|
|
|
168
168
|
void SetError(facebook::jsi::JSINativeException const &nativeException) noexcept;
|
|
169
169
|
|
|
170
170
|
private:
|
|
171
|
-
std::shared_ptr
|
|
171
|
+
std::shared_ptr<::Microsoft::JSI::RuntimeHolderLazyInit> m_runtimeHolder;
|
|
172
172
|
std::shared_ptr<facebook::jsi::Runtime> m_runtime;
|
|
173
173
|
RuntimeAccessor *m_runtimeAccessor{};
|
|
174
174
|
std::mutex m_mutex;
|
|
@@ -530,7 +530,7 @@ UIManager::UIManager() : m_module(std::make_shared<UIManagerModule>()) {}
|
|
|
530
530
|
UIManager::~UIManager() {
|
|
531
531
|
// To make sure that we destroy UI components in UI thread.
|
|
532
532
|
if (!m_context.UIDispatcher().HasThreadAccess()) {
|
|
533
|
-
m_context.UIDispatcher().Post([module = std::move(m_module)]() {});
|
|
533
|
+
m_context.UIDispatcher().Post([module = std::move(m_module)]() mutable { module = nullptr; });
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#include <Base/CoreNativeModules.h>
|
|
9
9
|
#include <Threading/MessageDispatchQueue.h>
|
|
10
10
|
#include <Threading/MessageQueueThreadFactory.h>
|
|
11
|
+
#include <appModel.h>
|
|
11
12
|
#include <comUtil/qiCast.h>
|
|
12
13
|
|
|
13
14
|
#ifndef CORE_ABI
|
|
@@ -446,10 +447,19 @@ void ReactInstanceWin::Initialize() noexcept {
|
|
|
446
447
|
break;
|
|
447
448
|
case JSIEngine::V8:
|
|
448
449
|
#if defined(USE_V8)
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
{
|
|
451
|
+
uint32_t length{0};
|
|
452
|
+
if (GetCurrentPackageFullName(&length, nullptr) != APPMODEL_ERROR_NO_PACKAGE) {
|
|
453
|
+
preparedScriptStore =
|
|
454
|
+
std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(getApplicationTempFolder());
|
|
455
|
+
} else {
|
|
456
|
+
wchar_t tempPath[MAX_PATH];
|
|
457
|
+
if (GetTempPathW(static_cast<DWORD>(std::size(tempPath)), tempPath)) {
|
|
458
|
+
preparedScriptStore =
|
|
459
|
+
std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(winrt::to_string(tempPath));
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
453
463
|
devSettings->jsiRuntimeHolder = std::make_shared<facebook::react::V8JSIRuntimeHolder>(
|
|
454
464
|
devSettings, m_jsMessageThread.Load(), std::move(scriptStore), std::move(preparedScriptStore));
|
|
455
465
|
break;
|
|
@@ -899,7 +909,7 @@ void ReactInstanceWin::DispatchEvent(int64_t viewTag, std::string &&eventName, f
|
|
|
899
909
|
}
|
|
900
910
|
|
|
901
911
|
winrt::Microsoft::ReactNative::JsiRuntime ReactInstanceWin::JsiRuntime() noexcept {
|
|
902
|
-
std::shared_ptr<
|
|
912
|
+
std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> jsiRuntimeHolder;
|
|
903
913
|
{
|
|
904
914
|
std::scoped_lock lock{m_mutex};
|
|
905
915
|
if (m_jsiRuntime) {
|
|
@@ -1005,8 +1015,8 @@ Mso::CntPtr<IReactInstanceInternal> MakeReactInstance(
|
|
|
1005
1015
|
}
|
|
1006
1016
|
|
|
1007
1017
|
#if defined(USE_V8)
|
|
1008
|
-
std::string ReactInstanceWin::
|
|
1009
|
-
auto local = winrt::Windows::Storage::ApplicationData::Current().
|
|
1018
|
+
std::string ReactInstanceWin::getApplicationTempFolder() {
|
|
1019
|
+
auto local = winrt::Windows::Storage::ApplicationData::Current().TemporaryFolder().Path();
|
|
1010
1020
|
|
|
1011
1021
|
return Microsoft::Common::Unicode::Utf16ToUtf8(local.c_str(), local.size()) + "\\";
|
|
1012
1022
|
}
|
|
@@ -131,7 +131,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
#if defined(USE_V8)
|
|
134
|
-
static std::string
|
|
134
|
+
static std::string getApplicationTempFolder();
|
|
135
135
|
#endif
|
|
136
136
|
|
|
137
137
|
private: // immutable fields
|
|
@@ -184,7 +184,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|
|
184
184
|
Mso::CntPtr<Mso::React::IDispatchQueue2> m_uiQueue;
|
|
185
185
|
std::deque<JSCallEntry> m_jsCallQueue;
|
|
186
186
|
|
|
187
|
-
std::shared_ptr<
|
|
187
|
+
std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> m_jsiRuntimeHolder;
|
|
188
188
|
winrt::Microsoft::ReactNative::JsiRuntime m_jsiRuntime{nullptr};
|
|
189
189
|
};
|
|
190
190
|
|
|
@@ -301,7 +301,7 @@ constexpr void ValidateCoroutineArg() noexcept {
|
|
|
301
301
|
static_assert(
|
|
302
302
|
!std::is_reference_v<TArg> && !std::is_pointer_v<TArg>,
|
|
303
303
|
"Coroutine parameter must be passed by value for safe access"
|
|
304
|
-
#ifndef
|
|
304
|
+
#ifndef __clang__
|
|
305
305
|
": " __FUNCSIG__
|
|
306
306
|
#endif
|
|
307
307
|
);
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.67.
|
|
13
|
+
<ReactNativeWindowsVersion>0.67.2</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>67</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>2</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
18
|
</PropertyGroup>
|
|
19
19
|
</Project>
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
namespace Microsoft::JSI {
|
|
11
11
|
|
|
12
|
+
facebook::react::JSIEngineOverride ChakraRuntimeHolder::getRuntimeType() noexcept {
|
|
13
|
+
return facebook::react::JSIEngineOverride::Chakra;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
std::shared_ptr<facebook::jsi::Runtime> ChakraRuntimeHolder::getRuntime() noexcept {
|
|
13
17
|
std::call_once(once_flag_, [this]() { initRuntime(); });
|
|
14
18
|
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
namespace Microsoft::JSI {
|
|
14
14
|
|
|
15
|
-
class ChakraRuntimeHolder final : public
|
|
15
|
+
class ChakraRuntimeHolder final : public Microsoft::JSI::RuntimeHolderLazyInit {
|
|
16
16
|
public:
|
|
17
17
|
std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
|
|
18
|
+
facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
|
|
18
19
|
|
|
19
20
|
ChakraRuntimeHolder(
|
|
20
21
|
std::shared_ptr<facebook::react::DevSettings> devSettings,
|
package/Shared/DevSettings.h
CHANGED
|
@@ -14,11 +14,9 @@
|
|
|
14
14
|
#define STRING_(s) #s
|
|
15
15
|
#define STRING(s) STRING_(s)
|
|
16
16
|
|
|
17
|
-
namespace
|
|
18
|
-
namespace jsi {
|
|
17
|
+
namespace Microsoft::JSI {
|
|
19
18
|
struct RuntimeHolderLazyInit;
|
|
20
|
-
}
|
|
21
|
-
} // namespace facebook
|
|
19
|
+
} // namespace Microsoft::JSI
|
|
22
20
|
|
|
23
21
|
namespace facebook {
|
|
24
22
|
namespace react {
|
|
@@ -81,7 +79,7 @@ struct DevSettings {
|
|
|
81
79
|
/// instance. This object should in general be used only from the JS engine
|
|
82
80
|
/// thread, unless the specific runtime implementation explicitly guarantees
|
|
83
81
|
/// reentrancy.
|
|
84
|
-
std::shared_ptr<
|
|
82
|
+
std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> jsiRuntimeHolder;
|
|
85
83
|
|
|
86
84
|
// Until the ABI story is addressed we'll use this instead of the above for
|
|
87
85
|
// the purposes of selecting a JSI Runtime to use.
|
|
@@ -72,6 +72,10 @@ class HermesExecutorRuntimeAdapter final : public facebook::hermes::inspector::R
|
|
|
72
72
|
|
|
73
73
|
} // namespace
|
|
74
74
|
|
|
75
|
+
facebook::react::JSIEngineOverride HermesRuntimeHolder::getRuntimeType() noexcept {
|
|
76
|
+
return facebook::react::JSIEngineOverride::Hermes;
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
std::shared_ptr<jsi::Runtime> HermesRuntimeHolder::getRuntime() noexcept {
|
|
76
80
|
std::call_once(m_once_flag, [this]() { initRuntime(); });
|
|
77
81
|
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
namespace facebook {
|
|
13
13
|
namespace react {
|
|
14
14
|
|
|
15
|
-
class HermesRuntimeHolder : public
|
|
15
|
+
class HermesRuntimeHolder : public Microsoft::JSI::RuntimeHolderLazyInit {
|
|
16
16
|
public:
|
|
17
17
|
std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
|
|
18
|
+
facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
|
|
18
19
|
|
|
19
20
|
HermesRuntimeHolder(
|
|
20
21
|
std::shared_ptr<facebook::react::DevSettings> devSettings,
|
|
@@ -96,7 +96,11 @@ void NapiJsiV8RuntimeHolder::InitRuntime() noexcept {
|
|
|
96
96
|
m_ownThreadId = std::this_thread::get_id();
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
#pragma region
|
|
99
|
+
#pragma region Microsoft::JSI::RuntimeHolderLazyInit
|
|
100
|
+
|
|
101
|
+
facebook::react::JSIEngineOverride NapiJsiV8RuntimeHolder::getRuntimeType() noexcept {
|
|
102
|
+
return facebook::react::JSIEngineOverride::V8NodeApi;
|
|
103
|
+
}
|
|
100
104
|
|
|
101
105
|
shared_ptr<Runtime> NapiJsiV8RuntimeHolder::getRuntime() noexcept /*override*/
|
|
102
106
|
{
|
|
@@ -112,6 +116,6 @@ shared_ptr<Runtime> NapiJsiV8RuntimeHolder::getRuntime() noexcept /*override*/
|
|
|
112
116
|
return m_runtime;
|
|
113
117
|
}
|
|
114
118
|
|
|
115
|
-
#pragma endregion
|
|
119
|
+
#pragma endregion Microsoft::JSI::RuntimeHolderLazyInit
|
|
116
120
|
|
|
117
121
|
} // namespace Microsoft::JSI
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
namespace Microsoft::JSI {
|
|
12
12
|
|
|
13
|
-
class NapiJsiV8RuntimeHolder : public
|
|
13
|
+
class NapiJsiV8RuntimeHolder : public Microsoft::JSI::RuntimeHolderLazyInit {
|
|
14
14
|
public:
|
|
15
15
|
std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
|
|
16
|
+
facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
|
|
16
17
|
|
|
17
18
|
NapiJsiV8RuntimeHolder(
|
|
18
19
|
std::shared_ptr<facebook::react::DevSettings> devSettings,
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
#include <jsi/jsi.h>
|
|
4
4
|
#include <memory>
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
#include <DevSettings.h>
|
|
7
|
+
|
|
8
|
+
namespace Microsoft::JSI {
|
|
8
9
|
|
|
9
10
|
// An instance of this interface is expected to
|
|
10
11
|
// a. lazily create a JSI Runtime on the first call to getRuntime
|
|
@@ -15,7 +16,7 @@ namespace jsi {
|
|
|
15
16
|
|
|
16
17
|
struct RuntimeHolderLazyInit {
|
|
17
18
|
virtual std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept = 0;
|
|
19
|
+
virtual facebook::react::JSIEngineOverride getRuntimeType() noexcept = 0;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
|
-
} // namespace
|
|
21
|
-
} // namespace facebook
|
|
22
|
+
} // namespace Microsoft::JSI
|
package/Shared/OInstance.cpp
CHANGED
|
@@ -193,7 +193,7 @@ class OJSIExecutorFactory : public JSExecutorFactory {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
OJSIExecutorFactory(
|
|
196
|
-
std::shared_ptr<
|
|
196
|
+
std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> runtimeHolder,
|
|
197
197
|
NativeLoggingHook loggingHook,
|
|
198
198
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
|
|
199
199
|
bool isProfilingEnabled,
|
|
@@ -205,7 +205,7 @@ class OJSIExecutorFactory : public JSExecutorFactory {
|
|
|
205
205
|
isProfilingEnabled_{isProfilingEnabled} {}
|
|
206
206
|
|
|
207
207
|
private:
|
|
208
|
-
std::shared_ptr<
|
|
208
|
+
std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> runtimeHolder_;
|
|
209
209
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry_;
|
|
210
210
|
std::shared_ptr<CallInvoker> jsCallInvoker_;
|
|
211
211
|
NativeLoggingHook loggingHook_;
|
|
@@ -278,6 +278,20 @@ void InstanceImpl::SetInError() noexcept {
|
|
|
278
278
|
m_isInError = true;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
namespace {
|
|
282
|
+
bool shouldStartHermesInspector(DevSettings &devSettings) {
|
|
283
|
+
bool isHermes =
|
|
284
|
+
((devSettings.jsiEngineOverride == JSIEngineOverride::Hermes) ||
|
|
285
|
+
(devSettings.jsiEngineOverride == JSIEngineOverride::Default && devSettings.jsiRuntimeHolder &&
|
|
286
|
+
devSettings.jsiRuntimeHolder->getRuntimeType() == facebook::react::JSIEngineOverride::Hermes));
|
|
287
|
+
|
|
288
|
+
if (isHermes && devSettings.useDirectDebugger && !devSettings.useWebDebugger)
|
|
289
|
+
return true;
|
|
290
|
+
else
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
} // namespace
|
|
294
|
+
|
|
281
295
|
InstanceImpl::InstanceImpl(
|
|
282
296
|
std::shared_ptr<Instance> &&instance,
|
|
283
297
|
std::string &&jsBundleBasePath,
|
|
@@ -305,8 +319,7 @@ InstanceImpl::InstanceImpl(
|
|
|
305
319
|
facebook::react::tracing::initializeETW();
|
|
306
320
|
#endif
|
|
307
321
|
|
|
308
|
-
if (m_devSettings
|
|
309
|
-
!m_devSettings->useWebDebugger) {
|
|
322
|
+
if (shouldStartHermesInspector(*m_devSettings)) {
|
|
310
323
|
m_devManager->StartInspector(m_devSettings->sourceBundleHost, m_devSettings->sourceBundlePort);
|
|
311
324
|
}
|
|
312
325
|
|
|
@@ -31,6 +31,10 @@ class TaskRunnerAdapter : public v8runtime::JSITaskRunner {
|
|
|
31
31
|
std::shared_ptr<facebook::react::MessageQueueThread> jsQueue_;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
facebook::react::JSIEngineOverride V8JSIRuntimeHolder::getRuntimeType() noexcept {
|
|
35
|
+
return facebook::react::JSIEngineOverride::V8;
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
std::shared_ptr<facebook::jsi::Runtime> V8JSIRuntimeHolder::getRuntime() noexcept {
|
|
35
39
|
std::call_once(once_flag_, [this]() { initRuntime(); });
|
|
36
40
|
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
namespace facebook {
|
|
14
14
|
namespace react {
|
|
15
15
|
|
|
16
|
-
class V8JSIRuntimeHolder : public
|
|
16
|
+
class V8JSIRuntimeHolder : public Microsoft::JSI::RuntimeHolderLazyInit {
|
|
17
17
|
public:
|
|
18
18
|
std::shared_ptr<facebook::jsi::Runtime> getRuntime() noexcept override;
|
|
19
|
+
facebook::react::JSIEngineOverride getRuntimeType() noexcept override;
|
|
19
20
|
|
|
20
21
|
V8JSIRuntimeHolder(
|
|
21
22
|
std::shared_ptr<facebook::react::DevSettings> devSettings,
|
package/jest/preprocessor.js
CHANGED
|
@@ -13,42 +13,10 @@
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
15
|
const babelRegisterOnly = require('metro-babel-register');
|
|
16
|
-
const nullthrows = require('nullthrows');
|
|
17
16
|
const createCacheKeyFunction = require('@jest/create-cache-key-function')
|
|
18
17
|
.default;
|
|
19
|
-
const t = require('@babel/types');
|
|
20
|
-
const {statements} = require('@babel/template').default;
|
|
21
18
|
|
|
22
|
-
const
|
|
23
|
-
const importAll = '__importAll__';
|
|
24
|
-
|
|
25
|
-
// prelude
|
|
26
|
-
const importPrelude = statements(`
|
|
27
|
-
function ${importDefault}(moduleId) {
|
|
28
|
-
const exports = require(moduleId);
|
|
29
|
-
|
|
30
|
-
if (exports && exports.__esModule) {
|
|
31
|
-
return exports.default;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return exports;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function ${importAll}(moduleId) {
|
|
38
|
-
const exports = require(moduleId);
|
|
39
|
-
|
|
40
|
-
if (exports && exports.__esModule) {
|
|
41
|
-
return exports;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return Object.assign({}, exports, {default: exports});
|
|
45
|
-
};
|
|
46
|
-
`);
|
|
47
|
-
|
|
48
|
-
const {
|
|
49
|
-
transformSync: babelTransformSync,
|
|
50
|
-
transformFromAstSync: babelTransformFromAstSync,
|
|
51
|
-
} = require('@babel/core');
|
|
19
|
+
const {transformSync: babelTransformSync} = require('@babel/core');
|
|
52
20
|
const generate = require('@babel/generator').default;
|
|
53
21
|
|
|
54
22
|
const nodeFiles = new RegExp(
|
|
@@ -73,13 +41,13 @@ module.exports = {
|
|
|
73
41
|
}).code;
|
|
74
42
|
}
|
|
75
43
|
|
|
76
|
-
|
|
44
|
+
const {ast} = transformer.transform({
|
|
77
45
|
filename: file,
|
|
78
46
|
options: {
|
|
79
47
|
ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
|
|
80
48
|
dev: true,
|
|
81
49
|
enableBabelRuntime: false,
|
|
82
|
-
experimentalImportSupport:
|
|
50
|
+
experimentalImportSupport: false,
|
|
83
51
|
globalPrefix: '',
|
|
84
52
|
hot: false,
|
|
85
53
|
inlineRequires: true,
|
|
@@ -111,6 +79,10 @@ module.exports = {
|
|
|
111
79
|
[require('@babel/plugin-transform-regenerator')],
|
|
112
80
|
[require('@babel/plugin-transform-sticky-regex')],
|
|
113
81
|
[require('@babel/plugin-transform-unicode-regex')],
|
|
82
|
+
[
|
|
83
|
+
require('@babel/plugin-transform-modules-commonjs'),
|
|
84
|
+
{strict: false, allowTopLevelThis: true},
|
|
85
|
+
],
|
|
114
86
|
[require('@babel/plugin-transform-classes')],
|
|
115
87
|
[require('@babel/plugin-transform-arrow-functions')],
|
|
116
88
|
[require('@babel/plugin-transform-spread')],
|
|
@@ -127,46 +99,6 @@ module.exports = {
|
|
|
127
99
|
],
|
|
128
100
|
});
|
|
129
101
|
|
|
130
|
-
// We're not using @babel/plugin-transform-modules-commonjs so
|
|
131
|
-
// we need to add 'use strict' manually
|
|
132
|
-
const directives = ast.program.directives;
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
ast.program.sourceType === 'module' &&
|
|
136
|
-
(directives == null ||
|
|
137
|
-
directives.findIndex(d => d.value.value === 'use strict') === -1)
|
|
138
|
-
) {
|
|
139
|
-
ast.program.directives = [
|
|
140
|
-
...(directives || []),
|
|
141
|
-
t.directive(t.directiveLiteral('use strict')),
|
|
142
|
-
];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Postprocess the transformed module to handle ESM and inline requires.
|
|
146
|
-
// We need to do this in a separate pass to avoid issues tracking references.
|
|
147
|
-
const babelTransformResult = babelTransformFromAstSync(ast, src, {
|
|
148
|
-
ast: true,
|
|
149
|
-
retainLines: true,
|
|
150
|
-
plugins: [
|
|
151
|
-
[
|
|
152
|
-
require('metro-transform-plugins').importExportPlugin,
|
|
153
|
-
{importDefault, importAll},
|
|
154
|
-
],
|
|
155
|
-
[
|
|
156
|
-
require('babel-preset-fbjs/plugins/inline-requires.js'),
|
|
157
|
-
{inlineableCalls: [importDefault, importAll]},
|
|
158
|
-
],
|
|
159
|
-
],
|
|
160
|
-
sourceType: 'module',
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
ast = nullthrows(babelTransformResult.ast);
|
|
164
|
-
|
|
165
|
-
// Inject import helpers *after* running the inline-requires transform,
|
|
166
|
-
// because otherwise it will assume they are user code and bail out of
|
|
167
|
-
// inlining calls to them.
|
|
168
|
-
ast.program.body.unshift(...importPrelude());
|
|
169
|
-
|
|
170
102
|
return generate(
|
|
171
103
|
ast,
|
|
172
104
|
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.67.
|
|
3
|
+
"version": "0.67.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@react-native-community/cli": "^6.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "^6.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "^6.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.67.
|
|
30
|
-
"@react-native-windows/virtualized-list": "0.67.0
|
|
29
|
+
"@react-native-windows/cli": "0.67.1",
|
|
30
|
+
"@react-native-windows/virtualized-list": "0.67.0",
|
|
31
31
|
"@react-native/assets": "1.0.0",
|
|
32
32
|
"@react-native/normalize-color": "2.0.0",
|
|
33
33
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"ws": "^6.1.4"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@react-native-windows/codegen": "0.67.0
|
|
60
|
+
"@react-native-windows/codegen": "0.67.0",
|
|
61
61
|
"@rnw-scripts/eslint-config": "1.1.8",
|
|
62
62
|
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.0.2",
|
|
63
63
|
"@rnx-kit/jest-preset": "^0.1.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"metro-config": "^0.66.0",
|
|
73
73
|
"prettier": "1.19.1",
|
|
74
74
|
"react": "17.0.2",
|
|
75
|
-
"react-native": "0.67.
|
|
75
|
+
"react-native": "0.67.1",
|
|
76
76
|
"react-native-platform-override": "^1.5.1",
|
|
77
77
|
"react-refresh": "^0.4.0",
|
|
78
78
|
"react-shallow-renderer": "16.14.1",
|
|
@@ -80,15 +80,15 @@
|
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"react": "17.0.2",
|
|
83
|
-
"react-native": "0.67.0
|
|
83
|
+
"react-native": "^0.67.0"
|
|
84
84
|
},
|
|
85
85
|
"beachball": {
|
|
86
|
-
"defaultNpmTag": "
|
|
86
|
+
"defaultNpmTag": "latest",
|
|
87
87
|
"gitTags": true,
|
|
88
88
|
"disallowedChangeTypes": [
|
|
89
89
|
"major",
|
|
90
90
|
"minor",
|
|
91
|
-
"
|
|
91
|
+
"prerelease"
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
94
|
"files": [
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
{{#nuGetTestFeed}}
|
|
9
9
|
<add key="NuGetTestFeed" value="{{ nuGetTestFeed }}" />
|
|
10
10
|
{{/nuGetTestFeed}}
|
|
11
|
+
{{#nuGetADOFeed}}
|
|
11
12
|
<add key="react-native" value="https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json" />
|
|
13
|
+
{{/nuGetADOFeed}}
|
|
12
14
|
<add key="Nuget.org" value="https://api.nuget.org/v3/index.json" />
|
|
13
15
|
</packageSources>
|
|
14
16
|
<disabledPackageSources>
|