Skip to content

feat: Add liveReload#1407

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

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

Live reload automatically refreshes the browser whenever you change a source file in your project — no manual reload needed. This shortens the edit/test cycle during development.

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.

@matz3 matz3 force-pushed the feat/liveReload branch from 8f5a612 to 2cd5e90 Compare June 9, 2026 09:41
@matz3

matz3 commented Jun 9, 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.

This has now been implemented.

@matz3 matz3 force-pushed the feat/liveReload branch 3 times, most recently from ff657e6 to 409ab00 Compare June 9, 2026 11:49
@matz3 matz3 marked this pull request as ready for review June 9, 2026 11:58
@matz3 matz3 requested a review from a team June 9, 2026 11:58

@d3xter666 d3xter666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

with small comments

Comment thread packages/cli/lib/cli/commands/serve.js
Comment thread packages/server/lib/liveReload/client.js Outdated
@d3xter666 d3xter666 requested a review from a team June 9, 2026 12:56
@matz3 matz3 force-pushed the feat/liveReload branch from 409ab00 to 7fd70bc Compare June 9, 2026 13:48
@matz3 matz3 requested a review from d3xter666 June 9, 2026 13:48
Comment thread internal/documentation/docs/pages/Server.md Outdated
Comment thread internal/documentation/docs/pages/Server.md Outdated
Comment thread internal/documentation/docs/updates/migrate-v5.md Outdated
Comment thread packages/server/lib/liveReload/client.js Outdated
Comment thread packages/server/lib/liveReload/client.js
Comment thread packages/server/lib/liveReload/server.js
Comment thread packages/server/lib/middleware/MiddlewareManager.js Outdated
@matz3 matz3 force-pushed the feat/liveReload branch from 7fd70bc to 77e4a42 Compare June 9, 2026 14:55
@matz3 matz3 requested a review from RandomByte June 9, 2026 14:56
Comment thread packages/server/lib/liveReload/client.js
Comment thread packages/project/lib/build/BuildServer.js
Comment thread internal/documentation/docs/pages/Server.md Outdated

@d3xter666 d3xter666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread internal/documentation/docs/pages/Server.md Outdated
@matz3 matz3 force-pushed the feat/liveReload branch from 0dd31d6 to 1b01cea Compare June 15, 2026 07:32
@matz3 matz3 requested review from KlattG and flovogt June 15, 2026 07:33
KlattG
KlattG previously approved these changes Jun 15, 2026
@matz3 matz3 force-pushed the feat/liveReload branch 2 times, most recently from 59235c4 to 4ae71d9 Compare June 15, 2026 14:53
Comment thread internal/documentation/docs/pages/Server.md Outdated
Comment thread internal/documentation/docs/pages/Server.md Outdated
Comment thread internal/documentation/docs/pages/Server.md Outdated
Comment thread internal/documentation/docs/pages/Server.md Outdated
matz3 added 3 commits June 16, 2026 09:54
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 force-pushed the feat/liveReload branch from e263f0f to 9eece4f Compare June 16, 2026 08:01
@matz3 matz3 requested a review from flovogt June 16, 2026 08:01
@flovogt

flovogt commented Jun 16, 2026

Copy link
Copy Markdown
Member

PM Review: LGTM

@flovogt flovogt dismissed their stale review June 16, 2026 08:33

Outdated

@matz3 matz3 requested a review from a team June 16, 2026 18:39
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.

5 participants