Skip to content

refactor: remove the unused pageInput set from viteBuild - #17987

Merged
ematipico merged 1 commit into
withastro:mainfrom
irontaek:cleanup/drop-unused-page-input
Sep 17, 2026
Merged

ematipico merged 1 commit into
withastro:mainfrom
irontaek:cleanup/drop-unused-page-input

Conversation

@irontaek

Copy link
Copy Markdown
Contributor

What

viteBuild in packages/astro/src/core/build/static-build.ts builds a
pageInput set of module ids and never reads it.

Its consumer used to be ssrBuild(opts, internals, pageInput, container), which
was removed with the Environment API in #14306. The producer stayed behind —
together with a comment that already suspected itself:

// The pages to be built for rendering purposes.
// (comment above may be outdated ?)
const pageInput = new Set<string>();

pageInput has no other reference anywhere in packages/astro/src.

Changes

  • Remove the pageInput set.
  • Remove the if (!routeIsRedirect(pageData.route)) guard, whose only body was
    the single pageInput.add(...).
  • Remove the routeIsRedirect import, unused after that.

9 deletions in one file, no behaviour change.

Checks

tsc --noEmit -p packages/astro/tsconfig.json reports 0 errors with the change,
and 0 on the same tree without it — identical to the baseline.

No changeset: nothing observable changes for users, matching how internal-only
changes land here (e.g. #17430, #16734).

Use of AI

An automated check flagged the collection as written-but-never-read; I traced the
consumer's removal to #14306, confirmed there are no other readers, and wrote and
verified the change myself.

`viteBuild` built a `pageInput` set of module ids and never read it. Its consumer
was `ssrBuild(opts, internals, pageInput, container)`, which went away with the
Environment API in withastro#14306; the producer stayed behind, along with a comment that
already suspected itself ("comment above may be outdated ?").

With the set gone, the `routeIsRedirect` guard around its only write has no body
left, so it goes too, and with it the now-unused import. No behaviour change:
nothing else in the repo reads `pageInput`.
@changeset-bot

changeset-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29f19fd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Sep 13, 2026
@codspeed

codspeed Bot commented Sep 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing irontaek:cleanup/drop-unused-page-input (29f19fd) with main (26d69c0)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (7a698ca) during the generation of this report, so 26d69c0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@irontaek

Copy link
Copy Markdown
Contributor Author

A note on the two red checks, since neither looks like it comes from this diff — but one of them I could not prove, so I want to be upfront about that.

Smoke fails during install, before any of this PR's code runs:

ERR_PNPM_FETCH_404  GET https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@722c34c: Not Found - 404

That is a preview-package pin that no longer resolves.

Integrations has 8 failures, all in @astrojs/cloudflare:test, all TypeError: fetch failed. This PR only removes the unused pageInput set and the now-unused routeIsRedirect import from packages/astro/src/core/build/static-build.ts. I tried to reproduce locally but could not run the integrations suite outside the turbo pipeline, so I have not verified that these failures are unrelated.

Happy to rebase, or to dig further into the cloudflare runtime tests if you think they are connected.

@ematipico
ematipico merged commit ec27992 into withastro:main Sep 17, 2026
38 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants