Skip to content

feat: Add off mode to UI5_WATCH_MODE - #1565

Draft
RandomByte wants to merge 3 commits into
mainfrom
feat/ui5-watch-mode-off
Draft

feat: Add off mode to UI5_WATCH_MODE#1565
RandomByte wants to merge 3 commits into
mainfrom
feat/ui5-watch-mode-off

Conversation

@RandomByte

@RandomByte RandomByte commented Sep 2, 2026

Copy link
Copy Markdown
Member

This flag allows to disable file watching, e.g. in CI and other environments where sources do not change and the overhead (especially in polling mode) is unwanted.

JIRA: CPOUI5FOUNDATION-1355

In CI and other environments where sources do not change while the server
runs, file watching is pure overhead. The polling backend is the worst case:
it walks the source tree every 250 ms, and it becomes the default inside
containers, where CI commonly runs.

UI5_WATCH_MODE=off makes the fileWatcher facade's subscribe() return an inert
subscription: the callback is never invoked and unsubscribe() is a no-op, so no
backend is loaded and no filesystem is polled. All three watcher consumers
(WatchHandler, ProjectDefinitionWatcher, projectGraphSettleWatcher) go through
this facade, so none of them arms an OS handle or a poll loop. Source changes
no longer trigger rebuilds or live reload for the server's lifetime.

The backend decision memoizes a mode string ("native" | "polling" | "off")
instead of a boolean; shouldUsePolling() and the new isWatchingDisabled()
derive from it.
…atching

Add a Troubleshooting section pointing CI users at UI5_WATCH_MODE=off, next to
the existing polling/native guidance. Names the polling watcher's tree walk and
its container default as the overhead this avoids.
Keep the fileWatcher facade description in the skill reference in sync: note the
"off" mode, the inert subscription it returns, and that the memoized decision is
now a mode string behind shouldUsePolling()/isWatchingDisabled().
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