rollipop 0.1.0-alpha.12 → 0.1.0-alpha.13
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.md +7 -0
- package/dist/{chunk-Dj-qOoLf.js → chunk-D0rfrjR5.js} +4 -5
- package/dist/commands.cjs +261 -1649
- package/dist/commands.js +253 -1642
- package/dist/hmr-client.js +137 -133
- package/dist/hmr-runtime.d.ts +1 -1
- package/dist/hmr-runtime.js +195 -187
- package/dist/index.d.ts +8 -27
- package/dist/index.js +341 -1740
- package/dist/pluginutils.d.ts +4 -21
- package/dist/pluginutils.js +7 -7
- package/dist/runtime.cjs +1 -0
- package/package.json +27 -33
- package/dist/pluginutils.cjs +0 -210
- package/dist/pluginutils.d.cts +0 -660
package/dist/hmr-runtime.js
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
//#region
|
|
2
|
-
var __esmMin = (
|
|
3
|
-
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __esmMin = function(e, r) {
|
|
3
|
+
return function() {
|
|
4
|
+
return e && (r = e(e = 0)), r;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
var __commonJSMin = function(e, r) {
|
|
8
|
+
return function() {
|
|
9
|
+
return r || e((r = { exports: {} }).exports, r), r.exports;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
4
12
|
|
|
5
13
|
//#endregion
|
|
6
14
|
//#region node_modules/mitt/dist/mitt.mjs
|
|
7
|
-
function mitt_default(n
|
|
15
|
+
function mitt_default(n) {
|
|
8
16
|
return {
|
|
9
|
-
all: n
|
|
10
|
-
on: function t(t
|
|
11
|
-
var i = n
|
|
12
|
-
i ? i.push(e
|
|
17
|
+
all: n = n || new Map(),
|
|
18
|
+
on: function t(t, e) {
|
|
19
|
+
var i = n.get(t);
|
|
20
|
+
i ? i.push(e) : n.set(t, [e]);
|
|
13
21
|
},
|
|
14
|
-
off: function t(t
|
|
15
|
-
var i = n
|
|
16
|
-
i && (e
|
|
22
|
+
off: function t(t, e) {
|
|
23
|
+
var i = n.get(t);
|
|
24
|
+
i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
|
|
17
25
|
},
|
|
18
|
-
emit: function t(t
|
|
19
|
-
var i = n
|
|
20
|
-
i && i.slice().map(function(n
|
|
21
|
-
n
|
|
22
|
-
}), (i = n
|
|
23
|
-
n
|
|
26
|
+
emit: function t(t, e) {
|
|
27
|
+
var i = n.get(t);
|
|
28
|
+
i && i.slice().map(function(n) {
|
|
29
|
+
n(e);
|
|
30
|
+
}), (i = n.get("*")) && i.slice().map(function(n) {
|
|
31
|
+
n(t, e);
|
|
24
32
|
});
|
|
25
33
|
}
|
|
26
34
|
};
|
|
@@ -29,25 +37,25 @@ var init_mitt = __esmMin(() => {});
|
|
|
29
37
|
|
|
30
38
|
//#endregion
|
|
31
39
|
//#region src/runtime/react-refresh-utils.ts
|
|
32
|
-
function e(e
|
|
40
|
+
function e(e) {
|
|
33
41
|
"@swc/helpers - typeof";
|
|
34
|
-
return e
|
|
42
|
+
return e && typeof Symbol !== "undefined" && e.constructor === Symbol ? "symbol" : typeof e;
|
|
35
43
|
}
|
|
36
|
-
function isReactRefreshBoundary(n
|
|
37
|
-
if (__ROLLIPOP_GLOBAL__.__ReactRefresh.isLikelyComponentType(n
|
|
44
|
+
function isReactRefreshBoundary(n) {
|
|
45
|
+
if (__ROLLIPOP_GLOBAL__.__ReactRefresh.isLikelyComponentType(n)) {
|
|
38
46
|
return true;
|
|
39
47
|
}
|
|
40
|
-
if (n
|
|
48
|
+
if (n === undefined || n === null || (typeof n === "undefined" ? "undefined" : e(n)) !== "object") {
|
|
41
49
|
return false;
|
|
42
50
|
}
|
|
43
51
|
var r = false;
|
|
44
52
|
var t = true;
|
|
45
|
-
for (var o in n
|
|
53
|
+
for (var o in n) {
|
|
46
54
|
r = true;
|
|
47
55
|
if (o === "__esModule") {
|
|
48
56
|
continue;
|
|
49
57
|
}
|
|
50
|
-
var f = n
|
|
58
|
+
var f = n[o];
|
|
51
59
|
if (!__ROLLIPOP_GLOBAL__.__ReactRefresh.isLikelyComponentType(f)) {
|
|
52
60
|
t = false;
|
|
53
61
|
}
|
|
@@ -73,81 +81,81 @@ var init_react_refresh_utils = __esmMin(() => {
|
|
|
73
81
|
var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
74
82
|
init_mitt();
|
|
75
83
|
init_react_refresh_utils();
|
|
76
|
-
function _array_like_to_array(e
|
|
77
|
-
if (t == null || t > e
|
|
78
|
-
for (var r = 0, n
|
|
79
|
-
return n
|
|
84
|
+
function _array_like_to_array(e, t) {
|
|
85
|
+
if (t == null || t > e.length) t = e.length;
|
|
86
|
+
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
|
|
87
|
+
return n;
|
|
80
88
|
}
|
|
81
|
-
function _array_with_holes(e
|
|
82
|
-
if (Array.isArray(e
|
|
89
|
+
function _array_with_holes(e) {
|
|
90
|
+
if (Array.isArray(e)) return e;
|
|
83
91
|
}
|
|
84
|
-
function _array_without_holes(e
|
|
85
|
-
if (Array.isArray(e
|
|
92
|
+
function _array_without_holes(e) {
|
|
93
|
+
if (Array.isArray(e)) return _array_like_to_array(e);
|
|
86
94
|
}
|
|
87
|
-
function _assert_this_initialized(e
|
|
88
|
-
if (e
|
|
95
|
+
function _assert_this_initialized(e) {
|
|
96
|
+
if (e === void 0) {
|
|
89
97
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
90
98
|
}
|
|
91
|
-
return e
|
|
99
|
+
return e;
|
|
92
100
|
}
|
|
93
|
-
function _call_super(e
|
|
101
|
+
function _call_super(e, t, r) {
|
|
94
102
|
t = _get_prototype_of(t);
|
|
95
|
-
return _possible_constructor_return(e
|
|
103
|
+
return _possible_constructor_return(e, _is_native_reflect_construct() ? Reflect.construct(t, r || [], _get_prototype_of(e).constructor) : t.apply(e, r));
|
|
96
104
|
}
|
|
97
|
-
function _class_call_check(e
|
|
98
|
-
if (!(e
|
|
105
|
+
function _class_call_check(e, t) {
|
|
106
|
+
if (!(e instanceof t)) {
|
|
99
107
|
throw new TypeError("Cannot call a class as a function");
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
|
-
function _defineProperties(e
|
|
110
|
+
function _defineProperties(e, t) {
|
|
103
111
|
for (var r = 0; r < t.length; r++) {
|
|
104
|
-
var n
|
|
105
|
-
n
|
|
106
|
-
n
|
|
107
|
-
if ("value" in n
|
|
108
|
-
Object.defineProperty(e
|
|
112
|
+
var n = t[r];
|
|
113
|
+
n.enumerable = n.enumerable || false;
|
|
114
|
+
n.configurable = true;
|
|
115
|
+
if ("value" in n) n.writable = true;
|
|
116
|
+
Object.defineProperty(e, n.key, n);
|
|
109
117
|
}
|
|
110
118
|
}
|
|
111
|
-
function _create_class(e
|
|
112
|
-
if (t) _defineProperties(e
|
|
113
|
-
if (r) _defineProperties(e
|
|
114
|
-
return e
|
|
119
|
+
function _create_class(e, t, r) {
|
|
120
|
+
if (t) _defineProperties(e.prototype, t);
|
|
121
|
+
if (r) _defineProperties(e, r);
|
|
122
|
+
return e;
|
|
115
123
|
}
|
|
116
|
-
function _get_prototype_of(e
|
|
117
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function e
|
|
118
|
-
return e
|
|
124
|
+
function _get_prototype_of(e) {
|
|
125
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function e(e) {
|
|
126
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
119
127
|
};
|
|
120
|
-
return _get_prototype_of(e
|
|
128
|
+
return _get_prototype_of(e);
|
|
121
129
|
}
|
|
122
|
-
function _inherits(e
|
|
130
|
+
function _inherits(e, t) {
|
|
123
131
|
if (typeof t !== "function" && t !== null) {
|
|
124
132
|
throw new TypeError("Super expression must either be null or a function");
|
|
125
133
|
}
|
|
126
|
-
e
|
|
127
|
-
value: e
|
|
134
|
+
e.prototype = Object.create(t && t.prototype, { constructor: {
|
|
135
|
+
value: e,
|
|
128
136
|
writable: true,
|
|
129
137
|
configurable: true
|
|
130
138
|
} });
|
|
131
|
-
if (t) _set_prototype_of(e
|
|
139
|
+
if (t) _set_prototype_of(e, t);
|
|
132
140
|
}
|
|
133
|
-
function _iterable_to_array(e
|
|
134
|
-
if (typeof Symbol !== "undefined" && e
|
|
141
|
+
function _iterable_to_array(e) {
|
|
142
|
+
if (typeof Symbol !== "undefined" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
135
143
|
}
|
|
136
|
-
function _iterable_to_array_limit(e
|
|
137
|
-
var r = e
|
|
144
|
+
function _iterable_to_array_limit(e, t) {
|
|
145
|
+
var r = e == null ? null : typeof Symbol !== "undefined" && e[Symbol.iterator] || e["@@iterator"];
|
|
138
146
|
if (r == null) return;
|
|
139
|
-
var n
|
|
147
|
+
var n = [];
|
|
140
148
|
var o = true;
|
|
141
149
|
var i = false;
|
|
142
150
|
var u, a;
|
|
143
151
|
try {
|
|
144
|
-
for (r = r.call(e
|
|
145
|
-
n
|
|
146
|
-
if (t && n
|
|
152
|
+
for (r = r.call(e); !(o = (u = r.next()).done); o = true) {
|
|
153
|
+
n.push(u.value);
|
|
154
|
+
if (t && n.length === t) break;
|
|
147
155
|
}
|
|
148
|
-
} catch (e
|
|
156
|
+
} catch (e) {
|
|
149
157
|
i = true;
|
|
150
|
-
a = e
|
|
158
|
+
a = e;
|
|
151
159
|
} finally {
|
|
152
160
|
try {
|
|
153
161
|
if (!o && r["return"] != null) r["return"]();
|
|
@@ -155,7 +163,7 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
155
163
|
if (i) throw a;
|
|
156
164
|
}
|
|
157
165
|
}
|
|
158
|
-
return n
|
|
166
|
+
return n;
|
|
159
167
|
}
|
|
160
168
|
function _non_iterable_rest() {
|
|
161
169
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
@@ -163,65 +171,65 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
163
171
|
function _non_iterable_spread() {
|
|
164
172
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
165
173
|
}
|
|
166
|
-
function _possible_constructor_return(e
|
|
174
|
+
function _possible_constructor_return(e, t) {
|
|
167
175
|
if (t && (_type_of(t) === "object" || typeof t === "function")) {
|
|
168
176
|
return t;
|
|
169
177
|
}
|
|
170
|
-
return _assert_this_initialized(e
|
|
178
|
+
return _assert_this_initialized(e);
|
|
171
179
|
}
|
|
172
|
-
function _set_prototype_of(e
|
|
173
|
-
_set_prototype_of = Object.setPrototypeOf || function e
|
|
174
|
-
e
|
|
175
|
-
return e
|
|
180
|
+
function _set_prototype_of(e, t) {
|
|
181
|
+
_set_prototype_of = Object.setPrototypeOf || function e(e, t) {
|
|
182
|
+
e.__proto__ = t;
|
|
183
|
+
return e;
|
|
176
184
|
};
|
|
177
|
-
return _set_prototype_of(e
|
|
185
|
+
return _set_prototype_of(e, t);
|
|
178
186
|
}
|
|
179
|
-
function _sliced_to_array(e
|
|
180
|
-
return _array_with_holes(e
|
|
187
|
+
function _sliced_to_array(e, t) {
|
|
188
|
+
return _array_with_holes(e) || _iterable_to_array_limit(e, t) || _unsupported_iterable_to_array(e, t) || _non_iterable_rest();
|
|
181
189
|
}
|
|
182
|
-
function _to_consumable_array(e
|
|
183
|
-
return _array_without_holes(e
|
|
190
|
+
function _to_consumable_array(e) {
|
|
191
|
+
return _array_without_holes(e) || _iterable_to_array(e) || _unsupported_iterable_to_array(e) || _non_iterable_spread();
|
|
184
192
|
}
|
|
185
|
-
function _type_of(e
|
|
193
|
+
function _type_of(e) {
|
|
186
194
|
"@swc/helpers - typeof";
|
|
187
|
-
return e
|
|
195
|
+
return e && typeof Symbol !== "undefined" && e.constructor === Symbol ? "symbol" : typeof e;
|
|
188
196
|
}
|
|
189
|
-
function _unsupported_iterable_to_array(e
|
|
190
|
-
if (!e
|
|
191
|
-
if (typeof e
|
|
192
|
-
var r = Object.prototype.toString.call(e
|
|
193
|
-
if (r === "Object" && e
|
|
197
|
+
function _unsupported_iterable_to_array(e, t) {
|
|
198
|
+
if (!e) return;
|
|
199
|
+
if (typeof e === "string") return _array_like_to_array(e, t);
|
|
200
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
201
|
+
if (r === "Object" && e.constructor) r = e.constructor.name;
|
|
194
202
|
if (r === "Map" || r === "Set") return Array.from(r);
|
|
195
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return _array_like_to_array(e
|
|
203
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return _array_like_to_array(e, t);
|
|
196
204
|
}
|
|
197
205
|
function _is_native_reflect_construct() {
|
|
198
206
|
try {
|
|
199
|
-
var e
|
|
200
|
-
} catch (e
|
|
207
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
208
|
+
} catch (e) {}
|
|
201
209
|
return (_is_native_reflect_construct = function() {
|
|
202
|
-
return !!e
|
|
210
|
+
return !!e;
|
|
203
211
|
})();
|
|
204
212
|
}
|
|
205
213
|
var BaseDevRuntime = DevRuntime;
|
|
206
214
|
var ModuleHotContext = /* @__PURE__ */ function() {
|
|
207
215
|
"use strict";
|
|
208
|
-
function e
|
|
209
|
-
_class_call_check(this, e
|
|
216
|
+
function e(t, r) {
|
|
217
|
+
_class_call_check(this, e);
|
|
210
218
|
this.moduleId = t;
|
|
211
219
|
this.socketHolder = r;
|
|
212
220
|
this.removeListeners = [];
|
|
213
221
|
this.acceptCallbacks = [];
|
|
214
222
|
}
|
|
215
|
-
_create_class(e
|
|
223
|
+
_create_class(e, [
|
|
216
224
|
{
|
|
217
225
|
key: "refresh",
|
|
218
|
-
get: function e
|
|
226
|
+
get: function e() {
|
|
219
227
|
return __ROLLIPOP_GLOBAL__.__ReactRefresh;
|
|
220
228
|
}
|
|
221
229
|
},
|
|
222
230
|
{
|
|
223
231
|
key: "refreshUtils",
|
|
224
|
-
get: function e
|
|
232
|
+
get: function e() {
|
|
225
233
|
return {
|
|
226
234
|
isReactRefreshBoundary,
|
|
227
235
|
enqueueUpdate
|
|
@@ -230,12 +238,12 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
230
238
|
},
|
|
231
239
|
{
|
|
232
240
|
key: "accept",
|
|
233
|
-
value: function e
|
|
234
|
-
for (var e
|
|
241
|
+
value: function e() {
|
|
242
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) {
|
|
235
243
|
t[r] = arguments[r];
|
|
236
244
|
}
|
|
237
245
|
if (t.length === 1) {
|
|
238
|
-
var n
|
|
246
|
+
var n = _sliced_to_array(t, 1), o = n[0];
|
|
239
247
|
var i = this.moduleId;
|
|
240
248
|
this.acceptCallbacks.push({
|
|
241
249
|
deps: [i],
|
|
@@ -248,7 +256,7 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
248
256
|
},
|
|
249
257
|
{
|
|
250
258
|
key: "invalidate",
|
|
251
|
-
value: function e
|
|
259
|
+
value: function e() {
|
|
252
260
|
this.socketHolder.send(JSON.stringify({
|
|
253
261
|
type: "hmr:invalidate",
|
|
254
262
|
moduleId: this.moduleId
|
|
@@ -257,45 +265,45 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
257
265
|
},
|
|
258
266
|
{
|
|
259
267
|
key: "on",
|
|
260
|
-
value: function e
|
|
268
|
+
value: function e(e, t) {
|
|
261
269
|
var r = this;
|
|
262
|
-
this.socketHolder.on(e
|
|
270
|
+
this.socketHolder.on(e, t);
|
|
263
271
|
this.removeListeners.push(function() {
|
|
264
|
-
return r.socketHolder.off(e
|
|
272
|
+
return r.socketHolder.off(e, t);
|
|
265
273
|
});
|
|
266
274
|
}
|
|
267
275
|
},
|
|
268
276
|
{
|
|
269
277
|
key: "off",
|
|
270
|
-
value: function e
|
|
271
|
-
this.socketHolder.off(e
|
|
278
|
+
value: function e(e, t) {
|
|
279
|
+
this.socketHolder.off(e, t);
|
|
272
280
|
}
|
|
273
281
|
},
|
|
274
282
|
{
|
|
275
283
|
key: "send",
|
|
276
|
-
value: function e
|
|
284
|
+
value: function e(e, t) {
|
|
277
285
|
this.socketHolder.send(JSON.stringify({
|
|
278
|
-
type: e
|
|
286
|
+
type: e,
|
|
279
287
|
payload: t
|
|
280
288
|
}));
|
|
281
289
|
}
|
|
282
290
|
},
|
|
283
291
|
{
|
|
284
292
|
key: "cleanup",
|
|
285
|
-
value: function e
|
|
286
|
-
var e
|
|
293
|
+
value: function e() {
|
|
294
|
+
var e = true, t = false, r = undefined;
|
|
287
295
|
try {
|
|
288
|
-
for (var n
|
|
296
|
+
for (var n = this.removeListeners[Symbol.iterator](), o; !(e = (o = n.next()).done); e = true) {
|
|
289
297
|
var i = o.value;
|
|
290
298
|
i();
|
|
291
299
|
}
|
|
292
|
-
} catch (e
|
|
300
|
+
} catch (e) {
|
|
293
301
|
t = true;
|
|
294
|
-
r = e
|
|
302
|
+
r = e;
|
|
295
303
|
} finally {
|
|
296
304
|
try {
|
|
297
|
-
if (!e
|
|
298
|
-
n
|
|
305
|
+
if (!e && n.return != null) {
|
|
306
|
+
n.return();
|
|
299
307
|
}
|
|
300
308
|
} finally {
|
|
301
309
|
if (t) {
|
|
@@ -307,38 +315,38 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
307
315
|
}
|
|
308
316
|
}
|
|
309
317
|
]);
|
|
310
|
-
return e
|
|
318
|
+
return e;
|
|
311
319
|
}();
|
|
312
320
|
var SocketHolder = /* @__PURE__ */ function() {
|
|
313
321
|
"use strict";
|
|
314
|
-
function e
|
|
315
|
-
_class_call_check(this, e
|
|
322
|
+
function e() {
|
|
323
|
+
_class_call_check(this, e);
|
|
316
324
|
this.queuedMessages = [];
|
|
317
325
|
this.emitter = mitt_default();
|
|
318
326
|
this._socket = null;
|
|
319
327
|
this._origin = null;
|
|
320
328
|
}
|
|
321
|
-
_create_class(e
|
|
329
|
+
_create_class(e, [
|
|
322
330
|
{
|
|
323
331
|
key: "socket",
|
|
324
|
-
get: function e
|
|
332
|
+
get: function e() {
|
|
325
333
|
return this._socket;
|
|
326
334
|
}
|
|
327
335
|
},
|
|
328
336
|
{
|
|
329
337
|
key: "origin",
|
|
330
|
-
get: function e
|
|
338
|
+
get: function e() {
|
|
331
339
|
return this._origin;
|
|
332
340
|
}
|
|
333
341
|
},
|
|
334
342
|
{
|
|
335
343
|
key: "setup",
|
|
336
|
-
value: function e
|
|
344
|
+
value: function e(e, t) {
|
|
337
345
|
var r = this;
|
|
338
|
-
this._socket = e
|
|
346
|
+
this._socket = e;
|
|
339
347
|
this._origin = t;
|
|
340
|
-
if (e
|
|
341
|
-
e
|
|
348
|
+
if (e.readyState !== WebSocket.OPEN) {
|
|
349
|
+
e.addEventListener("open", function() {
|
|
342
350
|
return r.flushQueuedMessages();
|
|
343
351
|
}, { once: true });
|
|
344
352
|
} else {
|
|
@@ -348,52 +356,52 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
348
356
|
},
|
|
349
357
|
{
|
|
350
358
|
key: "on",
|
|
351
|
-
value: function e
|
|
352
|
-
this.emitter.on(e
|
|
359
|
+
value: function e(e, t) {
|
|
360
|
+
this.emitter.on(e, t);
|
|
353
361
|
}
|
|
354
362
|
},
|
|
355
363
|
{
|
|
356
364
|
key: "off",
|
|
357
|
-
value: function e
|
|
358
|
-
this.emitter.off(e
|
|
365
|
+
value: function e(e, t) {
|
|
366
|
+
this.emitter.off(e, t);
|
|
359
367
|
}
|
|
360
368
|
},
|
|
361
369
|
{
|
|
362
370
|
key: "emit",
|
|
363
|
-
value: function e
|
|
364
|
-
this.emitter.emit(e
|
|
371
|
+
value: function e(e, t) {
|
|
372
|
+
this.emitter.emit(e, t);
|
|
365
373
|
}
|
|
366
374
|
},
|
|
367
375
|
{
|
|
368
376
|
key: "send",
|
|
369
|
-
value: function e
|
|
377
|
+
value: function e(e) {
|
|
370
378
|
if (this._socket == null || this._socket.readyState !== WebSocket.OPEN) {
|
|
371
|
-
this.queuedMessages.push(e
|
|
379
|
+
this.queuedMessages.push(e);
|
|
372
380
|
return;
|
|
373
381
|
}
|
|
374
382
|
this.flushQueuedMessages();
|
|
375
|
-
this._socket.send(e
|
|
383
|
+
this._socket.send(e);
|
|
376
384
|
}
|
|
377
385
|
},
|
|
378
386
|
{
|
|
379
387
|
key: "flushQueuedMessages",
|
|
380
|
-
value: function e
|
|
388
|
+
value: function e() {
|
|
381
389
|
if (this._socket == null) {
|
|
382
390
|
return;
|
|
383
391
|
}
|
|
384
|
-
var e
|
|
392
|
+
var e = true, t = false, r = undefined;
|
|
385
393
|
try {
|
|
386
|
-
for (var n
|
|
394
|
+
for (var n = this.queuedMessages[Symbol.iterator](), o; !(e = (o = n.next()).done); e = true) {
|
|
387
395
|
var i = o.value;
|
|
388
396
|
this._socket.send(i);
|
|
389
397
|
}
|
|
390
|
-
} catch (e
|
|
398
|
+
} catch (e) {
|
|
391
399
|
t = true;
|
|
392
|
-
r = e
|
|
400
|
+
r = e;
|
|
393
401
|
} finally {
|
|
394
402
|
try {
|
|
395
|
-
if (!e
|
|
396
|
-
n
|
|
403
|
+
if (!e && n.return != null) {
|
|
404
|
+
n.return();
|
|
397
405
|
}
|
|
398
406
|
} finally {
|
|
399
407
|
if (t) {
|
|
@@ -406,7 +414,7 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
406
414
|
},
|
|
407
415
|
{
|
|
408
416
|
key: "close",
|
|
409
|
-
value: function e
|
|
417
|
+
value: function e() {
|
|
410
418
|
if (this._socket == null) {
|
|
411
419
|
return;
|
|
412
420
|
}
|
|
@@ -414,94 +422,94 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
414
422
|
}
|
|
415
423
|
}
|
|
416
424
|
]);
|
|
417
|
-
return e
|
|
425
|
+
return e;
|
|
418
426
|
}();
|
|
419
427
|
var ReactNativeDevRuntime = /* @__PURE__ */ function(BaseDevRuntime1) {
|
|
420
428
|
"use strict";
|
|
421
429
|
_inherits(ReactNativeDevRuntime1, BaseDevRuntime1);
|
|
422
430
|
function ReactNativeDevRuntime1() {
|
|
423
431
|
_class_call_check(this, ReactNativeDevRuntime1);
|
|
424
|
-
var e
|
|
432
|
+
var e;
|
|
425
433
|
var t = new SocketHolder();
|
|
426
|
-
var r = { send: function(e
|
|
427
|
-
return t.send(JSON.stringify(e
|
|
434
|
+
var r = { send: function(e) {
|
|
435
|
+
return t.send(JSON.stringify(e));
|
|
428
436
|
} };
|
|
429
|
-
e
|
|
430
|
-
e
|
|
431
|
-
return e
|
|
437
|
+
e = _call_super(this, ReactNativeDevRuntime1, [r]), e.moduleHotContexts = new Map(), e.moduleHotContextsToBeUpdated = new Map();
|
|
438
|
+
e.socketHolder = t;
|
|
439
|
+
return e;
|
|
432
440
|
}
|
|
433
441
|
_create_class(ReactNativeDevRuntime1, [
|
|
434
442
|
{
|
|
435
443
|
key: "createModuleHotContext",
|
|
436
|
-
value: function e
|
|
437
|
-
var t = new ModuleHotContext(e
|
|
438
|
-
if (this.moduleHotContexts.has(e
|
|
439
|
-
this.moduleHotContextsToBeUpdated.set(e
|
|
444
|
+
value: function e(e) {
|
|
445
|
+
var t = new ModuleHotContext(e, this.socketHolder);
|
|
446
|
+
if (this.moduleHotContexts.has(e)) {
|
|
447
|
+
this.moduleHotContextsToBeUpdated.set(e, t);
|
|
440
448
|
} else {
|
|
441
|
-
this.moduleHotContexts.set(e
|
|
449
|
+
this.moduleHotContexts.set(e, t);
|
|
442
450
|
}
|
|
443
451
|
return t;
|
|
444
452
|
}
|
|
445
453
|
},
|
|
446
454
|
{
|
|
447
455
|
key: "applyUpdates",
|
|
448
|
-
value: function e
|
|
456
|
+
value: function e(e) {
|
|
449
457
|
var t = this;
|
|
450
|
-
var r = true, n
|
|
458
|
+
var r = true, n = false, o = undefined;
|
|
451
459
|
try {
|
|
452
460
|
var i, u = function() {
|
|
453
|
-
var e
|
|
454
|
-
var o
|
|
455
|
-
if (o
|
|
456
|
-
var u
|
|
457
|
-
u
|
|
458
|
-
e
|
|
461
|
+
var e = _sliced_to_array(s.value, 2), r = e[0], n = e[1];
|
|
462
|
+
var o = i.moduleHotContexts.get(r);
|
|
463
|
+
if (o) {
|
|
464
|
+
var u = o.acceptCallbacks;
|
|
465
|
+
u.filter(function(e) {
|
|
466
|
+
e.fn(t.modules[r].exports);
|
|
459
467
|
});
|
|
460
|
-
o
|
|
468
|
+
o.cleanup();
|
|
461
469
|
}
|
|
462
470
|
};
|
|
463
|
-
for (var a = e
|
|
464
|
-
} catch (e
|
|
465
|
-
n
|
|
466
|
-
o = e
|
|
471
|
+
for (var a = e[Symbol.iterator](), s; !(r = (s = a.next()).done); r = true) i = this, u();
|
|
472
|
+
} catch (e) {
|
|
473
|
+
n = true;
|
|
474
|
+
o = e;
|
|
467
475
|
} finally {
|
|
468
476
|
try {
|
|
469
477
|
if (!r && a.return != null) {
|
|
470
478
|
a.return();
|
|
471
479
|
}
|
|
472
480
|
} finally {
|
|
473
|
-
if (n
|
|
481
|
+
if (n) {
|
|
474
482
|
throw o;
|
|
475
483
|
}
|
|
476
484
|
}
|
|
477
485
|
}
|
|
478
|
-
this.moduleHotContextsToBeUpdated.forEach(function(e
|
|
479
|
-
t.moduleHotContexts.set(r
|
|
486
|
+
this.moduleHotContextsToBeUpdated.forEach(function(e, r) {
|
|
487
|
+
t.moduleHotContexts.set(r, e);
|
|
480
488
|
});
|
|
481
489
|
this.moduleHotContextsToBeUpdated.clear();
|
|
482
490
|
}
|
|
483
491
|
},
|
|
484
492
|
{
|
|
485
493
|
key: "setup",
|
|
486
|
-
value: function e
|
|
494
|
+
value: function e(e, t) {
|
|
487
495
|
var r = this;
|
|
488
496
|
if (this.socketHolder.socket != null) {
|
|
489
497
|
console.warn("[HMR]: ReactNativeDevRuntime already setup");
|
|
490
498
|
return;
|
|
491
499
|
}
|
|
492
|
-
this.socketHolder.setup(e
|
|
493
|
-
e
|
|
494
|
-
var n
|
|
495
|
-
if (isCustomHMRMessage(n
|
|
500
|
+
this.socketHolder.setup(e, t);
|
|
501
|
+
e.addEventListener("message", function(t) {
|
|
502
|
+
var n = JSON.parse(t.data);
|
|
503
|
+
if (isCustomHMRMessage(n)) {
|
|
496
504
|
var o, i;
|
|
497
|
-
debug("[HMR]: Custom HMR message received: ".concat(n
|
|
498
|
-
r.socketHolder.emit(n
|
|
499
|
-
(o = (i = __ROLLIPOP_GLOBAL__).__ROLLIPOP_CUSTOM_HMR_HANDLER__) === null || o === void 0 ? void 0 : o.call(i, e
|
|
505
|
+
debug("[HMR]: Custom HMR message received: ".concat(n.type));
|
|
506
|
+
r.socketHolder.emit(n.type, n.payload);
|
|
507
|
+
(o = (i = __ROLLIPOP_GLOBAL__).__ROLLIPOP_CUSTOM_HMR_HANDLER__) === null || o === void 0 ? void 0 : o.call(i, e, n);
|
|
500
508
|
return;
|
|
501
509
|
}
|
|
502
|
-
switch (n
|
|
510
|
+
switch (n.type) {
|
|
503
511
|
case "hmr:update":
|
|
504
|
-
r.evaluate(n
|
|
512
|
+
r.evaluate(n.code);
|
|
505
513
|
break;
|
|
506
514
|
case "hmr:reload":
|
|
507
515
|
r.reload();
|
|
@@ -523,29 +531,29 @@ var require_hmr_runtime = /* @__PURE__ */ __commonJSMin((() => {
|
|
|
523
531
|
},
|
|
524
532
|
{
|
|
525
533
|
key: "reload",
|
|
526
|
-
value: function e
|
|
534
|
+
value: function e() {
|
|
527
535
|
debug("[HMR]: Reloading");
|
|
528
|
-
var e
|
|
529
|
-
(__ROLLIPOP_GLOBAL__.__turboModuleProxy ? __ROLLIPOP_GLOBAL__.__turboModuleProxy(e
|
|
536
|
+
var e = "DevSettings";
|
|
537
|
+
(__ROLLIPOP_GLOBAL__.__turboModuleProxy ? __ROLLIPOP_GLOBAL__.__turboModuleProxy(e) : __ROLLIPOP_GLOBAL__.nativeModuleProxy[e]).reload();
|
|
530
538
|
}
|
|
531
539
|
}
|
|
532
540
|
]);
|
|
533
541
|
return ReactNativeDevRuntime1;
|
|
534
542
|
}(BaseDevRuntime);
|
|
535
543
|
function debug() {
|
|
536
|
-
for (var e
|
|
544
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) {
|
|
537
545
|
t[r] = arguments[r];
|
|
538
546
|
}
|
|
539
547
|
if (process.env.DEBUG_ROLLIPOP) {
|
|
540
|
-
var n
|
|
541
|
-
(n
|
|
548
|
+
var n;
|
|
549
|
+
(n = console).log.apply(n, _to_consumable_array(t));
|
|
542
550
|
}
|
|
543
551
|
}
|
|
544
|
-
function isCustomHMRMessage(e
|
|
545
|
-
if ((typeof e
|
|
552
|
+
function isCustomHMRMessage(e) {
|
|
553
|
+
if ((typeof e === "undefined" ? "undefined" : _type_of(e)) !== "object" || e == null) {
|
|
546
554
|
return false;
|
|
547
555
|
}
|
|
548
|
-
if ("type" in e
|
|
556
|
+
if ("type" in e && typeof e.type === "string" && e.type.startsWith("hmr:")) {
|
|
549
557
|
return false;
|
|
550
558
|
}
|
|
551
559
|
return true;
|