-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
No dynamic import in service worker #27699
Conversation
@domenic you might be interested in this, as it's a pattern that could be extended to other module worker types |
@annevk feedback addressed, cheers! |
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.
Looks good modulo that seemingly fundamental problem. I don't feel comfortable reviewing the infrastructure addition. I'll leave that to @jgraham and @stephenmcgruer.
The runs at e.g. https://github.com/web-platform-tests/wpt/pull/27699/checks?check_run_id=1936236036 show the new infrastructure isn't working right on CI---maybe that's as expected though. The runs at https://github.com/web-platform-tests/wpt/pull/27699/checks?check_run_id=1936236067 and https://github.com/web-platform-tests/wpt/pull/27699/checks?check_run_id=1936051438 show that Firefox and Safari do support dynamic import, it seems. |
@domenic those results look expected to me. No browsers support module service workers right now. And yes, dynamic import works (but not as intended) in Firefox and Safari. |
I've gone ahead and added support for dedicated/shared worker modules too. May as well do the lot. |
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.
Basically I think this implementation is reasonable; just one comment.
tools/serve/serve.py
Outdated
if key == "title": | ||
value = value.replace("\\", "\\\\").replace('"', '\\"') | ||
return 'self.META_TITLE = "%s";' % value | ||
return None | ||
|
||
|
||
class AnyWorkerModuleHandler(AnyWorkerHandler): |
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.
I feel like I'd prefer if this and AnyWorkerHandler
both inherited from a common base rather than having this one override parts of the behaviour in the other concrete class.
@jgraham heh, I forgot that Python auto-exports. I've renamed the other references. |
@jgraham the failures seem unrelated to me (webrtc?), but I'm not really familiar with them |
OK, I'm pretty sure I've seen that test failure in unrelated PRs, so it's probably broken on master. Will investigate. |
Ah @stephenmcgruer already fixed it in #27744 |
@jgraham thanks! |
@jgraham this PR adds a new "service worker module" handler type, but I'm not confident I've done it correctly. The intent is to allow
.any.serviceworker-module.html
to run the equivalent.any.js
in a service worker with type 'module'.Part of whatwg/html#6395 and w3c/ServiceWorker#1356