From c66cb42bb027160956bf655114836ab8909986d7 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Thu, 14 Oct 2021 11:12:13 +0200 Subject: [PATCH] Bugfix + closes #86 --- package-lock.json | 41 +++++++++++++---------------------------- package.json | 3 ++- src/editor/Editor.jsx | 2 +- src/polyfills/index.js | 3 ++- 4 files changed, 18 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 164501a..86322a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.5.2", "license": "BSD-3-Clause", "dependencies": { - "@babel/polyfill": "^7.10.4", + "core-js": "^3.18.3", "downshift": "^6.1.3", "fast-deep-equal": "^3.1.3", "node-polyglot": "^2.4.0", @@ -17,6 +17,7 @@ "react-draggable": "^4.4.3", "react-select": "^4.3.1", "react-transition-group": "^4.4.2", + "regenerator-runtime": "^0.13.9", "timeago-react": "^3.0.2", "uuid": "^8.3.2" }, @@ -1392,16 +1393,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/polyfill": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.12.1.tgz", - "integrity": "sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g==", - "deprecated": "🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.", - "dependencies": { - "core-js": "^2.6.5", - "regenerator-runtime": "^0.13.4" - } - }, "node_modules/@babel/preset-env": { "version": "7.15.8", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.15.8.tgz", @@ -2010,11 +2001,14 @@ } }, "node_modules/core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", - "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", - "hasInstallScript": true + "version": "3.18.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz", + "integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } }, "node_modules/core-js-compat": { "version": "3.18.2", @@ -4950,15 +4944,6 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, - "@babel/polyfill": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.12.1.tgz", - "integrity": "sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g==", - "requires": { - "core-js": "^2.6.5", - "regenerator-runtime": "^0.13.4" - } - }, "@babel/preset-env": { "version": "7.15.8", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.15.8.tgz", @@ -5458,9 +5443,9 @@ } }, "core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + "version": "3.18.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz", + "integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==" }, "core-js-compat": { "version": "3.18.2", diff --git a/package.json b/package.json index f539a7d..c5553b0 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "mocha": "^9.1.2" }, "dependencies": { - "@babel/polyfill": "^7.10.4", + "core-js": "^3.18.3", "downshift": "^6.1.3", "fast-deep-equal": "^3.1.3", "node-polyglot": "^2.4.0", @@ -41,6 +41,7 @@ "react-draggable": "^4.4.3", "react-select": "^4.3.1", "react-transition-group": "^4.4.2", + "regenerator-runtime": "^0.13.9", "timeago-react": "^3.0.2", "uuid": "^8.3.2" } diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 6605399..8dd19cc 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -229,7 +229,7 @@ export default class Editor extends Component { // Update .map(b => { const diff = toUpdate.find(t => t.previous === b); - return diff ? diff.updated : body; + return diff ? diff.updated : b; }), // Append diff --git a/src/polyfills/index.js b/src/polyfills/index.js index efa747b..2c277cc 100644 --- a/src/polyfills/index.js +++ b/src/polyfills/index.js @@ -1,4 +1,5 @@ -import '@babel/polyfill'; +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; /** * Adds DOM polyfills that babel polyfill doesn't include