Skip to content

Drop hyphens when testing equality of kebab names - #2626

Merged
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:drop-dashes
Aug 27, 2026
Merged

Drop hyphens when testing equality of kebab names#2626
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:drop-dashes

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This commit is an implementation of WebAssembly/component-model#704 for this repository where the main change is to drop the - character when comparing kebab-names. More rationale can be found in the upstream PR, and while there's expected to be minor amounts of test-related fallout this is not expected to break anything in practice.

This commit is an implementation of WebAssembly/component-model#704 for
this repository where the main change is to drop the `-` character when
comparing kebab-names. More rationale can be found in the upstream PR,
and while there's expected to be minor amounts of test-related fallout
this is not expected to break anything in practice.
@alexcrichton
alexcrichton requested a review from a team as a code owner August 26, 2026 22:32
@alexcrichton
alexcrichton requested review from pchickey and removed request for a team August 26, 2026 22:32
(component
(import "foo" (type $foo (sub resource)))
(import "[static]foo.bar-baz" (func))
(import "[method]foo.barbaz" (func (param "self" (borrow $foo)))))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To maximize terribleness, you could also add a test where you import foo-bar, and then import [method]foo-bar.FO-ob-AR or something :) (In other words, something that will trigger the [method]foo.foo rule.)

You could also add a test that makes foo-bar and [constructor]FOOBAR conflict, but such a test would either require you to also import a resource type named FOOBAR (which would itself conflict as seen above), or it would imply that strong uniqueness is checked before the constructor name itself, which feels wrong to me but I don't think the order is specified today anyhow. (I'd just avoid a test for that at this stage.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added the [method]... case, and yeah otherwise the order-of-validation makes it not possible right now to write a test for foo-bar and [constructor]FOOBAR

@alexcrichton
alexcrichton enabled auto-merge August 27, 2026 17:45
@alexcrichton
alexcrichton added this pull request to the merge queue Aug 27, 2026
Merged via the queue into bytecodealliance:main with commit 9c0b78d Aug 27, 2026
37 checks passed
@alexcrichton
alexcrichton deleted the drop-dashes branch August 27, 2026 18:02
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.

3 participants