-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactor: move all the routes one level deeper to enable layoutless routes #1009
Conversation
623c134
to
898a956
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked well on my tests. Just some nitpicks
const searchParams = useSearch({ from: `/_main${ISSUE_ROUTE}` }); | ||
const { issueId } = useParams({ from: `/_main${ISSUE_ROUTE}` }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: wouldn't it be more readable if we had another constant with the additional path? Like
PATHLESS_ISSUE_ROUTE = `/_main${ISSUE_ROUTE}`
but I'm not so sure about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other components, like BuildDetails and Hardware Details, the path is given as a string. If you will follow this way, it's should be a pattern in application. I don't think that this is necessary for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case I say we remove ISSUE_ROUTE
altogether and just write _main/issue/$issueId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the routes are type safe, no need for an ISSUE_ROUTE
constant, deleted it
@@ -0,0 +1,3 @@ | |||
import { createFileRoute } from '@tanstack/react-router'; | |||
|
|||
export const Route = createFileRoute('/_main/hardware/$hardwareId/boot')({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I don't think you need to pass an empty object here. See the route for /_main/tree/$treeId/test/$testId
you also did
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted it, it wasn't needed
@@ -0,0 +1,3 @@ | |||
import { createFileRoute } from '@tanstack/react-router'; | |||
|
|||
export const Route = createFileRoute('/_main/hardware/$hardwareId/build')({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto about empty object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto about deleting
@@ -0,0 +1,3 @@ | |||
import { createFileRoute } from '@tanstack/react-router'; | |||
|
|||
export const Route = createFileRoute('/_main/hardware/$hardwareId/test')({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto about empty object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto about deleting
1749230
to
c7e5cb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
c7e5cb5
to
f4c174c
Compare
layout right now the layout is in the root of the app, so a solution to create routes without the layout is to move all routes one level deeper Closes #1010
f4c174c
to
0473c44
Compare
Description
right now the layout is in the root of the app, so a solution to create
routes without the layout is to move all routes one level deeper
How to test
See if the app is working as usual, try to create a new route without layout in the app and test it
Closes #1010