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

[Themes] Skip proxy fallback for known rendering requests #5445

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

frandiox
Copy link
Contributor

WHY are these changes introduced?

Requests using Section Rendering API and such don't need the proxy fallback since we are sure they are supposed to go to SFR. This is a quick fix to make logs easier for an issue that @jamesmengo is debugging.

WHAT is this pull request doing?

How to test your changes?

Post-release steps

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@frandiox frandiox requested a review from jamesmengo February 21, 2025 02:26
@frandiox frandiox requested review from a team as code owners February 21, 2025 02:26

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Feb 21, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 75.73% 9113/12034
🟡 Branches 70.92% 4455/6282
🟡 Functions 75.42% 2375/3149
🟡 Lines
76.27% (+0.01% 🔼)
8606/11283
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app-event-watcher.ts
95.18% (-1.2% 🔻)
86.49% (-2.7% 🔻)
95.45% 100%

Test suite run success

2066 tests passing in 922 suites.

Report generated by 🧪jest coverage report action from 0d1d9ce

Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

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

Thank you for this PR, @frandiox! It looks good to me and works as expected as well.

I've shared a minor suggestion regarding H3 events, but it is optional (I would love to hear your thoughts on that tho).

Thanks again for this PR!

* Detects routes and params that indicate this request should be handled by SFR.
*/
function isKnownRenderingRequest(event: H3Event) {
const searchParams = new URLSearchParams(event.path.split('?')[1])
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this logic in other areas. I wonder if it might be nice to decorate™️ events to have this in a single place, with something like this:

event = devServer(event)
event.queryParams
event.pathname

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.

4 participants