fix(astro): Construct parametrized route during runtime #17190
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For v9, the changes were already reverted in this PR (#17179) to create a quick fix we can release soon. However, this removed some parametrization.
This PR here not only fixed the problem with continuously writing to
globalThis
to share build-time data with the runtime (we don't do this anymore). The route parametrization now happens only during runtime, as we have access to the route segments at runtime with Astro v5.This adds a little performance overhead when compared with the previous approach (the route segments are now constructed during runtime) - but this is not an expensive operation. The
.find
method was used in the previous approach as well.Fixes #17179