Skip to content

fix(astro): Construct parametrized route during runtime #17190

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

Merged
merged 1 commit into from
Jul 29, 2025

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jul 28, 2025

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

@s1gr1d s1gr1d requested review from Lms24 and andreiborza July 28, 2025 12:27
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice!

@s1gr1d s1gr1d merged commit faada7c into develop Jul 29, 2025
37 checks passed
@s1gr1d s1gr1d deleted the sig/astro-route-param-fix branch July 29, 2025 14:28
s1gr1d added a commit that referenced this pull request Jul 30, 2025
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
s1gr1d added a commit that referenced this pull request Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sentry.server.config.js fills up with globalThis
2 participants