Skip to content

Remove legacy route prioritization - #11798

Merged
matthewp merged 5 commits into
nextfrom
globalroutepriority
Aug 23, 2024
Merged

matthewp merged 5 commits into
nextfrom
globalroutepriority

Conversation

@matthewp

@matthewp matthewp commented Aug 20, 2024 •

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-bot Bot commented Aug 20, 2024 •

Copy link
Copy Markdown

🦋 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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@ematipico ematipico left a comment

Copy link
Copy Markdown
Member

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
@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

⌂ 换网址