Open lidel opened 4 years ago
Hey, cool idea! I actually just pushed some changes to dev
branch (and very soon primary
) that will make the debugging process a bit easier. It appears as though the dynamic import to load the WASM code isn't playing friendly with static mode (note - Next's page says dynamic imports are supported, so not sure why this isn't working). Here's where we dynamically import https://github.com/openworklabs/filecoin-web-wallet/blob/primary/lib/WasmLoader.jsx#L12
Anyways, I am able to at least load the page and see logs, which should unstuck you from seeing logs in the console. I did so following these steps.
"export": "next build && next export"
npm run export
cd out
npx http-server
http://127.0.0.1:8081
You'll see in the screenshot I hit an error when trying to load the wasm. I would definitely review / accept a PR to make this happen if you are able to get it to work//have the time. (Also note - there is some funny race condition or inconsistency when running this in static mode - an error loading the WASM should push the user to an "unsupported browser" page).
I've opened #530 to include scripts for running static version, but won't have bandwidth to debug the WASM issue. If someone else is able to resolve it, I can help with wrapping into a browser extension.
Hey @lidel ! Thank you for putting that together. Right now we're also at development capacity preparing for mainnet, but if we can dig up some free time, we'll look into this.
Hi, I am looking into the feasibility of bundling this wallet inside a browser extension (Manifest V2):
Initial idea is to have a browser action button that when clicked, loads the wallet inside a popup or in a new tab.
There are two ways of doing that:
The latter is preferable, because it also means we can harden supply chain and host it on IPFS, and trust CID instead of TLS cert fingerprint and DNS.
I tried to pre-build everything with
next export
, which outputs to./out/
, but when I try to load static version in a browser (npx http-server ./out -a 127.0.0.1 -p 3000 -c-1
), there is just a blank white page without any errors in console.Is static mode supported at all? Any suggestions/concerns?