← Back to release summary

ES Modules for shared workers ('module' type option)

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 83)
Intent stage
Prepare to ship

Summary

JavaScript will support modules in shared workers. Setting 'module' type by the constructor's type attribute, worker scripts are loaded as ES modules and the import statement is available on worker contexts.

Motivation

With this feature, web developers can more easily write programs in a composable way and share them among a page and workers.

Standards & signals

Docs: https://docs.google.com/document/d/1sSdYdSOLd5zvnNGeVNlBqfTZs_VRPIrrigV3SlMnWjg/edit?usp=sharing

Explainers: https://html.spec.whatwg.org/multipage/workers.html#shared-workers-and-the-sharedworker-interface

View on chromestatus.com