Skip to content

[DX][Components] Twig components case sensitivity / HTML syntax #2118

Open
@smnandre

Description

@smnandre

TL;DR; ⏲️

  • Should we adopt a naming convention for component names in UX packages and documentation? If so, which one?
  • Should all component names be case-sensitive?

Context 🔠

While working on UX Map, @Kocal raised a question during the discussion:

Should it be <twig:ux:map /> or <twig:UX:Map />? (I noticed you used UX:Map in the twig.component tag). Or is it case-insensitive?

During the development and early stages of UX Icons, @kbond and I decided to switch from <twig:Ux:Icon /> to <twig:ux:icon /> both in the code and in the documentation.

This change felt more natural for typing and reading in the documentation. Additionally, since "<twig" is lowercase, "<twig:ux" seemed more consistent to me. As a result, we made it case-insensitive.

However, this is the only place where it works this way, as user-land component names are still case-sensitive.

Suggestions 🗳️

I’d like to gather feedback from the team and community on the following points:

Symfony UX Components

  • A0: Symfony UX component names (e.g., Map, Icon, and future ones) should be case-insensitive (in HTML syntax).
  • A1: Symfony UX components should adopt a consistent casing style in documentation, code blocks, and social media.
  • A2: Symfony UX components should use lowercase casing style in documentation, code blocks, and social media.

App/User-Land/Bundle Components

  • B0: Twig/Live Component names should be case-sensitive (as these names may be used in events, logs, etc.).
  • B1: [NEW] Twig/Live Component names should be unique in a case-insensitive form (preventing Acme:Foo and acMe:foo from being registered simultaneously).
  • B2: [NEW] We could (later) suggest the correct name when a user misspells it, or even automatically map it to the correct one.

.

I’m inclined to answer "yes" to all these points.

Let’s discuss them and hear from you if there are any concerns. :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions