Merge branch 'master' into 2.0
This commit is contained in:
commit
83b85a3609
2
experimental/babel-preset-env/.gitignore
vendored
2
experimental/babel-preset-env/.gitignore
vendored
@ -6,3 +6,5 @@ test/tmp
|
||||
*.log
|
||||
.vscode
|
||||
.nyc_output
|
||||
tmp
|
||||
babel-preset-env-*.tgz
|
||||
|
||||
@ -5,5 +5,7 @@ scripts
|
||||
.eslintignore
|
||||
.travis.yml
|
||||
codecov.yml
|
||||
data/*.js
|
||||
yarn.lock
|
||||
.nyc_output
|
||||
.vscode
|
||||
babel-preset-env-*.tgz
|
||||
|
||||
@ -26,7 +26,8 @@ install:
|
||||
script:
|
||||
- 'if [ -n "${LINT-}" ]; then $PKG_CMD run lint ; fi'
|
||||
- 'if [ -n "${DATA_CHECK-}" ]; then $PKG_CMD run build-data -- --check ; fi'
|
||||
- 'if [ -z "${LINT-}" ] && [ -z "${DATA_CHECK-}" ]; then $PKG_CMD run test-ci ; fi'
|
||||
- 'if [ -n "${SMOKE_TEST-}" ]; then node scripts/smoke-test.js ; fi'
|
||||
- 'if [ -z "${LINT-}" ] && [ -z "${DATA_CHECK-}" ] && [ -z "${SMOKE_TEST-}" ]; then $PKG_CMD run test-ci ; fi'
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
@ -34,4 +35,7 @@ matrix:
|
||||
env: LINT=true PKG_CMD="npm"
|
||||
- node_js: "node"
|
||||
env: DATA_CHECK=true PKG_CMD="npm"
|
||||
after_success: 'if [ -z "${LINT-}" ] && [ -z "${DATA_CHECK-}" ]; then npm run coverage-ci ; fi'
|
||||
- node_js: "node"
|
||||
env: SMOKE_TEST=true PKG_CMD="npm"
|
||||
|
||||
after_success: 'if [ -z "${LINT-}" ] && [ -z "${DATA_CHECK-}" && [ -z "${SMOKE_TEST-}" ]; then npm run coverage-ci ; fi'
|
||||
|
||||
@ -1,5 +1,35 @@
|
||||
# Changelog
|
||||
|
||||
## v1.3.0 (2017-03-30)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Add check for ArrayBuffer[Symbol.species] ([#233](https://github.com/babel/babel-preset-env/pull/233)) (@existentialism)
|
||||
|
||||
We now properly check for `Symbol.species` support in ArrayBuffer and include the
|
||||
polyfill if necessary. This should, as a side effect, fix ArrayBuffer-related
|
||||
errors on IE9.
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
- Fill data with electron as a target. ([#229](https://github.com/babel/babel-preset-env/pull/229)) (@yavorsky)
|
||||
|
||||
We've simplified things by adding `electron` as a target instead of doing a bunch of
|
||||
things at runtime. Electron targets should now also be displayed in the debug output.
|
||||
|
||||
- separate default builtins for platforms ([#226](https://github.com/babel/babel-preset-env/pull/226)) (@restrry)
|
||||
|
||||
If you are targeting the `node` environment exclusively, the always-included web polyfills
|
||||
(like `dom.iterable`, and a few others) will now no longer be included.
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
* remove deprecated projects ([#223](https://github.com/babel/babel-preset-env/pull/223)) [skip ci] (@stevemao)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
* npmignore: Add related to build data and codecov. ([#216](https://github.com/babel/babel-preset-env/pull/216)) (@yavorsky)
|
||||
|
||||
## v1.2.2 (2017-03-14)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
@ -337,7 +337,7 @@ exports.A = A;
|
||||
}
|
||||
```
|
||||
|
||||
**stdin**
|
||||
**stdout**
|
||||
|
||||
```sh
|
||||
Using targets:
|
||||
|
||||
@ -25,11 +25,11 @@ const typedArrayMethods = [
|
||||
"typed arrays / %TypedArray%.prototype.values",
|
||||
"typed arrays / %TypedArray%.prototype.entries",
|
||||
"typed arrays / %TypedArray%.prototype[Symbol.iterator]",
|
||||
"typed arrays / %TypedArray%[Symbol.species]"
|
||||
"typed arrays / %TypedArray%[Symbol.species]",
|
||||
];
|
||||
|
||||
const es2015 = {
|
||||
// "es6.typed/array-buffer": "typed arrays / ",
|
||||
"es6.typed.array-buffer": "typed arrays / ArrayBuffer[Symbol.species]",
|
||||
"es6.typed.data-view": "typed arrays / DataView",
|
||||
"es6.typed.int8-array": {
|
||||
features: ["typed arrays / Int8Array"].concat(typedArrayMethods)
|
||||
|
||||
@ -1,4 +1,14 @@
|
||||
{
|
||||
"es6.typed.array-buffer": {
|
||||
"chrome": 51,
|
||||
"edge": 13,
|
||||
"firefox": 48,
|
||||
"safari": 10,
|
||||
"node": 6.5,
|
||||
"ios": 10,
|
||||
"opera": 38,
|
||||
"electron": 1.2
|
||||
},
|
||||
"es6.typed.data-view": {
|
||||
"chrome": 5,
|
||||
"opera": 12,
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
"format": "prettier --trailing-comma all --write \"src/*.js\" \"test/*.js\" && prettier --trailing-comma es5 --write \"scripts/*.js\"",
|
||||
"lint": "eslint .",
|
||||
"precommit": "lint-staged",
|
||||
"prepublish": "npm run build",
|
||||
"test": "npm run build && npm run test-only",
|
||||
"test-ci": "nyc npm run test",
|
||||
"test-only": "mocha ./test --compilers js:babel-register -t 10000"
|
||||
|
||||
70
experimental/babel-preset-env/scripts/smoke-test.js
Executable file
70
experimental/babel-preset-env/scripts/smoke-test.js
Executable file
@ -0,0 +1,70 @@
|
||||
const fs = require("fs-extra");
|
||||
const execSync = require("child_process").execSync;
|
||||
const path = require("path");
|
||||
const pkg = require("../package.json");
|
||||
|
||||
let errorOccurred = false;
|
||||
|
||||
const tempFolderPath = path.join(__dirname, "../tmp");
|
||||
const packPath = path.join(__dirname, `../babel-preset-env-${pkg.version}.tgz`);
|
||||
|
||||
try {
|
||||
console.log("Creating package");
|
||||
execSync("npm pack");
|
||||
|
||||
console.log("Setting up smoke test");
|
||||
fs.ensureDir(tempFolderPath);
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(tempFolderPath, "package.json"),
|
||||
`
|
||||
{
|
||||
"name": "babel-preset-env-smoke-test",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"build": "babel index.js --out-file index.es6"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-cli": "*",
|
||||
"babel-preset-env": "${packPath}"
|
||||
}
|
||||
}
|
||||
`
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(tempFolderPath, ".babelrc"),
|
||||
`
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
modules: false,
|
||||
useBuiltIns: true
|
||||
}]
|
||||
]
|
||||
}
|
||||
`
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(tempFolderPath, "index.js"),
|
||||
`
|
||||
import "babel-polyfill";
|
||||
1 ** 2;
|
||||
`
|
||||
);
|
||||
|
||||
process.chdir(tempFolderPath);
|
||||
|
||||
console.log("Running smoke test");
|
||||
execSync("npm install && npm run build");
|
||||
} catch (e) {
|
||||
errorOccurred = true;
|
||||
}
|
||||
|
||||
console.log("Cleaning up");
|
||||
fs.removeSync(tempFolderPath);
|
||||
fs.removeSync(packPath);
|
||||
|
||||
process.exit(errorOccurred ? 1 : 0);
|
||||
@ -35,6 +35,7 @@ Using plugins:
|
||||
syntax-trailing-function-commas {"chrome":54,"ie":10,"node":6}
|
||||
|
||||
Using polyfills:
|
||||
es6.typed.array-buffer {"ie":10,"node":6}
|
||||
es6.typed.int8-array {"ie":10,"node":6}
|
||||
es6.typed.uint8-array {"ie":10,"node":6}
|
||||
es6.typed.uint8-clamped-array {"ie":10,"node":6}
|
||||
|
||||
@ -22,6 +22,7 @@ Using plugins:
|
||||
syntax-trailing-function-commas {"electron":0.36}
|
||||
|
||||
Using polyfills:
|
||||
es6.typed.array-buffer {"electron":0.36}
|
||||
es6.typed.int8-array {"electron":0.36}
|
||||
es6.typed.uint8-array {"electron":0.36}
|
||||
es6.typed.uint8-clamped-array {"electron":0.36}
|
||||
|
||||
@ -38,6 +38,7 @@ Using plugins:
|
||||
syntax-trailing-function-commas {"chrome":54,"edge":13,"firefox":49,"ie":10,"ios":9,"safari":7}
|
||||
|
||||
Using polyfills:
|
||||
es6.typed.array-buffer {"ie":10,"ios":9,"safari":7}
|
||||
es6.typed.int8-array {"ie":10,"ios":9,"safari":7}
|
||||
es6.typed.uint8-array {"ie":10,"ios":9,"safari":7}
|
||||
es6.typed.uint8-clamped-array {"ie":10,"ios":9,"safari":7}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import "core-js/modules/es6.typed.array-buffer";
|
||||
import "core-js/modules/es6.typed.data-view";
|
||||
import "core-js/modules/es6.typed.int8-array";
|
||||
import "core-js/modules/es6.typed.uint8-array";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import "core-js/modules/es6.typed.array-buffer";
|
||||
import "core-js/modules/es6.typed.int8-array";
|
||||
import "core-js/modules/es6.typed.uint8-array";
|
||||
import "core-js/modules/es6.typed.uint8-clamped-array";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import "core-js/modules/es6.typed.array-buffer";
|
||||
import "core-js/modules/es6.typed.int8-array";
|
||||
import "core-js/modules/es6.typed.uint8-array";
|
||||
import "core-js/modules/es6.typed.uint8-clamped-array";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import "core-js/modules/es6.typed.array-buffer";
|
||||
import "core-js/modules/es6.typed.data-view";
|
||||
import "core-js/modules/es6.typed.int8-array";
|
||||
import "core-js/modules/es6.typed.uint8-array";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import "core-js/modules/es6.typed.array-buffer";
|
||||
import "core-js/modules/es6.typed.int8-array";
|
||||
import "core-js/modules/es6.typed.uint8-array";
|
||||
import "core-js/modules/es6.typed.uint8-clamped-array";
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import "core-js/modules/es6.typed.array-buffer";
|
||||
import "core-js/modules/es6.typed.int8-array";
|
||||
import "core-js/modules/es6.typed.uint8-array";
|
||||
import "core-js/modules/es6.typed.uint8-clamped-array";
|
||||
|
||||
1
experimental/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/actual.js
vendored
Normal file
1
experimental/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import "babel-polyfill";
|
||||
87
experimental/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/expected.js
vendored
Normal file
87
experimental/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/expected.js
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
import "core-js/modules/es6.typed.array-buffer";
|
||||
import "core-js/modules/es6.typed.data-view";
|
||||
import "core-js/modules/es6.typed.int8-array";
|
||||
import "core-js/modules/es6.typed.uint8-array";
|
||||
import "core-js/modules/es6.typed.uint8-clamped-array";
|
||||
import "core-js/modules/es6.typed.int16-array";
|
||||
import "core-js/modules/es6.typed.uint16-array";
|
||||
import "core-js/modules/es6.typed.int32-array";
|
||||
import "core-js/modules/es6.typed.uint32-array";
|
||||
import "core-js/modules/es6.typed.float32-array";
|
||||
import "core-js/modules/es6.typed.float64-array";
|
||||
import "core-js/modules/es6.map";
|
||||
import "core-js/modules/es6.set";
|
||||
import "core-js/modules/es6.weak-map";
|
||||
import "core-js/modules/es6.weak-set";
|
||||
import "core-js/modules/es6.reflect.apply";
|
||||
import "core-js/modules/es6.reflect.construct";
|
||||
import "core-js/modules/es6.reflect.define-property";
|
||||
import "core-js/modules/es6.reflect.delete-property";
|
||||
import "core-js/modules/es6.reflect.get";
|
||||
import "core-js/modules/es6.reflect.get-own-property-descriptor";
|
||||
import "core-js/modules/es6.reflect.get-prototype-of";
|
||||
import "core-js/modules/es6.reflect.has";
|
||||
import "core-js/modules/es6.reflect.is-extensible";
|
||||
import "core-js/modules/es6.reflect.own-keys";
|
||||
import "core-js/modules/es6.reflect.prevent-extensions";
|
||||
import "core-js/modules/es6.reflect.set";
|
||||
import "core-js/modules/es6.reflect.set-prototype-of";
|
||||
import "core-js/modules/es6.promise";
|
||||
import "core-js/modules/es6.symbol";
|
||||
import "core-js/modules/es6.object.assign";
|
||||
import "core-js/modules/es6.object.is";
|
||||
import "core-js/modules/es6.object.set-prototype-of";
|
||||
import "core-js/modules/es6.function.name";
|
||||
import "core-js/modules/es6.string.raw";
|
||||
import "core-js/modules/es6.string.from-code-point";
|
||||
import "core-js/modules/es6.string.code-point-at";
|
||||
import "core-js/modules/es6.string.repeat";
|
||||
import "core-js/modules/es6.string.starts-with";
|
||||
import "core-js/modules/es6.string.ends-with";
|
||||
import "core-js/modules/es6.string.includes";
|
||||
import "core-js/modules/es6.regexp.flags";
|
||||
import "core-js/modules/es6.regexp.match";
|
||||
import "core-js/modules/es6.regexp.replace";
|
||||
import "core-js/modules/es6.regexp.split";
|
||||
import "core-js/modules/es6.regexp.search";
|
||||
import "core-js/modules/es6.array.from";
|
||||
import "core-js/modules/es6.array.of";
|
||||
import "core-js/modules/es6.array.copy-within";
|
||||
import "core-js/modules/es6.array.find";
|
||||
import "core-js/modules/es6.array.find-index";
|
||||
import "core-js/modules/es6.array.fill";
|
||||
import "core-js/modules/es6.array.iterator";
|
||||
import "core-js/modules/es6.number.is-finite";
|
||||
import "core-js/modules/es6.number.is-integer";
|
||||
import "core-js/modules/es6.number.is-safe-integer";
|
||||
import "core-js/modules/es6.number.is-nan";
|
||||
import "core-js/modules/es6.number.epsilon";
|
||||
import "core-js/modules/es6.number.min-safe-integer";
|
||||
import "core-js/modules/es6.number.max-safe-integer";
|
||||
import "core-js/modules/es6.math.acosh";
|
||||
import "core-js/modules/es6.math.asinh";
|
||||
import "core-js/modules/es6.math.atanh";
|
||||
import "core-js/modules/es6.math.cbrt";
|
||||
import "core-js/modules/es6.math.clz32";
|
||||
import "core-js/modules/es6.math.cosh";
|
||||
import "core-js/modules/es6.math.expm1";
|
||||
import "core-js/modules/es6.math.fround";
|
||||
import "core-js/modules/es6.math.hypot";
|
||||
import "core-js/modules/es6.math.imul";
|
||||
import "core-js/modules/es6.math.log1p";
|
||||
import "core-js/modules/es6.math.log10";
|
||||
import "core-js/modules/es6.math.log2";
|
||||
import "core-js/modules/es6.math.sign";
|
||||
import "core-js/modules/es6.math.sinh";
|
||||
import "core-js/modules/es6.math.tanh";
|
||||
import "core-js/modules/es6.math.trunc";
|
||||
import "core-js/modules/es7.array.includes";
|
||||
import "core-js/modules/es7.object.values";
|
||||
import "core-js/modules/es7.object.entries";
|
||||
import "core-js/modules/es7.object.get-own-property-descriptors";
|
||||
import "core-js/modules/es7.string.pad-start";
|
||||
import "core-js/modules/es7.string.pad-end";
|
||||
import "core-js/modules/web.timers";
|
||||
import "core-js/modules/web.immediate";
|
||||
import "core-js/modules/web.dom.iterable";
|
||||
import "regenerator-runtime/runtime";
|
||||
12
experimental/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/options.json
vendored
Normal file
12
experimental/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/options.json
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"presets": [
|
||||
["../../../../lib", {
|
||||
"targets": {
|
||||
"ie": 9
|
||||
},
|
||||
"modules": false,
|
||||
"useBuiltIns": true,
|
||||
"modules": false
|
||||
}]
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user