Skip to content

Commit

Permalink
Add missing things in core-js-pure 3 (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu authored Jan 25, 2024
1 parent 51b5b76 commit 599f7c4
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 51 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "yarn build-es-shims-data && yarn build-corejs3-shipped-proposals && gulp build && gulp bundle",
"build-corejs3-shipped-proposals": "node ./scripts/build-corejs3-shipped-proposals.mjs",
"build-es-shims-data": "./scripts/download-compat-table.sh && node ./scripts/build-es-shims-data",
"build-es-shims-data": "node ./scripts/download-compat-table.js && node ./scripts/build-es-shims-data",
"clean": "rimraf packages/*/lib packages/*/esm",
"clean-all": "yarn clean && rimraf packages/*/node_modules node_modules",
"lint": "eslint packages '*.{js,ts}' --ext .js,.ts --format=codeframe",
Expand Down Expand Up @@ -94,4 +94,4 @@
},
"version": "0.0.0",
"packageManager": "[email protected]"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {

Map: {
from: define(null, ["esnext.map.from", ...MapDependencies]),
groupBy: define(null, ["es.map.group-by", ...MapDependencies]),
keyBy: define(null, ["esnext.map.key-by", ...MapDependencies]),
groupBy: define("map/group-by", ["es.map.group-by", ...MapDependencies]),
keyBy: define("map/key-by", ["esnext.map.key-by", ...MapDependencies]),
of: define(null, ["esnext.map.of", ...MapDependencies]),
},

Expand Down Expand Up @@ -515,18 +515,18 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {

Promise: {
all: define(null, PromiseDependenciesWithIterators),
allSettled: define(null, [
allSettled: define("promise/all-settled", [
"es.promise.all-settled",
...PromiseDependenciesWithIterators,
]),
any: define(null, [
any: define("promise/any", [
"es.promise.any",
"es.aggregate-error",
...PromiseDependenciesWithIterators,
]),
race: define(null, PromiseDependenciesWithIterators),
try: define(null, ["esnext.promise.try", ...PromiseDependencies]),
withResolvers: define(null, [
try: define("promise/try", ["esnext.promise.try", ...PromiseDependencies]),
withResolvers: define("promise/with-resolvers", [
"es.promise.with-resolvers",
...PromiseDependencies,
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import _isWellFormedInstanceProperty from "core-js-pure/features/instance/is-wel
import _toWellFormedInstanceProperty from "core-js-pure/features/instance/to-well-formed.js";
import _self from "core-js-pure/stable/self.js";
import _URL$canParse from "core-js-pure/stable/url/can-parse.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise from "core-js-pure/stable/promise/index.js";
import _URLSearchParams from "core-js-pure/stable/url-search-params/index.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
Expand Down Expand Up @@ -75,6 +76,6 @@ _Symbol.isWellKnownSymbol(foo);
_Symbol.isRegisteredSymbol(foo);
_Symbol.metadata;
Object.groupBy(a, b);
_Map.groupBy(a, b);
_Map$groupBy(a, b);
_Promise.withResolvers();
new _URLSearchParams().has(a, b);
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import _toWellFormedInstanceProperty from "core-js-pure/stable/instance/to-well-
import _self from "core-js-pure/stable/self.js";
import _URL$canParse from "core-js-pure/stable/url/can-parse.js";
import _Object$groupBy from "core-js-pure/features/object/group-by.js";
import _Promise from "core-js-pure/stable/promise/index.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js";
import _URLSearchParams from "core-js-pure/stable/url-search-params/index.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
Expand Down Expand Up @@ -76,8 +77,8 @@ _Symbol.isWellKnownSymbol(foo);
_Symbol.isRegisteredSymbol(foo);
_Symbol.metadata;
_Object$groupBy(a, b);
_Map.groupBy(a, b);
_Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new _URLSearchParams().has(a, b);
Math.f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import _toWellFormedInstanceProperty from "core-js-pure/stable/instance/to-well-
import _self from "core-js-pure/stable/self.js";
import _URL$canParse from "core-js-pure/stable/url/can-parse.js";
import _Object$groupBy from "core-js-pure/features/object/group-by.js";
import _Promise from "core-js-pure/stable/promise/index.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js";
import _URLSearchParams from "core-js-pure/stable/url-search-params/index.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
Expand Down Expand Up @@ -76,8 +77,8 @@ _Symbol.isWellKnownSymbol(foo);
_Symbol.isRegisteredSymbol(foo);
_Symbol.metadata;
_Object$groupBy(a, b);
_Map.groupBy(a, b);
_Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new _URLSearchParams().has(a, b);
Math.f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import _toWellFormedInstanceProperty from "core-js-pure/stable/instance/to-well-
import _self from "core-js-pure/stable/self.js";
import _URL$canParse from "core-js-pure/stable/url/can-parse.js";
import _Object$groupBy from "core-js-pure/features/object/group-by.js";
import _Promise from "core-js-pure/stable/promise/index.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js";
import _URLSearchParams from "core-js-pure/stable/url-search-params/index.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
Expand Down Expand Up @@ -76,8 +77,8 @@ _Symbol.isWellKnownSymbol(foo);
_Symbol.isRegisteredSymbol(foo);
_Symbol.metadata;
_Object$groupBy(a, b);
_Map.groupBy(a, b);
_Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new _URLSearchParams().has(a, b);
Math.f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import _toWellFormedInstanceProperty from "core-js-pure/stable/instance/to-well-
import _self from "core-js-pure/stable/self.js";
import _URL$canParse from "core-js-pure/stable/url/can-parse.js";
import _Object$groupBy from "core-js-pure/stable/object/group-by.js";
import _Promise from "core-js-pure/stable/promise/index.js";
import _Map$groupBy from "core-js-pure/stable/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/stable/promise/with-resolvers.js";
import _URLSearchParams from "core-js-pure/stable/url-search-params/index.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
Expand Down Expand Up @@ -76,8 +77,8 @@ _Symbol.isWellKnownSymbol(foo);
_Symbol.isRegisteredSymbol(foo);
_Symbol.metadata;
_Object$groupBy(a, b);
_Map.groupBy(a, b);
_Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new _URLSearchParams().has(a, b);
Math.f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import _Symbol$isWellKnown from "core-js-pure/features/symbol/is-well-known.js";
import _Symbol$isRegistered from "core-js-pure/features/symbol/is-registered.js";
import _demethodizeInstanceProperty from "core-js-pure/features/instance/demethodize.js";
import _URL$canParse from "core-js-pure/features/url/can-parse.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
Expand Down Expand Up @@ -88,6 +89,6 @@ Symbol.isWellKnownSymbol(foo);
Symbol.isRegisteredSymbol(foo);
_Symbol$metadata;
Object.groupBy(a, b);
Map.groupBy(a, b);
_Map$groupBy(a, b);
Promise.withResolvers();
new URLSearchParams().has(a, b);
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import _URL$canParse from "core-js-pure/features/url/can-parse.js";
import _Symbol$isWellKnownSymbol from "core-js-pure/features/symbol/is-well-known-symbol.js";
import _Symbol$isRegisteredSymbol from "core-js-pure/features/symbol/is-registered-symbol.js";
import _Object$groupBy from "core-js-pure/features/object/group-by.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
Expand Down Expand Up @@ -91,8 +93,8 @@ _Symbol$isWellKnownSymbol(foo);
_Symbol$isRegisteredSymbol(foo);
_Symbol$metadata;
_Object$groupBy(a, b);
Map.groupBy(a, b);
Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new URLSearchParams().has(a, b);
Math.f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import _URL$canParse from "core-js-pure/features/url/can-parse.js";
import _Symbol$isWellKnownSymbol from "core-js-pure/features/symbol/is-well-known-symbol.js";
import _Symbol$isRegisteredSymbol from "core-js-pure/features/symbol/is-registered-symbol.js";
import _Object$groupBy from "core-js-pure/features/object/group-by.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js";
import _Math$f16round from "core-js-pure/features/math/f16round.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
Expand Down Expand Up @@ -92,8 +94,8 @@ _Symbol$isWellKnownSymbol(foo);
_Symbol$isRegisteredSymbol(foo);
_Symbol$metadata;
_Object$groupBy(a, b);
Map.groupBy(a, b);
Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new URLSearchParams().has(a, b);
_Math$f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import _URL$canParse from "core-js-pure/features/url/can-parse.js";
import _Symbol$isWellKnownSymbol from "core-js-pure/features/symbol/is-well-known-symbol.js";
import _Symbol$isRegisteredSymbol from "core-js-pure/features/symbol/is-registered-symbol.js";
import _Object$groupBy from "core-js-pure/features/object/group-by.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js";
import _Math$f16round from "core-js-pure/features/math/f16round.js";
import _RegExp$escape from "core-js-pure/features/regexp/escape.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
Expand Down Expand Up @@ -93,8 +95,8 @@ _Symbol$isWellKnownSymbol(foo);
_Symbol$isRegisteredSymbol(foo);
_Symbol$metadata;
_Object$groupBy(a, b);
Map.groupBy(a, b);
Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new URLSearchParams().has(a, b);
_Math$f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import _URL$canParse from "core-js-pure/features/url/can-parse.js";
import _Symbol$isWellKnownSymbol from "core-js-pure/features/symbol/is-well-known-symbol.js";
import _Symbol$isRegisteredSymbol from "core-js-pure/features/symbol/is-registered-symbol.js";
import _Object$groupBy from "core-js-pure/features/object/group-by.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.js";
import _Math$f16round from "core-js-pure/features/math/f16round.js";
import _RegExp$escape from "core-js-pure/features/regexp/escape.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
Expand Down Expand Up @@ -93,8 +95,8 @@ _Symbol$isWellKnownSymbol(foo);
_Symbol$isRegisteredSymbol(foo);
_Symbol$metadata;
_Object$groupBy(a, b);
Map.groupBy(a, b);
Promise.withResolvers();
_Map$groupBy(a, b);
_Promise$withResolvers();
new URLSearchParams().has(a, b);
_Math$f16round(foo);
foo.getFloat16(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,21 @@ JSON.parse
Math.pow

Symbol.something

Map.from
Map.groupBy
Map.keyBy
Map.of

Promise.all
Promise.allSettled
Promise.any
Promise.race
Promise.try
Promise.withResolvers
WeakMap.from

ArrayBuffer.isView

Uint8Array.from
Uint8Array.of
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[
"@@/polyfill-corejs3",
{
"method": "usage-pure"
"method": "usage-pure",
"version": "3.34"
}
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ var _Symbol$split = require("core-js-pure/stable/symbol/split.js");
var _Symbol$toPrimitive = require("core-js-pure/stable/symbol/to-primitive.js");
var _Symbol$toStringTag = require("core-js-pure/stable/symbol/to-string-tag.js");
var _Symbol$unscopables = require("core-js-pure/stable/symbol/unscopables.js");
var _Map = require("core-js-pure/stable/map/index.js");
var _Map$groupBy = require("core-js-pure/stable/map/group-by.js");
var _Promise = require("core-js-pure/stable/promise/index.js");
var _Promise$allSettled = require("core-js-pure/stable/promise/all-settled.js");
var _Promise$any = require("core-js-pure/stable/promise/any.js");
var _Promise$withResolvers = require("core-js-pure/stable/promise/with-resolvers.js");
var _WeakMap = require("core-js-pure/stable/weak-map/index.js");
_Array$from;
_Array$isArray;
_Array$of;
Expand Down Expand Up @@ -193,3 +200,17 @@ Date.something;
JSON.parse;
Math.pow;
_Symbol.something;
_Map.from;
_Map$groupBy;
_Map.keyBy;
_Map.of;
_Promise.all;
_Promise$allSettled;
_Promise$any;
_Promise.race;
_Promise.try;
_Promise$withResolvers;
_WeakMap.from;
ArrayBuffer.isView;
Uint8Array.from;
Uint8Array.of;
28 changes: 28 additions & 0 deletions scripts/download-compat-table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { execSync } = require("child_process");
const { existsSync, mkdirSync } = require("fs");
const path = require("path");
const rimraf = require("rimraf");

const COMPAT_TABLE_COMMIT = "459ee154ee35e1cf55fc9179178d072badf8c67d";
const COMPAT_TABLE_PATH = "build/compat-table";

if (existsSync(COMPAT_TABLE_PATH)) {
const commit = execSync("git rev-parse HEAD", {
cwd: COMPAT_TABLE_PATH,
encoding: "utf8",
}).trim();
if (commit === COMPAT_TABLE_COMMIT) {
process.exit(0);
}
}

rimraf.sync(COMPAT_TABLE_PATH);
mkdirSync("build", { recursive: true });

execSync(
"git clone --branch=gh-pages --single-branch --shallow-since=2022-05-15 https://github.com/kangax/compat-table.git " +
COMPAT_TABLE_PATH
);
execSync("git checkout -qf " + COMPAT_TABLE_COMMIT, {
cwd: COMPAT_TABLE_PATH,
});
20 changes: 0 additions & 20 deletions scripts/download-compat-table.sh

This file was deleted.

0 comments on commit 599f7c4

Please sign in to comment.