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

fix(routing): don't attach locals to request #12647

Merged
merged 2 commits into from
Dec 6, 2024
Merged

Conversation

ematipico
Copy link
Member

Changes

This PR refactors how we internally handle the locals. The use of the symbol on Request has been limited only to the dev server, because that's the only way for adapters to send us locals in dev.

Technically, this isn't a breaking change for the adapters because the App.render function already provides the APIs for passing initial locals. Plus, the RenderContext class already holds the locals when it's created, so it's safe to remove the places where Reflect.set/Reflect.get is used.

The only place where we need to keep the Request usage is a runtime, public API called createContext, which is only used my the edge middleware.

Testing

The CI should pass

Docs

N/A

Copy link

changeset-bot bot commented Dec 5, 2024

⚠️ No Changeset found

Latest commit: 902a3a1

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 Dec 5, 2024
Copy link

codspeed-hq bot commented Dec 5, 2024

CodSpeed Performance Report

Merging #12647 will not alter performance

Comparing fix/symbol-locals (902a3a1) with main (e216250)

Summary

✅ 4 untouched benchmarks

@ematipico ematipico merged commit 8f8f15c into main Dec 6, 2024
10 checks passed
@ematipico ematipico deleted the fix/symbol-locals branch December 6, 2024 10:31
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.

2 participants