Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/documentation/docs/pages/Server.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ Please be aware of the following risks when using the server:

## Standard Middleware

::: info Removed Middleware
The `serveThemes` middleware has been removed in UI5 CLI v5. Theme compilation is now handled by the `buildThemes` build task during the incremental build, which pre-compiles all theme CSS files. The resulting CSS files (including `library.css`, `library-RTL.css`, `library-parameters.json`, and CSS Variables resources) are served via the `serveResources` middleware, providing the same functionality with better performance through build-time compilation and caching.

Custom middleware previously referencing `serveThemes` via `beforeMiddleware` or `afterMiddleware` will continue to work with automatic remapping and a deprecation warning. See the [v5 migration guide](../updates/migrate-v5.md) for details.
:::

All available standard middleware are listed below in the order of their execution.

A project can also add custom middleware to the server by using the [Custom Server Middleware Extensibility](./extensibility/CustomServerMiddleware.md).
Expand All @@ -37,7 +43,6 @@ A project can also add custom middleware to the server by using the [Custom Serv
| `discovery` | See chapter [discovery](#discovery) |
| `serveResources` | See chapter [serveResources](#serveresources) |
| `testRunner` | See chapter [testRunner](#testrunner) |
| `serveThemes` | See chapter [serveThemes](#servethemes) |
| `versionInfo` | See chapter [versionInfo](#versioninfo) |
| `nonReadRequests` | See chapter [nonReadRequests](#nonreadrequests) |
| `serveIndex` | See chapter [serveIndex](#serveindex) |
Expand Down Expand Up @@ -73,11 +78,6 @@ The following file content transformations are executed:
### testRunner
Serves a static version of the UI5 QUnit TestRunner at `/test-resources/sap/ui/qunit/testrunner.html`.

### serveThemes
Compiles CSS files for themes on-the-fly from the source `*.less` files.

Changes made to these `*.less` files while the server is running will automatically lead to the re-compilation of the relevant CSS files when requested again.

### versionInfo
Generates and serves the version info file `/resources/sap-ui-version.json`, which is required for several framework functionalities.

Expand Down
21 changes: 21 additions & 0 deletions internal/documentation/docs/updates/migrate-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,27 @@ Delete the custom `test/Test.qunit.html` file from your test directory. This fil
Depending on your project setup, you might need to update additional paths in configuration files or test runners to reflect the new structure.
The test suite is now served under the standard `/test-resources/` path with the component's full namespace (e.g. `/test-resources/sap/ui/demo/todo/testsuite.qunit.html`).

## Removal of Standard Server Middleware

The following middleware has been removed from the [standard middlewares list](../pages/Server.md#standard-middleware):

* `serveThemes` — Theme compilation (LESS to CSS) is now handled by the `buildThemes` build task during the incremental build, rather than on-demand during runtime. The resulting CSS files are served via the `serveResources` middleware. This change improves performance through build-time compilation and caching while maintaining the same functionality.

**Backward Compatibility:**
If your project or any custom middleware references a removed middleware via `beforeMiddleware` or `afterMiddleware`, UI5 CLI will automatically remap the reference to the nearest remaining middleware and log a deprecation warning. Your custom middleware will still be executed in the expected order.

**What Changed:**
- Theme CSS files (`library.css`, `library-RTL.css`, etc.) are now **pre-built** during the incremental build
- Files are served via `serveResources` instead of being compiled on-demand
- The same CSS files are available at the same URLs as before

**Recommended Action:**
Update your `ui5.yaml` configuration to reference an existing middleware instead.

| Removed Middleware | Replacement Behavior | Recommended `afterMiddleware` |
| ------------------ | -------------------- | ----------------------------- |
| `serveThemes` | CSS files pre-built by `buildThemes` task and served via `serveResources` | `testRunner` |

## Learn More

- [Project: Type `component`](../pages/Project#component)
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/test/lib/cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function getDefaultArgv() {

function getDefaultBuilderArgs() {
return {
cacheDir: path.join("/root/path", ".ui5-cache"),
destPath: "./dist",
cleanDest: false,
dependencyIncludes: {
Expand Down Expand Up @@ -64,7 +65,8 @@ test.beforeEach(async (t) => {
t.context.getBuilderSettings = sinon.stub().returns(undefined);
const fakeGraph = {
getRoot: sinon.stub().returns({
getBuilderSettings: t.context.getBuilderSettings
getBuilderSettings: t.context.getBuilderSettings,
getRootPath: sinon.stub().returns("/root/path")
}),
build: t.context.builder
};
Expand Down
Loading