-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove useESModules
in favor of conditional exports for @babel/runtime
#12295
Changes from 2 commits
85fe4ee
fa0963e
39f5547
b4c981e
d66b663
426ef52
948c463
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct"; | ||
import _classCallCheck from "@babel/runtime-corejs3/helpers/esm/classCallCheck"; | ||
import _inherits from "@babel/runtime-corejs3/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/esm/getPrototypeOf"; | ||
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is |
||
import _inherits from "@babel/runtime-corejs3/helpers/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf"; | ||
|
||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import _inherits from "@babel/runtime/helpers/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; | ||
|
||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import _inherits from "@babel/runtime/helpers/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; | ||
|
||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import undef from "@babel/runtime-corejs2/helpers/temporalUndefined"; | ||
import err from "@babel/runtime-corejs2/helpers/tdz"; | ||
export default function _temporalRef(val, name) { | ||
return val === undef ? err(name) : val; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import arrayWithHoles from "@babel/runtime-corejs2/helpers/arrayWithHoles"; | ||
import iterableToArray from "@babel/runtime-corejs2/helpers/iterableToArray"; | ||
import unsupportedIterableToArray from "@babel/runtime-corejs2/helpers/unsupportedIterableToArray"; | ||
import nonIterableRest from "@babel/runtime-corejs2/helpers/nonIterableRest"; | ||
export default function _toArray(arr) { | ||
return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the ideal experience, the very same value should be repeated for a priority
"module"
condition that is supported by webpack (and will most likely be supported by Rollup as well), in noderequire
cant load ESM so it can lead to the same module being loaded twice (once for ESM loader and once for the CJS loader) which ain't ideal for the web consumers so this condition allows the same file (authored in ESM) to be loaded for both loaders, so this behaves pretty much as thepackage.json#module