From 8c77615bb9c7e8153ef7bafb65625d4375a6ccf1 Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Mon, 27 Feb 2023 04:15:09 +0700 Subject: [PATCH] 3.29.0 --- CHANGELOG.md | 3 ++ ORIGINAL_README.md | 14 ++--- deno/corejs/README.md | 2 +- deno/corejs/index.js | 74 +++++++++++++++++---------- docs/compat/compat-data.js | 31 ++++++++--- docs/compat/tests.js | 5 +- package-lock.json | 18 +++---- package.json | 2 +- packages/core-js-builder/package.json | 6 +-- packages/core-js-bundle/package.json | 2 +- packages/core-js-compat/README.md | 6 +-- packages/core-js-compat/package.json | 2 +- packages/core-js-pure/package.json | 2 +- packages/core-js/internals/shared.js | 4 +- packages/core-js/package.json | 2 +- 15 files changed, 107 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00f87765b478..824174b28a53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog ##### Unreleased +- Nothing + +##### [3.29.0 - 2023.02.27](https://github.com/zloirock/core-js/releases/tag/v3.29.0) - Added `URLSearchParams.prototype.size` getter, [url/734](https://github.com/whatwg/url/pull/734) - Allowed cloning resizable `ArrayBuffer`s in the `structuredClone` polyfill - Fixed wrong export in `/(stable|actual|full)/instance/unshift` entries, [#1207](https://github.com/zloirock/core-js/issues/1207) diff --git a/ORIGINAL_README.md b/ORIGINAL_README.md index 5ea061c94007..b323b85f86d9 100644 --- a/ORIGINAL_README.md +++ b/ORIGINAL_README.md @@ -208,11 +208,11 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3]) ### Installation:[⬆](#index) ```sh // global version -npm install --save core-js@3.28.0 +npm install --save core-js@3.29.0 // version without global namespace pollution -npm install --save core-js-pure@3.28.0 +npm install --save core-js-pure@3.29.0 // bundled global version -npm install --save core-js-bundle@3.28.0 +npm install --save core-js-bundle@3.29.0 ``` Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/core-js-bundle). @@ -309,9 +309,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.28'`. +[`@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.29'`. -> **Warning!** Recommended to specify used minor `core-js` version, like `corejs: '3.28'`, 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.29'`, 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 @@ -366,7 +366,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.28', 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.29', proposals: true }`. > **Warning!** In the case of `useBuiltIns: 'usage'`, you should not add `core-js` imports by yourself, they will be added automatically. @@ -402,7 +402,7 @@ Fast JavaScript transpiler `swc` [contains integration with `core-js`](https://s "env": { "targets": "> 0.25%, not dead", "mode": "entry", - "coreJs": "3.28" + "coreJs": "3.29" } } ``` diff --git a/deno/corejs/README.md b/deno/corejs/README.md index cffbfc56f5a2..f16947f64d9e 100644 --- a/deno/corejs/README.md +++ b/deno/corejs/README.md @@ -28,7 +28,7 @@ *Example*: ```js -import 'https://deno.land/x/corejs@v3.28.0/index.js'; // <- at the top of your entry point +import 'https://deno.land/x/corejs@v3.29.0/index.js'; // <- at the top of your entry point Object.hasOwn({ foo: 42 }, 'foo'); // => true diff --git a/deno/corejs/index.js b/deno/corejs/index.js index 9a979a5ef5bd..0309091610aa 100644 --- a/deno/corejs/index.js +++ b/deno/corejs/index.js @@ -1,7 +1,7 @@ /** - * core-js 3.28.0 + * core-js 3.29.0 * © 2014-2023 Denis Pushkarev (zloirock.ru) - * license: https://github.com/zloirock/core-js/blob/v3.28.0/LICENSE + * license: https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE * source: https://github.com/zloirock/core-js */ !function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap @@ -277,7 +277,8 @@ __webpack_require__(433); __webpack_require__(434); __webpack_require__(435); __webpack_require__(440); -module.exports = __webpack_require__(441); +__webpack_require__(441); +module.exports = __webpack_require__(442); /***/ }), @@ -942,10 +943,10 @@ var store = __webpack_require__(36); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.28.0', + version: '3.29.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.28.0/LICENSE', + license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); @@ -9435,31 +9436,21 @@ Context.prototype = { var i = this.skip(IS_WHITESPACE, this.index); var fork = this.fork(i); var chr = at(source, i); - var result; - if (exec(IS_NUMBER_START, chr)) result = fork.number(); - else switch (chr) { + if (exec(IS_NUMBER_START, chr)) return fork.number(); + switch (chr) { case '{': - result = fork.object(); - break; + return fork.object(); case '[': - result = fork.array(); - break; + return fork.array(); case '"': - result = fork.string(); - break; + return fork.string(); case 't': - result = fork.keyword(true); - break; + return fork.keyword(true); case 'f': - result = fork.keyword(false); - break; + return fork.keyword(false); case 'n': - result = fork.keyword(null); - break; - default: - throw SyntaxError('Unexpected character: "' + chr + '" at: ' + i); - } - return result; + return fork.keyword(null); + } throw SyntaxError('Unexpected character: "' + chr + '" at: ' + i); }, node: function (type, value, start, end, nodes) { return new Node(value, end, type ? null : slice(this.source, start, end), nodes); @@ -13951,7 +13942,7 @@ var structuredCloneInternal = function (value, map) { var type = classof(value); var deep = false; - var C, name, cloned, dataTransfer, i, length, keys, key, source, target; + var C, name, cloned, dataTransfer, i, length, keys, key, source, target, options; switch (type) { case 'Array': @@ -14106,11 +14097,12 @@ var structuredCloneInternal = function (value, map) { if (!C && typeof value.slice != 'function') throwUnpolyfillable(type); // detached buffers throws in `DataView` and `.slice` try { - if (typeof value.slice == 'function') { + if (typeof value.slice == 'function' && !value.resizable) { cloned = value.slice(0); } else { length = value.byteLength; - cloned = new ArrayBuffer(length); + options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined; + cloned = new ArrayBuffer(length, options); source = new C(value); target = new C(cloned); for (i = 0; i < length; i++) { @@ -14305,5 +14297,33 @@ $({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLA }); +/***/ }), +/* 442 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var DESCRIPTORS = __webpack_require__(5); +var uncurryThis = __webpack_require__(13); +var defineBuiltInAccessor = __webpack_require__(119); + +var URLSearchParamsPrototype = URLSearchParams.prototype; +var forEach = uncurryThis(URLSearchParamsPrototype.forEach); + +// `URLSearchParams.prototype.size` getter +// https://github.com/whatwg/url/pull/734 +if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) { + defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { + get: function size() { + var count = 0; + forEach(this, function () { count++; }); + return count; + }, + configurable: true, + enumerable: true + }); +} + + /***/ }) /******/ ]); }(); diff --git a/docs/compat/compat-data.js b/docs/compat/compat-data.js index 7a959600cdca..c9ac3654f61c 100644 --- a/docs/compat/compat-data.js +++ b/docs/compat/compat-data.js @@ -5981,22 +5981,34 @@ "esnext.set.filter": {}, "esnext.set.find": {}, "esnext.set.from": {}, - "esnext.set.intersection.v2": {}, + "esnext.set.intersection.v2": { + "bun": "0.5.7" + }, "esnext.set.intersection": {}, - "esnext.set.is-disjoint-from.v2": {}, + "esnext.set.is-disjoint-from.v2": { + "bun": "0.5.7" + }, "esnext.set.is-disjoint-from": {}, - "esnext.set.is-subset-of.v2": {}, + "esnext.set.is-subset-of.v2": { + "bun": "0.5.7" + }, "esnext.set.is-subset-of": {}, - "esnext.set.is-superset-of.v2": {}, + "esnext.set.is-superset-of.v2": { + "bun": "0.5.7" + }, "esnext.set.is-superset-of": {}, "esnext.set.join": {}, "esnext.set.map": {}, "esnext.set.of": {}, "esnext.set.reduce": {}, "esnext.set.some": {}, - "esnext.set.symmetric-difference.v2": {}, + "esnext.set.symmetric-difference.v2": { + "bun": "0.5.7" + }, "esnext.set.symmetric-difference": {}, - "esnext.set.union.v2": {}, + "esnext.set.union.v2": { + "bun": "0.5.7" + }, "esnext.set.union": {}, "esnext.string.at": {}, "esnext.string.cooked": {}, @@ -6049,7 +6061,9 @@ "safari": "13.1", "samsung": "14.0" }, - "esnext.string.to-well-formed": {}, + "esnext.string.to-well-formed": { + "bun": "0.5.7" + }, "esnext.symbol.async-dispose": {}, "esnext.symbol.dispose": {}, "esnext.symbol.is-registered": {}, @@ -6535,5 +6549,6 @@ "quest": "6.0", "safari": "14.0", "samsung": "9.0" - } + }, + "web.url-search-params.size": {} } \ No newline at end of file diff --git a/docs/compat/tests.js b/docs/compat/tests.js index 0d5206b25730..effebb5ccb56 100644 --- a/docs/compat/tests.js +++ b/docs/compat/tests.js @@ -1945,5 +1945,8 @@ GLOBAL.tests = { 'web.url.to-json': [URL_AND_URL_SEARCH_PARAMS_SUPPORT, function () { return URL.prototype.toJSON; }], - 'web.url-search-params.constructor': URL_AND_URL_SEARCH_PARAMS_SUPPORT + 'web.url-search-params.constructor': URL_AND_URL_SEARCH_PARAMS_SUPPORT, + 'web.url-search-params.size': [URL_AND_URL_SEARCH_PARAMS_SUPPORT, function () { + return 'size' in URLSearchParams.prototype; + }] }; diff --git a/package-lock.json b/package-lock.json index 50d40a30a932..14b4c7822a96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "core-js", - "version": "3.28.0", + "version": "3.29.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "version": "3.28.0", + "version": "3.29.0", "license": "MIT", "workspaces": [ "./packages/*" @@ -6201,7 +6201,7 @@ } }, "packages/core-js": { - "version": "3.28.0", + "version": "3.29.0", "hasInstallScript": true, "license": "MIT", "funding": { @@ -6210,11 +6210,11 @@ } }, "packages/core-js-builder": { - "version": "3.28.0", + "version": "3.29.0", "license": "MIT", "dependencies": { - "core-js": "3.28.0", - "core-js-compat": "3.28.0", + "core-js": "3.29.0", + "core-js-compat": "3.29.0", "mkdirp": ">=0.5.5 <1", "webpack": ">=4.46.0 <5" }, @@ -6227,7 +6227,7 @@ } }, "packages/core-js-bundle": { - "version": "3.28.0", + "version": "3.29.0", "hasInstallScript": true, "license": "MIT", "funding": { @@ -6236,7 +6236,7 @@ } }, "packages/core-js-compat": { - "version": "3.28.0", + "version": "3.29.0", "license": "MIT", "dependencies": { "browserslist": "^4.21.5" @@ -6247,7 +6247,7 @@ } }, "packages/core-js-pure": { - "version": "3.28.0", + "version": "3.29.0", "hasInstallScript": true, "license": "MIT", "funding": { diff --git a/package.json b/package.json index 72edd2e8710b..5e2db87cbacf 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "3.28.0", + "version": "3.29.0", "repository": { "type": "git", "url": "https://github.com/zloirock/core-js.git" diff --git a/packages/core-js-builder/package.json b/packages/core-js-builder/package.json index 19aa0371bb28..4e119d7de40f 100644 --- a/packages/core-js-builder/package.json +++ b/packages/core-js-builder/package.json @@ -1,6 +1,6 @@ { "name": "core-js-builder", - "version": "3.28.0", + "version": "3.29.0", "description": "core-js builder", "repository": { "type": "git", @@ -21,8 +21,8 @@ "main": "index.js", "types": "index.d.ts", "dependencies": { - "core-js": "3.28.0", - "core-js-compat": "3.28.0", + "core-js": "3.29.0", + "core-js-compat": "3.29.0", "mkdirp": ">=0.5.5 <1", "webpack": ">=4.46.0 <5" }, diff --git a/packages/core-js-bundle/package.json b/packages/core-js-bundle/package.json index 2a7a45a4232e..5117e58920f8 100644 --- a/packages/core-js-bundle/package.json +++ b/packages/core-js-bundle/package.json @@ -1,6 +1,6 @@ { "name": "core-js-bundle", - "version": "3.28.0", + "version": "3.29.0", "description": "Standard library", "keywords": [ "ES3", diff --git a/packages/core-js-compat/README.md b/packages/core-js-compat/README.md index 9cc2c93b79c7..6b88c5d18775 100644 --- a/packages/core-js-compat/README.md +++ b/packages/core-js-compat/README.md @@ -27,7 +27,7 @@ const { exclude: [ // optional list / filter of modules to exclude, the signature is similar to `modules` option 'web.atob', ], - version: '3.28', // used `core-js` version, by default - the latest + version: '3.29', // 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 require('core-js-compat').modules; // => Array // the subset of modules which available in the passed `core-js` version: -require('core-js-compat/get-modules-list-for-target-version')('3.28'); // => Array +require('core-js-compat/get-modules-list-for-target-version')('3.29'); // => Array // or -require('core-js-compat').getModulesListForTargetVersion('3.28'); // => Array +require('core-js-compat').getModulesListForTargetVersion('3.29'); // => Array ``` 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: diff --git a/packages/core-js-compat/package.json b/packages/core-js-compat/package.json index 3d6095e46ef8..15dcc456292d 100644 --- a/packages/core-js-compat/package.json +++ b/packages/core-js-compat/package.json @@ -1,6 +1,6 @@ { "name": "core-js-compat", - "version": "3.28.0", + "version": "3.29.0", "description": "core-js compat", "repository": { "type": "git", diff --git a/packages/core-js-pure/package.json b/packages/core-js-pure/package.json index ca25e495dc22..dcff489257db 100644 --- a/packages/core-js-pure/package.json +++ b/packages/core-js-pure/package.json @@ -1,6 +1,6 @@ { "name": "core-js-pure", - "version": "3.28.0", + "version": "3.29.0", "description": "Standard library", "keywords": [ "ES3", diff --git a/packages/core-js/internals/shared.js b/packages/core-js/internals/shared.js index 505279142c36..a46fbf331c2f 100644 --- a/packages/core-js/internals/shared.js +++ b/packages/core-js/internals/shared.js @@ -4,9 +4,9 @@ var store = require('../internals/shared-store'); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.28.0', + version: '3.29.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.28.0/LICENSE', + license: 'https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); diff --git a/packages/core-js/package.json b/packages/core-js/package.json index 5fd100b26a0a..dab7f079d634 100644 --- a/packages/core-js/package.json +++ b/packages/core-js/package.json @@ -1,6 +1,6 @@ { "name": "core-js", - "version": "3.28.0", + "version": "3.29.0", "description": "Standard library", "keywords": [ "ES3",