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

Format button #3

Open
2 tasks
isaacharrisholt opened this issue May 15, 2024 · 6 comments
Open
2 tasks

Format button #3

isaacharrisholt opened this issue May 15, 2024 · 6 comments

Comments

@isaacharrisholt
Copy link

isaacharrisholt commented May 15, 2024

Add an autoformat button that takes the user's code and formats it.

Note: due to potential large binary sizes, we should test:

  • The size of the current WASM binary if we include the formatter
  • The size of a formatter-only WASM binary
@lpil
Copy link
Member

lpil commented May 17, 2024

This is not something we have a wasm API for yet. One thing I would like to do is to ensure that it does not cause the wasm binary size to grow too much.

@isaacharrisholt
Copy link
Author

Could we use a separate binary that can be downloaded later? So it's opt-in, or perhaps it can even be streamed in, i.e. some sort of 'download formatter' button that gets the formatter. We could generate a hash of the binary at build time that the playground could check against the cached version to see if it's been updated since the last download and prompt the user accordingly

@lpil
Copy link
Member

lpil commented May 17, 2024

I suspect that would be a second large binary, but I could be wrong.

@isaacharrisholt
Copy link
Author

Sure, but if it's optional, I think that negates the issue slightly. I think the best thing to do would be to test these things. I'll add a task to the issue

@lpil
Copy link
Member

lpil commented May 18, 2024

A second equally large binary would be worse than one slightly larger binary for me. I would like to have this with only a small increase in download size.

@isaacharrisholt
Copy link
Author

Fair. Needs more research, and I think #2 is probably higher priority anyway

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