Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy route prioritization #11798

Merged
merged 5 commits into from
Aug 23, 2024
Merged

Remove legacy route prioritization #11798

merged 5 commits into from
Aug 23, 2024

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Aug 20, 2024

Changes

  • Removes the experimental.globalRoutePriority option, which is now the default and only setting.
  • Removes legacy code (there wasn't a lot)!

Testing

  • Removed tests that assumed the legacy behavior.

Docs

Copy link

changeset-bot bot commented Aug 20, 2024

🦋 Changeset detected

Latest commit: 2938241

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review labels Aug 20, 2024
@matthewp matthewp marked this pull request as ready for review August 21, 2024 17:28
@github-actions github-actions bot added the semver: major Change triggers a `major` release label Aug 21, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a major changeset. A reviewer will merge this at the next release if approved.

@matthewp matthewp requested a review from Fryuni August 21, 2024 17:29
Comment on lines 512 to 517
// Report route collisions
if (config.experimental.globalRoutePriority) {
for (const [index, higherRoute] of routes.entries()) {
for (const lowerRoute of routes.slice(index + 1)) {
detectRouteCollision(higherRoute, lowerRoute, config, logger);
}
for (const [index, higherRoute] of routes.entries()) {
for (const lowerRoute of routes.slice(index + 1)) {
detectRouteCollision(higherRoute, lowerRoute, config, logger);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

As a note, this collision report is the warning part that is currently incorrect due to this prioritization happening before the export const prerender is read from the files.

The entire prioritization is affected, but this is the part that yells at the users, so it is more visible.

packages/astro/src/core/config/schema.ts Outdated Show resolved Hide resolved
packages/astro/src/types/public/config.ts Outdated Show resolved Hide resolved
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Looks good, however we need to address the issue around env that @bluwy highlighted

@matthewp matthewp merged commit e9e2139 into next Aug 23, 2024
14 checks passed
@matthewp matthewp deleted the globalroutepriority branch August 23, 2024 13:58
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) pr: docs A PR that includes documentation for review semver: major Change triggers a `major` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants