Repository navigation
Conversation
The root middleware loaded the content (with four expansions), the site and the user for every request, including fetcher requests to resource routes that only call the Plone client. Each object browser navigation made five backend requests instead of two, and a path that doesn't exist failed with a 404 before the route's loader could handle it. Route entries take a new skipContent option. React Router middleware only gets the matched route pattern, not the matches or their handle, so the middleware builds the patterns of the flagged routes from the registry routes (and the app's own ok and reset-fetcher routes, now in app-routes.ts) and compares the request pattern with them. The cmsui resource routes, the contents action routes and layers.css opt out. The object browser loader runs search and breadcrumbs in parallel and gives an empty listing for a folder that doesn't exist. @breadcrumbs keeps returning the backend status.
This was referenced Oct 9, 2026
Member
Author
|
@pnicolli it caught this, totally unadverted in front of us... What do you think about the solution? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The root middleware (
fetchPloneContent) runs for every request, including fetcher requests to resource routes. For each one, it loads the content atparams['*']with four expansions, the site and the user, before the route's own loader runs:/layers.css, requested on every page load, made 3.Changes
skipContentroute option (@plone/types): a registry route entry withskipContent: truedoesn't get the content, site and user loaded. Children inherit it; a child can set it back tofalse.apps/aurora): React Router 8 middleware gets only the matchedpattern, not the matches or theirhandle, and the app runs onreact-router-serve(nogetLoadContext). So the middleware builds the patterns of the flagged routes fromconfig.routes, cached per array, and compares the request'spatternwith them. No route names are hardcoded.linkMiddlewareskips them too, since it reads the content.okandreset-fetchermove toapp/app-routes.ts, shared byroutes.tsand the middleware, and opt out.@plone/cmsui:@search,@breadcrumbs,@objectBrowserWidget,@queryStringOptions,@createContent.@plone/contents: the@@contentsaction routes (@@delete,@@upload,@@rename,@@workflow,@@tags,@@properties,@@order,@@paste).@plone/publicui:layers.css.@objectBrowserWidgetloader: runs search and breadcrumbs in parallel. For a folder that doesn't exist (a 4xx), it gives an empty listing instead of an error. 5xx errors are still thrown.@breadcrumbsloader: re-throws the backend status, so a missing path is still a 404, not a 500.skipContentis documented in the routes how-to (docs/how-to-guides/routes.md), with the updatedReactRouterRouteEntrytype.Backend requests per call
Measured by logging Plone client calls on a dev server:
@objectBrowserWidgetnavigation@search,@queryStringOptions,@breadcrumbs/layers.css,/reset-fetcher,/okBehavior to note
/ok: it no longer calls the backend, so as a health check it only reports that the frontend is up.@objectBrowserWidgetloader read breadcrumbs fromploneContentContext. That doesn't work once the route skips the content, so when the two meet,objectBrowserWidget.tsxshould keep this PR's version.Tests
middleware.server.test.tscovers pattern building, inheritance and override, thefetchPloneContentskip, andlinkMiddlewarewithout content. The two skip tests fail with the opt-out disabled.packages/cmsui/acceptance/tests/object-browser.test.tsnavigates into a folder in the object browser, and requests the folder the Image add form browses, which doesn't exist. The second test fails onmain(404).check:tsare clean. cmsui + contents acceptance: 72 passed, and the 2 failures passed on rerun (flaky, unrelated).Found, not fixed here
config.routesgrows by 8 entries on every request, becauseinstallServer()runs per request.@querystringSearchis never registered, so the Querystring widget's preview gets a 404.