Skip to content

Conversation

@ematipico
Copy link
Member

Changes

This PR adds a new virtual module that allows to return the list of routes inside an Astro project.

This virtual module essentially replaces the RoutesList type that we create when we start the dev server.

Testing

Unit tests should pass. Integration tests pass on my machine, they will still time out here

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Sep 4, 2025

⚠️ No Changeset found

Latest commit: bdc8f13

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 4, 2025
Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will App be able to load this if there are no routes in the manifest?

@ematipico
Copy link
Member Author

ematipico commented Sep 4, 2025

Will App be able to load this if there are no routes in the manifest?

Not yet, but now that manifest and routesList are both virtual modules, now manifest can import routesList and update its routes field.

Eventually, App just needs to pull the manifest, and the routes will be there already

@ematipico
Copy link
Member Author

Important

I removed the astro:scanner plugin, and moved its logic inside the new astro:routes plugin. Both plugins need to work around the routes that are created from createRoutesList, and leaving them as two separate plugins was a problem. Merging them made things easier.

@ematipico
Copy link
Member Author

ematipico commented Sep 5, 2025

This PR broke a bunch of stuff around prerendering. Currently checking what's the best course of action once I understand the problem clearly

@ematipico
Copy link
Member Author

The problem is caused now by an inconsistency between the dev/ssr pipeline and the build pipeline.

Particularly, there's a plugin called plugin-manifest, which is a plugin excessively used during the build.

I will address this in a separate PR.

@ematipico ematipico merged commit 9ed7a3c into feat/environment-api Sep 8, 2025
12 of 25 checks passed
@ematipico ematipico deleted the env-api/routes-virtual-module branch September 8, 2025 09:23
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.

4 participants