Chrome v83 enables JS module support for SharedWorkers → Starting a new era for multi Brows...

栏目: IT技术 · 发布时间: 5年前

内容简介:Now you might be wondering: “So, what does this mean?”Since the release of Chrome v80, JS module support for “normal” workers is in place:

https://www.chromestatus.com/feature/5169440012369920

Chrome v83 enables JS module support for SharedWorkers → Starting a new era for multi Brows...

A big thank you at the Blink Team for making this happen!

Now you might be wondering: “So, what does this mean?”

Since the release of Chrome v80, JS module support for “normal” workers is in place:

const worker = new Worker(filePath, {type: 'module'});

Now with v83, you can do this:

const sharedWorker = new SharedWorker(filePath, {type: 'module'});

Meaning: you can now use ES6+ classes & modules for your SharedWorkers, allowing us to create solid architectures for complex use cases.

2. How is the support in Firefox and Safari?

Truth to be told: not there yet.

Both, Firefox & Safari do not even support JS modules for non shared workers yet.

const worker = new Worker(filePath, {type: 'module'});

This will just break at the first (non dynamic) import statement.

(Opened 4 years ago)

(Opened 4 years ago)

In case you do care about Firefox & Safari not completely falling behind, please add some weight to the tickets. This should improve the priority.

What is neo.mjs?

neo.mjs is a webworkers driven UI framework I am working on. The first public release was on November 23, 2019.

The entire code base as well as all demo Apps are using the MIT license.

In short: neo.mjs is using 4 threads by default:

  1. Main (top level)
  2. App
  3. Data
  4. VDom

The main thread only creates the 3 workers, delegates virtualised UI events to the App worker and manipulates the real DOM (applying delta updates).

You can enhance Main using main thread addons, e.g. in case you want to work with external libraries like AmCharts or MapboxGL, which have to run inside the main thread.

Most parts of the framework as well as the Apps you build with it run inside the App worker.

This leaves the main thread mostly idle, leading to a blazing fast rendering performance.

To really get the idea, let us take a quick look at the Covid Dashboard Demo App without using SharedWorkers first:


以上所述就是小编给大家介绍的《Chrome v83 enables JS module support for SharedWorkers → Starting a new era for multi Brows...》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

重来2

重来2

[美] 贾森·弗里德、[美] 戴维·海涅迈尔·汉森 / 苏西 / 中信出版社 / 2014-4-8 / 39.00元

“不再需要办公室”,这不仅仅是未来才有的事——它已经发生了。现在,轮到你迈开脚步,跟上时代的步伐了。 上百万的员工和成千上万的企业已经发现了远程工作的乐趣和好处。然而,远程工作方式还没有成为常见的选择。事实上,远程工作的技术手段都已齐备。还没有升级换代的,是人们的思想。 这本书的目的就是帮你把想法升级换代。作者会向你展示远程工作的诸多好处:可以找到最优秀的人才,从摧残灵魂的通勤路上解脱......一起来看看 《重来2》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具