Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm tools #6

Open
phoddie opened this issue May 6, 2019 · 5 comments
Open

wasm tools #6

phoddie opened this issue May 6, 2019 · 5 comments

Comments

@phoddie
Copy link
Owner

phoddie commented May 6, 2019

This issue is for discussion of the XS and Moddable SDK tools for wasm.

Today we pushed changes to bring just about all the Moddable SDK tools to wasm. They include a new mcruntool to build mods from manifests, just as mcconfig is used to builds hosts from manifests. In particular, mcrun supports adding and transforming resources into the mod archive binary.

A brief introductory document is here.

@FWeinb
Copy link

FWeinb commented May 7, 2019

I updated the WebIDE with support for mcrun. The only thing I needed to change was changing the build environment to worker. Here is a diff:

--- a/build/makefiles/wasm/tools.mk
+++ b/build/makefiles/wasm/tools.mk
@@ -217,7 +217,7 @@ LIBRARIES = -ldl -lm

 # LINK_FLAGS = -arch i386
 LINK_FLAGS =\
-       -s ENVIRONMENT=web\
+       -s ENVIRONMENT=worker\
        -s ALLOW_MEMORY_GROWTH=1\
        -s MODULARIZE=1\
        -s EXPORT_ES6=1\

I also added support for json files in the WebIDE, all projects require a manifest.json in the root now.

WebIDE

@phoddie
Copy link
Owner Author

phoddie commented May 7, 2019

Nice. That was quick. I'll give it a look a little later.

@FWeinb
Copy link

FWeinb commented May 8, 2019

@phoddie
I just pushed another update to the WebIDE, the mcrun tool could only be used once before. I was not cleaning up correctly.

The moddable zero was in the mail today (thank a lot) and got it running with the WebIDE (click to see a video):
Video Preview

@phoddie
Copy link
Owner Author

phoddie commented May 8, 2019

Nice demo. Great to see it running with the display on Moddable Zero.

FWIW - I pushed a couple reliability fixes to the install upload last night.

@FWeinb
Copy link

FWeinb commented May 8, 2019

I just tested these changes, everything is working fine!

I think drag&drop support for adding files and folders is needed. I would also like to include drag and drop support for files inside the file explorer to reorganise projects. I might be able to reuse the vscode file explorer to handle all this stuff. Need to figure out how to do that.

Another thing is that currently projects aren't really shareable because everything is persisted locally and with images and other files we can't use gists anymore.

What I also noticed is that currently the runmod application needs to be recompiled if we want to include more system modules. Would it be possible to precompile these and have the compiler just include these pre-builds when referencing a path like "$(MODULES)/network/http/*" to test this we could use emscriptens -preload-file to include these files inside the tools file system. If that works another step would be to only dynamically load these so we don't ship such a huge payload to the browser each time.
I guess these pre-builds would be platform specific but with the dynamic loading approach we could add a platform switch to the UI and load the appropriate builds for each platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants