-
Notifications
You must be signed in to change notification settings - Fork 131
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
Remove XMLHttpRequest from ServiceWorkerGlobalScope #19
Comments
So the idea is to not expose XMLHttpRequest in new contexts in order to encourage usage of |
Sounds good |
I was half expecting push back on this. Won't it be annoying that you can't reuse some existing library code because it uses XHR? From https://code.google.com/p/chromium/issues/detail?id=395931 it sounds like part of the motivation was to get rid of the sync mode, but is that a bigger problem for service workers than other kinds of workers? |
The pain in implementation would be small if we're to keep only async XHR, I guess. Not sure if there're works such that:
|
I was actually expecting us to simply forbid synchronous XMLHttpRequest in SW, but leave it working otherwise. However, since What about |
Actually To me, throwing @coonsta and @jakearchibald, thoughts? |
I'm sorry that we didn't file a spec bug and link to it from that patch; we should always do that. @slightlyoff is a better person to ask about exposing XHR; @kinu is a better person to ask for implementer feedback from Chromium/Blink. |
Ping! |
Ping again @coonsta, what do you think we should do here? |
Only shipping async XHR in SW makes sense to me and I don't feel it's too difficult to implement in Chromium/Blink. I'm not really sure if exposing XHR is still awaited since SW was shipped without XHR sometime ago and now we have fetch, but having it may make it easier to use JS libraries in SW I guess. |
I haven't heard users complain about lack of XHR in Chrome's SW implementation yet, so maybe there's no need to add async XHR now. We can always add it later if needed. |
OK, so I guess let's change the spec instead. |
Thank you folks! |
whatwg/xhr#19 BUG=395931 [email protected] Review URL: https://codereview.chromium.org/1310543002 git-svn-id: svn://svn.chromium.org/blink/trunk@201597 bbb929c8-8fbe-4397-9dbb-9b2b20218538
With cancellation and timeouts (still) missing from fetch, would it be appropriate to revisit |
Cancellation is making progress. We have experimental support for it in FF55 if you set dom.fetchController.enabled to true. |
Let me get this straight - The option to use XHR in service workers was removed because one guy thinks it's "redundant", and is partial to fetch? Options be damned! |
Well, we also want folks to move to |
fetch() eventually added an abort, but you still have to cobble together your own timeout. And the abort is quite a bit clunkier than what it takes for an XHR. I hope in the future you'll make sure your API's are a superset (and preferably cleaner) before forcing the sunset of old API's. |
I noticed a discrepancy between the spec IDL and Blink, that comes down to this bug:
https://code.google.com/p/chromium/issues/detail?id=395931
If this makes sense, I suggest replacing
Exposed=(Window,Worker)
withExposed=(Window,DedicatedWorker,SharedWorker)
in the spec too.CC @coonsta and @jakearchibald
The text was updated successfully, but these errors were encountered: