You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/03-code-quality/06-polyfills/article.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ The JavaScript language steadily evolves. New proposals to the language appear r
5
5
6
6
Teams behind JavaScript engines have their own ideas about what to implement first. They may decide to implement proposals that are in draft and postpone things that are already in the spec, because they are less interesting or just harder to do.
7
7
8
-
So it's quite common for an engine to implement only the part of the standard.
8
+
So it's quite common for an engine to implement only part of the standard.
9
9
10
10
A good page to see the current state of support for language features is <https://kangax.github.io/compat-table/es6/> (it's big, we have a lot to study yet).
11
11
@@ -40,9 +40,9 @@ Now the rewritten code is suitable for older JavaScript engines.
40
40
41
41
Usually, a developer runs the transpiler on their own computer, and then deploys the transpiled code to the server.
42
42
43
-
Speaking of names, [Babel](https://babeljs.io) is one of the most prominent transpilers out there.
43
+
Speaking of names, [Babel](https://babeljs.io) is one of the most prominent transpilers out there.
44
44
45
-
Modern project build systems, such as [webpack](https://webpack.js.org/), provide means to run transpiler automatically on every code change, so it's very easy to integrate into development process.
45
+
Modern project build systems, such as [webpack](https://webpack.js.org/), provide a means to run a transpiler automatically on every code change, so it's very easy to integrate into the development process.
46
46
47
47
## Polyfills
48
48
@@ -69,9 +69,9 @@ if (!Math.trunc) { // if no such function
69
69
}
70
70
```
71
71
72
-
JavaScript is a highly dynamic language, scripts may add/modify any functions, even including built-in ones.
72
+
JavaScript is a highly dynamic language. Scripts may add/modify any function, even built-in ones.
73
73
74
-
Two interesting libraries of polyfills are:
74
+
Two interesting polyfill libraries are:
75
75
- [core js](https://github.com/zloirock/core-js) that supports a lot, allows to include only needed features.
76
76
- [polyfill.io](http://polyfill.io) service that provides a script with polyfills, depending on the features and user's browser.
77
77
@@ -80,9 +80,9 @@ Two interesting libraries of polyfills are:
80
80
81
81
In this chapter we'd like to motivate you to study modern and even "bleeding-edge" language features, even if they aren't yet well-supported by JavaScript engines.
82
82
83
-
Just don't forget to use transpiler (if using modern syntax or operators) and polyfills (to add functions that may be missing). And they'll ensure that the code works.
83
+
Just don't forget to use a transpiler (if using modern syntax or operators) and polyfills (to add functions that may be missing). They'll ensure that the code works.
84
84
85
-
For example, later when you're familiar with JavaScript, you can setup a code build system based on [webpack](https://webpack.js.org/) with [babel-loader](https://github.com/babel/babel-loader) plugin.
85
+
For example, later when you're familiar with JavaScript, you can setup a code build system based on [webpack](https://webpack.js.org/) with the [babel-loader](https://github.com/babel/babel-loader) plugin.
86
86
87
87
Good resources that show the current state of support for various features:
88
88
- <https://kangax.github.io/compat-table/es6/> - for pure JavaScript.
0 commit comments