refactor(server): Rename middleware resource parameters - #1506
Open
RandomByte wants to merge 3 commits into
Open
refactor(server): Rename middleware resource parameters#1506RandomByte wants to merge 3 commits into
RandomByte wants to merge 3 commits into
Conversation
RandomByte
marked this pull request as ready for review
August 7, 2026 08:29
Rename the reader bundles passed to middleware so their names match what they hold: the raw source readers become `resources` (restoring the v4 behavior, and the build output readers become `builtResources`. Standard middleware receive both bundles. serveResources and serveIndex keep serving the build output via `builtResources`; discovery and versionInfo read the raw sources via `resources`. Custom middleware receive `builtResources` only when they define Specification Version 5.0 or higher. JIRA: CPOUI5FOUNDATION-1306
serveResources is mounted at "/" and matches a request for /resources/sap-ui-version.json. Since it can't find that resource in the built output, it triggers a build of all dependencies in the hope of producing it before falling through. Placing versionInfo ahead of serveResources lets it serve the path directly and terminate the request, avoiding that unnecessary build. versionInfo stays after serveBuildError so error diversion still preempts it. It only reads resources.dependencies, so it does not depend on serveResources having run. As a side effect, the served sap-ui-version.json now carries manifestHints. versionInfo generates each library manifest on the fly from the source .library via generateLibraryManifest, and its sap.ui5/dependencies/libs becomes manifestHints. When serveResources ran first, its build populated the project reader with a built manifest.json; manifestCreator skips generation when a manifest already exists (returns null), so generateLibraryManifest returned undefined and no hints were emitted. The built manifest carries the same dependencies; it was never read, it only suppressed the middleware's own generation. Tests updated accordingly.
RandomByte
force-pushed
the
refactor/middleware-built-resource-access
branch
from
August 7, 2026 08:36
5430a91 to
0d50b01
Compare
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.
Rename the reader bundles passed to middleware so their names match what
they hold: the raw source readers become
resources(restoring the v4behavior, and the build output readers become
builtResources.Standard middleware receive both bundles. serveResources and serveIndex keep
serving the build output via
builtResources; discovery and versionInfo readthe raw sources via
resources. Custom middleware receivebuiltResourcesonly when they define Specification Version 5.0 or higher.
JIRA: CPOUI5FOUNDATION-1306