From 9a80b9332bc4517bb77a833965897f54e60a46e8 Mon Sep 17 00:00:00 2001 From: GertSallaerts <1267900+GertSallaerts@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:10:42 +0100 Subject: [PATCH 1/2] chore(build): update polyfilling with core-js --- js/babel.config.js | 10 +++++++--- js/package.json | 3 ++- js/yarn.lock | 13 ++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/babel.config.js b/js/babel.config.js index 8ddd8f62a..e4f5a6633 100644 --- a/js/babel.config.js +++ b/js/babel.config.js @@ -10,14 +10,18 @@ module.exports = api => { '@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-export-namespace-from', '@babel/plugin-proposal-export-default-from', - 'add-module-exports' + 'add-module-exports', + [ + 'polyfill-corejs3', + { + method: 'usage-pure' + } + ] ], presets: [ [ '@babel/preset-env', { - useBuiltIns: 'usage', - corejs: 2, modules: api.env('commonjs') || api.env('test') ? 'commonjs' : false, forceAllTransforms: api.env('production') } diff --git a/js/package.json b/js/package.json index 8be027c48..ea31bdaba 100644 --- a/js/package.json +++ b/js/package.json @@ -26,6 +26,7 @@ "@babel/preset-env": "^7.4.0", "babel-eslint": "^10.0.1", "babel-plugin-add-module-exports": "^1.0.2", + "babel-plugin-polyfill-corejs3": "^0.3.0", "eslint": "^4.18.1", "eslint-config-prettier": "^2.9.0", "eslint-plugin-prettier": "^2.6.0", @@ -57,7 +58,7 @@ }, "dependencies": { "@babel/runtime": "^7.3.1", - "core-js": "^2.5.0", + "core-js-pure": "^3.19.0", "punycode": "1.4.1", "twemoji-parser": "^11.0.2" } diff --git a/js/yarn.lock b/js/yarn.lock index 1dd647aed..327807d5d 100644 --- a/js/yarn.lock +++ b/js/yarn.lock @@ -1381,10 +1381,10 @@ "browserslist" "^4.17.6" "semver" "7.0.0" -"core-js@^2.5.0": - "integrity" "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" - "resolved" "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz" - "version" "2.6.12" +"core-js-pure@^3.19.0": + "integrity" "sha512-Q0Knr8Es84vtv62ei6/6jXH/7izKmOrtrxH9WJTHLCMAVeU+8TF8z8Nr08CsH4Ot0oJKzBzJJL9SJBYIv7WlfQ==" + "resolved" "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.19.1.tgz" + "version" "3.19.1" "core-util-is@~1.0.0": "integrity" "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" @@ -1782,11 +1782,6 @@ "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" "version" "1.0.0" -"fsevents@~2.3.2": - "integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==" - "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" - "version" "2.3.2" - "function-bind@^1.1.1": "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" From 441d77c53c3bed135f472eb6cf1fbe08e895137d Mon Sep 17 00:00:00 2001 From: GertSallaerts <1267900+GertSallaerts@users.noreply.github.com> Date: Thu, 4 Nov 2021 09:29:05 +0100 Subject: [PATCH 2/2] [ambassify] add info about core-js adjustment --- js/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/README.md b/js/README.md index 5f87b57be..a3c0c9563 100644 --- a/js/README.md +++ b/js/README.md @@ -8,7 +8,7 @@ A JavaScript utility that provides text processing routines for Tweets. This li This fork of the original twitter-text library includes: -- ... +- [Updated core-js and polyfill strategy](https://github.com/twitter/twitter-text/pull/363) It's available on NPM as `npm install @ambassify/twitter-text`