Skip to content

refactor(server): Rename middleware resource parameters - #1506

Open
RandomByte wants to merge 3 commits into
mainfrom
refactor/middleware-built-resource-access
Open

refactor(server): Rename middleware resource parameters#1506
RandomByte wants to merge 3 commits into
mainfrom
refactor/middleware-built-resource-access

Conversation

@RandomByte

Copy link
Copy Markdown
Member

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

@RandomByte
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
RandomByte force-pushed the refactor/middleware-built-resource-access branch from 5430a91 to 0d50b01 Compare August 7, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant