sadpandajoe commented on code in PR #45522:
URL: https://github.com/apache/superset/pull/45522#discussion_r4338925605
##########
superset-frontend/src/views/routes.tsx:
##########
@@ -315,6 +321,27 @@ if (authRegistrationEnabled) {
routes.push({ path: RoutePaths.REGISTRATIONS, Component: UserRegistrations
});
}
+if (isFeatureEnabled(FeatureFlag.EnableExtensions)) {
+ // Pushed last, and deliberately a catch-all rather than one route per
+ // page. `<Switch>` takes the first match in array order, so every route
+ // the host ships wins over this one -- the same precedence Werkzeug gives
+ // the server's static rules over an extension's, arrived at a different
+ // way. An extension therefore cannot shadow a host screen here either,
+ // whatever path it declared.
+ //
+ // The route table is built once at module evaluation, while extensions
+ // load afterwards, so enumerating pages here is not possible; `/:path+`
+ // defers the question to `ExtensionPage`, which resolves it against the
+ // registry once extensions have settled.
+ //
+ // `+` requires at least one segment, which keeps `/` free for the
+ // `<Redirect to="/welcome/">` that follows the generated routes.
+ routes.push({
+ path: '/:extensionPagePath+',
Review Comment:
A page declared beneath a host screen's path, e.g. `/welcome/review`, is
accepted at boot (the server's `/welcome/` rule doesn't serve descendants) but
never renders: `App.tsx` mounts routes without `exact`, so the host's
`/welcome/` route matches the prefix first and this catch-all is never reached.
The page shows as registered and its menu entry opens Home. Should the boot
check also refuse paths nested under a host client route, or should contributed
pages be matched ahead of prefix routes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]