Skip to content

gen-host-js: base64 option#411

Merged
guybedford merged 2 commits intobytecodealliance:mainfrom
guybedford:base64
Nov 3, 2022
Merged

gen-host-js: base64 option#411
guybedford merged 2 commits intobytecodealliance:mainfrom
guybedford:base64

Conversation

@guybedford
Copy link
Copy Markdown
Contributor

@guybedford guybedford commented Nov 2, 2022

Adds a --base64 flag to the JS host generator for inlining the Wasm. This is almost always a terrible idea and so the option has been hidden from the options display. The option has been left in the help without warnings, so users can use it as appropriate.

It can be useful in certain contexts though, such as for es-module-lexer where the binary size is very carefully managed and a latency delay for a separate fetch during browser intialization wouldn't be acceptable. It doesn't add much code complexity overhead at all though thankfully.

Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some tests for this as well?

Comment thread crates/gen-host-js/src/lib.rs
@guybedford guybedford merged commit 2612c44 into bytecodealliance:main Nov 3, 2022
@guybedford guybedford deleted the base64 branch November 3, 2022 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants