Skip to content

feat: Add liveReload#1407

Draft
matz3 wants to merge 3 commits into
mainfrom
feat/liveReload
Draft

feat: Add liveReload#1407
matz3 wants to merge 3 commits into
mainfrom
feat/liveReload

Conversation

@matz3

@matz3 matz3 commented Jun 8, 2026

Copy link
Copy Markdown
Member

JIRA: CPOUI5FOUNDATION-1224

matz3 added 3 commits June 8, 2026 18:04
Adds optional live reload support to the server:
- New `serveLiveReloadClient` middleware serves the client at
  `/.ui5/liveReload/client.js`.
- The `serveResources` middleware injects the client script tag into
  HTML responses when `liveReload` is enabled.
- A WebSocket server attaches to the HTTP server and notifies connected
  clients when the BuildServer emits a `sourcesChanged` event.

The feature is opt-in via the new `liveReload` option to `serve()` and
defaults to `false`.

JIRA: CPOUI5FOUNDATION-1224
- Add new `server.settings.liveReload` boolean option to the project
  configuration schema, available with specVersion 5.0 and higher.
- BuildServer now emits a debounced `sourcesChanged` event (100ms
  debounce) whenever watched source files change, so a burst of changes
  results in a single notification.

JIRA: CPOUI5FOUNDATION-1224
- Add new `--live-reload` CLI flag (defaults to true) for the
  `ui5 serve` command. Pass `--no-live-reload` to disable it.
- The flag overrides the `server.settings.liveReload` setting in the
  project's `ui5.yaml`.
- When neither the CLI flag nor the configuration sets a value, live
  reload is enabled by default.

JIRA: CPOUI5FOUNDATION-1224
@matz3

matz3 commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

To be decided: Should clients try to reconnect to the server, e.g. in case it has been restarted? This is currently not implemented, but I think it should be added.

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