Skip to content

Isolate docs bundles and route-specific styles - #881

Draft
zahlekhan wants to merge 1 commit into
thesysdev:mainfrom
zahlekhan:codex/docs-bundle-boundaries
Draft

Isolate docs bundles and route-specific styles#881
zahlekhan wants to merge 1 commit into
thesysdev:mainfrom
zahlekhan:codex/docs-bundle-boundaries

Conversation

@zahlekhan

Copy link
Copy Markdown
Contributor

Summary

  • replace React UI barrel imports with explicit component subpath imports across docs, demos, chat, compare, and design-system examples
  • dynamically load expensive charts, renderer previews, OSS agent surfaces, and demo preview panels
  • move React UI, Thesys, and Fumadocs preset CSS from the global route into the layouts that consume it
  • replace the global Fumadocs theme provider with a lightweight site theme provider and keep Fumadocs scoped to docs routes
  • remove the root Geist Mono font from unrelated routes
  • enable normal production mangling and browser source maps

Why

The shared module and stylesheet graph caused /cloud to retain UI components, charts, GenUI libraries, agent surfaces, and route-specific CSS that it did not use. Importing package barrels also limited useful tree-shaking and chunk isolation.

Impact

This is the bundle/style-boundary slice of #879. It contains many files, but most changes are mechanical import-path replacements. The combined optimized build reduced total transfer from 3.9 MB to 514 KiB and Total Blocking Time from 830 ms to 10 ms.

Validation

  • pnpm --dir docs types:check
  • staged diff integrity check
  • the focused ESLint run reaches three existing set-state-in-effect errors in GitHub demo state initialization and the demos theme listener; this PR only changes imports/dynamic boundaries in those files

Tradeoffs

  • dynamically loaded previews may briefly show their existing loading state
  • production browser source maps increase deployment artifact size and may be publicly served depending on hosting configuration

Supersedes the bundle and style isolation portion of #879.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant