Implement "module" service workers
Categories
(Core :: DOM: Service Workers, enhancement, P3)
Tracking
()
People
(Reporter: bkelly, Assigned: asuth)
References
(Blocks 4 open bugs)
Details
(Keywords: dev-doc-needed)
Attachments
(1 file)
The spec has support for loading service workers built on modules instead of classic importScripts(). See things that reference: https://w3c.github.io/ServiceWorker/#dfn-type
Comment 1•7 years ago
|
||
Ben, feel free to comment if you think this should be prioritized and need resource to work on it.
Updated•7 years ago
|
Comment 3•5 years ago
|
||
It might be helpful to error and link to this bug when users attempt to navigator.serviceWorker.register(url, {type: 'module'}) to make it more clear that the implementation of this is not complete. This is Chrome's current behaviour.
Updated•2 years ago
|
Comment 4•1 year ago
|
||
Depends on D156103
Comment 5•1 year ago
|
||
I'll update the in progress patch, but here is the current state:
the patch largely works, however we are breaking certain constraints: Specifically,
- we need to disable top level await for service workers via a flag that is passed to spidermonkey
- we need to disable dynamic import once it lands.
Otherwise we are passing a good chunk of the tests here.
Assignee | ||
Comment 7•8 months ago
|
||
It seems like this shouldn't be too hard to do, going to take the bug although this will not be immediate and it may end up making sense to fix bug 1808685 as part of our tech debt cleanups first. (Note that the landed patch was a disabling of a prior attempt to do that, not a fix.)
(In reply to Yulia Startsev [:yulia] | Back in Oct. from comment #5)
I'll update the in progress patch, but here is the current state:
the patch largely works, however we are breaking certain constraints: Specifically,
- we need to disable top level await for service workers via a flag that is passed to spidermonkey
Here's the CompileOptions flag to set.
- we need to disable dynamic import once it lands.
Yulia already implemented the check to bail out in this case, although it's currently after we do the work to create the dynamic loader, which is weird, but the initial landing state was that way per the diff for that section.
Description
•