-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
refactor(preview)!: use base middleware #14818
Conversation
Co-authored-by: 翠 / green <[email protected]>
Run & review this pull request in StackBlitz Codeflow. |
/ecosystem-ci run |
📝 Ran ecosystem CI on
|
Hmm it's not as bad as I thought. Seems like it's only Astro and Vike affected like before. cc @brillout again if you have thoughts on this. There's still quite a number of usage with post-middlewares in the wild (github search). But the rest internal apps are less likely to fiddle with preview servers I think. |
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.
Thanks!
I think it's worth giving a try.
60% of the usage is coming from a forked repo (non forked repo result). |
I'll wait for another review from others or feedback from Rom before going with this, in case anyone has concerns. |
This looks good to me, but I agree with waiting for Brillout's feedback. |
At first glance I've nothing to object. Vike has extensive base tests, so it could be worth it to first fix the Vite+Vike CI before merging this. (I suspect Vike is red only because of #14836.) |
/ecosystem-ci run vike |
📝 Ran ecosystem CI on
|
@bluwy Sounds good 👍. (I didn't reply yet because I didn't manage to make |
All green from my side, this PR LGTM. |
I think it could be worth it to merge(/reject) #14859 before. |
Next time the ecosystem CI is failing, please give us a heads up rather than ignoring it. I really think this PR was a bad idea and if we wanted to standardize dev and preview it would have been better to do it in the reverse direction and remove the base middleware from dev mode. The base middleware is a bad actor that screws with the URL and only lets some requests through to be handled, so the only way I can get our preview mode to work is to reach in to the internals and strip out the base middleware. |
Description
Followup on #14756 (comment) and #14756 (comment)
Not sure if this will break a lot, but could run ecosystem-ci if this passes.
This makes it so that preview post-middlewares do not have access to the
base
, similar to dev as it's stripped off. For example,req.url
will not have the base prepended.Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).