Warning / Linting about routeLoader left behind #17
Replies: 3 comments
-
Good idea but I wonder how to find uses. Perhaps after the build just scan for the qrl symbol and check that it's being called (ignoring where it's defined) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the proposal @czuma ! We've reviewed this proposal and came to the following conclusion: Figuring out if a loader is actually being used can be a very hard problem because it cannot be guaranteed only by static analysis. But, maybe writing a lint rule that simply checks if a specific symbol ( We don't have the resources to create / maintain it, so we thought it would be valuable to implement as a community plugin for the linter. If you or anyone else wants to take this on, this could be very helpful. So I'm moving it to "External Library Ideas". Thanks again! 🙏 |
Beta Was this translation helpful? Give feedback.
-
This could be part of a report on the API that should get autogenerated and
committed.
It could list all server$, action$ calls with their scope and parameters
and all middleware/onXyz/route loaders
Then when refactoring to remove a route loader you should expect that file
to change.
Wout.
…On Sat, 21 Dec 2024, 00:28 Shai Reznik, ***@***.***> wrote:
Thanks for the proposal @czuma <https://github.com/czuma> !
We've reviewed this proposal and came to the following conclusion:
Figuring out if a loader is actually being used can be a very hard problem
because it cannot be guaranteed only by static analysis.
So adding this warning as an error / warning in the compilation is
impossible.
But, maybe writing a lint rule that simply checks if a specific symbol (
useDangForget) is not being used anywhere and can warn about it might be
valuable.
We don't have the resources to create / maintain it, so we thought it
would be valuable to implement as a community plugin for the linter.
If you or anyone else wants to take this on, this could be very helpful.
So I'm moving it to "External Library Ideas".
Thanks again! 🙏
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANNFSBJOWFN4BFQSCMHUT2GSDWTAVCNFSM6AAAAABNZTOCN2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRTGM3TOMY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
What is it about?
No response
What's the motivation for this proposal?
Problems you are trying to solve:
Goals you are trying to achieve:
Any other context or information you want to share:
Proposed Solution / Feature
What do you propose?
on dev/build/preview generate an error or a warning if you have routeLoaders not being used in any part of your code
Code examples
put this inside a random index.tsx or layout and have fun trying to locate them
you don't even need to call it anywhere.
Links / References
No response
Beta Was this translation helpful? Give feedback.
All reactions