-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(rerouting): attempt without middleware #8814
Conversation
🦋 Changeset detectedLatest commit: 4242c68 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! Thanks for the fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this change should be part of the App pipeline
because it's in charge of running the middleware, so we should only expose the functions to or not run it.
Also, App
is used by other adapters, so we should bump all those adapters that use App
:
- node
- vercel
- cloudflare
- netlify
I was under the impression that the changes made here were all to internal APIs. I'll take another look later. |
Unfortunately no. https://docs.astro.build/en/reference/adapter-reference/#astroapp Search for |
but I have made no changes to the public interface of app |
True, although I think that all the consumers of this fix will benefit from it, so we should bump a patch for them too. |
In its current state, the fix would apply to adapters and all their versions retroactively; a bump souldn't be necessary. But maybe I am misunderstanding. Is the idea is to allow the adapter to say whether middleware should run? app.renderWithOptions(request, { runMiddleware: false }) It would expand the scope of this PR from a bugfix to a feature. FWIW, it is already planned for the reroute API, and you can see the implementation in the exploration branch. |
Yeah you're right, I misunderstood things. Sorry for bikeshedding this. A patch for core should be enough. |
No worries. I'll get to the suggestions in a few hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Left some feedback and question.
Co-authored-by: Emanuele Stoppa <[email protected]>
Changes
Testing
Added a case to
middleware.test.js
.Docs
Does not affect usage.