wasm-bindgen icon indicating copy to clipboard operation
wasm-bindgen copied to clipboard

Remove outdated js snippet caveat on imports

Open crajcan opened this issue 2 years ago • 3 comments

I'm not sure if import statements are universally implemented now but myself and others seem to be having success using them in snippets.

crajcan avatar Jan 10 '24 19:01 crajcan

I honestly don't know anything about this limitation. Going through git blame didn't help either.

@Liamolucko do you know something about the historical context here? Testing it out locally seems to work fine for me.

daxpedda avatar Jan 11 '24 10:01 daxpedda

@Liamolucko do you know something about the historical context here? Testing it out locally seems to work fine for me.

No, but I found the original RFC for snippets and there's a note about it there. It looks like what the caveat's supposed to mean is that imports don't work relative to the original path of the snippet like you'd expect, but there's nothing stopping you from writing them anyway and having them be resolved relative to the final path of the snippet. The fact that that works seems to be an unintended side effect of not processing the JS at all.

Liamolucko avatar Jan 11 '24 23:01 Liamolucko

Thank you! @crajcan at best I would update the documentation then instead of removing it.

daxpedda avatar Jan 11 '24 23:01 daxpedda