feat: Add off mode to UI5_WATCH_MODE - #1565
Draft
RandomByte wants to merge 3 commits into
Draft
Conversation
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().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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