Skip to content
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

getDuplicateRoutes: Ignore redirects and other unnamed routes #7564

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Feb 3, 2023

Routes without names, like redirects and the notfound route should not be considered duplicate routes

This PR solves https://community.redwoodjs.com/t/redirect-from-splash-screen/4552. #7556 also solves that issue, but in another way. @Josh-Walker-GM, you wrote the duplicate route detection. What do you think?


When we've agreed on what solution to go for here I was thinking I'd add duplicate redirects detection too (two redirects from the same path) and duplicate notfound pages.

Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah apologies for not considering this at the time, the example routes I used to create this didn't consider these cases.

I was thinking I'd add duplicate redirects detection too (two redirects from the same path) and duplicate notfound pages

Don't see why we wouldn't want this 👍

@Tobbe Tobbe force-pushed the tobbe-duplicate-routes-redirect branch from e688e7a to 3eb2f4e Compare February 3, 2023 23:27
@jtoar
Copy link
Contributor

jtoar commented Feb 4, 2023

I didn't review the code but I'd prefer this solution as well, I wouldn't want to have to make users name the notfound route, etc

Copy link
Contributor

dac09 commented Feb 6, 2023

Let’s go with this Tobbe! Only consideration is, can you/should you be able to navigate to the not found page programmatically?

Routes,notFound() (I.e. the name that you set) - this does not currently work, and we have no way of navigating to a 404 page (unless we do navigate('/bazingaKittensNonExistentRoute'))

@jtoar jtoar added this to the next-release-patch milestone Feb 9, 2023
@jtoar jtoar enabled auto-merge (squash) February 9, 2023 04:12
@jtoar jtoar merged commit 2813199 into redwoodjs:main Feb 9, 2023
@jtoar jtoar modified the milestones: next-release-patch, v4.1.2 Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants