Title: Avoid passive esbuild-wasm loads in Charts docs · Issue #1130 · TanStack/tanstack.com · GitHub
Open Graph Title: Avoid passive esbuild-wasm loads in Charts docs · Issue #1130 · TanStack/tanstack.com
X Title: Avoid passive esbuild-wasm loads in Charts docs · Issue #1130 · TanStack/tanstack.com
Description: @tannerlinsley The new inline Charts documentation examples automatically load a browser compiler and execute as readers approach them. This needs a product/performance decision rather than an automatic behavior change. Evidence ChartsCa...
Open Graph Description: @tannerlinsley The new inline Charts documentation examples automatically load a browser compiler and execute as readers approach them. This needs a product/performance decision rather than an auto...
X Description: @tannerlinsley The new inline Charts documentation examples automatically load a browser compiler and execute as readers approach them. This needs a product/performance decision rather than an auto...
Opengraph URL: https://github.com/TanStack/tanstack.com/issues/1130
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Avoid passive esbuild-wasm loads in Charts docs","articleBody":"@tannerlinsley The new inline Charts documentation examples automatically load a browser compiler and execute as readers approach them. This needs a product/performance decision rather than an automatic behavior change.\n\n## Evidence\n\n- `ChartsCatalogDocExample` switches from its existing static SVG preview to the live client when the section enters a 320px root margin: [source](https://github.com/TanStack/tanstack.com/blob/9ab7a51c6b76945419369ad81150cf13f3d8a2e0/src/components/charts/ChartsCatalogDocExample.tsx#L33-L60).\n- The live client immediately fetches the complete example workspace: [source](https://github.com/TanStack/tanstack.com/blob/9ab7a51c6b76945419369ad81150cf13f3d8a2e0/src/components/charts/ChartsCatalogDocExample.client.tsx#L34-L49).\n- `ChartsCatalogResult` then calls `compileExampleWorkspace` without further user intent: [source](https://github.com/TanStack/tanstack.com/blob/9ab7a51c6b76945419369ad81150cf13f3d8a2e0/src/components/charts/ChartsCatalogResult.client.tsx#L33-L52).\n- The compiler is the pinned `esbuild-wasm@0.27.4`: [source](https://github.com/TanStack/tanstack.com/blob/9ab7a51c6b76945419369ad81150cf13f3d8a2e0/package.json#L109).\n- A production build emits `dist/client/assets/esbuild-*.wasm` at **13,539,721 bytes raw / 3,614,425 bytes gzip**. The shared browser compiler JS is another **74,128 bytes raw / 21,234 bytes gzip**. This excludes the fetched example source and esm.sh runtime modules.\n- Current `TanStack/charts` main contains **89 `::chart-example` directives across 29 docs pages**. The largest page, `docs/examples/polar-and-radar.md`, contains 15. Each newly approached example recompiles and mounts even when the reader does not select Run or Edit.\n- The static `ChartsCatalogPreview` is already rendered before the live client loads, so a compiler-free passive state exists.\n- This is distinct from #1091: that issue bounded landing-page catalog rotation. This path was added later for docs examples.\n\n## Expected impact\n\nKeeping passive docs examples static would avoid roughly 3.6 MB of first-visit compiler transfer plus WASM initialization/compile CPU and remote module requests for readers who only read or scroll the page. It would also prevent multi-example pages from progressively compiling and mounting every chart.\n\n## Proposed direction\n\nKeep the existing static preview until the reader selects **Run** or **Edit**. That action can load the current client, fetch the workspace, initialize the shared compiler once, and preserve the current editable/runnable experience from that point onward.\n\nAdd a focused component test asserting that visibility alone does not load the live client and that explicit activation does.\n\n## Alternatives and tradeoffs\n\n1. **Click to run/edit** — lowest passive cost and reuses the current static preview; live charts no longer start automatically.\n2. **Auto-run only the first example per page** — preserves one immediate live demonstration but adds page-level coordination and still pays the compiler cost.\n3. **Serve precompiled immutable catalog modules for passive rendering** — retains automatic interactivity without shipping the browser compiler, but restores publication/build machinery that the new source-driven path deleted.\n4. **Keep current behavior** — simplest and maximizes immediate interactivity, but explicitly accepts the compiler transfer and progressive compile/mount work on docs pages.\n\n## Decision needed\n\nShould Charts docs examples remain auto-running near the viewport, or should live compilation wait for Run/Edit? If auto-run is required, is restoring a precompiled passive-render path worth the added catalog publication complexity?\n\n## Validation\n\n- `pnpm build` completed and emitted the measured production assets.\n- Duplicate searches for `esbuild-wasm`, passive Charts docs, auto-run chart examples, and browser compiler docs found no matching open/closed issue or open PR.\n","author":{"url":"https://github.com/tannerlinsley","@type":"Person","name":"tannerlinsley"},"datePublished":"2026-08-09T14:10:43Z","url":"https://github.com/TanStack/tanstack.com/issues/1130"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:67682195-ba78-bc79-d0a3-c18574002867 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9F0:1E5A09:11D6F06:1762906:6AF9A462 |
| html-safe-nonce | fbe134b639f58a375d2bdee2989d45f1be4e23e115d69a82739bde3c1f8bdd34 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUYwOjFFNUEwOToxMUQ2RjA2OjE3NjI5MDY6NkFGOUE0NjIiLCJ2aXNpdG9yX2lkIjoiODY4MzI3NzU3MzMwNTI0NjgxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ea04f9303490f75ade9b800295054f197c96b372f7b5a664bf34235a7ecd2a3d |
| hovercard-subject-tag | issue:5102958219 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TanStack/tanstack.com/1130/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e9634063a61023115be861a19b4e15fb9da77792d3520344340edc6d6ff5dcae/TanStack/tanstack.com/issues/1130 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e9634063a61023115be861a19b4e15fb9da77792d3520344340edc6d6ff5dcae/TanStack/tanstack.com/issues/1130 |
| og:image:alt | @tannerlinsley The new inline Charts documentation examples automatically load a browser compiler and execute as readers approach them. This needs a product/performance decision rather than an auto... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tannerlinsley |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/TanStack/tanstack.com git https://github.com/TanStack/tanstack.com.git |
| octolytics-dimension-user_id | 72518640 |
| octolytics-dimension-user_login | TanStack |
| octolytics-dimension-repository_id | 297489727 |
| octolytics-dimension-repository_nwo | TanStack/tanstack.com |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 297489727 |
| octolytics-dimension-repository_network_root_nwo | TanStack/tanstack.com |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width