socket-function 0.12.15 → 0.12.16
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
|
@@ -53,6 +53,7 @@ export interface SerializedModule {
|
|
|
53
53
|
// request => resolvedPath
|
|
54
54
|
[request: string]: string;
|
|
55
55
|
};
|
|
56
|
+
asyncRequests: { [request: string]: true };
|
|
56
57
|
// NOTE: IF !allowclient && !serveronly, it might just mean we didn't add allowclient
|
|
57
58
|
// to the module yet. BUT, if serveronly, then we know for sure we don't want it client.
|
|
58
59
|
// So the messages and behavior will be different.
|
|
@@ -201,6 +202,7 @@ class RequireControllerBase {
|
|
|
201
202
|
seqNum: module.requireControllerSeqNum,
|
|
202
203
|
size: module.size,
|
|
203
204
|
version: module.version,
|
|
205
|
+
asyncRequests: module.asyncRequires,
|
|
204
206
|
};
|
|
205
207
|
let moduleObj = modules[module.filename];
|
|
206
208
|
if (moduleObj.allowclient) {
|
|
@@ -271,6 +273,7 @@ class RequireControllerBase {
|
|
|
271
273
|
path: "",
|
|
272
274
|
paths: [],
|
|
273
275
|
requires: {},
|
|
276
|
+
asyncRequires: {},
|
|
274
277
|
allowclient: true,
|
|
275
278
|
moduleContents: `console.warn(${JSON.stringify(error)})`,
|
|
276
279
|
};
|
package/require/require.js
CHANGED
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
// request => resolvedPath
|
|
75
75
|
[request: string]: string;
|
|
76
76
|
};
|
|
77
|
+
asyncRequests: { [request: string]: true };
|
|
77
78
|
// NOTE: IF !allowclient && !serveronly, it might just mean we didn't add allowclient
|
|
78
79
|
// to the module yet. BUT, if serveronly, then we know for sure we don't want it client.
|
|
79
80
|
// So the messages and behavior will be different.
|
|
@@ -255,6 +256,9 @@
|
|
|
255
256
|
if (typeof asyncIsFine !== "boolean") {
|
|
256
257
|
asyncIsFine = false;
|
|
257
258
|
}
|
|
259
|
+
if (request in serializedModule.asyncRequests) {
|
|
260
|
+
asyncIsFine = true;
|
|
261
|
+
}
|
|
258
262
|
if (request in builtInModuleExports) {
|
|
259
263
|
return builtInModuleExports[request];
|
|
260
264
|
}
|
|
@@ -292,8 +296,8 @@
|
|
|
292
296
|
"color: red", "color: unset",
|
|
293
297
|
"color: red", "color: unset",
|
|
294
298
|
);
|
|
299
|
+
debugger;
|
|
295
300
|
}
|
|
296
|
-
debugger;
|
|
297
301
|
return rootRequire(resolvedPath);
|
|
298
302
|
}
|
|
299
303
|
|
|
@@ -427,7 +431,10 @@
|
|
|
427
431
|
|
|
428
432
|
// Import children, as the children may be allowed clientside, and may have side-effects!
|
|
429
433
|
if (!source) {
|
|
430
|
-
let requests = Object.keys(serializedModule.requests)
|
|
434
|
+
let requests = Object.keys(serializedModule.requests)
|
|
435
|
+
.filter(x => x !== "NOTALLOWEDCLIENTSIDE")
|
|
436
|
+
.filter(x => !(x in serializedModule.asyncRequests))
|
|
437
|
+
;
|
|
431
438
|
source = requests.map(id => `require(${JSON.stringify(id)});\n`).join("");
|
|
432
439
|
}
|
|
433
440
|
|