@tinyactors/wasm 0.3.0 → 0.4.0
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/README.md +15 -6
- package/index.d.ts +899 -590
- package/index.mjs +3 -4
- package/init.mjs +0 -1
- package/lib/checks.mjs +3 -1
- package/lib/compile.mjs +27 -16
- package/lib/convenience.mjs +815 -101
- package/lib/datamodel.mjs +59 -398
- package/lib/direct.mjs +6 -4
- package/lib/errors.mjs +28 -0
- package/lib/host.mjs +191 -34
- package/lib/http.mjs +19 -0
- package/lib/realm-script.mjs +1 -1
- package/lib/version.mjs +5 -0
- package/package.json +1 -1
- package/tinyactors.wasm +0 -0
package/README.md
CHANGED
|
@@ -18,10 +18,9 @@ const compiled = compileCharts([{ name: 'hello.scxml', text: `
|
|
|
18
18
|
datamodel="ecmascript" name="hello" initial="s">
|
|
19
19
|
<state id="s"><onentry><log expr="'hello from ' + _ioprocessors.scxml.location"/></onentry></state>
|
|
20
20
|
</scxml>` }]);
|
|
21
|
-
const host = new Host({
|
|
22
|
-
host.addImage(compiled.image);
|
|
21
|
+
const host = new Host(compiled, { system: 'web', log: (entry) => console.log(entry.text) });
|
|
23
22
|
compiled.close();
|
|
24
|
-
host.spawn(
|
|
23
|
+
host.spawn('hello');
|
|
25
24
|
await host.idle();
|
|
26
25
|
host.close();
|
|
27
26
|
```
|
|
@@ -66,9 +65,19 @@ The guides are shared with `@tinyactors/node`:
|
|
|
66
65
|
- [@tinyactors/node's README](https://github.com/tinyactors-dev/tinyactors-napi#readme):
|
|
67
66
|
the concepts, from a first chart to hosts, actors, I/O processors and
|
|
68
67
|
errors.
|
|
69
|
-
- [The guides](https://github.com/tinyactors-dev/tinyactors-napi/tree/main/docs/guide)
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
- [The guides](https://github.com/tinyactors-dev/tinyactors-napi/tree/main/docs/guide),
|
|
69
|
+
in three groups, as the README orders them:
|
|
70
|
+
- **writing an application:** charts, I/O processors, when the actor
|
|
71
|
+
is not there, services, hibernation with a store, testing, the
|
|
72
|
+
quickjs sandbox;
|
|
73
|
+
- **operating a host** (the README's
|
|
74
|
+
[Operating a host](https://github.com/tinyactors-dev/tinyactors-napi#operating-a-host)):
|
|
75
|
+
inspection, capacity, telemetry, hibernation by a policy of your own,
|
|
76
|
+
migration, snapshots;
|
|
77
|
+
- **the wire format** (the README's
|
|
78
|
+
[Wire format](https://github.com/tinyactors-dev/tinyactors-napi#wire-format)):
|
|
79
|
+
`encode` and `decode`, `decodeTraces`, addresses, other systems and
|
|
80
|
+
SCXML's BasicHTTP.
|
|
72
81
|
|
|
73
82
|
Charts are trusted code: their expressions run as JavaScript in a realm
|
|
74
83
|
of their own, which is not a security boundary.
|