René's URL Explorer Experiment


Title: perf: make published pages lighter by deferring error page code by tristan-mouchet · Pull Request #569 · ycode/ycode · GitHub

Open Graph Title: perf: make published pages lighter by deferring error page code by tristan-mouchet · Pull Request #569 · ycode/ycode

X Title: perf: make published pages lighter by deferring error page code by tristan-mouchet · Pull Request #569 · ycode/ycode

Description: Summary Every published page was downloading and parsing the error boundary's renderer chunks even when no error occurred. This removes them from the initial page load, cutting roughly 64 KB compressed (~213 KB parsed) off the mobile critical path before first paint. Closes #567. Follow-up to #558, which removed the static import but left the next/dynamic graph resolving into a duplicate copy of the shared renderer modules. Changes Render a minimal static 500 from the error boundaries instead of the full renderer Load the custom 500 page tree with a runtime import() after an error actually occurs, so its chunks never appear in errorScripts Extract ErrorFallback (tiny, no renderer graph) and DeferredErrorPage (shared defer logic) so the published and preview boundaries stay in sync Reuse ErrorFallback for ErrorPageContent's loading and no-custom-page states, replacing duplicated markup and removing a blank flash while the custom page is fetched Results Measured on a production build, public page client-reference manifest: Before After Boundary chunks 6 chunks, ~64 KB br 2 chunks, 1.2 KB + 1.7 KB Heavy renderer modules in boundary rich-text / inline-variable / YcodeBadge none LayerRendererPublic copies 2 1 ErrorPageContent in errorScripts yes no Test plan Load a published page and confirm the error-boundary chunks are no longer in the initial