Conversation
resolve #22
Contributor
|
校对认领 |
Member
| 这就是 Babel 来拯救的东西。 | ||
|
|
||
| [Babel](https://babeljs.io) is a [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler). It rewrites modern JavaScript code into the previous standard. | ||
| [Babel](https://babeljs.io) 是一个 [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler)。它将新一代的 JavaScript 代码写入前一个标准中。 |
Contributor
There was a problem hiding this comment.
[它将新一代的 JavaScript 代码写入前一个标准中] => [它将现代的 JavaScript 代码转化为上一代的标准形式]
| transpiler 会重写代码,因此现有的语法特性都被覆盖了。但是对于新特性我们需要写一个特殊的脚本来实现它们。JavaScript 是一个高度动态化的语言。脚本可能不仅是添加一些新特性,还会修改一些内置特性,以便它们根据现代标准表现。 | ||
|
|
||
| There's a term "polyfill" for scripts that "fill in" the gap and add missing implementations. | ||
| 脚本有一个术语 “polyfill” 表示用来“填补”缺口并添加缺少的实现。 |
Contributor
There was a problem hiding this comment.
[以便它们根据现代标准表现。] => [以便于它们表现得符合现代标准]
| If we orient towards modern engines and do not use features except those supported everywhere, then we don't need to use Babel. | ||
|
|
||
| ## Examples in the tutorial | ||
| 如果我们朝着现代引擎进发,并且不使用那些除了任何地方都支持的特性之外的特性,那么我们就不需要使用 Babel。 |
Contributor
There was a problem hiding this comment.
[如果我们朝着现代引擎进发] => [如果我们的目标是现代引擎]
Contributor
There was a problem hiding this comment.
[并且不使用那些除了任何地方都支持的特性之外的特性] => [并且整个项目不使用其他地方不支持的特性]
leviding
reviewed
Apr 24, 2018
| Examples that use modern JS will work only if your browser supports it. | ||
| ```` | ||
| 只有你的浏览器支持它才会工作的现代 JS 例子: | ||
| ``` |
| 1. 第一,transpiler 程序,就是重写代码的那个。开发者在他自己的电脑上运行它。它将代码重写到旧的标准中。然后将代码交付给用户的网站。诸如 [webpack](http://webpack.github.io/) 或 [brunch](http://brunch.io/) 这样的现代项目构建系统提供了每当代码改变都会自动运行 transpiler 的方法,因此我们这边没有任何的时间损失。 | ||
|
|
||
| 2. Second, the polyfill. | ||
| 2. 第二,polyfill. |
| # Polyfills | ||
|
|
||
| The JavaScript language steadily evolves. New proposals to the language appear regularly, they are analyzed and, if considered worthy, are appended to the list at <https://tc39.github.io/ecma262/> and then progress to the [specification](http://www.ecma-international.org/publications/standards/Ecma-262.htm). | ||
| JavaScript 语言在稳步发展。对语言的新提议也会定期出现,它们会被分析讨论,如果认为有价值,就会被加入到 <https://tc39.github.io/ecma262/> 的列表中,然后进入 [规范](http://www.ecma-international.org/publications/standards/Ecma-262.htm)。 |
Author
|
@leviding Done. |
leviding
approved these changes
Apr 24, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolve #22