Title: fix: stop shipping duplicate renderer chunk on published pages by tristan-mouchet · Pull Request #558 · ycode/ycode · GitHub
Open Graph Title: fix: stop shipping duplicate renderer chunk on published pages by tristan-mouchet · Pull Request #558 · ycode/ycode
X Title: fix: stop shipping duplicate renderer chunk on published pages by tristan-mouchet · Pull Request #558 · ycode/ycode
Description: Summary Published pages downloaded two overlapping copies of the public renderer graph. The route error boundary (app/(site)/error.tsx, re-exported by the published and builder boundaries) and the preview error boundary both statically imported LayerRendererPublic, so Turbopack rooted a second full copy of the renderer in every route's error-boundary chunk. This lazy-loads that renderer instead, leaving a single shared copy. Closes #548. Changes Add shared ErrorPageContent component holding the custom-500 logic (data fetch, CSS injection, LayerRendererPublic, badge), parameterised by a published flag — removing the duplication between the two near-identical error boundaries Slim app/(site)/error.tsx and app/(site)/ycode/preview/error.tsx to thin boundaries that lazy-load ErrorPageContent via next/dynamic The published ((published)/[[...slug]]/error.tsx) and builder ((builder)/error.tsx) re-exporters inherit the fix automatically Result (production build) Before: two overlapping renderer chunks shipped on every published page After: one shared 192 KB renderer chunk + a 23 KB lazy error chunk that reuses it — the second full copy no longer ships in the page's initial JS The renderer downloads only when an error actually renders a custom 500 page Test plan Homepage/published page ships only one public-renderer chunk (verify in a production Lighthouse/treemap — no duplicated layer-utils/renderer) Custom 500 page still renders after a thrown error on a published page Custom 500 page still renders in preview after a thrown error Default fallback 500 (Server Error / Preview Error) renders when no custom error page exists reset() "Try Again" button still works
Open Graph Description: Summary Published pages downloaded two overlapping copies of the public renderer graph. The route error boundary (app/(site)/error.tsx, re-exported by the published and builder boundaries) and the ...
X Description: Summary Published pages downloaded two overlapping copies of the public renderer graph. The route error boundary (app/(site)/error.tsx, re-exported by the published and builder boundaries) and the ...
Opengraph URL: https://github.com/ycode/ycode/pull/558
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a16f9acd-5478-c7b3-793d-8aca8270d7ba |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AF94:30C434:EA434:13CEA1:6AFE4520 |
| html-safe-nonce | daa1f2596dc8fe899799492272e2b98f85e047997e47b33bba98801e0d32b2fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjk0OjMwQzQzNDpFQTQzNDoxM0NFQTE6NkFGRTQ1MjAiLCJ2aXNpdG9yX2lkIjoiMTM1MDczODg4NTc1ODMzMzc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d440fc03317a216cffaffac7e947e0a6c3584bf7e404da14777e0fc76f1ab4a0 |
| hovercard-subject-tag | pull_request:4545262502 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/ycode/ycode/pull/558/files |
| twitter:image | https://avatars.githubusercontent.com/u/82507011?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/82507011?s=400&v=4 |
| og:image:alt | Summary Published pages downloaded two overlapping copies of the public renderer graph. The route error boundary (app/(site)/error.tsx, re-exported by the published and builder boundaries) and the ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/ycode/ycode git https://github.com/ycode/ycode.git |
| octolytics-dimension-user_id | 65892203 |
| octolytics-dimension-user_login | ycode |
| octolytics-dimension-repository_id | 1165452593 |
| octolytics-dimension-repository_nwo | ycode/ycode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1165452593 |
| octolytics-dimension-repository_network_root_nwo | ycode/ycode |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ce393ea11ad276623b946bc9663d3e7d6f564275 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width