| Entrypoint | Role | Runtime Notes |
|---|---|---|
loader/autodarts-xconfig.user.js |
Userscript entry at document-start |
Loads the bundled runtime into the page. |
src/runtime/bootstrap-runtime.js |
Tampermonkey startup coordinator | Loads persisted config, creates the feature registry, starts the runtime, and mounts the xConfig shell. |
src/core/bootstrap.js |
Runtime composition root | Creates the event bus, listener registry, observer registry, DOM guards, game-state store, and feature mount lifecycle. |
src/features/feature-registry.js |
Feature catalog | Wraps all feature mount functions and exposes runtime metadata used by the shell and bootstrap. |
src/features/xconfig-ui/index.js |
xConfig shell bootstrap | Injects the menu entry and panel host, patches history, observes the app root, and reacts to runtime start/stop/config events. |
| Entrypoint | Role | Runtime Notes |
|---|---|---|
src/core/game-state-store.js |
WebSocket-derived state store | Intercepts MessageEvent.prototype.data for match websocket messages, derives the current match snapshot, and notifies feature subscribers. |
src/core/event-bus.js |
Internal runtime event fan-out | Used for runtime lifecycle events and shell synchronization. Feature updates now use direct gameState.subscribe() instead of duplicating game-state:updated event-bus subscriptions. |
The runtime keeps the current per-feature observer model. Each mounted feature owns at most one registry-managed observer key and disconnects it on cleanup.
| Feature | Observer Scope | Trigger Source |
|---|---|---|
checkout-score-pulse |
root subtree, childList, characterData, class attributes |
score and suggestion DOM changes |
checkout-board-targets |
root subtree, childList, characterData |
suggestion text and board replacement |
tv-board-zoom |
root subtree, childList, characterData, class/style |
board DOM changes and zoom-target layout changes |
style-checkout-suggestions |
root subtree, childList, characterData |
suggestion text and replacement |
average-trend-arrow |
root subtree, childList, characterData |
average text changes |
turn-start-sweep |
root subtree, childList, class attributes |
active-player row changes |
triple-double-bull-hits |
root subtree, childList, characterData |
throw row text changes |
cricket-highlighter |
root subtree, childList, characterData |
cricket grid text and board replacement |
cricket-grid-fx |
root subtree, childList, characterData |
cricket grid text and row replacement |
dart-marker-emphasis |
root subtree, childList |
marker insertion/removal |
dart-marker-darts |
root subtree, childList, geometry attributes |
marker insertion and board geometry changes |
remove-darts-notification |
root subtree, childList, characterData |
remove-darts notice appearance and fallback text |
single-bull-sound |
root subtree, childList, characterData |
throw text changes |
turn-points-count |
root subtree, childList, characterData |
turn-points text changes |
winner-fireworks |
root subtree, childList, class/style |
winner banner visibility changes |
theme-* via mount-theme-feature |
root subtree, childList, characterData |
theme target layout/content changes |
xconfig-ui |
app root subtree, childList |
navigation/content tree changes outside shell-managed DOM |
Each mounted feature that reacts to match progress subscribes directly to gameState.subscribe() and returns a cleanup function that unsubscribes during feature teardown.
Features with direct game-state subscriptions:
checkout-score-pulsecheckout-board-targetstv-board-zoomstyle-checkout-suggestionsaverage-trend-arrowturn-start-sweeptriple-double-bull-hitscricket-highlightercricket-grid-fxdart-marker-emphasisdart-marker-dartsremove-darts-notificationsingle-bull-soundturn-points-countwinner-fireworkstheme-*viamount-theme-feature
Registry-managed listeners are concentrated in the shell, themes, and layout-sensitive features:
tv-board-zoom:resize,orientationchange,pointerdown(Klick auf Wurfanzeigenleiste für Korrektur-Auszoom),visibilitychange,beforeunloadwinner-fireworks:resize,visibilitychange,pointerdowncricket-highlighter:resize,orientationchange,visibilitychangecricket-grid-fx:resize,orientationchange,visibilitychangedart-marker-darts:resize,visibilitychangedart-marker-emphasis:visibilitychangesingle-bull-sound:pointerdown,keydown,visibilitychangeturn-points-count:visibilitychangetriple-double-bull-hits:visibilitychangetheme-*:resize,scrollxconfig-ui:popstate, delegatedclick, delegatedchange, delegatedkeydown
shared/raf-scheduler.jsis the standard feature-side scheduler used to coalesce repeated DOM and game-state triggers into one RAF callback.turn-points-countanimates scoreboard text and tracks per-node RAF/anime handles.average-trend-arrow,turn-start-sweep,dart-marker-darts,cricket-grid-fx, andwinner-fireworksuse timeout-based cleanup for transient UI state.winner-fireworksalso uses an interval while the effect is active.single-bull-soundandtriple-double-bull-hitssupport optional polling intervals and now skip hidden-tab polling work.
src/core/bootstrap.jsunmounts every mounted feature before callingobservers.disconnectAll(),listeners.removeAll(), andgameState.stop().- Every feature cleanup remains idempotent and is responsible for removing its own DOM artifacts, timers, and registry-managed observer/listener keys.
src/features/xconfig-ui/index.jsis outside the feature registry but exposes its ownmount,teardown, anddisposelifecycle and cleans up its observer/listeners separately.