Skip to content

fix: speed up local dev server - #4342

Merged
khadni merged 2 commits into
mainfrom
fix/local-dev-slowness-blocks
Oct 20, 2026
Merged

khadni merged 2 commits into
mainfrom
fix/local-dev-slowness-blocks

Conversation

@khadni

@khadni khadni commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Why

In astro dev, every page took ~7s to render, even on reload.

Cause:

  • @chainlink/blocks ships raw TS, and its root entry re-exports ~3,700 icon modules.
  • Astro's dev server crawls the whole module graph of each page on every request.

Change

Dev-only Vite plugin (apply: "serve") that pre-bundles @chainlink/blocks for SSR, so it becomes a single module in the graph:

  • react / react-dom excluded from the bundle to keep a single React instance.
  • jsx: "automatic", required by blocks' TSX.

Production build is not affected.

Results (local)

  • Page reload: 6.4–10.8s → 0.03–0.05s
  • First visit of a page: 7–11s → 0.07–2.3s
  • Same rendered HTML and islands as before. No errors.

Notes

  • Temporary: remove once @chainlink/blocks ships a built package without the icon barrel.
  • To re-check during the Astro 6/7 upgrade (Vite 8 replaces esbuild in the optimizer).

@khadni
khadni requested review from a team as code owners October 20, 2026 19:38
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
documentation Ready Ready Preview Oct 20, 2026 7:51pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

👋 khadni, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@khadni
khadni merged commit da25b3e into main Oct 20, 2026
27 checks passed
@khadni
khadni deleted the fix/local-dev-slowness-blocks branch October 20, 2026 21:42

This branch was successfully deployed

1 active deployment
Preview — bfcb16da Deployed Oct 20, 2026 by vercel[bot]
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.

2 participants