JavaScript+XML that supports Firefox and IE for data paging

2023-01-23   ES  

babel-polyfill

Babel-Polyfill will simulate an ES2015+environment in the application, so you can use Babel-Polyfill to use built-in objects such as Promise and Weakmap, static methods such as array.from and object.assign. And the Generator function (need to provide Babel-Plugin-Transform-Regnerator plug-in). In general, Polyfill has modified the global scope, under the browser is Window, and the global is under node.

Babel-Polyfill is mainly composed of two parts, Core-JS and Regnerator Runtime.

Core-JS: Provides the simulation implementation of various objects and methods defined in the specifications such as ES5, ES6, ES7.
Regnerator: Provide general support, if the general use of the general and async function in the application code is used.

Introduction to Babel-Polyfill will become very large after full package.

babel-plugin-transform-runtime

Babel-Plugin-Transform-Runtime mainly did three things:

  1. When you use the Generator/Async function, automatically introduce Babel-Runtime/Regnerator (running with regenerator without polluting the current environment).
  2. Automatically introduce Babel-Runtime/Core-JS and map ES6 static methods and built-in plug-ins (the function of Polyfill and has no global pollution,but the instance method cannot be used normally, such as “FOOBAR” .inCludes (“FOO”) )。
  3. Remove the Babel Helper of Neilian and use the module Babel-Runtime/Helpers instead (extract the code of the Babel conversion syntax).
{
  "plugins": [
    ["transform-runtime", {
      "helpers": true, // default
      "polyfill": true, // default
      "regenerator": true, // defalut
      "moduleName": "babel-runtime" // default
    }]
  ]
}

No additional configuration is to use the default configuration, so it is possible. So Babel-Plugin-Transform-Runtime does not pollute the global environment, which is generally used in the Node packaged by Webpack. Because of this, Transform-Runtime is widely used in third-party libraries.

Install Babel-Plugin-Transform-Runtime back to install Babel-Runtime by default (all the help functions are in this package).

Reference:

https://babeljs.io/docs/en/babel-plugin-transform-runtime
https://babeljs.io/docs/en/babel-plugin-transform-runtime#technical-details

https://www.cnblogs.com/chyingp/archive/2018/06/01/understanding-babel-polyfill.html
https://www.cnblogs.com/JRliu/p/8280055.html

source

Related Posts

ubuntu network card ENP0S3 is changed to ETH0

CSS Internal Code Style Format Style

TREEMAP is sorted according to Key and Value

Request object GetAttribute () and GetParameter () methods

JavaScript+XML that supports Firefox and IE for data paging

Random Posts

POJ3006, Dirichlet’s theorem on Arithmetic Progressions, Di Likrey theorem.

How to operate the SQLite3 database through the command line

Cloud computing general learning

OPENCV MAT format data access .at

Lesson 6: emit GUI element Dream