Open isaacharrisholt opened 4 months ago
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.
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
I suspect that would be a second large binary, but I could be wrong.
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
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.
Fair. Needs more research, and I think #2 is probably higher priority anyway
Add an autoformat button that takes the user's code and formats it.
Note: due to potential large binary sizes, we should test: