Skip to content

Conversation

@weaverryan
Copy link
Member

Right now, the UX controller names have the form symfony/ux-typed/typed (well, technically symfony--ux-typed--typed, but stimulus_controller() normalizes for you).

Anyways, most UX components only ship with 1 controller... and symfony/ux-typed/typed seems unnecessarily long. This PR allows for a package to define a controller called default in its package.json - e.g. right here: https://github.com/symfony/ux/blob/09c9effcc2582d4de0907c9e12c35afa313433ae/src/Typed/Resources/assets/package.json#L8

When this happens, the final package name would be just the package name: symfony/ux-typed

Cheers!

tgalopin added a commit that referenced this pull request May 31, 2022
…age or the user (weaverryan)

This PR was merged into the main branch.

Discussion
----------

Allowing the controller name to be overridden by the package or the user

This is needed for live components, where the controller name needs to be simply `live`... else it will be super annoying to use :).

Allowing the user to also override the controller name... isn't really needed... but if the user does this, I think they know they are on their own.

This COULD actually replace #69... as a package could add, for example, `name: 'symfony/ux-typed'` to change the name to a shorter version.

Commits
-------

d8f6d5b Allowing the controller name to be overridden by the package or the user
@weaverryan weaverryan closed this May 31, 2022
@weaverryan weaverryan deleted the default-import branch May 31, 2022 16:43
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.

1 participant