Repository navigation
perf: drop jschardet and the editor stack from startup payloads - #292
Merged
Merged
Conversation
ranuts 0.5.1 moves its jschardet-backed helpers out of utils/str.ts (chaxus/ran#443). MessageCodec, used at startup by lib/events.ts, no longer drags the 332 KB detector into the editor entry chunk; nothing here calls the charset-sniffing helpers. ranui 0.5.1 brings ranview 0.2.1, so the minimum-release-age exclusion follows it, and the vendored token sheet and component IIFEs are re-synced the way bin/build.sh does on every build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page imported formatRelativeTime from history/recovery (which imports lib/document) and the autosave preference from history/autosave (which imports the save pipeline), so /history loaded the editor's document chunk to render a list. Both helpers are pure and now live in history/relative-time and history/preferences; setAutosaveEnabled still writes the preference and stops the running session. 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: |
e3333c1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0c1df4f1.document-7hm.pages.dev |
| Branch Preview URL: | https://perf-startup-payload-2.document-7hm.pages.dev |
ranui 0.5.1 writes the portal layer inline as var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, 1100)), so the plain z-index rules on .agent-speech-popover and r-dropdown[role='listbox'] lost to it and both portals fell under the assistant panel (z-index 10000): the dictation privacy hint could not be hovered, and settings select lists drew behind the panel. Set the property ranui reads instead. A new spec checks a select opened in the panel is the topmost element; it and the dictation case fail with the old rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
This is the second round of startup-payload fixes, after #291.
47ee1d3a)/editor/historyCounting #291 as well, the editor's startup graph has gone from 350 KB to 163 KB gzip. The figures are the static startup graph, summed per chunk from
.vite/manifest.json.jschardet (fixed upstream)
466 KB of the editor entry chunk's source was jschardet, though nothing in the app detects charsets statistically. It came from
ranuts/utils/str.ts, which importsdetectat the top.MessageCodec, used at startup bylib/events.ts, lives in the same file, and jschardet is CommonJS, so bundlers can't drop it.Fixed in ranuts itself: chaxus/ran#443 moves the three functions that use jschardet into
utils/charset.ts, and ranuts 0.5.1 is published with it. This PR upgrades ranuts and ranui to 0.5.1; ranui brings ranview 0.2.1, and theminimumReleaseAgeExcludepin follows. It also re-syncs the vendoredran-tokens.cssandranui-iife/*the same waybin/build.shdoes.The history page loaded the editor
/historyimportedformatRelativeTimefromhistory/recovery, which importslib/document, and the autosave preference fromhistory/autosave, which imports the save pipeline. Both helpers are pure. They now live inhistory/relative-time.tsandhistory/preferences.ts, andsetAutosaveEnabledbehaves as before.Commits
build(deps): ranuts / ranui 0.5.1perf(history): history page no longer imports the editor stacktest(e2e): startup payload spec covers jschardet and/historydocs(perf): exploration record, CHANGELOG, CLAUDE.md noteTests and reverse validation
editor-startup-payload.spec.tsnow checks:/editor: the agent tools, the PWA library and jschardet are absent./history: the save pipeline and jschardet are absent.Reverse validation:
history/recoveryandhistory/autosaveagain, the history case fails on the save pipeline.Run locally:
lint:tsandformat:check: passed.editor-startup-payload,history-page,app-smoke,csv-encoding;main-site,embed-regression,autosave-recovery,entry-paths,agent-sidebar-layout,webmcp.The full E2E suite and the Pages/Docker configs are left to CI. An independent subagent review found no blocking issues, and its two low findings are fixed.
Not in this PR
All seven languages' message tables (about 215 KB of source) load on both pages. Fixing that changes the synchronous
t()contract of@ranuts/shared/i18n, so it needs its own decision.🤖 Generated with Claude Code