Defer uncommon admin icons and Block Kit chart code #2486
richardjoo
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Defer uncommon admin icons and Block Kit chart code
Motivation
The admin
PluginRegistryentry currently includes the full@phosphor-icons/reactnamespace used to resolve plugin navigation icon names, plus Block Kit chart code even when no chart is rendered. This makes every admin visit download and parse code needed only by uncommon plugin icons or chart blocks.Benchmark
I built the same production Astro/Cloudflare site twice with source maps and Rollup graph metadata, changing only the EmDash workspace packages. Sizes below sum the
PluginRegistryentry and its static import closure; gzip uses level 9 and Brotli uses quality 11.The complete admin-reachable graph stays effectively flat: gzip changes from 3,073,718 B to 3,068,896 B (-0.2%). This is code deferral, not code removal.
A separate repository fixture on the candidate reports a 1,861,446 B raw
PluginRegistry, 2,745,418 B initial static closure, 153 initial Phosphor definitions, 32 lazy icon buckets (largest 217,820 B raw), and one lazy chart chunk.Proposed design
@phosphor-icons/reactexport surface. Preserve canonical names,*Iconaliases, and aliases exported from differently named modules.Plug; a failed bucket load also falls back toPlugand does not unmount the admin.React.lazyandSuspense. Reserve the configured chart height while loading; retain that placeholder if the chunk fails.Compatibility and failure behavior
Plugfallback.Verification completed on the candidate
git diff --checkpass.Repository-wide Oxlint currently aborts inside
oxc_allocatoron this machine even when constrained to one changed file and one thread; no lint diagnostic is emitted. I would rely on upstream CI for that gate before merge.If this direction is acceptable, I have a single-commit branch based directly on current
main, including tests and a patch changeset, ready for review.All reactions