Skip to content

Emit component name in core Wasm file names#408

Merged
guybedford merged 4 commits intobytecodealliance:mainfrom
guybedford:core-naming
Oct 31, 2022
Merged

Emit component name in core Wasm file names#408
guybedford merged 4 commits intobytecodealliance:mainfrom
guybedford:core-naming

Conversation

@guybedford
Copy link
Copy Markdown
Contributor

@guybedford guybedford commented Oct 29, 2022

This updates the generator to rather than outputting module{n}.wasm for the core Wasm files, to instead use the naming scheme {name}.core{n}.wasm and also in addition when n == 0 to emit the n.

This way applications with a single Wasm file get an unnumbered Wasm, and the loaded Wasm file has a component-specific name eg in the network tab etc.

In addition this also fixes a one-liner regression in the Node.js compat output which wasn't using compileStreaming, and corrects the unhandled rejection handler attachment in the singular case for the JS generator.

@alexcrichton
Copy link
Copy Markdown
Member

Could this perhaps be threaded through to the generators in some form of a structure describing the names? That should avoid having three locations that all need to be kept in sync as the naming scheme gets fancier.

@guybedford
Copy link
Copy Markdown
Contributor Author

Good point, I've updated the PR to use a core_file_name trait function.

@guybedford guybedford merged commit 2047fa4 into bytecodealliance:main Oct 31, 2022
@guybedford guybedford deleted the core-naming branch October 31, 2022 21:22
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