-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Prefix all route IDs with /
#7332
Comments
On way to ease this for users would be to detect that |
I'm in favor of this change. The path portion of URLs always including the leading I suppose I'm ambivalent about the dev time warning, because for each person it sounds like that will either be (a) something they never look at, or (b) something that irritates them when it's printed every time, even after they've made the appropriate changes. |
It seems |
Describe the problem
I don't recall if there was a reason we decided that the
routeId
forsrc/routes/foo/+page.svelte
should befoo
instead of/foo
, but I think it was a mistake. On a number of occasions I've found myself doing things likeif (routeId)
and getting caught out because it can sometimes be the empty string.Since we expose
routeId
viaevent
, app developers will inevitably run into the same issue.Describe the proposed solution
It would be safer, and arguably more intuitive, if route IDs were always prefixed with
/
.Alternatives considered
The problem of course is that this would be a breaking change, and we can't detect people doing
routeId === 'foo'
. For the people currently usingrouteId
this would be annoying.The question is whether causing breaking change for that population is more costly than reaching 1.0 with a known design flaw.
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: