Archive @babel/polyfill (#12541)

babel/babel-archive@701775cd9f
This commit is contained in:
Nicolò Ribaudo
2020-12-22 16:52:40 +01:00
committed by GitHub
parent 60138bea0d
commit d9dfd29ce8
13 changed files with 10 additions and 368 deletions

View File

@@ -38,7 +38,6 @@ Check out the [`babel-handbook`](https://github.com/thejameskyle/babel-handbook/
|--------|-------|------------|
| [`@babel/cli`](/packages/babel-cli) | [![npm](https://img.shields.io/npm/v/@babel/cli.svg?maxAge=3600)](https://www.npmjs.com/package/@babel/cli) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-cli)](https://david-dm.org/babel/babel?path=packages/babel-cli) |
| [`@babel/types`](/packages/babel-types) | [![npm](https://img.shields.io/npm/v/@babel/types.svg?maxAge=3600)](https://www.npmjs.com/package/@babel/types) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-types)](https://david-dm.org/babel/babel?path=packages/babel-types) |
| [`@babel/polyfill`](/packages/babel-polyfill) | [![npm](https://img.shields.io/npm/v/@babel/polyfill.svg?maxAge=3600)](https://www.npmjs.com/package/@babel/polyfill) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-polyfill)](https://david-dm.org/babel/babel?path=packages/babel-polyfill) |
| [`@babel/runtime`](/packages/babel-runtime) | [![npm](https://img.shields.io/npm/v/@babel/runtime.svg?maxAge=3600)](https://www.npmjs.com/package/@babel/runtime) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-runtime)](https://david-dm.org/babel/babel?path=packages/babel-runtime) |
| [`@babel/register`](/packages/babel-register) | [![npm](https://img.shields.io/npm/v/@babel/register.svg?maxAge=3600)](https://www.npmjs.com/package/@babel/register) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-register)](https://david-dm.org/babel/babel?path=packages/babel-register) |
| [`@babel/template`](/packages/babel-template) | [![npm](https://img.shields.io/npm/v/@babel/template.svg?maxAge=3600)](https://www.npmjs.com/package/@babel/template) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-template)](https://david-dm.org/babel/babel?path=packages/babel-template) |
@@ -47,7 +46,6 @@ Check out the [`babel-handbook`](https://github.com/thejameskyle/babel-handbook/
- [`@babel/cli`](/packages/babel-cli) is the CLI tool that runs `@babel/core` and helps with outputting to a directory, a file, stdout and more (also includes `@babel/node` cli). Check out the [docs](https://babeljs.io/docs/usage/cli/).
- [`@babel/types`](/packages/babel-types) is used to validate, build and change AST nodes.
- [`@babel/polyfill`](/packages/babel-polyfill) is [literally a wrapper](/packages/babel-polyfill/src/index.js) around [`core-js`](https://github.com/zloirock/core-js) and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime). Check out the [docs](https://babeljs.io/docs/usage/polyfill/).
- [`@babel/runtime`](/packages/babel-runtime) is similar to the polyfill except that it doesn't modify the global scope and is to be used with [`@babel/plugin-transform-runtime`](/packages/babel-plugin-transform-runtime) (usually in library/plugin code). Check out the [docs](https://babeljs.io/docs/plugins/transform-runtime/).
- [`@babel/register`](/packages/babel-register) is a way to automatically compile files with Babel on the fly by binding to Node.js `require`. Check out the [docs](http://babeljs.io/docs/usage/require/).
- [`@babel/template`](/packages/babel-template) is a helper function that allows constructing AST nodes from a string presentation of the code; this eliminates the tedium of using `@babel/types` for building AST nodes.

View File

@@ -1,3 +0,0 @@
src
test
*.log

View File

@@ -1,19 +0,0 @@
# @babel/polyfill
> Provides polyfills necessary for a full ES2015+ environment
See our website [@babel/polyfill](https://babeljs.io/docs/en/babel-polyfill) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20polyfill%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save @babel/polyfill
```
or using yarn:
```sh
yarn add @babel/polyfill
```

View File

@@ -1 +0,0 @@
require("./lib/noConflict");

View File

@@ -1,31 +0,0 @@
{
"name": "@babel/polyfill",
"version": "7.12.1",
"description": "Provides polyfills necessary for a full ES2015+ environment",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"scripts": {
"prepublishOnly": "cp dist/polyfill.min.js browser.js",
"postpublish": "rm browser.js"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-polyfill"
},
"main": "lib/index.js",
"dependencies": {
"core-js": "^2.6.5",
"regenerator-runtime": "^0.13.4"
},
"devDependencies": {
"browserify": "^16.5.2",
"bundle-collapser": "1.3.0",
"derequire": "2.1.1",
"uglify-js": "3.7.2"
}
}

View File

@@ -1,14 +0,0 @@
#!/bin/sh
set -ex
mkdir -p dist
yarn browserify lib/index.js \
--insert-global-vars 'global' \
--plugin bundle-collapser/plugin \
--plugin derequire/plugin \
>dist/polyfill.js
yarn uglifyjs dist/polyfill.js \
--compress keep_fnames,keep_fargs \
--mangle keep_fnames \
>dist/polyfill.min.js

View File

@@ -1,14 +0,0 @@
import "./noConflict";
import global from "core-js/library/fn/global";
if (global._babelPolyfill && typeof console !== "undefined" && console.warn) {
console.warn(
"@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended " +
"and may have consequences if different versions of the polyfills are applied sequentially. " +
"If you do need to load the polyfill more than once, use @babel/polyfill/noConflict " +
"instead to bypass the warning.",
);
}
global._babelPolyfill = true;

View File

@@ -1,20 +0,0 @@
// Cover all standardized ES6 APIs.
import "core-js/es6";
// Standard now
import "core-js/fn/array/includes";
import "core-js/fn/array/flat-map";
import "core-js/fn/string/pad-start";
import "core-js/fn/string/pad-end";
import "core-js/fn/string/trim-start";
import "core-js/fn/string/trim-end";
import "core-js/fn/symbol/async-iterator";
import "core-js/fn/object/get-own-property-descriptors";
import "core-js/fn/object/values";
import "core-js/fn/object/entries";
import "core-js/fn/promise/finally";
// Ensure that we polyfill ES6 compat for anything web-related, if it exists.
import "core-js/web";
import "regenerator-runtime/runtime";