Unsupported operation: dart:isolate is not supported on dart4web

dart2 sdk web端不再支持对 isolate 的支持。

对于javascript玩家推荐使用 Web Workers 替换。API不支持多端统一这让人太不爽了,如果你有什么方法解决,求评论告知,万分感谢!




As part of our work to ship Dart 2, we are removing support in our web tools for dart:mirrors and dart:isolate. You will see this change in dart2js and the Dart Dev Compiler in the next few weeks on the Dart SDK dev channel.
Note: the Dart VM will continue to fully support both libraries.
dart:isolate - This library was an attempt to provide a single API that provides common concurrency functionality across Dart’s web and native platforms. While useful in some cases, most users found the isolate API limiting compared to the Web Workers API. The infrastructure for supporting isolates also adds substantial overhead when compiling to JavaScript. In the future, you should use Web Workers to access concurrency on the web.
dart:mirrors - This library provides a runtime reflection API. To provide a full fidelity experience, Dart JavaScript compilers included a substantial amount of type information while also losing the ability to do precise tree-shaking. This leads to dramatically increased output size and execution time. We recommend web developers use code generation using tools like package:build and package:source_gen. These are the tools used by AngularDart and package:json_serializable.
If you have questions about this change, please post on the Dart discussion group.

For more news and information, visit https://plus.google.com/+dartlang
To join the conversation, visit https://groups.google.com/a/dartlang.org/


作为发布Dart 2的工作的一部分,我们正在删除Web工具中对dart:mirrors和dart:isolate的支持。在接下来的几周内,您将在Dart SDK开发人员频道上看到dart2js和Dart Dev Compiler中的这一更改。
注意:Dart VM将继续完全支持两个库。
详细信息:dart:isolate-该库试图提供一个API,该API在Dart的Web和本机平台上提供通用的并发功能。尽管在某些情况下很有用,但大多数用户发现与Web Workers API相比,隔离API的限制。支持隔离的基础结构在编译为JavaScript时也增加了相当大的开销。将来,您应该使用Web Workers来访问Web上的并发性。
dart:mirrors-该库提供了运行时反射API。为了提供完整的保真度体验,Dart JavaScript编译器包含了大量的类型信息,同时也失去了进行精确摇树的能力。这导致输出大小和执行时间大大增加。我们建议Web开发人员使用诸如package:build和package:source_gen之类的工具来生成代码。这些是AngularDart和package:json_serializable使用的工具。

有关更多新闻和信息,请访问 https://plus.google.com/+dartlang
加入对话,请访问 https://groups.google.com/a/dartlang.org/

©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页