Skip to content

Make strongly-unique hyphen-insensitive - #704

Open
bvisness wants to merge 1 commit into
WebAssembly:mainfrom
bvisness:no-hyphens
Open

Make strongly-unique hyphen-insensitive#704
bvisness wants to merge 1 commit into
WebAssembly:mainfrom
bvisness:no-hyphens

Conversation

@bvisness

Copy link
Copy Markdown
Collaborator

In #197 @lukewagner discussed making the strongly-unique algorithm also hyphen-insensitive. There was also some discussion of how strong this needed to be, but in my opinion it makes the most sense to remove hyphens entirely when checking for uniqueness, as this completely prevents names that differ only in case.

This is already a concern for us in Firefox, as an identifier like [method]a-b.AB on resource type a-b will produce a class named AB (PascalCase), and a method named AB (theoretically camelCase, but acronym). That's maybe workable for us as far as JS goes (because the constructor is just named constructor), but obviously other languages like Java and C# would choke on this case as well. I don't see a good reason for component interfaces to require case sensitivity.

@bvisness
bvisness requested a review from lukewagner August 20, 2026 14:14

@badeend badeend left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this makes sense and offers wider compatibility across different languages 👍

@lukewagner

Copy link
Copy Markdown
Member

Good point! Makes sense to me. It might be good to get a bit of implementation feedback (to see if this breaks anything) before merging though.

@bvisness

Copy link
Copy Markdown
Collaborator Author

Yeah, for sure. I do think this is a direction we want to go but there's no urgency to merge this; we can work around stuff for now (and are unlikely to encounter this in practice).

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