Repository navigation
perf(editor): move optional modules off the startup payload - #291
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying document with
|
| Latest commit: |
7c5e489
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d9d20115.document-7hm.pages.dev |
| Branch Preview URL: | https://perf-editor-startup-payload.document-7hm.pages.dev |
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.
Summary
The editor's static startup graph (the entry chunk plus its modulepreload links) shrinks from 1102 KB to 866 KB raw, and from 350 KB to 281 KB gzip, about 20% less. Two optional modules moved behind the point where they are first used:
get_document_text:lib/web-mcp.tsimportedlib/agent-plugin/tools.tsat the top of the file, which pulled in the whole agent tool layer andmarkedon every editor load. The tool is now imported inside its handler and still shares the panel's implementation. Saves 107 KB raw.index.tsimported@khmyznikov/pwa-installup front, but only mounted it from a 1 s timer. It is now imported inside that timer. Saves 129 KB raw.Both chunks remain in the offline precache:
bin/offline-assets.mjsfollows dynamic imports from entries, and I checked thatAPP_ASSETS_TO_CACHEliststools-*.jsandpwa-install.es-*.js.Also adds
pnpm run clean:e2e, which removes thedist-e2e-*/test-results-*/playwright-report-*directories thatE2E_PORTruns leave behind. Nothing removed them before.Commits
perf(webmcp): dynamic import of the tool layerperf(editor): dynamic import of pwa-installtest(e2e):editor-startup-payload.spec.tschore(e2e):clean:e2escriptdocs(perf): exploration record, CHANGELOG, CLAUDE.md (WebMCP rule 5 corrected, spec count and table)Tests and reverse validation
test/e2e/editor-startup-payload.spec.tsfetches every module script and modulepreload URL from the servededitor.htmland checks that none contains a probe string unique to a deferred module. A second case checks that<pwa-install>is still defined and mounted.index.tsreverted, it fails on the PWA probe.Run locally:
editor-startup-payload+webmcp+app-smokeE2E: 12 passedpnpm run lint:ts: passedformat:check: passedweb-mcp,workflow-contract,offline-assets-build,hosting-contract: 105 passedI did not run the full E2E suite or the Pages/Docker configs locally; CI covers them. An independent subagent review found no blocking issues, and its three minor notes are addressed.
Details:
docs/explorations/2026-10-24-editor-startup-payload.md.🤖 Generated with Claude Code