Routing feedback #7176
Feuerhamster
started this conversation in
General
Replies: 1 comment
-
I have no problem with files names or “+”. |
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
-
When the new Routing was announced, they said they want to collect feedback about the change, so I want to post my feedback here.
I've read a lot of the issues and discussions regarding the new routing.
Here is my personal opinion about it:
I like the directory based routing!
It makes a lot more sense and helps keep files organized.
I don't like the
+
.I understand why it is that way, but I want to say a few things about some arguments.
/routes
directory. But isn't that bad practice? Isn't it like the/routes
directory should only contain route files and components should go to a different directory?My suggestion:
Here is a solution that would also work, provide a better experience for developers using sveltekit, and make more sense and understanding. I have already read this solution from some other users in the discussions and issues, and I am 100% for it.
Instead of the
+
, just prefix it with the route files with the name of the route/directory.So
routes/contacts/+page.svelte
becomesroutes/contacts/contacts.page.svelte
This would also solve the editor tab file name problem.
Compromise suggestion:
Just do both / let the user decide what they want to use.
Somewhere it was said that with the new routing, the option to override the default route matching was removed to make the developer experience more consistent. I definitely understand that, and I also understand, that they don't want to make breaking changes again.
So what about keeping the
+
thing as a default, but if the developer wants it, they can enable in the config what I suggested above?Beta Was this translation helpful? Give feedback.
All reactions