webassemblyjs icon indicating copy to clipboard operation
webassemblyjs copied to clipboard

use uint8array instead

Open jimmywarting opened this issue 3 years ago • 1 comments

just browsing the code and just having a look at it to see if it's something i would use...

something i notice right from the bat, is that you are using NodeJS specific stuff, and i'm targeting both browser and Deno, so i would prefer if you used uint8array + dataview instead.

Here is just one example... https://github.com/xtuc/webassemblyjs/blob/255ab4de257925d7893f0ad7223fdd29c873cd44/packages/leb128/src/bufs.js#L87

don't really wish to ship node specific stuff that works slower in the browser than using say eg TextEncoder/TextDecoder etc...

jimmywarting avatar Sep 27 '22 12:09 jimmywarting

Thanks for the report. Please feel free to send a change to fix

xtuc avatar Oct 11 '22 13:10 xtuc

hey @xtuc , I've got a local branch to experiment with removing the node specific Buffer dependency. I'd like to test this by linking the project I'm importing @webassemblyjs/wasm-parser from to my local machine using npm link. Do you happen to know if there is an easy way to do this?

wikiwong avatar Jul 20 '23 22:07 wikiwong

Opened a PR for this: https://github.com/xtuc/webassemblyjs/pull/1144

wikiwong avatar Jul 26 '23 18:07 wikiwong