@remix_labs/machine-starter 2.2050.0-dev → 2.2053.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 CHANGED
@@ -1,4 +1,5 @@
1
1
  import { GROOVEBOX_BUILD } from "./groovebox_build.js";
2
+ import { mixcoreFromConfigStarter } from "./mixcore.js";
2
3
  import { nanoid } from "nanoid";
3
4
 
4
5
  let workers = {};
@@ -56,20 +57,8 @@ function StartWASM(hub, baseURL, org, workspace, vmID, user, token, noOutputViaM
56
57
  })
57
58
  }
58
59
 
59
- // The parameter config.mixcore controls the mixcore integration. it can be one
60
- // of the following:
61
- //
62
- // - {kind: "mixcore", mixcore: Mixcore}: use an already instantiated Mixcore
63
- // - {kind: "webkit"}: use Webkit backend implemented in
64
- // `mixcore/bindings/swift/Mixcore.swift` and used in flutter-runtime
65
- // (AppClipWebview.swift and appclip.html)
66
- // - {kind: "tauri", dbDir: STRING, dbName: STRING, dbUser: STRING}: use
67
- // Tauri backend for turntable/remix-desktop, implemented in
68
- // `mix-rs/mixcore/bindings/tauri/mixcore_tauri.rs`
69
- // - {kind: "wasm", dbDir: STRING, dbName: STRING, dbUser: STRING, url: STRING}:
70
- // use the Wasm backend, the `url` can something `fetch`able, or `file://` on
71
- // node
72
- // - {kind: "serviceworker", url: STRING, "dbName": STRING, "dbUser": STRING}
60
+ // See `mix-rs/mixcore/bindings/javascript/mixcore.js` for a description of the
61
+ // values of config.mixcore.
73
62
  async function StartWASM2(hub, config) {
74
63
  console.log("GROOVEBOX_BUILD (machine-starter)", GROOVEBOX_BUILD);
75
64
  let channel = await hub.newChannel();
@@ -81,25 +70,11 @@ async function StartWASM2(hub, config) {
81
70
  let localFFIkind = {};
82
71
  let localFFIfuns = {};
83
72
 
84
- console.log("MIXCORE CONFIG", mixcoreConfig);
85
- if (mixcoreConfig && mixcoreConfig.kind == "mixcore") {
86
- await mixcoreConfig.mixcore.setHandleFFIs(mixcoreConfig.includes, mixcoreConfig.excludes);
73
+ let mixcore = await mixcoreFromConfigStarter(mixcoreConfig);
74
+ if (mixcore !== null) {
87
75
  localFFIs = {...localFFIs, ...mixcore.localFFIs()};
88
76
  mixcoreConfig = null;
89
77
  }
90
- if (mixcoreConfig && mixcoreConfig.kind == "wasm-instance") {
91
- // this is the only mixcore configuration that cannot be to the
92
- // machine-wasm. the FFIs are registered as localFFIs.
93
- let mixcore = new MixcoreWasm(
94
- mixcoreConfig.dbDir,
95
- mixcoreConfig.dbName,
96
- mixcoreConfig.username,
97
- mixcoreConfig.instance);
98
- await mixcore.setHandleFFIs(mixcoreConfig.includes, mixcoreConfig.excludes);
99
- localFFIs = {...localFFIs, ...mixcore.localFFIs()};
100
- mixcoreConfig = null;
101
- }
102
-
103
78
  if (localFFIs) {
104
79
  for (const [k, v] of Object.entries(localFFIs)) {
105
80
  localFFIfuns[k] = {...v};
@@ -1,2 +1,2 @@
1
- var GROOVEBOX_BUILD = "2194";
1
+ var GROOVEBOX_BUILD = "2198";
2
2
  export { GROOVEBOX_BUILD }