This commit is contained in:
Denis Pushkarev
2023-12-06 01:01:25 +07:00
parent 05aac8709e
commit a5f44ac8ba
15 changed files with 1272 additions and 893 deletions
+3
View File
@@ -1,5 +1,8 @@
## Changelog
##### Unreleased
- Nothing
##### [3.34.0 - 2023.12.06](https://github.com/zloirock/core-js/releases/tag/v3.34.0)
- [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping):
- Methods:
- `Object.groupBy`
+7 -7
View File
@@ -210,11 +210,11 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
### Installation:[⬆](#index)
```sh
// global version
npm install --save core-js@3.33.3
npm install --save core-js@3.34.0
// version without global namespace pollution
npm install --save core-js-pure@3.33.3
npm install --save core-js-pure@3.34.0
// bundled global version
npm install --save core-js-bundle@3.33.3
npm install --save core-js-bundle@3.34.0
```
Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/core-js-bundle).
@@ -311,9 +311,9 @@ import 'regenerator-runtime/runtime';
#### `@babel/preset-env`[⬆](#index)
[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes working with global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to used version of `core-js`, like `corejs: '3.33'`.
[`@babel/preset-env`](https://github.com/babel/babel/tree/master/packages/babel-preset-env) has `useBuiltIns` option, which optimizes working with global version of `core-js`. With `useBuiltIns` option, you should also set `corejs` option to used version of `core-js`, like `corejs: '3.34'`.
> **Warning!** Recommended to specify used minor `core-js` version, like `corejs: '3.33'`, instead of `corejs: 3`, since with `corejs: 3` will not be injected modules which were added in minor `core-js` releases.
> **Warning!** Recommended to specify used minor `core-js` version, like `corejs: '3.34'`, instead of `corejs: 3`, since with `corejs: 3` will not be injected modules which were added in minor `core-js` releases.
- `useBuiltIns: 'entry'` replaces imports of `core-js` to import only required for a target environment modules. So, for example,
```js
@@ -368,7 +368,7 @@ import 'core-js/modules/es.array.of';
var array = Array.of(1, 2, 3);
```
By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by `proposals` option, as `corejs: { version: '3.33', proposals: true }`.
By default, `@babel/preset-env` with `useBuiltIns: 'usage'` option only polyfills stable features, but you can enable polyfilling of proposals by `proposals` option, as `corejs: { version: '3.34', proposals: true }`.
> **Warning!** In the case of `useBuiltIns: 'usage'`, you should not add `core-js` imports by yourself, they will be added automatically.
@@ -404,7 +404,7 @@ Fast JavaScript transpiler `swc` [contains integration with `core-js`](https://s
"env": {
"targets": "> 0.25%, not dead",
"mode": "entry",
"coreJs": "3.33"
"coreJs": "3.34"
}
}
```
+1 -1
View File
@@ -29,7 +29,7 @@
*Example*:
```js
import 'https://deno.land/x/corejs@v3.33.3/index.js'; // <- at the top of your entry point
import 'https://deno.land/x/corejs@v3.34.0/index.js'; // <- at the top of your entry point
Object.hasOwn({ foo: 42 }, 'foo'); // => true
+1168 -854
View File
File diff suppressed because it is too large Load Diff
+50
View File
@@ -1836,6 +1836,22 @@
"safari": "10.0",
"samsung": "5.0"
},
"es.map.group-by": {
"android": "117",
"chrome": "117",
"chrome-android": "117",
"deno": "1.37",
"edge": "117",
"electron": "27.0",
"firefox": "119",
"firefox-android": "119",
"node": "21.0",
"oculus": "30.0",
"opera": "103",
"opera-android": "78",
"opera_mobile": "78",
"quest": "30.0"
},
"es.math.acosh": {
"android": "54",
"bun": "0.1.1",
@@ -2874,6 +2890,22 @@
"safari": "9.0",
"samsung": "4.0"
},
"es.object.group-by": {
"android": "117",
"chrome": "117",
"chrome-android": "117",
"deno": "1.37",
"edge": "117",
"electron": "27.0",
"firefox": "119",
"firefox-android": "119",
"node": "21.0",
"oculus": "30.0",
"opera": "103",
"opera-android": "78",
"opera_mobile": "78",
"quest": "30.0"
},
"es.object.has-own": {
"android": "93",
"bun": "0.1.1",
@@ -3451,6 +3483,18 @@
"safari": "11.0",
"samsung": "9.0"
},
"es.promise.with-resolvers": {
"android": "119",
"bun": "0.7.1",
"chrome": "119",
"chrome-android": "119",
"deno": "1.38",
"edge": "119",
"electron": "28.0",
"firefox": "121",
"firefox-android": "121",
"opera": "105"
},
"es.reflect.apply": {
"android": "49",
"bun": "0.1.1",
@@ -6245,6 +6289,8 @@
"deno": "1.38",
"edge": "119",
"electron": "28.0",
"firefox": "121",
"firefox-android": "121",
"opera": "105"
},
"esnext.reflect.define-metadata": {},
@@ -6519,6 +6565,10 @@
"safari": "16.4",
"samsung": "21.0"
},
"esnext.uint8-array.from-base64": {},
"esnext.uint8-array.from-hex": {},
"esnext.uint8-array.to-base64": {},
"esnext.uint8-array.to-hex": {},
"esnext.weak-map.delete-all": {},
"esnext.weak-map.from": {},
"esnext.weak-map.of": {},
+21 -9
View File
@@ -694,6 +694,9 @@ GLOBAL.tests = {
&& map.has(0)
&& map[Symbol.toStringTag];
}],
'es.map.group-by': function () {
return Map.groupBy;
},
'es.math.acosh': function () {
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
return Math.floor(Math.acosh(Number.MAX_VALUE)) === 710
@@ -880,6 +883,9 @@ GLOBAL.tests = {
'es.object.get-prototype-of': function () {
return Object.getPrototypeOf('qwe');
},
'es.object.group-by': function () {
return Object.groupBy;
},
'es.object.has-own': function () {
return Object.hasOwn;
},
@@ -957,6 +963,9 @@ GLOBAL.tests = {
}],
'es.promise.reject': PROMISES_SUPPORT,
'es.promise.resolve': PROMISES_SUPPORT,
'es.promise.with-resolvers': [PROMISES_SUPPORT, function () {
return Promise.withResolvers;
}],
'es.reflect.apply': function () {
try {
return Reflect.apply(function () {
@@ -1678,9 +1687,6 @@ GLOBAL.tests = {
'esnext.map.from': function () {
return Map.from;
},
'esnext.map.group-by': function () {
return Map.groupBy;
},
'esnext.map.includes': function () {
return Map.prototype.includes;
},
@@ -1741,12 +1747,6 @@ GLOBAL.tests = {
'esnext.number.from-string': function () {
return Number.fromString;
},
'esnext.object.group-by': function () {
return Object.groupBy;
},
'esnext.promise.with-resolvers': [PROMISES_SUPPORT, function () {
return Promise.withResolvers;
}],
'esnext.regexp.escape': function () {
return RegExp.escape;
},
@@ -1830,6 +1830,18 @@ GLOBAL.tests = {
'esnext.typed-array.unique-by': function () {
return Int8Array.prototype.uniqueBy;
},
'esnext.uint8-array.from-base64': function () {
return Uint8Array.fromBase64;
},
'esnext.uint8-array.from-hex': function () {
return Uint8Array.fromHex;
},
'esnext.uint8-array.to-base64': function () {
return Uint8Array.prototype.toBase64;
},
'esnext.uint8-array.to-hex': function () {
return Uint8Array.prototype.toHex;
},
'esnext.weak-map.delete-all': function () {
return WeakMap.prototype.deleteAll;
},
+9 -9
View File
@@ -1,11 +1,11 @@
{
"name": "core-js",
"version": "3.33.3",
"version": "3.34.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"version": "3.33.3",
"version": "3.34.0",
"license": "MIT",
"workspaces": [
"./packages/*"
@@ -6168,7 +6168,7 @@
}
},
"packages/core-js": {
"version": "3.33.3",
"version": "3.34.0",
"hasInstallScript": true,
"license": "MIT",
"funding": {
@@ -6177,11 +6177,11 @@
}
},
"packages/core-js-builder": {
"version": "3.33.3",
"version": "3.34.0",
"license": "MIT",
"dependencies": {
"core-js": "3.33.3",
"core-js-compat": "3.33.3",
"core-js": "3.34.0",
"core-js-compat": "3.34.0",
"mkdirp": ">=0.5.5 <1",
"webpack": ">=4.47.0 <5"
},
@@ -6194,7 +6194,7 @@
}
},
"packages/core-js-bundle": {
"version": "3.33.3",
"version": "3.34.0",
"hasInstallScript": true,
"license": "MIT",
"funding": {
@@ -6203,7 +6203,7 @@
}
},
"packages/core-js-compat": {
"version": "3.33.3",
"version": "3.34.0",
"license": "MIT",
"dependencies": {
"browserslist": "^4.22.2"
@@ -6214,7 +6214,7 @@
}
},
"packages/core-js-pure": {
"version": "3.33.3",
"version": "3.34.0",
"hasInstallScript": true,
"license": "MIT",
"funding": {
+1 -1
View File
@@ -1,5 +1,5 @@
{
"version": "3.33.3",
"version": "3.34.0",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-builder",
"version": "3.33.3",
"version": "3.34.0",
"type": "commonjs",
"description": "core-js builder",
"repository": {
@@ -22,8 +22,8 @@
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"core-js": "3.33.3",
"core-js-compat": "3.33.3",
"core-js": "3.34.0",
"core-js-compat": "3.34.0",
"mkdirp": ">=0.5.5 <1",
"webpack": ">=4.47.0 <5"
},
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-bundle",
"version": "3.33.3",
"version": "3.34.0",
"type": "commonjs",
"description": "Standard library",
"keywords": [
+3 -3
View File
@@ -27,7 +27,7 @@ const {
exclude: [ // optional list / filter of modules to exclude, the signature is similar to `modules` option
'web.atob',
],
version: '3.33', // used `core-js` version, by default - the latest
version: '3.34', // used `core-js` version, by default - the latest
inverse: false, // inverse of the result - shows modules that are NOT required for the target environment
});
@@ -125,9 +125,9 @@ require('core-js-compat/modules'); // => Array<ModuleName>
require('core-js-compat').modules; // => Array<ModuleName>
// the subset of modules which available in the passed `core-js` version:
require('core-js-compat/get-modules-list-for-target-version')('3.33'); // => Array<ModuleName>
require('core-js-compat/get-modules-list-for-target-version')('3.34'); // => Array<ModuleName>
// or
require('core-js-compat').getModulesListForTargetVersion('3.33'); // => Array<ModuleName>
require('core-js-compat').getModulesListForTargetVersion('3.34'); // => Array<ModuleName>
```
If you wanna help to improve this data, you could take a look at the related section of [`CONTRIBUTING.md`](https://github.com/zloirock/core-js/blob/master/CONTRIBUTING.md#how-to-update-core-js-compat-data). The visualization of compatibility data and the browser tests runner is available [here](http://zloirock.github.io/core-js/compat/), the example:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-compat",
"version": "3.33.3",
"version": "3.34.0",
"type": "commonjs",
"description": "core-js compat",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js-pure",
"version": "3.33.3",
"version": "3.34.0",
"type": "commonjs",
"description": "Standard library",
"keywords": [
+2 -2
View File
@@ -5,9 +5,9 @@ var store = require('../internals/shared-store');
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.33.3',
version: '3.34.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "core-js",
"version": "3.33.3",
"version": "3.34.0",
"type": "commonjs",
"description": "Standard library",
"keywords": [