metro-runtime 0.73.2 → 0.73.3
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/package.json
CHANGED
|
@@ -147,9 +147,9 @@ class HMRClient extends EventEmitter {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
function mergeUpdates(base: HmrUpdate, next: HmrUpdate): HmrUpdate {
|
|
150
|
-
const addedIDs = new Set();
|
|
151
|
-
const deletedIDs = new Set();
|
|
152
|
-
const moduleMap = new Map();
|
|
150
|
+
const addedIDs = new Set<number>();
|
|
151
|
+
const deletedIDs = new Set<number>();
|
|
152
|
+
const moduleMap = new Map<number, HmrModule>();
|
|
153
153
|
|
|
154
154
|
// Fill in the temporary maps and sets from both updates in their order.
|
|
155
155
|
applyUpdateLocally(base);
|
|
@@ -184,9 +184,9 @@ function mergeUpdates(base: HmrUpdate, next: HmrUpdate): HmrUpdate {
|
|
|
184
184
|
const result = {
|
|
185
185
|
isInitialUpdate: next.isInitialUpdate,
|
|
186
186
|
revisionId: next.revisionId,
|
|
187
|
-
added: [],
|
|
188
|
-
modified: [],
|
|
189
|
-
deleted: [],
|
|
187
|
+
added: ([]: Array<HmrModule>),
|
|
188
|
+
modified: ([]: Array<HmrModule>),
|
|
189
|
+
deleted: ([]: Array<number>),
|
|
190
190
|
};
|
|
191
191
|
deletedIDs.forEach(id => {
|
|
192
192
|
result.deleted.push(id);
|
|
@@ -558,7 +558,7 @@ if (__DEV__) {
|
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
const Refresh = requireRefresh();
|
|
561
|
-
const refreshBoundaryIDs = new Set();
|
|
561
|
+
const refreshBoundaryIDs = new Set<ModuleID>();
|
|
562
562
|
|
|
563
563
|
// In this loop, we will traverse the dependency tree upwards from the
|
|
564
564
|
// changed module. Updates "bubble" up to the closest accepted parent.
|
|
@@ -646,7 +646,7 @@ if (__DEV__) {
|
|
|
646
646
|
|
|
647
647
|
// If we reached here, it is likely that hot reload will be successful.
|
|
648
648
|
// Run the actual factories.
|
|
649
|
-
const seenModuleIDs = new Set();
|
|
649
|
+
const seenModuleIDs = new Set<ModuleID>();
|
|
650
650
|
for (let i = 0; i < updatedModuleIDs.length; i++) {
|
|
651
651
|
const updatedID = updatedModuleIDs[i];
|
|
652
652
|
if (seenModuleIDs.has(updatedID)) {
|
|
@@ -754,8 +754,8 @@ if (__DEV__) {
|
|
|
754
754
|
earlyStop: T => boolean,
|
|
755
755
|
): Array<T> {
|
|
756
756
|
const result = [];
|
|
757
|
-
const visited = new Set();
|
|
758
|
-
const stack = new Set();
|
|
757
|
+
const visited = new Set<mixed>();
|
|
758
|
+
const stack = new Set<mixed>();
|
|
759
759
|
function traverseDependentNodes(node: T) {
|
|
760
760
|
if (stack.has(node)) {
|
|
761
761
|
throw CYCLE_DETECTED;
|
|
@@ -902,7 +902,7 @@ if (__DEV__) {
|
|
|
902
902
|
if (key === '__esModule') {
|
|
903
903
|
continue;
|
|
904
904
|
}
|
|
905
|
-
const desc = Object.getOwnPropertyDescriptor(moduleExports, key);
|
|
905
|
+
const desc = Object.getOwnPropertyDescriptor<any>(moduleExports, key);
|
|
906
906
|
if (desc && desc.get) {
|
|
907
907
|
// Don't invoke getters as they may have side effects.
|
|
908
908
|
return false;
|
|
@@ -949,7 +949,7 @@ if (__DEV__) {
|
|
|
949
949
|
if (key === '__esModule') {
|
|
950
950
|
continue;
|
|
951
951
|
}
|
|
952
|
-
const desc = Object.getOwnPropertyDescriptor(moduleExports, key);
|
|
952
|
+
const desc = Object.getOwnPropertyDescriptor<any>(moduleExports, key);
|
|
953
953
|
if (desc && desc.get) {
|
|
954
954
|
continue;
|
|
955
955
|
}
|
|
@@ -972,7 +972,7 @@ if (__DEV__) {
|
|
|
972
972
|
return;
|
|
973
973
|
}
|
|
974
974
|
for (const key in moduleExports) {
|
|
975
|
-
const desc = Object.getOwnPropertyDescriptor(moduleExports, key);
|
|
975
|
+
const desc = Object.getOwnPropertyDescriptor<any>(moduleExports, key);
|
|
976
976
|
if (desc && desc.get) {
|
|
977
977
|
// Don't invoke getters as they may have side effects.
|
|
978
978
|
continue;
|