Wilfred / difftastic

a structural diff that understands syntax 🟥🟩
https://difftastic.wilfred.me.uk/
MIT License
21.07k stars 344 forks source link

Make WASM builds #407

Open CetinSert opened 2 years ago

CetinSert commented 2 years ago

difftastic would benefit greatly from wasm builds! It would open the project up to web browsers, deno deploy, bun oven, cloudflare workers!

Wilfred commented 2 years ago

I'm open to PRs for this. The fiddly bit is getting the tree-sitter parsers compiled to wasm, as they're C code.

MRYingLEE commented 7 months ago

This will be a great feature.

I just found that actually the underlying tree-sitter had have a WASM version for years. Please check https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md

So, is it possible to build WASM version of Diffastic?

BTW, on web a Markdown display for code will be better than a direct HTML display.

Thank you in advance,

psymbio commented 7 months ago

Hi @Wilfred

I wanted to understand what is the feasibility of doing this given that tree-sitter has a WASM based version (https://github.com/wasm-lsp/tree-sitter-wasm). Also, if you can attach any comprehensive GitHub comments, or guides to build this it would be helpful.

Thanks!