react-refresh 0.17.0-canary-9b62ee71-20250122 → 0.17.0-canary-de1eaa26-20250124
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.
|
@@ -261,35 +261,68 @@
|
|
|
261
261
|
isPerformingRefresh = !0;
|
|
262
262
|
try {
|
|
263
263
|
var staleFamilies = new Set(),
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
update = { updatedFamilies: new Set(), staleFamilies: staleFamilies };
|
|
265
|
+
staleFamilies = pendingUpdates;
|
|
266
266
|
pendingUpdates = [];
|
|
267
|
-
|
|
268
|
-
var family = _ref[0]
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
updatedFamiliesByType.set(prevType, family);
|
|
267
|
+
staleFamilies.forEach(function (_ref) {
|
|
268
|
+
var family = _ref[0],
|
|
269
|
+
nextType = _ref[1];
|
|
270
|
+
_ref = family.current;
|
|
272
271
|
updatedFamiliesByType.set(_ref, family);
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
(
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
272
|
+
updatedFamiliesByType.set(nextType, family);
|
|
273
|
+
family.current = nextType;
|
|
274
|
+
if (
|
|
275
|
+
(_ref.prototype && _ref.prototype.isReactComponent) ||
|
|
276
|
+
(nextType.prototype && nextType.prototype.isReactComponent) ||
|
|
277
|
+
typeof _ref !== typeof nextType ||
|
|
278
|
+
("object" === typeof _ref &&
|
|
279
|
+
null !== _ref &&
|
|
280
|
+
null !== nextType &&
|
|
281
|
+
getProperty(_ref, "$$typeof") !==
|
|
282
|
+
getProperty(nextType, "$$typeof"))
|
|
283
|
+
)
|
|
284
|
+
var shouldPreserveState = !1;
|
|
285
|
+
else {
|
|
286
|
+
shouldPreserveState = allSignaturesByType.get(_ref);
|
|
287
|
+
var nextSignature = allSignaturesByType.get(nextType);
|
|
288
|
+
shouldPreserveState =
|
|
289
|
+
(void 0 === shouldPreserveState && void 0 === nextSignature) ||
|
|
290
|
+
(void 0 !== shouldPreserveState &&
|
|
291
|
+
void 0 !== nextSignature &&
|
|
292
|
+
computeFullKey(shouldPreserveState) ===
|
|
293
|
+
computeFullKey(nextSignature) &&
|
|
294
|
+
!nextSignature.forceReset)
|
|
295
|
+
? !0
|
|
296
|
+
: !1;
|
|
297
|
+
}
|
|
298
|
+
if ("object" === typeof _ref && null !== _ref)
|
|
299
|
+
switch (
|
|
300
|
+
((nextType = {
|
|
301
|
+
current:
|
|
302
|
+
getProperty(nextType, "$$typeof") === REACT_FORWARD_REF_TYPE
|
|
303
|
+
? nextType.render
|
|
304
|
+
: getProperty(nextType, "$$typeof") === REACT_MEMO_TYPE
|
|
305
|
+
? nextType.type
|
|
306
|
+
: nextType
|
|
307
|
+
}),
|
|
308
|
+
getProperty(_ref, "$$typeof"))
|
|
309
|
+
) {
|
|
310
|
+
case REACT_FORWARD_REF_TYPE:
|
|
311
|
+
updatedFamiliesByType.set(_ref.render, nextType);
|
|
312
|
+
shouldPreserveState
|
|
313
|
+
? update.updatedFamilies.add(nextType)
|
|
314
|
+
: update.staleFamilies.add(nextType);
|
|
315
|
+
break;
|
|
316
|
+
case REACT_MEMO_TYPE:
|
|
317
|
+
updatedFamiliesByType.set(_ref.type, nextType),
|
|
318
|
+
shouldPreserveState
|
|
319
|
+
? update.updatedFamilies.add(nextType)
|
|
320
|
+
: update.staleFamilies.add(nextType);
|
|
321
|
+
}
|
|
322
|
+
shouldPreserveState
|
|
323
|
+
? update.updatedFamilies.add(family)
|
|
324
|
+
: update.staleFamilies.add(family);
|
|
288
325
|
});
|
|
289
|
-
var update = {
|
|
290
|
-
updatedFamilies: updatedFamilies,
|
|
291
|
-
staleFamilies: staleFamilies
|
|
292
|
-
};
|
|
293
326
|
helpersByRendererID.forEach(function (helpers) {
|
|
294
327
|
helpers.setRefreshHandler(resolveFamily);
|
|
295
328
|
});
|