-
-
Notifications
You must be signed in to change notification settings - Fork 323
Add @tanstack/react-router plugin
#856
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
Conversation
commit: |
|
Thanks for the PR, @nickrttn!
I see what you're doing here, why it's needed, and I find it nice you gave it a shot and impressive you pulled it off. Now to me, the question is whether the complexity of this plugin warrants users not having to also configure Knip, like so: {
"production": ["src/path/to/routeTree.gen.ts"], // either one
"tanstack-router": {
"production": ["src/path/to/routeTree.gen.ts"], // of these is fine
}
}How often So far, I think none of the plugins use or need |
|
@webpro just wanted to let you know that this hasn't dropped off my radar, will get back to this as soon as I can! |
|
That's great, no rush. |
e8120d3 to
93c724a
Compare
|
@nickrttn I've been working on support for a new |
|
Closing this in favor of #1005. |
|
@nickrttn Is there any chance you could explain why you submitted the plugin? It seems like the generated routes tree file (e.g. |
|
cc @brandongit2 and @codepunkt |
|
@webpro it's been a while, but if I recall correctly the project I worked on at the time had a reason for git-ignoring the |
|
My apologies for letting this die a silent death btw, my priorities changed and some real life stuff happened around the same time. Was hectic for a bit. |
That could definitely be it! Then I 100% understand. Also, it's not uncommon for build artifacts to be on disk before knip can run successfully (another example is https://knip.dev/features/source-mapping). I'll give it another thought, but it's a good argument you got there to keep it. But I'm still leaning towards removing it, although it's not ideal for end-users and probably requires some warnings/docs.
No worries! Thanks for helping out. It has been super useful to create the |
This adds support for the file-based routing Vite/RsPack/RsBuild/Webpack plugin of
@tanstack/react-router. The only reliable way I saw to parse the config files of those tools to generate the correct entries was through building an AST using TS.I saw you've got some helpers for TS AST's in the codebase. Let me know if I can/need to use any of those.