Open Bug 1360870 Opened 7 years ago Updated 2 months ago

Implement "module" service workers

Categories

(Core :: DOM: Service Workers, enhancement, P3)

enhancement

Tracking

()

ASSIGNED

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
Ben, feel free to comment if you think this should be prioritized and need resource to work on it.
Priority: -- → P3

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.

Depends on: 1247687
Blocks: 1775574
Severity: normal → S3

Depends on D156103

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.

Duplicate of this bug: 1775574
No longer duplicate of this bug: 1775574
Blocks: 1807919

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.

Assignee: nobody → bugmail
Status: NEW → ASSIGNED
Blocks: 1694377
Duplicate of this bug: 1884257
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: