sCrypt-Inc / scryptlib

Javascript SDK
MIT License
47 stars 28 forks source link

improved browser support #214

Closed adrianhunter closed 2 weeks ago

adrianhunter commented 1 year ago

This PR improves browser support by upgrading package.json to type "module". I'm not 100% sure if something is still broken, but will open soon another PR to also update scrypt-ts for better browser support.

xhliu commented 1 year ago

@adrianhunter

adrianhunter commented 1 year ago

Hey @xhliu, I gave you all access to my repo, where I have tried to put civet and Deepkit together, still needs a lot more tweaking with all the LSP stuff, and it's really a mess still, every annoying where the Deno LSP often crashes when activated and stuff. But this also included modernising stuff with "npm:" prefix to get full Deno support + nodejs. https://github.com/adrianhunter/kitto-framework/blob/main/packages/vite-plugin-kitto/mod.ts#L32

Would be interesting to use the smaller "bvm" lib in this repo when it's ready instead of the bsv.js lib

adrianhunter commented 1 year ago

I still need to connect all the runtime code, so currently in this example it just spits out the contract as you have written it, but I'm pretty sure it will not be much runtime code for a minimal version.

Screenshot 2023-02-02 at 00 49 30 Screenshot 2023-02-02 at 00 49 45
adrianhunter commented 1 year ago

One can also optimise the 4mb down to 200-300kb or so, but its probably easier to start with 0.5kb and then only add carefully very little stuff.

zhfnjust commented 2 weeks ago

close due to not active