As mentioned in the Zipline WASM support discussio...
# squarelibraries
c
As mentioned in the Zipline WASM support discussion, replacing the QuickJS interpreter with Wasm3 or WasmEdge would be the only way to achieve a web-based loader, correct? The current loader module doesn't support the web; it's limited to Android, iOS, and desktop. While I have created a simple program to simulate the effect of dynamically loading a JS plugin, trying to somehow insert a JS file into the existing Zipline files would be quite messy... However, the work involved in replacing the interpreter, if possible, is massive. As for inserting a dynamic JS plugin into the current structure, perhaps a 'web' folder could be created in Zipline's root directory to store the JS, though this JS would likely need to consider encryption. https://github.com/cashapp/zipline/discussions/843 https://github.com/crowforkotlin/compose-multiplatform-web-dynamic-load-js-plugin
j
What do you mean by a web-based loader? We only use Zipline on Android and iOS (and JVM for testing), and for use in the browser we use the normal JS output of Kotlin.
c
The
zipline-loader
module implements extensions for Android, iOS, and desktop.
zipline-loader
calls the corresponding platform's
NativeLoader
within the
zipline
module to load the QuickJS interpreter. However, there is no such extension implemented for the web platform. My suggestion is based on the goal of implementing a web loader now. The latest active QuickJS branch on GitHub seems to support WASM, but running another QuickJS interpreter inside the web to interpret JS might not be the most sensible approach... That's why I implemented a direct JS-based interpreter on the web, thinking I could extend the existing Zipline project with it, as replacing the WASM interpreter might involve a significantly larger workload.
j
So there is no Wasm support whatsoever today.
But the web natively has JS support so we don't need to do anything to support it.
Here's an example where we're running the same code in a browser: https://cashapp.github.io/redwood/latest/emoji-search/ We basically just bypass Zipline altogether and load the JS directly.
But if you look at the Android or iOS samples the code is loaded through Zipline: https://github.com/cashapp/redwood/tree/trunk/samples/emoji-search
👍🏻 1
c
Got it. Thank you.