From a9b7bc774ee158be131eaeb8dc3a6c8217ac3f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Ooms?= Date: Sun, 5 Jul 2020 17:48:56 +0200 Subject: [PATCH] :unamused: chore(dev-deps): Replace @babel/polyfill by regenerator-runtime/runtime. --- README.md | 6 +++--- _benchmark/benchmark.js | 2 +- _benchmark/tree.js | 2 +- _profile/append.js | 2 +- _profile/concat.js | 2 +- _profile/cons.js | 2 +- _profile/init.js | 2 +- _profile/prepend.js | 2 +- _profile/push.js | 2 +- _profile/split.js | 2 +- _profile/tail.js | 2 +- doc/manual/usage.md | 8 ++++---- package.json | 4 ++-- yarn.lock | 12 ++---------- 14 files changed, 21 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index da91d1ba..0411871d 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,11 @@ All methods are pure functions that do not modify their object. > The [parent project](https://github.com/aureooms/js-persistent) shows how > specialized persistent data structures can be build on top of those methods. -> The code needs a ES2015+ polyfill to work (`regeneratorRuntime`), for example -> [babel-polyfill](https://babeljs.io/docs/usage/polyfill). +> The code requires `regeneratorRuntime` to be defined, for instance by importing +> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime). ```js -import 'babel-polyfill' ; +import 'regenerator-runtime/runtime.js' ; ``` ### Definition of a `Tree` diff --git a/_benchmark/benchmark.js b/_benchmark/benchmark.js index 7e934605..6c3cfbf6 100644 --- a/_benchmark/benchmark.js +++ b/_benchmark/benchmark.js @@ -1,4 +1,4 @@ -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const itertools = require('@aureooms/js-itertools'); diff --git a/_benchmark/tree.js b/_benchmark/tree.js index 2bc8829b..1a9e0823 100644 --- a/_benchmark/tree.js +++ b/_benchmark/tree.js @@ -1,4 +1,4 @@ -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const itertools = require('@aureooms/js-itertools'); const fingertree = require('..'); const empty = fingertree.empty; diff --git a/_profile/append.js b/_profile/append.js index ff3a1224..dd70f01e 100644 --- a/_profile/append.js +++ b/_profile/append.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/_profile/concat.js b/_profile/concat.js index ad8c8370..a2fa8b53 100644 --- a/_profile/concat.js +++ b/_profile/concat.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/_profile/cons.js b/_profile/cons.js index 2a9eaba7..cedf988b 100644 --- a/_profile/cons.js +++ b/_profile/cons.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/_profile/init.js b/_profile/init.js index 0a665116..25d7d8fa 100644 --- a/_profile/init.js +++ b/_profile/init.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/_profile/prepend.js b/_profile/prepend.js index cc41d439..878092ed 100644 --- a/_profile/prepend.js +++ b/_profile/prepend.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/_profile/push.js b/_profile/push.js index db9852ed..b603907f 100644 --- a/_profile/push.js +++ b/_profile/push.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/_profile/split.js b/_profile/split.js index 80ea6d4e..2504e5bd 100644 --- a/_profile/split.js +++ b/_profile/split.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/_profile/tail.js b/_profile/tail.js index f3729a9a..17b57fa5 100644 --- a/_profile/tail.js +++ b/_profile/tail.js @@ -1,5 +1,5 @@ console.time('prepare'); -require('@babel/polyfill'); +require('regenerator-runtime/runtime'); const ArgumentParser = require('argparse').ArgumentParser; const itertools = require('@aureooms/js-itertools'); const empty = require('..').empty; diff --git a/doc/manual/usage.md b/doc/manual/usage.md index 94e97795..7010c320 100644 --- a/doc/manual/usage.md +++ b/doc/manual/usage.md @@ -1,11 +1,11 @@ # Usage -The code needs a ES2015+ polyfill to work, for example -[babel-polyfill](https://babeljs.io/docs/usage/polyfill). +The code requires `regeneratorRuntime` to be defined, for instance by importing +[regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime). ```js -require( 'babel-polyfill' ) ; +require( 'regenerator-runtime/runtime' ); // or -import 'babel-polyfill' ; +import 'regenerator-runtime/runtime.js' ; ``` Then diff --git a/package.json b/package.json index 74ca0239..3b7ace94 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test/src/**/*" ], "require": [ - "@babel/polyfill", + "regenerator-runtime/runtime", "@babel/register" ] }, @@ -33,7 +33,6 @@ "@aureooms/js-predicate": "2.0.2", "@babel/cli": "7.10.4", "@babel/core": "7.10.4", - "@babel/polyfill": "7.10.4", "@babel/preset-env": "7.10.4", "@babel/register": "7.10.4", "argparse": "1.0.10", @@ -48,6 +47,7 @@ "microtime": "3.0.0", "np": "6.2.5", "nyc": "15.1.0", + "regenerator-runtime": "^0.13.5", "xo": "0.32.1" }, "files": [ diff --git a/yarn.lock b/yarn.lock index 6b68d40c..53b95ba0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -899,14 +899,6 @@ "@babel/helper-create-regexp-features-plugin" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/polyfill@7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.10.4.tgz#915e5bfe61490ac0199008e35ca9d7d151a8e45a" - integrity sha512-8BYcnVqQ5kMD2HXoHInBH7H1b/uP3KdnwCYXOqFnXqguOyuu443WXusbIUbWEfY3Z0Txk0M1uG/8YuAMhNl6zg== - dependencies: - core-js "^2.6.5" - regenerator-runtime "^0.13.4" - "@babel/preset-env@7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.10.4.tgz#fbf57f9a803afd97f4f32e4f798bb62e4b2bef5f" @@ -2483,7 +2475,7 @@ core-js-compat@^3.6.2: browserslist "^4.8.5" semver "7.0.0" -core-js@^2.4.0, core-js@^2.6.5: +core-js@^2.4.0: version "2.6.11" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== @@ -6764,7 +6756,7 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.13.4: +regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.5: version "0.13.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==