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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(components): shortcut to find unused components #358

Open
manniL opened this issue Aug 2, 2023 · 8 comments
Open

feat(components): shortcut to find unused components #358

manniL opened this issue Aug 2, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@manniL
Copy link
Member

manniL commented Aug 2, 2023

馃啋 Your use case

In bigger projects and after refactoring/new features, having an overview which of the hundred components are still in use is not always given. Thus, it'd be amazing to figure that out through the devtools and the component tab.

馃啎 The solution you'd like

In the component tab, having an option to list only unused components.
There might be caveats with dynamic imports or similar (not sure?) but eventually, that could be shown as warning.

馃攳 Alternatives you've considered

No response

鈩癸笍 Additional info

Happy to also work on the feature if people are interested in it

@manniL manniL added the enhancement New feature or request label Aug 2, 2023
@antfu antfu closed this as completed in 5012012 Aug 10, 2023
Dev1436 pushed a commit to Dev1436/devtools that referenced this issue Aug 12, 2023
Dev1436 pushed a commit to Dev1436/devtools that referenced this issue Aug 12, 2023
Dev1436 pushed a commit to Dev1436/devtools that referenced this issue Aug 12, 2023
Dev1436 pushed a commit to Dev1436/devtools that referenced this issue Aug 12, 2023
@metkm
Copy link

metkm commented Dec 23, 2023

Does this work at all? It shows hundreds of unused components for me but I'm pretty sure they are used. Maybe It only shows as used if I'm on the same page? @antfu

@manniL
Copy link
Member Author

manniL commented Dec 23, 2023

@metkm I think this worked for me in the past but recently it only shows components not used on the current page indeed.

@manniL
Copy link
Member Author

manniL commented Feb 8, 2024

We will need to add a button like "Scan components for all routes" to allow users to bring the behavior back manually.

@davidparys
Copy link

This sounds pretty useful !

@stefanobartoletti
Copy link

I was thinking about having this feature, and I see that there is already a proposal.

I can only add that the same thing could be done also for composables, under the same exact reasoning.

Thanks by the way!

@kogratte
Copy link

kogratte commented Apr 9, 2024

Sounds like an analyzer to run at buildtime.Will be interested too.

@sifferhans
Copy link
Contributor

This would be amazing to have fixed again! I am trying to clean up a large Nuxt codebase with lots of dead components, and having a list of all the unused components would help a bunch.

@fabis94
Copy link

fabis94 commented Apr 19, 2024

This would definitely be very useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants