fermyon / spin-js-sdk

https://developer.fermyon.com/spin/javascript-components
Apache License 2.0
52 stars 18 forks source link

Change template .wasm file to use project-name parameter #165

Closed mikkelhegn closed 1 year ago

mikkelhegn commented 1 year ago

It makes sense to call the .wasm output file using the template name, as this is the convention we have for other templates.

A potential addition could be to parameterize this to use {{project-name | kebab_case}}.wasm, like the component id.

Marking this a draft until we agree on whether this should be parameterized.

karthik2804 commented 1 year ago

I think parameterizing the name of the output file sounds like a good idea to me. Allowing for easier identification of the purpose of the wasm module. The package.json needs to be updated for that.

itowlson commented 1 year ago

Some templates (e.g. Rust) parameterise the name of the output file. Others (e.g. Go) do not. I like to imagine it depends on what is convenient in the language/toolchain, though it is probably really historical accident inherited from whoever wrote the example the template was adapted from. In any case, parameterising the Wasm file name is definitely not an established convention, and template authors should not feel any obligation or pressure to do it.

itowlson commented 1 year ago

And... to be clear... that is not a "don't parameterise"... that is a "parameterise if it is more convenient or if you prefer it that way."

mikkelhegn commented 1 year ago

I'd love for this to be a convention, it just makes spin.toml much easier to read, if the wasm modules don't have generic names. but get your point @itowlson :-)

mikkelhegn commented 1 year ago

BTW - the handle bar templating works really nicely 👍🏻