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

Lift static handler creation and pass context through query/queryRoute #4790

Merged
merged 2 commits into from Dec 7, 2022

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Dec 6, 2022

Updates to @remix-run/router@1.0.5-pre.2 with support for requestContext in query/queryRoute and lifts the static handler creation outside of requestHandler

Closes #4733

@changeset-bot
Copy link

changeset-bot bot commented Dec 6, 2022

🦋 Changeset detected

Latest commit: ef509ea

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

This PR includes changesets to release 16 packages
Name Type
@remix-run/server-runtime Patch
@remix-run/cloudflare Patch
@remix-run/deno Patch
@remix-run/dev Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
create-remix Patch
@remix-run/architect Patch
@remix-run/express Patch
@remix-run/netlify Patch
@remix-run/vercel Patch
@remix-run/serve Patch
remix Patch
@remix-run/eslint-config Patch

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

loadContext,
request: args.request,
params: args.params,
loadContext: args.context,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer comes from the closure scope and instead passes straight through

let response = await staticHandler.queryRoute(request, {
routeId,
requestContext: loadContext,
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Send the context through query/queryRoute

@brophdawg11 brophdawg11 merged commit 10dee7c into release-hotfix Dec 7, 2022
@brophdawg11 brophdawg11 deleted the brophdawg11/static-handler-perf branch December 7, 2022 14:30
kentcdodds pushed a commit that referenced this pull request Dec 15, 2022
#4790)

* Lift static handler creation and pass context through query/queryRoute

* add changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

createRequestHandler in server-runtime causing slower responses in larger apps
1 participant