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

feature: WASM web app #136

Closed
caner-cetin opened this issue Nov 22, 2022 · 11 comments · Fixed by #2278
Closed

feature: WASM web app #136

caner-cetin opened this issue Nov 22, 2022 · 11 comments · Fixed by #2278

Comments

@caner-cetin
Copy link

A web editor, for at least preview can be done with https://go-app.dev/. I may work on this, couldn't find anything similar on issues. pls hit me up if someone already works on a web app.

@nhooyr nhooyr added this to D2 Dec 1, 2022
@nhooyr
Copy link
Contributor

nhooyr commented Dec 3, 2022

This is a goal. @alixander thoughts on doing it for the playground? That way we don't even need a stateful API, all static!!!

@alixander
Copy link
Collaborator

our wasm build currently is 50M lmao. the vast majority is Goja. the other big dead weight is playwright

Screen Shot 2022-12-06 at 6 56 13 PM

@alixander
Copy link
Collaborator

alixander commented Dec 7, 2022

without goja, playwright, elk, dagre, i got the build down to 27M, compressed with gzip is 6.5M.

compressed with brotli is 4.4M. i think that's a reasonable size to serve to users, even with fast load times as a top priority for the playground. further removing fonts, mathjax, pflag and net, can probably hit a bit over 3M compressed? @nhooyr wdyt

@nhooyr
Copy link
Contributor

nhooyr commented Dec 8, 2022

Yea we don't need goja on the web, we can run the JS directly in the browser. See #366

Yes, 4.4M is excellent.

@zachcp
Copy link

zachcp commented Feb 23, 2023

+1 for this. Would love to have something like a fully embeddable playground/static site.

@nickchomey
Copy link

could tinygo perhaps be useful here for making a smaller wasm binary? https://tinygo.org/docs/guides/webassembly/

@alixander
Copy link
Collaborator

Thank you for the suggestion. I tried tinygo with some minimal effort ~a year ago but ran into errors. The size shouldn't be an issue anyway once we shed unused dependencies for wasm.

@caner-cetin
Copy link
Author

i forgot why i asked for this feature and what is D2 but, gratz! and thank you :3

@alixander
Copy link
Collaborator

haha yeah this one's been on the backburner for a while

@nhooyr
Copy link
Contributor

nhooyr commented Jan 12, 2025

Slick! 🚀

@zachcp
Copy link

zachcp commented Jan 13, 2025

Awesome!

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

Successfully merging a pull request may close this issue.

5 participants