Depending on which p2panda-js build you chose to import into your project,
the WebAssembly code needs to be initialised in different ways:
NodeJS: No initialisation needed. You can optionally activate debug tools
for better error messages in WebAssembly code by calling initWebAssembly.
UMD, CJS and ESM builds with inlined WebAssembly code running in the
browser: WebAssembly needs to be decoded and initialised by calling
initWebAssembly once before all other methods. This will also implicitly
activate debug tools for better error messages in WebAssembly code.
CJS and ESM "slim" builds running in browser: WebAssembly needs to be
initialised by providing external "p2panda.wasm" file path as an input
when calling initWebAssembly methods. This will also implicitly activate
debug tools for better error messages in WebAssembly code.
Depending on which
p2panda-js
build you chose to import into your project, the WebAssembly code needs to be initialised in different ways:NodeJS: No initialisation needed. You can optionally activate debug tools for better error messages in WebAssembly code by calling
initWebAssembly
.UMD, CJS and ESM builds with inlined WebAssembly code running in the browser: WebAssembly needs to be decoded and initialised by calling
initWebAssembly
once before all other methods. This will also implicitly activate debug tools for better error messages in WebAssembly code.CJS and ESM "slim" builds running in browser: WebAssembly needs to be initialised by providing external "p2panda.wasm" file path as an input when calling
initWebAssembly
methods. This will also implicitly activate debug tools for better error messages in WebAssembly code.