@swmansion/popcorn 0.2.0-rc.3 → 0.2.0-rc.4
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/AtomVM.mjs +2 -2
- package/dist/AtomVM.wasm +0 -0
- package/dist/bridge.mjs +1 -4
- package/dist/iframe.mjs +20 -4
- package/dist/types.mjs +1 -2
- package/package.json +1 -1
package/dist/AtomVM.mjs
CHANGED
|
@@ -56,7 +56,7 @@ if (ENVIRONMENT_IS_PTHREAD) {
|
|
|
56
56
|
|
|
57
57
|
// --pre-jses are emitted after the Module integration code, so that they can
|
|
58
58
|
// refer to Module (if they choose; they can also define Module)
|
|
59
|
-
// include: /tmp/popcorn-swm.
|
|
59
|
+
// include: /tmp/popcorn-swm.tJ64R0d/atomvm/src/platforms/emscripten/src/atomvm.pre.js
|
|
60
60
|
/*
|
|
61
61
|
* This file is part of AtomVM.
|
|
62
62
|
*
|
|
@@ -128,7 +128,7 @@ function ensureValidResult(result) {
|
|
|
128
128
|
throw new Error(message);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
// end include: /tmp/popcorn-swm.
|
|
131
|
+
// end include: /tmp/popcorn-swm.tJ64R0d/atomvm/src/platforms/emscripten/src/atomvm.pre.js
|
|
132
132
|
var arguments_ = [];
|
|
133
133
|
|
|
134
134
|
var thisProgram = "./this.program";
|
package/dist/AtomVM.wasm
CHANGED
|
Binary file
|
package/dist/bridge.mjs
CHANGED
|
@@ -2,9 +2,6 @@ import { isMessageType } from './types.mjs';
|
|
|
2
2
|
import { throwError } from './errors.mjs';
|
|
3
3
|
|
|
4
4
|
const STYLE_HIDDEN = "visibility: hidden; width: 0px; height: 0px; border: none";
|
|
5
|
-
function sendIframeResponse(type, data) {
|
|
6
|
-
window.parent.postMessage({ type, value: data });
|
|
7
|
-
}
|
|
8
5
|
class IframeBridge {
|
|
9
6
|
iframe;
|
|
10
7
|
handlerRef;
|
|
@@ -65,4 +62,4 @@ function metaTagsFrom(config) {
|
|
|
65
62
|
.join("\n");
|
|
66
63
|
}
|
|
67
64
|
|
|
68
|
-
export { IframeBridge
|
|
65
|
+
export { IframeBridge };
|
package/dist/iframe.mjs
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import init from './AtomVM.mjs';
|
|
2
|
+
|
|
3
|
+
const HEARTBEAT_INTERVAL_MS = 500;
|
|
4
|
+
const MESSAGES = {
|
|
5
|
+
INIT: "popcorn-init",
|
|
6
|
+
START_VM: "popcorn-startVm",
|
|
7
|
+
CALL: "popcorn-call",
|
|
8
|
+
CAST: "popcorn-cast",
|
|
9
|
+
CALL_ACK: "popcorn-callAck",
|
|
10
|
+
STDOUT: "popcorn-stdout",
|
|
11
|
+
STDERR: "popcorn-stderr",
|
|
12
|
+
HEARTBEAT: "popcorn-heartbeat",
|
|
13
|
+
RELOAD: "popcorn-reload",
|
|
14
|
+
};
|
|
15
|
+
new Set(Object.values(MESSAGES));
|
|
16
|
+
|
|
17
|
+
function sendIframeResponse(type, data) {
|
|
18
|
+
window.parent.postMessage({ type, value: data });
|
|
19
|
+
}
|
|
4
20
|
|
|
5
21
|
// @ts-expect-error atomvm doesn't have types yet
|
|
6
22
|
let Module = null;
|
|
@@ -43,7 +59,7 @@ async function startVm(avmBundle) {
|
|
|
43
59
|
const resultPromise = new Promise((resolve) => {
|
|
44
60
|
resolveResultPromise = resolve;
|
|
45
61
|
});
|
|
46
|
-
const moduleInstance = await
|
|
62
|
+
const moduleInstance = await init({
|
|
47
63
|
preRun: [
|
|
48
64
|
function ({ FS }) {
|
|
49
65
|
FS.mkdir("/data");
|
package/dist/types.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const INIT_VM_TIMEOUT_MS = 30_000;
|
|
2
2
|
const CALL_TIMEOUT_MS = 60_000;
|
|
3
3
|
const HEARTBEAT_TIMEOUT_MS = 60_000;
|
|
4
|
-
const HEARTBEAT_INTERVAL_MS = 500;
|
|
5
4
|
const MAX_RELOAD_N = 3;
|
|
6
5
|
const MESSAGES = {
|
|
7
6
|
INIT: "popcorn-init",
|
|
@@ -19,4 +18,4 @@ function isMessageType(type) {
|
|
|
19
18
|
return MESSAGES_TYPES.has(type);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
export { CALL_TIMEOUT_MS,
|
|
21
|
+
export { CALL_TIMEOUT_MS, HEARTBEAT_TIMEOUT_MS, INIT_VM_TIMEOUT_MS, MAX_RELOAD_N, MESSAGES, isMessageType };
|