symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
847 stars 312 forks source link

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

Open smnandre opened 2 months ago

smnandre commented 2 months ago

TL;DR; ⏲️

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

App/User-Land/Bundle Components

.

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

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

smnandre commented 2 months ago

cc @Kocal @kbond @WebMamba :)

Kocal commented 2 months ago

Hey Simon, thanks for opening the discussion! 🙏🏻

Symfony UX Components

Personally I prefer the form <twig:UX:Map> over <twig:ux:map>, I find it more visually distinctive between native HTML tags. I may be biased by Vue.js style guide for components naming, but I've always preferred to use PascalCase over kebab-case for components usage. For React, I didn't find anything but the AirBnb's styleguide for React, and they use PascalCase aswell.

For me:

App/User-Land/Bundle Components

Thanks!