Skip to content

Commit

Permalink
Babel 7.20 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalduez committed Oct 31, 2022
1 parent 1545ef6 commit 8e90e11
Show file tree
Hide file tree
Showing 54 changed files with 1,365 additions and 1,584 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Change log

## [Unreleased]
### Changed
* Babel `7.20.x` upgrades.

## 5.9.0 - 2022-09-08
### Changed
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = (context, options = {}) => {
corejs: 2,
helpers: true,
regenerator: true,
version: '7.19.0', // 1
version: '7.20.0', // 1
};

let presets = [
Expand Down
2,747 changes: 1,324 additions & 1,423 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.18.10",
"@babel/preset-env": "^7.19.0",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.19.4",
"@babel/preset-flow": "^7.18.6",
"@babel/preset-react": "^7.18.6"
},
"devDependencies": {
"@babel/core": "^7.19.0",
"@babel/runtime-corejs2": "^7.19.0",
"jest": "^29.0.2",
"@babel/core": "^7.19.6",
"@babel/runtime-corejs2": "^7.20.0",
"jest": "^29.2.2",
"jest-file-snapshot": "^0.5.0",
"prettier": "^2.7.1"
},
"peerDependencies": {
"@babel/runtime-corejs2": "7.19.x"
"@babel/runtime-corejs2": "7.20.x"
}
}
2 changes: 0 additions & 2 deletions test/__file_snapshots__/cjsm--Object.entries-0
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _entries = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/entries"));

(0, _entries.default)({
a: 1
});
2 changes: 0 additions & 2 deletions test/__file_snapshots__/cjsm--Promise.allSettled-0
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));

_promise.default.allSettled([_promise.default.resolve(1), _promise.default.resolve(2)]).then(function (rs) {
return rs.forEach(function (r) {
return console.log(r.status);
Expand Down
28 changes: 3 additions & 25 deletions test/__file_snapshots__/cjsm--React-class-component-0
Original file line number Diff line number Diff line change
@@ -1,45 +1,27 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _interopRequireWildcard = require("@babel/runtime-corejs2/helpers/interopRequireWildcard").default;

var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutProperties"));

var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/regeneratorRuntime"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));

var _createSuper2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createSuper"));

var React = _interopRequireWildcard(require("react"));

var _excluded = ["type"];

var Button = /*#__PURE__*/function (_React$Component) {
(0, _inherits2.default)(Button, _React$Component);

var _super = (0, _createSuper2.default)(Button);

function Button() {
var _this;

(0, _classCallCheck2.default)(this, Button);

for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

_this = _super.call.apply(_super, [this].concat(args));

_this.handleClick = /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(evt) {
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
Expand All @@ -49,30 +31,26 @@ var Button = /*#__PURE__*/function (_React$Component) {
evt.preventDefault();
_context.next = 3;
return fetch('/foo');

case 3:
case "end":
return _context.stop();
}
}
}, _callee);
}));

return function (_x) {
return _ref.apply(this, arguments);
};
}();

return _this;
}

(0, _createClass2.default)(Button, [{
key: "render",
value: function render() {
var _this$props = this.props,
_this$props$type = _this$props.type,
type = _this$props$type === void 0 ? 'button' : _this$props$type,
extraProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
_this$props$type = _this$props.type,
type = _this$props$type === void 0 ? 'button' : _this$props$type,
extraProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({
type: type,
onClick: this.handleClick
Expand Down
10 changes: 3 additions & 7 deletions test/__file_snapshots__/cjsm--React-function-component-0
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutProperties"));

var _excluded = ["type", "children"];

function Button(_ref) {
var _ref$type = _ref.type,
type = _ref$type === void 0 ? 'button' : _ref$type,
children = _ref.children,
extraProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
type = _ref$type === void 0 ? 'button' : _ref$type,
children = _ref.children,
extraProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({
type: type
}, extraProps), children);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var C = /*#__PURE__*/(0, _createClass2.default)(function C() {
(0, _classCallCheck2.default)(this, C);
});
4 changes: 0 additions & 4 deletions test/__file_snapshots__/cjsm--Runtime-ponyfills-0
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));

var _set = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/set"));

var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));

new _map.default();
new _set.default();
new _promise.default();
4 changes: 0 additions & 4 deletions test/__file_snapshots__/cjsm--async-await-0
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/regeneratorRuntime"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));

(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return foo();

case 2:
case "end":
return _context.stop();
Expand Down
4 changes: 0 additions & 4 deletions test/__file_snapshots__/cjsm--class-properties-0
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var A = /*#__PURE__*/(0, _createClass2.default)(function A() {
(0, _classCallCheck2.default)(this, A);

this.a = function () {
return 'hello';
};
Expand Down
3 changes: 0 additions & 3 deletions test/__file_snapshots__/cjsm--dynamic-imports-0
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));

var _interopRequireWildcard2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/interopRequireWildcard"));

_promise.default.resolve().then(function () {
return (0, _interopRequireWildcard2.default)(require('./a'));
});
5 changes: 1 addition & 4 deletions test/__file_snapshots__/cjsm--jsx-spread-0
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/extends"));

/*#__PURE__*/
React.createElement("div", (0, _extends2.default)({
/*#__PURE__*/React.createElement("div", (0, _extends2.default)({
a: true
}, b), "hello");
1 change: 0 additions & 1 deletion test/__file_snapshots__/cjsm--nullish-coalescing-0
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";

var _obj$foo;

var obj = {};
var foo = (_obj$foo = obj.foo) !== null && _obj$foo !== void 0 ? _obj$foo : 'default';
2 changes: 0 additions & 2 deletions test/__file_snapshots__/cjsm--object-rest-spread-0
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectSpread2"));

var b = (0, _objectSpread2.default)({}, a);
1 change: 0 additions & 1 deletion test/__file_snapshots__/cjsm--optional-chaining-0
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict";

var _obj$foo, _obj$foo$bar, _obj$qux;

var obj = {
foo: {
bar: {
Expand Down
3 changes: 0 additions & 3 deletions test/__file_snapshots__/cjsm--static-class-properties-0
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault").default;

var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));

var A = /*#__PURE__*/(0, _createClass2.default)(function A() {
(0, _classCallCheck2.default)(this, A);
});
Expand Down
1 change: 0 additions & 1 deletion test/__file_snapshots__/esm--Object.entries-0
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import _Object$entries from "@babel/runtime-corejs2/core-js/object/entries";

_Object$entries({
a: 1
});
1 change: 0 additions & 1 deletion test/__file_snapshots__/esm--Promise.allSettled-0
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import _Promise from "@babel/runtime-corejs2/core-js/promise";

_Promise.allSettled([_Promise.resolve(1), _Promise.resolve(2)]).then(function (rs) {
return rs.forEach(function (r) {
return console.log(r.status);
Expand Down
19 changes: 3 additions & 16 deletions test/__file_snapshots__/esm--React-class-component-0
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,16 @@ import _inherits from "@babel/runtime-corejs2/helpers/inherits";
import _createSuper from "@babel/runtime-corejs2/helpers/createSuper";
var _excluded = ["type"];
import * as React from 'react';

var Button = /*#__PURE__*/function (_React$Component) {
_inherits(Button, _React$Component);

var _super = _createSuper(Button);

function Button() {
var _this;

_classCallCheck(this, Button);

for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

_this = _super.call.apply(_super, [this].concat(args));

_this.handleClick = /*#__PURE__*/function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(evt) {
return _regeneratorRuntime().wrap(function _callee$(_context) {
Expand All @@ -34,37 +27,31 @@ var Button = /*#__PURE__*/function (_React$Component) {
evt.preventDefault();
_context.next = 3;
return fetch('/foo');

case 3:
case "end":
return _context.stop();
}
}
}, _callee);
}));

return function (_x) {
return _ref.apply(this, arguments);
};
}();

return _this;
}

_createClass(Button, [{
key: "render",
value: function render() {
var _this$props = this.props,
_this$props$type = _this$props.type,
type = _this$props$type === void 0 ? 'button' : _this$props$type,
extraProps = _objectWithoutProperties(_this$props, _excluded);

_this$props$type = _this$props.type,
type = _this$props$type === void 0 ? 'button' : _this$props$type,
extraProps = _objectWithoutProperties(_this$props, _excluded);
return /*#__PURE__*/React.createElement("button", _extends({
type: type,
onClick: this.handleClick
}, extraProps), children);
}
}]);

return Button;
}(React.Component);
8 changes: 3 additions & 5 deletions test/__file_snapshots__/esm--React-function-component-0
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import _extends from "@babel/runtime-corejs2/helpers/extends";
import _objectWithoutProperties from "@babel/runtime-corejs2/helpers/objectWithoutProperties";
var _excluded = ["type", "children"];

function Button(_ref) {
var _ref$type = _ref.type,
type = _ref$type === void 0 ? 'button' : _ref$type,
children = _ref.children,
extraProps = _objectWithoutProperties(_ref, _excluded);

type = _ref$type === void 0 ? 'button' : _ref$type,
children = _ref.children,
extraProps = _objectWithoutProperties(_ref, _excluded);
return /*#__PURE__*/React.createElement("button", _extends({
type: type
}, extraProps), children);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import _createClass from "@babel/runtime-corejs2/helpers/createClass";
import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck";

var C = /*#__PURE__*/_createClass(function C() {
_classCallCheck(this, C);
});
Loading

0 comments on commit 8e90e11

Please sign in to comment.