WebAssembly / component-model

Repository for design and specification of the Component Model
Other
898 stars 75 forks source link

Change package namespaces and names to be lowercased #299

Closed calvinrp closed 2 months ago

calvinrp commented 5 months ago

Currently, in the docs and corresponding tooling, package namespaces and names can include a mix of lowercased and uppercased characters, such as MY-namespace:some-PACKAGE is valid.

As we are looking at publishing packages to registries, supporting mixed case names adds, perhaps, unnecessary complexity. It would be best to support whatever is valid in the component model specification. If there isn't a good reason to support mixed case for namespaces and package names, we should consider changing the spec to require lowercase characters only.

Relevant sections that I spotted in the docs: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#import-and-export-definitions https://github.com/WebAssembly/component-model/blob/main/design/mvp/Binary.md#type-definitions

lukewagner commented 5 months ago

Given that package and namespace names are going to show up not just in programming languages but also URLs and other random identifiers and given that there is far less benefit to being able to express idiomatically-cased acronyms in these contexts, I agree that it makes sense to conservatively restrict the grammar for namespaces/packages (subsetting <label>). If noone has any good arguments to the contrary, I can write a PR to do this in a bit.