Skip to content

Commit

Permalink
Update core-js (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock authored Jan 8, 2024
1 parent 984c56c commit 3a657bd
Show file tree
Hide file tree
Showing 40 changed files with 2,024 additions and 60 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@lerna/package": "patch:@lerna/package@npm:3.16.0#.yarn-patches/@lerna/package.patch",
"@lerna/package-graph": "patch:@lerna/package-graph@npm:3.18.5#.yarn-patches/@lerna/package-graph.patch",
"@lerna/pack-directory": "patch:@lerna/pack-directory@npm:3.16.4#.yarn-patches/@lerna/pack-directory.patch",
"@babel/preset-env/core-js-compat": "^3.33.1"
"@babel/preset-env/core-js-compat": "^3.34.0"
},
"engines": {
"node": ">= 6.9.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-plugin-polyfill-corejs3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
"dependencies": {
"@babel/helper-define-polyfill-provider": "workspace:^0.4.4",
"core-js-compat": "^3.33.1"
"core-js-compat": "^3.34.0"
},
"devDependencies": {
"@babel/core": "^7.22.6",
Expand All @@ -39,8 +39,8 @@
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
"@babel/plugin-transform-runtime": "^7.22.15",
"@babel/plugin-transform-spread": "^7.22.5",
"core-js": "^3.33.1",
"core-js-pure": "^3.33.1"
"core-js": "^3.34.0",
"core-js-pure": "^3.34.0"
},
"peerDependencies": {
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
Expand Down
32 changes: 24 additions & 8 deletions packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const define = (
};
};

const typed = (name: string) => define(null, [name, ...TypedArrayDependencies]);
const typed = (...modules) =>
define(null, [...modules, ...TypedArrayDependencies]);

const ArrayNatureIterators = [
"es.array.iterator",
Expand Down Expand Up @@ -210,12 +211,13 @@ export const DecoratorMetadataDependencies = [
];

const TypedArrayStaticMethods = {
from: define(null, ["es.typed-array.from"]),
from: define(null, ["es.typed-array.from", ...TypedArrayDependencies]),
fromAsync: define(null, [
"esnext.typed-array.from-async",
...PromiseDependenciesWithIterators,
...TypedArrayDependencies,
]),
of: define(null, ["es.typed-array.of"]),
of: define(null, ["es.typed-array.of", ...TypedArrayDependencies]),
};

const DataViewDependencies = [
Expand Down Expand Up @@ -262,7 +264,11 @@ export const BuiltIns: ObjectMap<CoreJSPolyfillDescriptor> = {
Int16Array: typed("es.typed-array.int16-array"),
Int32Array: typed("es.typed-array.int32-array"),
Iterator: define("iterator/index", IteratorDependencies),
Uint8Array: typed("es.typed-array.uint8-array"),
Uint8Array: typed(
"es.typed-array.uint8-array",
"esnext.uint8-array.to-base64",
"esnext.uint8-array.to-hex",
),
Uint8ClampedArray: typed("es.typed-array.uint8-clamped-array"),
Uint16Array: typed("es.typed-array.uint16-array"),
Uint32Array: typed("es.typed-array.uint32-array"),
Expand Down Expand Up @@ -429,7 +435,7 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {

Map: {
from: define(null, ["esnext.map.from", ...MapDependencies]),
groupBy: define(null, ["esnext.map.group-by", ...MapDependencies]),
groupBy: define(null, ["es.map.group-by", ...MapDependencies]),
keyBy: define(null, ["esnext.map.key-by", ...MapDependencies]),
of: define(null, ["esnext.map.of", ...MapDependencies]),
},
Expand Down Expand Up @@ -488,7 +494,7 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
"es.object.get-prototype-of",
]),
groupBy: define("object/group-by", [
"esnext.object.group-by",
"es.object.group-by",
"es.object.create",
]),
hasOwn: define("object/has-own", ["es.object.has-own"]),
Expand Down Expand Up @@ -521,7 +527,7 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
race: define(null, PromiseDependenciesWithIterators),
try: define(null, ["esnext.promise.try", ...PromiseDependencies]),
withResolvers: define(null, [
"esnext.promise.with-resolvers",
"es.promise.with-resolvers",
...PromiseDependencies,
]),
},
Expand Down Expand Up @@ -693,7 +699,17 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
},

Int8Array: TypedArrayStaticMethods,
Uint8Array: TypedArrayStaticMethods,
Uint8Array: {
fromBase64: define(null, [
"esnext.uint8-array.from-base64",
...TypedArrayDependencies,
]),
fromHex: define(null, [
"esnext.uint8-array.from-hex",
...TypedArrayDependencies,
]),
...TypedArrayStaticMethods,
},
Uint8ClampedArray: TypedArrayStaticMethods,
Int16Array: TypedArrayStaticMethods,
Uint16Array: TypedArrayStaticMethods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ export default new Set<string>([
"esnext.json.is-raw-json",
"esnext.json.parse",
"esnext.json.raw-json",
"esnext.map.group-by",
"esnext.object.group-by",
"esnext.promise.with-resolvers",
"esnext.set.difference.v2",
"esnext.set.intersection.v2",
"esnext.set.is-disjoint-from.v2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'core-js/actual';
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"plugins": [
[
"@@/polyfill-corejs3",
{
"version": "3.34",
"method": "entry-global",
"targets": {
"chrome": 107
}
}
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import "core-js/modules/es.array.push.js";
import "core-js/modules/es.array.to-reversed.js";
import "core-js/modules/es.array.to-sorted.js";
import "core-js/modules/es.array.to-spliced.js";
import "core-js/modules/es.array.with.js";
import "core-js/modules/es.map.group-by.js";
import "core-js/modules/es.object.group-by.js";
import "core-js/modules/es.promise.with-resolvers.js";
import "core-js/modules/es.regexp.flags.js";
import "core-js/modules/es.string.is-well-formed.js";
import "core-js/modules/es.string.to-well-formed.js";
import "core-js/modules/es.typed-array.to-reversed.js";
import "core-js/modules/es.typed-array.to-sorted.js";
import "core-js/modules/es.typed-array.with.js";
import "core-js/modules/esnext.suppressed-error.constructor.js";
import "core-js/modules/esnext.array.from-async.js";
import "core-js/modules/esnext.array.group.js";
import "core-js/modules/esnext.array.group-by.js";
import "core-js/modules/esnext.array.group-by-to-map.js";
import "core-js/modules/esnext.array.group-to-map.js";
import "core-js/modules/esnext.array-buffer.detached.js";
import "core-js/modules/esnext.array-buffer.transfer.js";
import "core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js";
import "core-js/modules/esnext.async-disposable-stack.constructor.js";
import "core-js/modules/esnext.async-iterator.constructor.js";
import "core-js/modules/esnext.async-iterator.async-dispose.js";
import "core-js/modules/esnext.async-iterator.drop.js";
import "core-js/modules/esnext.async-iterator.every.js";
import "core-js/modules/esnext.async-iterator.filter.js";
import "core-js/modules/esnext.async-iterator.find.js";
import "core-js/modules/esnext.async-iterator.flat-map.js";
import "core-js/modules/esnext.async-iterator.for-each.js";
import "core-js/modules/esnext.async-iterator.from.js";
import "core-js/modules/esnext.async-iterator.map.js";
import "core-js/modules/esnext.async-iterator.reduce.js";
import "core-js/modules/esnext.async-iterator.some.js";
import "core-js/modules/esnext.async-iterator.take.js";
import "core-js/modules/esnext.async-iterator.to-array.js";
import "core-js/modules/esnext.data-view.get-float16.js";
import "core-js/modules/esnext.data-view.set-float16.js";
import "core-js/modules/esnext.disposable-stack.constructor.js";
import "core-js/modules/esnext.function.metadata.js";
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.dispose.js";
import "core-js/modules/esnext.iterator.drop.js";
import "core-js/modules/esnext.iterator.every.js";
import "core-js/modules/esnext.iterator.filter.js";
import "core-js/modules/esnext.iterator.find.js";
import "core-js/modules/esnext.iterator.flat-map.js";
import "core-js/modules/esnext.iterator.for-each.js";
import "core-js/modules/esnext.iterator.from.js";
import "core-js/modules/esnext.iterator.map.js";
import "core-js/modules/esnext.iterator.reduce.js";
import "core-js/modules/esnext.iterator.some.js";
import "core-js/modules/esnext.iterator.take.js";
import "core-js/modules/esnext.iterator.to-array.js";
import "core-js/modules/esnext.iterator.to-async.js";
import "core-js/modules/esnext.json.is-raw-json.js";
import "core-js/modules/esnext.json.parse.js";
import "core-js/modules/esnext.json.raw-json.js";
import "core-js/modules/esnext.math.f16round.js";
import "core-js/modules/esnext.set.difference.v2.js";
import "core-js/modules/esnext.set.intersection.v2.js";
import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
import "core-js/modules/esnext.set.is-subset-of.v2.js";
import "core-js/modules/esnext.set.is-superset-of.v2.js";
import "core-js/modules/esnext.set.symmetric-difference.v2.js";
import "core-js/modules/esnext.set.union.v2.js";
import "core-js/modules/esnext.symbol.async-dispose.js";
import "core-js/modules/esnext.symbol.dispose.js";
import "core-js/modules/esnext.symbol.metadata.js";
import "core-js/modules/esnext.typed-array.to-spliced.js";
import "core-js/modules/web.dom-exception.stack.js";
import "core-js/modules/web.immediate.js";
import "core-js/modules/web.structured-clone.js";
import "core-js/modules/web.url.can-parse.js";
import "core-js/modules/web.url-search-params.delete.js";
import "core-js/modules/web.url-search-params.has.js";
import "core-js/modules/web.url-search-params.size.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'core-js/actual';
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": [
[
"@@/polyfill-corejs3",
{
"version": "3.34",
"method": "entry-global"
}
]
]
}
Loading

0 comments on commit 3a657bd

Please sign in to comment.