Skip to content

[Docs] Make docs build faster - #9982

Merged
weronikaolejniczak merged 4 commits into
elastic:mainfrom
weronikaolejniczak:chore/make-docs-build-faster
Sep 2, 2026
Merged

[Docs] Make docs build faster#9982
weronikaolejniczak merged 4 commits into
elastic:mainfrom
weronikaolejniczak:chore/make-docs-build-faster

Conversation

@weronikaolejniczak

@weronikaolejniczak weronikaolejniczak commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes https://github.com/elastic/eui-private/issues/762

What:

  • Enable Docusaurus Faster. It doesn't work out-of-box because SWC skips babel.config.js, so we have to configure it to compile JSX with Emotion’s runtime (importSource: '@emotion/react') instead of the default React runtime.
  • Reuse the react-docgen-typescript parser across files instead of creating one per file (~1394x). Previously it was in a loop.

Local timings (Docusaurus build only, workspaces already built):

  • Webpack baseline: ~2m 23s vs Faster + Emotion SWC: ~24s
  • Docgen: ~74s~22s

Benchmark

Step n2d8 only (#9984) Faster + docgen Saved
yarn 39s 40s 0
@elastic/eui compile + other workspaces ~2.5m ~2.5m ~0
docgen parse 77s 36s 41s
typedoc 29s 29s 0
Docusaurus 3.7m (webpack client 2.91m) 48s ~2.9m
GCS 9s 9s 0
website job 8m58s 5m20s ~3.6m

QA instructions for reviewer

  • Smoke test PR docs preview,
    • home page typewriter effect,
    • CSS-heavy pages like Button,
    • misbehaving pages like Empty prompt,
    • verify showing the source and changing the source works as expected,
    • verify the examples render correctly...
  • make sure docgen maintains the same shape (e.g. you can smoke-test prop tables in docs).

@weronikaolejniczak
weronikaolejniczak force-pushed the chore/make-docs-build-faster branch from 04530c8 to 5897fdb Compare September 1, 2026 09:33
@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review September 1, 2026 09:44
@weronikaolejniczak
weronikaolejniczak requested a review from a team as a code owner September 1, 2026 09:44
Copilot AI lite review requested due to automatic review settings September 1, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes core docs build tooling/CI execution characteristics (experimental Faster/Rspack/SWC + larger agents) and should be validated by a human reviewer in CI and preview deployments.

Pull request overview

Speeds up the EUI docs deploy pipeline by enabling Docusaurus “Faster” (Rspack/SWC-based build path), increasing CI agent resources, and reducing overhead in the docgen generation step.

Changes:

  • Enable future.experimental_faster in Docusaurus and configure SWC to use Emotion’s JSX runtime (importSource: '@emotion/react').
  • Add @docusaurus/faster dependency (and corresponding lockfile updates).
  • Reuse a single react-docgen-typescript parser instance across files and increase Buildkite deploy-docs agent size.
File summaries
File Description
yarn.lock Adds lock entries for @docusaurus/faster and its transitive deps (Rspack/SWC/etc.).
packages/website/package.json Adds @docusaurus/faster@3.7.0 to website dependencies.
packages/website/docusaurus.config.ts Enables Docusaurus Faster and customizes SWC loader options for Emotion’s automatic runtime.
packages/eui-docgen/src/main.ts Reuses a docgen parser across files and adjusts per-file state handling.
.buildkite/pipelines/deploy_docs.yml Upgrades deploy-docs agent machine type to n2d-standard-8 for faster builds.
Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/eui-docgen/src/main.ts Outdated
@weronikaolejniczak
weronikaolejniczak force-pushed the chore/make-docs-build-faster branch from 89a40d6 to 0d21aa9 Compare September 1, 2026 14:13

@mgadewoll mgadewoll left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Changes are LGTM, left one comment. Great update to speed up the build! 🎉

Comment thread packages/website/package.json Outdated
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@weronikaolejniczak
weronikaolejniczak enabled auto-merge (squash) September 2, 2026 13:14
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@weronikaolejniczak
weronikaolejniczak merged commit 7862307 into elastic:main Sep 2, 2026
7 checks passed
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.

3 participants