-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ref(routes): Simplify routing tree using custom route builder #66747
ref(routes): Simplify routing tree using custom route builder #66747
Conversation
7ac115c
to
0e0d3b5
Compare
fcab9d3
to
6eabc82
Compare
static/app/routes.tsx
Outdated
/> | ||
</Route> | ||
</Fragment> | ||
<Route path="/release-thresholds/" withLegacyPath> |
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 this case the NoOp
component is not required and will be added as needed.
6eabc82
to
e6b1208
Compare
e6b1208
to
1e2b685
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.
🤸🏻
// When adding new top-level organization routes, be sure the top level | ||
// route includes withOrgPath to support installs that are not using | ||
// customer domains. |
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.
If this is really important (which it is) might be worth making a component called TopLevelRoute
and another called Route
so this error is harder to make
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.
that's not a bad idea 👍
static/app/routes.tsx
Outdated
// traversing the component tree, that is why this logic lives here and not | ||
// inside a custom Route component. | ||
// | ||
// To udnerstand deepr how thsi works, see [0]. |
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.
// To udnerstand deepr how thsi works, see [0]. | |
// To understand deeper how this works, see [0]. |
This helps reduce the current complexity of reading the route tree. We have many route sub-trees that have conditional checks to be
1e2b685
to
816c56d
Compare
This helps reduce the current complexity of reading the route tree by introducing some logic which builds the two org and orgless routes from a single route.
This only changes the simplest cases. There are a number of more complicated routes that can also be simplified that I will do in a follow up.