@vxrn/vite-native-hmr 1.27.1 → 2.0.0-beta.45.1
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/dist/cjs/devServerClient.cjs +113 -129
- package/dist/cjs/devServerClient.native.cjs +214 -0
- package/dist/cjs/devServerClient.native.js +184 -199
- package/dist/cjs/devServerClient.native.js.map +1 -1
- package/dist/cjs/getDevServerLocation.cjs +32 -43
- package/dist/cjs/getDevServerLocation.native.cjs +50 -0
- package/dist/cjs/getDevServerLocation.native.js +32 -42
- package/dist/cjs/getDevServerLocation.native.js.map +1 -1
- package/dist/cjs/hmr-client.cjs +155 -175
- package/dist/cjs/hmr-client.native.cjs +231 -0
- package/dist/cjs/hmr-client.native.js +210 -224
- package/dist/cjs/hmr-client.native.js.map +1 -1
- package/dist/cjs/index.cjs +14 -18
- package/dist/cjs/index.native.cjs +29 -0
- package/dist/cjs/index.native.js +14 -17
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/devServerClient.mjs +93 -100
- package/dist/esm/devServerClient.mjs.map +1 -1
- package/dist/esm/devServerClient.native.js +164 -171
- package/dist/esm/devServerClient.native.js.map +1 -1
- package/dist/esm/getDevServerLocation.mjs +17 -17
- package/dist/esm/getDevServerLocation.mjs.map +1 -1
- package/dist/esm/getDevServerLocation.native.js +17 -17
- package/dist/esm/getDevServerLocation.native.js.map +1 -1
- package/dist/esm/hmr-client.mjs +143 -157
- package/dist/esm/hmr-client.mjs.map +1 -1
- package/dist/esm/hmr-client.native.js +198 -207
- package/dist/esm/hmr-client.native.js.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +4 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +4 -1
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +2 -2
- package/types/devServerClient.d.ts.map +1 -1
- package/types/index.d.ts.map +1 -1
|
@@ -7,56 +7,46 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
14
|
};
|
|
15
15
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
23
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
32
27
|
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
29
|
var getDevServerLocation_exports = {};
|
|
37
|
-
__export(getDevServerLocation_exports, {
|
|
38
|
-
getDevServerLocation: () => getDevServerLocation
|
|
39
|
-
});
|
|
30
|
+
__export(getDevServerLocation_exports, { getDevServerLocation: () => getDevServerLocation });
|
|
40
31
|
module.exports = __toCommonJS(getDevServerLocation_exports);
|
|
41
32
|
var import_getDevServer = __toESM(require("react-native/Libraries/Core/Devtools/getDevServer"));
|
|
42
33
|
var location;
|
|
43
34
|
function getDevServerLocation() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return location;
|
|
35
|
+
if (!location) {
|
|
36
|
+
var { url } = (0, import_getDevServer.default)();
|
|
37
|
+
var origin = url.replace(/\/$/, "");
|
|
38
|
+
var host = origin.replace(/https?:\/\//, "");
|
|
39
|
+
location = {
|
|
40
|
+
host,
|
|
41
|
+
hostname: host.split(":")[0],
|
|
42
|
+
href: url,
|
|
43
|
+
origin,
|
|
44
|
+
pathname: url.split(host)[1],
|
|
45
|
+
port: host.split(":")[1],
|
|
46
|
+
protocol: (url.match(/^([a-z])+:\/\//) || [void 0, void 0])[1]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return location;
|
|
61
50
|
}
|
|
51
|
+
|
|
62
52
|
//# sourceMappingURL=getDevServerLocation.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"getDevServerLocation.native.js","names":[],"sources":["cjs/getDevServerLocation.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getDevServerLocation_exports = {};\n__export(getDevServerLocation_exports, {\n getDevServerLocation: () => getDevServerLocation\n});\nmodule.exports = __toCommonJS(getDevServerLocation_exports);\nvar import_getDevServer = __toESM(require(\"react-native/Libraries/Core/Devtools/getDevServer\"));\nvar location;\nfunction getDevServerLocation() {\n if (!location) {\n var { url } = (0, import_getDevServer.default)();\n var origin = url.replace(/\\/$/, \"\");\n var host = origin.replace(/https?:\\/\\//, \"\");\n location = {\n host,\n hostname: host.split(\":\")[0],\n href: url,\n origin,\n pathname: url.split(host)[1],\n port: host.split(\":\")[1],\n protocol: (url.match(/^([a-z])+:\\/\\//) || [\n void 0,\n void 0\n ])[1]\n };\n }\n return location;\n}\n//# sourceMappingURL=getDevServerLocation.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,+BAA+B,CAAC;AACpC,SAAS,8BAA8B,EACrC,4BAA4B,qBAC9B,CAAC;AACD,OAAO,UAAU,aAAa,4BAA4B;AAC1D,IAAI,sBAAsB,QAAQ,QAAQ,mDAAmD,CAAC;AAC9F,IAAI;AACJ,SAAS,uBAAuB;CAC9B,IAAI,CAAC,UAAU;EACb,IAAI,EAAE,SAAS,GAAG,oBAAoB,QAAO,CAAE;EAC/C,IAAI,SAAS,IAAI,QAAQ,OAAO,EAAE;EAClC,IAAI,OAAO,OAAO,QAAQ,eAAe,EAAE;EAC3C,WAAW;GACT;GACA,UAAU,KAAK,MAAM,GAAG,CAAC,CAAC;GAC1B,MAAM;GACN;GACA,UAAU,IAAI,MAAM,IAAI,CAAC,CAAC;GAC1B,MAAM,KAAK,MAAM,GAAG,CAAC,CAAC;GACtB,WAAW,IAAI,MAAM,gBAAgB,KAAK,CACxC,KAAK,GACL,KAAK,CACP,EAAC,CAAE;EACL;CACF;CACA,OAAO;AACT"}
|
package/dist/cjs/hmr-client.cjs
CHANGED
|
@@ -3,185 +3,165 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
10
|
};
|
|
11
11
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
21
|
var hmr_client_exports = {};
|
|
24
|
-
__export(hmr_client_exports, {
|
|
25
|
-
loadHMRClient: () => loadHMRClient
|
|
26
|
-
});
|
|
22
|
+
__export(hmr_client_exports, { loadHMRClient: () => loadHMRClient });
|
|
27
23
|
module.exports = __toCommonJS(hmr_client_exports);
|
|
28
24
|
var import_getDevServerLocation = require("./getDevServerLocation.cjs");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
console.warn(" \u24F5 [hmr] cannot check for update - full reload needed");
|
|
149
|
-
console.warn("[hmr]", error);
|
|
150
|
-
this.app.reload();
|
|
151
|
-
} else {
|
|
152
|
-
console.warn(" \u24F5 [hmr] update check failed", {
|
|
153
|
-
error
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
} finally {
|
|
157
|
-
this.app.LoadingView.hide();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
25
|
+
var HMRClient = class {
|
|
26
|
+
constructor(app) {
|
|
27
|
+
this.app = app;
|
|
28
|
+
const port = process.env.REACT_NATIVE_SERVER_PUBLIC_PORT || 8081;
|
|
29
|
+
this.url = `ws://${(0, import_getDevServerLocation.getDevServerLocation)().hostname}:${port}/__hmr?platform=${process.env.REACT_NATIVE_PLATFORM || "ios"}`;
|
|
30
|
+
this.socket = new WebSocket(this.url);
|
|
31
|
+
console.info(" ⓵ [hmr] connecting...");
|
|
32
|
+
this.socket.onopen = () => {
|
|
33
|
+
console.info(" ⓵ [hmr] connected");
|
|
34
|
+
};
|
|
35
|
+
this.socket.onclose = () => {
|
|
36
|
+
console.info(` \u24F5 [hmr] disconnected ${this.url}`);
|
|
37
|
+
};
|
|
38
|
+
this.socket.onerror = (event) => {
|
|
39
|
+
console.error(" ⓵ [hmr] error", event);
|
|
40
|
+
};
|
|
41
|
+
this.socket.onmessage = (event) => {
|
|
42
|
+
try {
|
|
43
|
+
const data = JSON.parse(event.data.toString());
|
|
44
|
+
this.processMessage(data);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.warn(" ⓵ [hmr] invalid message", error);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
app;
|
|
51
|
+
url;
|
|
52
|
+
socket;
|
|
53
|
+
lastHash = "";
|
|
54
|
+
upToDate(hash) {
|
|
55
|
+
if (hash) {
|
|
56
|
+
this.lastHash = hash;
|
|
57
|
+
}
|
|
58
|
+
return this.lastHash === __webpack_hash__;
|
|
59
|
+
}
|
|
60
|
+
processMessage(message) {
|
|
61
|
+
switch (message.action) {
|
|
62
|
+
case "building":
|
|
63
|
+
this.app.LoadingView.showMessage("Rebuilding...", "refresh");
|
|
64
|
+
console.info(" ⓵ [hmr] bundle rebuilding", { name: message.body?.name });
|
|
65
|
+
break;
|
|
66
|
+
case "built": console.info(" ⓵ [hmr] bundle rebuilt", {
|
|
67
|
+
name: message.body?.name,
|
|
68
|
+
time: message.body?.time
|
|
69
|
+
});
|
|
70
|
+
case "sync":
|
|
71
|
+
if (!message.body) {
|
|
72
|
+
console.warn(" ⓵ [hmr] message body is empty");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (message.body.errors?.length) {
|
|
76
|
+
message.body.errors.forEach((error) => {
|
|
77
|
+
console.error("Cannot apply update due to error:", error);
|
|
78
|
+
});
|
|
79
|
+
this.app.LoadingView.hide();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (message.body.warnings?.length) {
|
|
83
|
+
message.body.warnings.forEach((warning) => {
|
|
84
|
+
console.warn(" ⓵ [hmr] bundle contains warnings:", warning);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
this.applyUpdate(message.body);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
applyUpdate(update) {
|
|
91
|
+
if (!module.hot) {
|
|
92
|
+
throw new Error(" ⓵ [hmr] hot Module Replacement is disabled.");
|
|
93
|
+
}
|
|
94
|
+
if (!this.upToDate(update.hash) && module.hot.status() === "idle") {
|
|
95
|
+
console.info(" ⓵ [hmr] checking for updates on the server...");
|
|
96
|
+
this.checkUpdates(update);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
checkUpdates(update) {
|
|
100
|
+
try {
|
|
101
|
+
this.app.LoadingView.showMessage("Refreshing...", "refresh");
|
|
102
|
+
module.hot?.check(false).then((updatedModules) => {
|
|
103
|
+
if (!updatedModules) {
|
|
104
|
+
console.warn(" ⓵ [hmr] cannot find update - full reload needed");
|
|
105
|
+
this.app.reload();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
module.hot?.apply({
|
|
109
|
+
ignoreDeclined: true,
|
|
110
|
+
ignoreUnaccepted: false,
|
|
111
|
+
ignoreErrored: false,
|
|
112
|
+
onDeclined: (data) => {
|
|
113
|
+
console.warn(" ⓵ [hmr] ignored an update due to declined module", { chain: data.chain });
|
|
114
|
+
}
|
|
115
|
+
}).then((renewedModules) => {
|
|
116
|
+
if (!this.upToDate()) {
|
|
117
|
+
this.checkUpdates(update);
|
|
118
|
+
}
|
|
119
|
+
const unacceptedModules = updatedModules.filter((moduleId) => {
|
|
120
|
+
return renewedModules && renewedModules.indexOf(moduleId) < 0;
|
|
121
|
+
});
|
|
122
|
+
if (unacceptedModules.length) {
|
|
123
|
+
console.warn(" ⓵ [hmr] not every module was accepted - full reload needed", { unacceptedModules });
|
|
124
|
+
this.app.reload();
|
|
125
|
+
} else {
|
|
126
|
+
console.info(" ⓵ [hmr] renewed modules - app is up to date", { renewedModules });
|
|
127
|
+
this.app.dismissErrors();
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (module.hot?.status() === "fail" || module.hot?.status() === "abort") {
|
|
133
|
+
console.warn(" ⓵ [hmr] cannot check for update - full reload needed");
|
|
134
|
+
console.warn("[hmr]", error);
|
|
135
|
+
this.app.reload();
|
|
136
|
+
} else {
|
|
137
|
+
console.warn(" ⓵ [hmr] update check failed", { error });
|
|
138
|
+
}
|
|
139
|
+
} finally {
|
|
140
|
+
this.app.LoadingView.hide();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
161
144
|
const loadHMRClient = () => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
LoadingView
|
|
186
|
-
});
|
|
187
|
-
};
|
|
145
|
+
const { DevSettings, Platform } = require("react-native-web");
|
|
146
|
+
const LoadingView = {
|
|
147
|
+
showMessage: () => {},
|
|
148
|
+
hide: () => {}
|
|
149
|
+
};
|
|
150
|
+
const reload = () => DevSettings.reload();
|
|
151
|
+
const dismissErrors = () => {
|
|
152
|
+
if (Platform.OS === "ios") {
|
|
153
|
+
const NativeRedBox = require("react-native/Libraries/NativeModules/specs/NativeRedBox").default;
|
|
154
|
+
NativeRedBox?.dismiss?.();
|
|
155
|
+
} else {
|
|
156
|
+
const NativeExceptionsManager = require("react-native/Libraries/Core/NativeExceptionsManager").default;
|
|
157
|
+
NativeExceptionsManager?.dismissRedbox();
|
|
158
|
+
}
|
|
159
|
+
const LogBoxData = require("react-native/Libraries/LogBox/Data/LogBoxData");
|
|
160
|
+
LogBoxData.clear();
|
|
161
|
+
};
|
|
162
|
+
new HMRClient({
|
|
163
|
+
reload,
|
|
164
|
+
dismissErrors,
|
|
165
|
+
LoadingView
|
|
166
|
+
});
|
|
167
|
+
};
|