-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Fetch-Based API] Limiting the scope of pending requests #72
Comments
@yoavweiss @clelland @annevk Could you please take a look? |
^^ @noamr |
See this comment. I think that it's OK if we define that deferred fetches have to be keepalive. The rest are perhaps not that necessary? We can also mandate GET/POST but I'm not sure that's necessary either. |
Do do you prefer to limit the request? Just throwing TypeError? |
Yes like keepalives. Remove the responsibility of having to auto flush partial beacons while the doc is alive from fetch. Each origin manages its own partial beacon and if the quota is exceeded it's a network error. This would meet the requirement of "the minimal additions to fetch to make the use case possible" |
Hey @mingyc, sorry for not having been part of the earlier discussions, but when you say "non-goal" it would really help if that came with a link. It's not clear to me why we would not allow some or all of these things to be as expressive as |
It comes from the motivation for this proposal, that we want to provide an alternative to calling |
At some point Aside from it seeming harder to target a subset of the API, I'm also worried that a couple years from now we'd be in the same boat as we were with |
I think it may make sense to currently limit implemented support to GET and POST, while still enabling future extension for other methods, if that becomes required. For that, we'd need to think of a way for developers to recognize lack of support in the future (e.g. by rejecting the promise with a NotSupportedError DOMException for not-yet-supported methods). |
I guess I don't really understand why we would limit them? |
My guess is that it can reduce initial implementation complexity, and is not something that's currently required by the potential users of the API. |
I think for WebKit it would likely end up being more complex. And if it comes with feature detection requirements there are also API complexity costs. |
I don't know about the details when the API was released. But just looking at our recent statistics, Given that, I think we can justify supporting a general request is not our goal? |
That's a surprising statistic. Would love to see HTTPArchive crawl data as to why that is the case. To the topic at hand, |
Could you suggest how we should proceed with this (fetch-based) proposal? |
|
Context: #70 and #71
Even if moving toward a fetch-based design, this proposal does still not focus on supporting every type of requests as beacons.
For example, it's non-goal to support most of HTTP methods, i.e. being able to defer an
OPTION
orTRACE
until page destroyed. It aldo does not make sense to allow settingkeepalive: false
for a deferred request.We should look into fields of RequestInit and decide whether
deferSend
should throw errors on some of their values:keepalive
: must betrue
.{deferSend: new DeferSend(), keepalive: false}
conflicts with each other.url
: supported.method
: one ofGET
orPOST
.headers
: supported.body
: only supported forPOST
.signal
: supported.credentials
: enforcingsame-origin
to be consistent.cache
: not supported?redirect
: enforcingfollow
?referrer
: enforcing same-origin URL?referrerPolicy
: enforcingsame-origin
?integrity
: not supported?priority
: enforcingauto
?As shown above, at least
keepalive: true
andmethod
need to be enforced.If going with this route, can we also consider the PendingRequest API approach that proposes a subclass of
Request
to enforce the above?The text was updated successfully, but these errors were encountered: