withastro
astro
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(astro): exclude prerendered redirect targets from SSR page map (#17060) In hybrid-mode builds (output: 'static' + adapter), pages with export const prerender = true that are the target of a config-level redirect were being added to the SSR page map, inflating the server function. The reporter saw 68MB vs ~1.4MB. Root cause: getRoutesForEnvironment in vite-plugin-pages/pages.ts unconditionally added a redirect's redirectRoute to the page map regardless of the target's prerender flag. The check now requires route.redirectRoute.prerender === isPrerender, so a prerendered target is only added to the prerender environment's page map. Safe because renderRedirect builds the redirect Response from segments and pathname only (see core/redirects/render.ts) and never loads the target's component. Added packages/astro/test/units/redirects/environment-filtering.test.ts covering all 4 combinations of (redirect.prerender, redirectRoute.prerender) for both isPrerender=true and isPrerender=false. Co-Authored-By: Claude <noreply@anthropic.com>
midlaj-muhammed:fix/17060-redirect-target-bundling
11 hours ago
changeset: document manual chunk entrypoint fix
Diyoncrz18:fix-manualchunks-component-proxy-hoist-17016
12 hours ago
fix: resolve manual chunk component entrypoints
Diyoncrz18:fix-manualchunks-component-proxy-hoist-17016
12 hours ago
feat(changeset): over all of this fixing
fkatsuhiro:fix/a11y-no-redundant-role
14 hours ago
feat(changeset): over all of this fixing
fkatsuhiro:fix/a11y-no-redundant-role
14 hours ago
fix(dev-toolbar): fix inverted login in a11y-no-redundant-roles rule
fkatsuhiro:fix/a11y-no-redundant-role
15 hours ago
Add unit tests for getRoutesForEnvironment redirect filtering Covers all four combinations of redirect/target prerender flags to verify that redirect targets are only included in the environment matching their own prerender flag.
fix/redirect-bundle-inflation
15 hours ago
Fix prerendered redirect targets inflating SSR bundle in hybrid mode Closes #17060 Supersedes #17061 Related: cb95536ef6, 8d5f783ad8 The getRoutesForEnvironment function unconditionally added every redirect's target route (via route.redirectRoute) to the environment's route set. In hybrid mode (output: 'static' + adapter), this pulled prerendered pages into the SSR bundle even though they should only exist in the prerender environment. The reporter saw their deployment grow from ~1.4MB to 68MB because 4 prerendered redirect targets dragged in all their static dependencies. The redirectRoute block was added in cb95536ef6 ('fix: include redirectRoute in environment route filtering') within PR #15093 as a safety measure, with the assumption that redirect responses need the target's component at runtime. After tracing the full runtime path, this turns out to be wrong: 1. AstroHandler.render() (routing/handler.ts:127) short-circuits redirect routes before any component loading — renderRedirect() only uses route metadata (segments, pathname) to compute the Location header. 2. getModuleForRoute in AppPipeline does swap to the target's component for redirects, but this codepath is never reached at SSR runtime because of the short-circuit above. 3. The only place that needs the target's component is prerendering (StaticPaths calls getComponentByRoute to invoke getStaticPaths on dynamic targets), but prerendered redirects and their targets share the same prerender flag, so both are already included by the route.prerender === isPrerender check. 4. The redirectRoute property is a reference to an existing RouteData object that already appears in the routes array (it comes from routeMap.get(destination) in create-manifest.ts:545). The redirectRoute block was redundant for matching-environment targets and harmful for cross-environment targets. PR #17061 proposed adding route.redirectRoute.prerender === isPrerender, which is correct but still redundant — the target with matching prerender is already in the set from its own loop iteration. The simpler fix is to remove the redirectRoute block entirely.
fix/redirect-bundle-inflation
16 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
fix(astro): exclude prerendered redirect targets from SSR page map (#17060)
#17070
11 hours ago
3d67bfc
midlaj-muhammed:fix/17060-redirect-target-bundling
CodSpeed Performance Gauge
0%
fix: resolve manual chunk component entrypoints
#17069
12 hours ago
23dc71b
Diyoncrz18:fix-manualchunks-component-proxy-hoist-17016
CodSpeed Performance Gauge
0%
FIx: inverted logic in a11y-no-redundant-roles rule
#17067
14 hours ago
f3351a5
fkatsuhiro:fix/a11y-no-redundant-role
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs