window.System 对象是 JavaScript ES6 的必需部分吗
Is the window.System object a required part of JavaScript ES6
不久前我读到 System object 是 es6 模块的必需部分,基本上是一个新的 Object 类型,具有模块加载所需的所有语义。
这是严格的 es6 要求吗?它似乎不在最新规范中。
似乎 API 从 ES2015 中删除,但最终会实现。
我找到了 this repository on GitHub, which talks a bit about the Module Loader API, but if you look at the issues, the first one is named "Programmatic module loader API Specification?"。它包括关于该主题的对话。
第一条评论是这样说的:
The module loader API was actually removed from ES2015; it should
probably just be removed from this repo.
这也是一个有趣的评论:
Worse, there's no way for import to even load modules, since it
doesn't have a loader to consult.
Eventually there will be a loader spec, but until then ES2015 just
specifies the syntax, and the syntax does nothing. (That is, the spec
contains points where it's like "consult the host environment to do
something useful here.")
发表上述两条评论的人,链接到这些注释作为参考:
https://github.com/tc39/tc39-notes/blob/master/es6/2014-09/sept-25.md#loader-pipeline
Conclusion/Resolution
Loader pipeline goes into a separate spec: living document that deals
with integration
全局 System
对象不是 ES2015 的一部分。
模块加载 API,其中包括 System
,已从 Draft 28, October 2014 中的 ES2015 规范中删除。
模块加载现在由单独的 WhatWG loader spec.
跟踪
在 https://github.com/ModuleLoader/es6-module-loader 的草案 27(包括 System
)中指定了模块加载器 API 的实现。
不久前我读到 System object 是 es6 模块的必需部分,基本上是一个新的 Object 类型,具有模块加载所需的所有语义。
这是严格的 es6 要求吗?它似乎不在最新规范中。
似乎 API 从 ES2015 中删除,但最终会实现。
我找到了 this repository on GitHub, which talks a bit about the Module Loader API, but if you look at the issues, the first one is named "Programmatic module loader API Specification?"。它包括关于该主题的对话。
第一条评论是这样说的:
The module loader API was actually removed from ES2015; it should probably just be removed from this repo.
这也是一个有趣的评论:
Worse, there's no way for import to even load modules, since it doesn't have a loader to consult.
Eventually there will be a loader spec, but until then ES2015 just specifies the syntax, and the syntax does nothing. (That is, the spec contains points where it's like "consult the host environment to do something useful here.")
发表上述两条评论的人,链接到这些注释作为参考:
https://github.com/tc39/tc39-notes/blob/master/es6/2014-09/sept-25.md#loader-pipeline
Conclusion/Resolution
Loader pipeline goes into a separate spec: living document that deals with integration
全局 System
对象不是 ES2015 的一部分。
模块加载 API,其中包括 System
,已从 Draft 28, October 2014 中的 ES2015 规范中删除。
模块加载现在由单独的 WhatWG loader spec.
跟踪在 https://github.com/ModuleLoader/es6-module-loader 的草案 27(包括 System
)中指定了模块加载器 API 的实现。