As the project grows, it becomes messier…
The best would be to keep things clean, but alas, not always possible.
I’m thinking to write a script to find unused server actions and delete them.
But I’d like some input please!
What should I write the script in? (Thinking python, never worked with it tho)
We can detect unused server actions if:
A: They’re not included in any page (As server connect)
B: They’re not included as any library action
C: They’re not marked as a server action that is meant to be ran directly (we have a bunch of dev tools like that that we just run in the browser)
-Maybe, an exclude list per target, dev, stag and prod., . Because some server actions works in test enviroment only, they are not upload in prod.
-Some server actions are used only as server side data in Frontend, so, not necessary are included as server connect in Frontend.
Great idea! Look forward to it. One thing I would request is that it produce a list that the server connects can be (de)selected from prior to deleting. I have a few about that I use for testing various things that aren’t connected to anything else so wouldn’t want those to auto delete!