Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d63b35c
update the changelog
zloirock Jul 29, 2021
8b64ba5
fix a typo
zloirock Jul 29, 2021
746b30c
add array grouping proposal
zloirock Jul 15, 2021
db449ca
update the changelog
zloirock Jul 15, 2021
6245936
adapt to the actual spec draft
zloirock Jul 17, 2021
0784656
IE10 fix
zloirock Jul 18, 2021
ac93365
Merge pull request #959 from zloirock/array-grouping
zloirock Jul 29, 2021
7ac3900
fix a typo
zloirock Jul 29, 2021
22c8126
fix a typo
zloirock Jul 29, 2021
ba97391
disable `Symbol constructor throws on symbol argument` test
zloirock Jul 29, 2021
92eb5dd
fix content of some entry points
zloirock Jul 29, 2021
c59ec15
add NodeJS 16.6 compat data mapping
zloirock Jul 30, 2021
26af5cc
some stylistic fixes
zloirock Jul 30, 2021
70dc9b3
update dependencies
zloirock Jul 30, 2021
89686ea
3.16.0
zloirock Jul 30, 2021
77e0e3d
move some tests to zx
zloirock Jul 30, 2021
bd40601
update dependencies
zloirock Jul 31, 2021
c8661bc
use `globby` in some cases + some stylistic changes
zloirock Aug 1, 2021
11a1e79
some stylistic changes, optimize `clean-and-copy`
zloirock Aug 2, 2021
f726966
add `check-unused-modules` script
zloirock Aug 2, 2021
de6d2fc
fix microtasks on iOS Pebble
leo60228 Aug 2, 2021
faa1168
Merge pull request #967 from leo60228/pebble-microtask
zloirock Aug 3, 2021
c064b7e
update the changelog
zloirock Aug 3, 2021
0171c09
update `eslint-plugin-unicorn`
zloirock Aug 3, 2021
8665a3d
update dependencies
zloirock Aug 4, 2021
25f09dd
update `babel`
zloirock Aug 5, 2021
9c3a0d8
use `konan` instead of `detective` since we need ESM support
zloirock Aug 5, 2021
84a0573
test and fix unexpected inner namespaces in entry points
zloirock Aug 5, 2021
0aae40b
update dependencies
zloirock Aug 5, 2021
ea035fe
use `7.1` instead of `8.0` for safari versions in compat data since i…
zloirock Aug 6, 2021
823785e
update dependencies
zloirock Aug 6, 2021
6ee268d
simplify and improve commonjs entries testing, test coverage of those…
zloirock Aug 7, 2021
4555d02
simplify
zloirock Aug 8, 2021
d4ecfce
3.16.1
zloirock Aug 8, 2021
ed89cce
update `eslint-plugin-import`
zloirock Aug 9, 2021
c2f48f3
update dependencies
zloirock Aug 9, 2021
1f254c6
drop `regexp/prefer-t` rule
zloirock Aug 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 9 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ const base = {
'import/no-dynamic-require': 'error',
// disallow importing from the same path more than once
'import/no-duplicates': 'error',
// forbid imports with CommonJS exports
'import/no-import-module-exports': 'error',
// prevent importing packages through relative paths
'import/no-relative-packages': 'error',
// forbid a module from importing itself
'import/no-self-import': 'error',
// forbid useless path segments
Expand Down Expand Up @@ -393,6 +397,10 @@ const base = {
'unicorn/no-unsafe-regex': 'error',
// disallow unused object properties
'unicorn/no-unused-properties': 'error',
// disallow useless array length check
'unicorn/no-useless-length-check': 'error',
// disallow useless spread
'unicorn/no-useless-spread': 'error',
// enforce lowercase identifier and uppercase value for number literals
'unicorn/number-literal-case': 'error',
// prefer `Array#indexOf` over `Array#findIndex`` when looking for the index of an item
Expand Down Expand Up @@ -558,8 +566,6 @@ const base = {
'regexp/prefer-regexp-test': 'error',
// enforce using `*` quantifier
'regexp/prefer-star-quantifier': 'error',
// enforce using `\t`
'regexp/prefer-t': 'error',
// enforce use of unicode codepoint escapes
'regexp/prefer-unicode-codepoint-escapes': 'error',
// enforce using `\w`
Expand Down Expand Up @@ -1069,18 +1075,15 @@ module.exports = {
files: ['*.mjs'],
parser: '@babel/eslint-parser',
parserOptions: {
babelOptions: {
plugins: ['@babel/plugin-syntax-top-level-await'],
},
ecmaVersion: 2022,
requireConfigFile: false,
sourceType: 'module',
},
},
{
files: [
'packages/core-js-compat/src/**',
'scripts/**',
'tests/*.mjs',
],
// zx
globals: {
Expand Down
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
## Changelog
##### Unreleased
- Nothing

##### 3.16.1 - 2021.08.09
- Fixed microtask implementation on iOS Pebble, [#967](https://github.com/zloirock/core-js/issues/967)
- Fixed some entry points
- Improved old Safari compat data

##### 3.16.0 - 2021.07.30
- [`Array` find from last proposal](https://github.com/tc39/proposal-array-find-from-last) moved to the stage 3, [July 2021 TC39 meeting](https://github.com/tc39/proposal-array-find-from-last/pull/47)
- [`Array` filtering stage 1 proposal](https://github.com/tc39/proposal-array-filtering):
- `Array.prototype.filterReject` replaces `Array.prototype.filterOut`
- `%TypedArray%.prototype.filterReject` replaces `%TypedArray%.prototype.filterOut`
- Work with symbols made stricter: some missed before case of methods that should throw error on symbols now works as they should
- Added [`Array` grouping stage 1 proposal](https://github.com/tc39/proposal-array-grouping):
- `Array.prototype.groupBy`
- `%TypedArray%.prototype.groupBy`
- Work with symbols made stricter: some missed before cases of methods that should throw an error on symbols now works as they should
- Handling `@@toPrimitive` in some cases of `ToPrimitive` internal logic made stricter
- Fixed work of `Request` with polyfilled `URLSearchParams`, [#965](https://github.com/zloirock/core-js/issues/965)
- Fixed possible exposing of collections elements metadata in some cases, [#427](https://github.com/zloirock/core-js/issues/427)
- Fixed crashing of `Object.create(null)` on WSH, [#966](https://github.com/zloirock/core-js/issues/966)
- Fixed some cases of typed arrays subclassing logic
- Fixed a minor bug related to string conversion in `RegExp#exec`
- Fixed `Date.prototype.getYear` feature detection and compat data for IE8-
- Fixed `Date.prototype.getYear` feature detection
- Fixed content of some entry points
- Some minor optimizations and refactoring
- Deno:
- Added Deno support (sure, after bundling since Deno does not support CommonJS)
- Allowed `deno` target in `core-js-compat` / `core-js-builder`
- A bundle for Deno published on [deno.land/x/corejs](https://deno.land/x/corejs)
- Added / updated compat data / mapping:
- Deno 1.0-1.13
- NodeJS up to 16.6
- iOS Safari up to 15.0
- Samsung Internet up to 15.0
- Opera Android up to 64
- `Object.hasOwn` marked as supported from [V8 9.3](https://chromestatus.com/feature/5662263404920832) and [FF92](https://bugzilla.mozilla.org/show_bug.cgi?id=1721149)
- `Date.prototype.getYear` marked as not supported in IE8-
- Added `summary` option to `core-js-builder`, see more info in the [`README`](https://github.com/zloirock/core-js/blob/master/packages/core-js-builder/README.md), [#910](https://github.com/zloirock/core-js/issues/910)

##### 3.15.2 - 2021.06.29
Expand Down
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Promise.resolve(32).then(x => console.log(x)); // => 32
- [`.of` and `.from` methods on collection constructors](#of-and-from-methods-on-collection-constructors)
- [`compositeKey` and `compositeSymbol`](#compositekey-and-compositesymbol)
- [`Array` filtering](#array-filtering)
- [`Array` grouping](#array-grouping)
- [`Array` deduplication](#array-deduplication)
- [Getting last item from `Array`](#getting-last-item-from-array)
- [`Number.range`](#numberrange)
Expand Down Expand Up @@ -140,14 +141,14 @@ Promise.resolve(32).then(x => console.log(x)); // => 32
### Installation:[⬆](#index)
```
// global version
npm install --save core-js@3.15.2
npm install --save core-js@3.16.1
// version without global namespace pollution
npm install --save core-js-pure@3.15.2
npm install --save core-js-pure@3.16.1
// bundled global version
npm install --save core-js-bundle@3.15.2
npm install --save core-js-bundle@3.16.1
```

Already bundled version of `core-js` [on CDN](https://unpkg.com/core-js-bundle@3.15.2) ([minified version](https://unpkg.com/core-js-bundle@3.15.2/minified.js)).
Already bundled version of `core-js` [on CDN](https://unpkg.com/core-js-bundle@3.16.1) ([minified version](https://unpkg.com/core-js-bundle@3.16.1/minified.js)).

### `postinstall` message[⬆](#index)
The `core-js` project needs your help, so the package shows a message about it after installation. If it causes problems for you, you can disable it:
Expand Down Expand Up @@ -237,9 +238,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.15'`.
[`@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.16'`.

> **Warning!** Recommended to specify used minor `core-js` version, like `corejs: '3.15'`, 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.16'`, 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
Expand Down Expand Up @@ -294,7 +295,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.15', 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.16', proposals: true }`.

#### `@babel/runtime`[⬆](#index)

Expand Down Expand Up @@ -2292,6 +2293,27 @@ core-js/features/typed-array/filter-reject
```js
[1, 2, 3, 4, 5].filterReject(it => it % 2); // => [2, 4]
````
##### [`Array` grouping](#https://github.com/tc39/proposal-array-grouping)[⬆](#index)
Modules [`esnext.array.group-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.group-by.js) and [`esnext.typed-array.group-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.group-by.js).
```js
class Array {
groupBy(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): { [key]: Array<mixed> };
}

class %TypedArray% {
groupBy(callbackfn: (value: number, index: number, target: %TypedArray%) => key, thisArg?: any): { [key]: %TypedArray% };
}
```
[*CommonJS entry points:*](#commonjs-api)
```
core-js/proposals/array-grouping
core-js(-pure)/features/array(/virtual)/group-by
core-js/features/typed-array/group-by
```
[*Examples*](http://es6.zloirock.ru/#log(%5B1%2C%202%2C%203%2C%204%2C%205%5D.groupBy(it%20%3D%3E%20it%20%25%202))%3B%20%2F%2F%20%3D%3E%20%7B%201%3A%20%5B1%2C%203%2C%205%5D%2C%200%3A%20%5B2%2C%204%5D%20%7D):
```js
[1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
````
##### [Array deduplication](https://github.com/tc39/proposal-array-unique)[⬆](#index)
Modules [`esnext.array.unique-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.unique-by.js) and [`esnext.typed-array.unique-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.unique-by.js)
```js
Expand Down Expand Up @@ -2851,9 +2873,9 @@ function getIteratorMethod(value: any): Function | void;
```
[*CommonJS entry points:*](#commonjs-api)
```js
core-js-pure/features/is-iterable
core-js-pure/features/get-iterator
core-js-pure/features/get-iterator-method
core-js-pure/es|stable|features/is-iterable
core-js-pure/es|stable|features/get-iterator
core-js-pure/es|stable|features/get-iterator-method
```
[*Examples*](http://goo.gl/SXsM6D):
```js
Expand Down
2 changes: 1 addition & 1 deletion deno/corejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

*Example*:
```js
import 'https://deno.land/x/corejs@v3.15.2/index.js'; // <- at the top of your entry point
import 'https://deno.land/x/corejs@v3.16.1/index.js'; // <- at the top of your entry point

Object.hasOwn({ foo: 42 }, 'foo'); // => true

Expand Down
Loading