@remix_labs/machine-starter 2.2907.0 → 2.2911.0-dev
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/common.js +18 -1
- package/groovebox_build.js +1 -1
- package/node.js +4 -0
- package/package.json +2 -2
- package/webpack.config.js +4 -0
package/common.js
CHANGED
|
@@ -56,6 +56,8 @@ globalThis.MixSetMask = (m => {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
const DEBUG_STATE = 4;
|
|
60
|
+
|
|
59
61
|
function StartWASM(hub, baseURL, org, workspace, vmID, user, token, noOutputViaMQTT) {
|
|
60
62
|
return StartWASM2(hub, {
|
|
61
63
|
baseURL: baseURL,
|
|
@@ -297,7 +299,9 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
|
|
|
297
299
|
let call_id = msg.payload.call_id;
|
|
298
300
|
let args = decode(msg.payload.args);
|
|
299
301
|
let fun = localFFIs[name];
|
|
300
|
-
|
|
302
|
+
if (initialMask & DEBUG_STATE) {
|
|
303
|
+
console.debug("[groovebox-starter] local FFI call", vmID, call_id, name);
|
|
304
|
+
};
|
|
301
305
|
try {
|
|
302
306
|
if (!fun) throw new Error("No such local FFI in groovebox starter: " + name);
|
|
303
307
|
let connector =
|
|
@@ -310,13 +314,26 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
|
|
|
310
314
|
let r = fun instanceof Function ? fun(connector, args) : fun.run(connector, args);
|
|
311
315
|
if (r instanceof Promise) {
|
|
312
316
|
// r.catch(_ => null); // prevent "unhandled rejection"
|
|
317
|
+
if (initialMask & DEBUG_STATE) {
|
|
318
|
+
console.debug("[groovebox-starter] running FFI call asynchronously", vmID, call_id, name);
|
|
319
|
+
}
|
|
313
320
|
await comm.later(call_id);
|
|
314
321
|
let value = await r;
|
|
322
|
+
if (initialMask & DEBUG_STATE) {
|
|
323
|
+
console.debug("[groovebox-starter] async FFI call returned", vmID, call_id, name);
|
|
324
|
+
};
|
|
315
325
|
await comm.returnOrFail(fun, call_id, value);
|
|
316
326
|
} else {
|
|
327
|
+
if (initialMask & DEBUG_STATE) {
|
|
328
|
+
console.debug("[groovebox-starter] sync FFI call returned", vmID, call_id, name);
|
|
329
|
+
};
|
|
317
330
|
await comm.returnOrFail(fun, call_id, r);
|
|
318
331
|
}
|
|
319
332
|
} catch (reason) {
|
|
333
|
+
if (initialMask & DEBUG_STATE) {
|
|
334
|
+
console.debug("[groovebox-starter] FFI call exception", vmID, call_id, name);
|
|
335
|
+
console.debug("[groovebox-starter] exception", reason);
|
|
336
|
+
};
|
|
320
337
|
await comm.error(call_id, reason.message, reason.stack);
|
|
321
338
|
}
|
|
322
339
|
}
|
package/groovebox_build.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var GROOVEBOX_BUILD = "
|
|
1
|
+
var GROOVEBOX_BUILD = "3206";
|
|
2
2
|
export { GROOVEBOX_BUILD }
|
package/node.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import Process from "process";
|
|
2
|
+
import Console from "console"
|
|
2
3
|
globalThis.Process = Process;
|
|
4
|
+
globalThis.console = new Console.Console({stdout: process.stderr, stderr: process.stderr });
|
|
5
|
+
// redirect stdout to stderr to avoid that log messages appear in the wrong
|
|
6
|
+
// order
|
|
3
7
|
|
|
4
8
|
// NB: The only way I've made this work in node+webpack is if:
|
|
5
9
|
//
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remix_labs/machine-starter",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2911.0-dev",
|
|
4
4
|
"description": "start the groove",
|
|
5
5
|
"main": "node.js",
|
|
6
6
|
"browser": "index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"author": "Remixlabs staff",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@remix_labs/hub-client": "2.
|
|
14
|
+
"@remix_labs/hub-client": "2.2911.0-dev",
|
|
15
15
|
"nanoid": "^5.0.2",
|
|
16
16
|
"web-worker": "^1.2.0"
|
|
17
17
|
},
|
package/webpack.config.js
CHANGED