Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Auto Completion for Livewire Components of a Module #1094

Open
lairg99 opened this issue Nov 3, 2024 · 2 comments
Open

Comments

@lairg99
Copy link

lairg99 commented Nov 3, 2024

Feature Description

Our application is organized into multiple modules, with each module registering its own Livewire components. These components are primarily registered via the Livewire facade using Livewire::component. For example, a module named Document registers a component like document.drafts.create. Given the large number of components, we implemented an auto-discovery mechanism to register all Livewire components within a specified directory or namespace, which avoids redundant code and ensures consistent naming.

Livewire::namespace(
    directory: __DIR__ . '/Livewire',
    namespace: 'Modules\\Document\\Livewire\\',
    prefix: 'document'
);

It would be amazing if we get auto completion for these components. Additionally, it would be helpful if we could click on the Livewire tags in the template to navigate directly to their definitions.

@adelf
Copy link
Member

adelf commented Nov 12, 2024

Livewire::namespace is not a standard method?

I found a package that does the same - https://github.com/joserick/laravel-livewire-discover.

Honestly, I want to implement something useful for all users... So, there is no standard solution for namespaces yet?

@lairg99
Copy link
Author

lairg99 commented Nov 12, 2024

Yep, it's not a standard method. However, the package does more or less the same thing. I absolutely agree with you that a solution is needed for all users, of course.

Maybe it is possible to build the auto-completion dynamically and depending on the components registered in the Livewire ComponentRegistry?

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

No branches or pull requests

2 participants