Fix signals and offline mode for js/wasm
Draft
+523
−327
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Changes in this PR include the things I needed to change in the CLI to make it compile to
js/wasm.Had to move around and refactor some code to fix import cycles and such. I'm not completely happy with the structure yet, but it's a start.
The
js/wasmbuild is not fully functional. There are things that are not supported in a browser environment, so these functions can't be used. Using mTLS (easily) is one of them. There are also things that aren't fully implemented yet, like the--offlinemode. Currently this functionality is stubbed, so that thejs/wasmbuild can at least compile. It would be cool to support this in the future, though, as this would allow running an offline instance ofstep-cain memory in a browser.Running
GOOS=js GOARCH=wasm go build -o ./html/test.wasm -tags nobadger,nobbolt cmd/step/main.gowill not result in a Wasm module yet. There are still some changes in dependencies to be completed:In my POC repo, using forks of those with dirty hacks, the Wasm compiles with the changes from this PR.