You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I found it difficult to setup WASM from the docs, and in the end, I had to install Node.js and use it (adding yet another dependency to my project). I found this CDN, but I don't know if it's oficially maintained by you guys (Also, it doesn't work).
Describe the solution you'd like to see
I would like to see a way to use Themis from the browser without the need for Node.js.
Describe alternatives you've considered
Offer a single minified file for the libthemis.js (Containing all cryptosystems and key generation), bundled with libthemis.wasm;
Additional context
I'm not very familiar with WASM, so I don't know the feasibility of loading it from a CDN (Even more so in a security-focused project like this one). If there are any easier ways to set this up, please let me know.
The text was updated successfully, but these errors were encountered:
# Adds .js extension to all of the imports
find . -name "*.js"! -name "libthemis.js" -exec sed -i "s/\(import.*from[[:space:]]\+['\"]\)\([^'\"]*\)\(['\"]\)/\1\2.js\3/" {} +
# Removes extra .js from libthemis.js import in index.js
sed -i 's/libthemis\.js\.js/libthemis\.js/g' index.js
# Adds default export to Module in libthemis.jsprintf"\n\nexport default Module;">> libthemis.js
# Removes module.exports from libthemis.js
sed -i 's/module\.exports=Module;//' libthemis.js
This way, I was able to initialize themis and use it as expected.
Example
<scripttype="module">importthemisfrom"/index.js";// Loading from a local file serverasyncfunctionmain(){awaitthemis.initialized;letkeypair=newthemis.KeyPair();letprivateKey=keypair.privateKey;letpublicKey=keypair.publicKey;console.log("Working 😎");}main();</script>
Needless to say that this is kinda of a burden. It would be easier to add .js extensions by default, add a conditional to check if module exists before module.exports=Module; and check if in a ES6 environment to add export default Module;.
Is your feature request related to a problem? Please describe.
I found it difficult to setup WASM from the docs, and in the end, I had to install Node.js and use it (adding yet another dependency to my project). I found this CDN, but I don't know if it's oficially maintained by you guys (Also, it doesn't work).
Describe the solution you'd like to see
I would like to see a way to use Themis from the browser without the need for Node.js.
Describe alternatives you've considered
libthemis.js
(Containing all cryptosystems and key generation), bundled withlibthemis.wasm
;Additional context
I'm not very familiar with WASM, so I don't know the feasibility of loading it from a CDN (Even more so in a security-focused project like this one). If there are any easier ways to set this up, please let me know.
The text was updated successfully, but these errors were encountered: