-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: event.isSubRequest #10170
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
feat: event.isSubRequest #10170
Conversation
🦋 Changeset detectedLatest commit: 9ec2a33 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
I've pushed a test similar to the one for |
I don't know what's happening with the tests here. |
I think the latest round of failures may indicate a bug in my implementation here. In the test that navigates to |
Ah. Nope. It's a bad test. In that particular case, since the (synthetic) call to I'm going to have to find a different way to test this. I had initially tried looking for (This does also make me wonder whether 'synthetic' is the right word. Arguably all of the requests made during prerendering are synthetic, but that's not what I'm trying to capture here. I want to know whether this is an internal |
This reverts commit 777d0cb.
these are probably from prerendering, and it is difficult to determine whether they are synthetic
Okay, the tests should be good to go now. I gave up on trying to detect whether a prerendering request has I do still think the |
Co-authored-by: Simon H <[email protected]>
Co-authored-by: Ben McCann <[email protected]>
Whee tests are failing. It looks like it's the |
If you merge master into this and increase the bug version by one then it should go away 🙏 |
I've merged master in, but I don't know what "increase the bug version by one" means. |
The patch version, sry. 10.20.4->10.20.5 in version.js or whatever the current version is . I can do it in a few minutes when I'm back at my laptop |
Oh it seems like Ben fixed it on master already |
Closes #10163. No test yet because I want to first get some feedback on whether this seems like the correct approach. I think
state.depth > 0
will tell us what we want. Also, if anyone has a better idea for a name thanevent.isSyntheticRequest
, I would love to hear it.Edit: I confirmed with Rich that this seemed like a sensible approach. I added tests for this, which I had to scale back a little in scope, because prerendering was making it hard to have another way of knowing whether this is a synthetic request.
Finally, I'm starting to really dislike the name 'synthetic request', because there are other types of requests (during prerendering) that are for pages, and thus aren't the type of request that this flag is for. I only want to be identifying requests that are sub-requests from
fetch
es during SSR. Heck if I have a good name for that though.Edit again: I think we've settled on
isSubRequest
, which isn't awful, at least.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.