Replies: 2 comments 2 replies
-
I personally would prefer option 1 too. In my projects, I haven't used full page Livewire components yet. If I would use them, I think it would confuse me if those would be classified as Controllers, eventhough they act as Controllers. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Added PR #201 for this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I made a Livewire Component Classifier that I am planning to submit as a PR. Before I finalize it I want some feedback.
For those who don't know Livewire has two different types of components. A full page component where a route points directly to the component class and a inline component which is referenced from within the blade file for an existing view or component.
In my testing it seems a full page component is picked up as a Controller by Laravel Stats by defualt, because it is pointed to directly by a route. But in-line components are ignored. I wrote a classifier to just looks for a class that extends
Livewire\Component
which will pickup in line components, but full page components are already classified as a controller.So I have 3 options:
Submit the PR as-is. Full page Livewire components will stay classified as a Controller (as they are today without a custom classifier) and my new classifier will classify any Inline Components only as a "Livewire Component".
Prioritize my classifier over the Controller classifier so that both full page and inline components are classified as one type "Livewire Component" and the controller classifier won't consider a full page Livewire component as a controller.
Make two different Livewire classifiers, one for full page and one for inline components (I would have to priorotize the full page component classifier over the controller classifier so that it will pickup those components before the controller classifier does.
Any of these options seems 'valid' to me, but I am leaning toward 1 since that maintains the status quo for defining a controller. But I can see an argument that a full page component shouldn't be consider a "controller". So I am curious to hear what anyone else thinks before committing to one way over the others.
Beta Was this translation helpful? Give feedback.
All reactions