Repository navigation
perf: defer charts.js/console.js; fix console leak after boost - #123
Merged
Merged
Conversation
…ak after boosted navigation Inline chart init waits for DCL on a full load (dockifyReady in app.js). The console cleanup is registered when a console opens (it was pushed once at script load and lost after the first swap), and setStatus ignores a status element that is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
charts.jsandconsole.jsload withdefer. InlineinitLiveCharts(...)on app/server detail is wrapped indockifyReady(fn)(app.js): waits for DOMContentLoaded on a full load, runs at once after an htmx swap.dockifyCleanupsonce at script load, so after the first boosted swap an open console's WebSocket stayed open when navigating away (main: 1 open console socket after leaving the page; this branch: 0). It is now registered when a console opens.setStatusignores a status element that was swapped out (pageerrorCannot set properties of nullon main when leaving with an open console).dockifyReadyrule.Evidence (mock, port 18090, auth on):
ui.mjsPASS. DCL median (UI_RUNS=15, two alternating runs each) dashboard/servers/apps/app-detail: main 191/178/186/202 ms, branch 193/179/192/205 ms, i.e. unchanged within noise. Expected: deferred scripts still run before DCL, and htmx/app.js stay blocking, so defer only removes ~5 KB from the parser-blocking path./apps/{id}full load and boosted from/apps: 8 chart elements, live badge online, Console opens (xterm, Connected), no pageerror; after navigating away 0 open console sockets, cleanup list empty.go build ./... && go vet ./... && go test ./...OK.🤖 Generated with Claude Code