Skip to content

perf(__docs__,ui-babel-preset): speed up and quiet the docs dev server#2611

Open
balzss wants to merge 1 commit into
masterfrom
dev-server-speedup
Open

perf(__docs__,ui-babel-preset): speed up and quiet the docs dev server#2611
balzss wants to merge 1 commit into
masterfrom
dev-server-speedup

Conversation

@balzss

@balzss balzss commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Parse the ~1700 doc source files across a worker-thread pool instead of serially; extract parseSingleFile.mts (shared with the markdown watcher) and add parse-worker.mts.
  • Quiet pnpm dev output by default — progress bar + "Dev server ready" summary, silenced webpack stats/banner via a DevServerStatus plugin; opt back in with DOCS_VERBOSE=1 or pnpm run dev:verbose.
  • Add an inlineHelpers option to ui-babel-preset (emits Babel helpers inline) and enable it in the docs config to fix the _interopRequireDefault is not a function crash from the @babel/runtime ESM/CJS mismatch.

Test Plan

  • Run pnpm run dev and confirm the docs site builds at http://localhost:9090 with quiet output and a working progress bar.
  • Run pnpm run dev:verbose (and DOCS_VERBOSE=1) and confirm full per-file/step logging returns.
  • Spot-check a few rendered component doc pages to confirm parsed output matches the previous serial build.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2611/

Built to branch gh-pages at 2026-06-25 14:40 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

github-actions Bot pushed a commit that referenced this pull request Jun 25, 2026
@github-actions

Copy link
Copy Markdown

Visual regression report

No changes.

Status Count
Unchanged 32
Changed 0
New 0
Removed 0

📊 View full report

Baselines come from the visual-baselines branch. They refresh on every merge to master.

Parse the ~1700 doc source files across a pool of worker threads instead of
serially. react-docgen/babel parsing is CPU-bound and single-threaded, so
fanning the files out across cores is the dominant `pnpm dev` startup win.
Workers return results keyed by original index so the output matches the serial
build regardless of completion order. Extract the pure parsing/writing logic
into parseSingleFile.mts (shared by the parallel build and the markdown watcher)
and add parse-worker.mts as the worker entry point.

Quiet startup output by default: replace per-file and per-step logs with a
single progress bar and a "Dev server ready" summary, silence webpack's
per-asset stats and dev-server banner, and add a DevServerStatus plugin that
owns the compile output. Opt back into full logging with `DOCS_VERBOSE=1` or the
new `pnpm run dev:verbose` script.

Add an `inlineHelpers` option to ui-babel-preset that emits Babel helpers inline
instead of importing them from `@babel/runtime`, and enable it in the docs babel
config. The dev build compiles `@instructure/*` from raw src to CommonJS while
webpack resolves `@babel/runtime` via the `import` condition (ESM helpers), a
mismatch that crashed with "_interopRequireDefault is not a function".

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@balzss balzss force-pushed the dev-server-speedup branch from 4c74423 to a3aea0e Compare June 25, 2026 14:36
@balzss balzss self-assigned this Jun 25, 2026
@balzss balzss requested a review from HerrTopi June 29, 2026 11:21
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