cossacklabs / themis

Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.
https://www.cossacklabs.com/themis
Apache License 2.0
1.87k stars 143 forks source link

A typo in wasm docs #894

Closed steida closed 2 years ago

steida commented 2 years ago

Here https://docs.cossacklabs.com/themis/languages/wasm/installation/

node: {
    fs: 'empty'
}

Should be ws. Also, Webpack 5 has a different format:

config.resolve.fallback = {
      ...config.resolve.fallback,
      // Themis
      ws: false,
    };
ilammy commented 2 years ago

@steida, I think fs is the correct one. There is no Node.js module named ws. This statement suppresses warnings from webpack caused by Node.js compatibility shims that Emscripten adds to generated code. They should never actually be used in Web environments, but exist in the code.

Do you experience issues with fs which get fixed by using ws? 🤔

ilammy commented 2 years ago

Regarding webpack 5, you are absolutely right. I've filed a PR to provide an example for webpack 5 syntax. Thanks.

steida commented 2 years ago

@steida, I think fs is the correct one. There is no Node.js module named ws. This statement suppresses warnings from webpack caused by Node.js compatibility shims that Emscripten adds to generated code. They should never actually be used in Web environments, but exist in the code.

Do you experience issues with fs which get fixed by using ws? 🤔

It fixed my code, that's why I made an issue. But I already deleted experimental Themis branch, so I can not retest it. 1mb gzipped for web is no-go.

vixentael commented 2 years ago

thank you guys! The docs are updated https://docs.cossacklabs.com/themis/languages/wasm/installation/