Skip to content

Commit 1071719

Browse files
slowcheetahzloirock
authored andcommitted
Update docs for v4
1 parent 3dcfa6e commit 1071719

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+216
-644
lines changed

docs/web/docs/engines.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Supported engines and compatibility data
22

3-
`core-js` tries to support all possible JS engines and environments with ES3 support. Some features have a higher lower bar - for example, *some* accessors can properly work only from ES5, promises require a way to set a microtask or a task, etc.
3+
Starting from version 4, `core-js` drops support for ancient engines and focuses on environments with at least IE11-level JavaScript features (approximately ES5 + some additions). Older platforms - such as IE10 and below, Android 4.4.3 and below, PhantomJS, Opera Presto, and similar legacy engines - are no longer supported. If you still need to support such legacy browsers, please continue using `core-js` version 3.
44

5-
However, I have no possibility to test `core-js` absolutely everywhere - for example, testing in IE7- and some other ancient was stopped. The list of definitely supported engines you can see in the compatibility table by the link below. [Write](https://github.com/zloirock/core-js/issues) if you have issues or questions with the support of any engine.
5+
The baseline is engines about IE11, ES5 with some additions:
6+
- Basic `WeakMap` support (no matter bugs, for internal usage only, in polyfills could be fixed)
7+
- Basic `Map` and `Set` support (no matter bugs, for internal usage only, in polyfills could be fixed or completely replaced)
8+
- Basic `%TypedArray%`, `ArrayBuffer` and `DataView` constructors support (no matter bugs, in polyfills could be fixed)
9+
- A way setting of a prototype - `Object.setPrototypeOf` or `__proto__`
610

7-
`core-js` project provides (as [`core-js-compat`](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat) package) all required data about the necessity of `core-js` modules, entry points, and tools for work with it - it's useful for integration with tools like `babel` or `swc`. If you wanna help, you could take a look at the related section of [`CONTRIBUTING`](contributing#h-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/master/compat/), the example:
11+
Examples of supported engines:
12+
- IE11
13+
- Chrome 38
14+
- Safari 7.1
15+
- FF15
16+
- Node 0.11
17+
18+
`core-js` provides (as [`@core-js/compat`](https://github.com/zloirock/core-js/tree/v4/packages/core-js-compat) package) all required data about the necessity of `core-js` modules, entry points, and tools for work with it - it's useful for integration with tools like `babel` or `swc`. If you wanna help, you could take a look at the related section of [`CONTRIBUTING`](contributing#h-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/v4/compat/), the example:
819

920
![compat-table](https://user-images.githubusercontent.com/2213682/217452234-ccdcfc5a-c7d3-40d1-ab3f-86902315b8c3.png)

docs/web/docs/features/ecmascript/array.md

Lines changed: 33 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ECMAScript: Array
22

33
## Modules
4-
[`es.array.from`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.from.js), [`es.array.from-async`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.from-async.js), [`es.array.is-array`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.is-array.js), [`es.array.of`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.of.js), [`es.array.copy-within`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.copy-within.js), [`es.array.fill`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.fill.js), [`es.array.find`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.find.js), [`es.array.find-index`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.find-index.js), [`es.array.find-last`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.find-last.js), [`es.array.find-last-index`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.find-last-index.js), [`es.array.iterator`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.iterator.js), [`es.array.includes`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.includes.js), [`es.array.push`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.push.js), [`es.array.slice`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.slice.js), [`es.array.join`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.join.js), [`es.array.unshift`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.unshift.js), [`es.array.index-of`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.index-of.js), [`es.array.last-index-of`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.last-index-of.js), [`es.array.every`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.every.js), [`es.array.some`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.some.js), [`es.array.for-each`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.for-each.js), [`es.array.map`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.map.js), [`es.array.filter`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.filter.js), [`es.array.reduce`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.reduce.js), [`es.array.reduce-right`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.reduce-right.js), [`es.array.reverse`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.reverse.js), [`es.array.sort`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.sort.js), [`es.array.flat`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.flat.js), [`es.array.flat-map`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.flat-map.js), [`es.array.unscopables.flat`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.unscopables.flat.js), [`es.array.unscopables.flat-map`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.unscopables.flat-map.js), [`es.array.at`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.at.js), [`es.array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.to-reversed.js), [`es.array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.to-sorted.js), [`es.array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.to-spliced.js), [`es.array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.array.with.js).
4+
[`es.array.from`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.from.js), [`es.array.from-async`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.from-async.js), [`es.array.of`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.of.js), [`es.array.copy-within`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.copy-within.js), [`es.array.fill`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.fill.js), [`es.array.find`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.find.js), [`es.array.find-index`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.find-index.js), [`es.array.find-last`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.find-last.js), [`es.array.find-last-index`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.find-last-index.js), [`es.array.iterator`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.iterator.js), [`es.array.includes`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.includes.js), [`es.array.push`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.push.js), [`es.array.slice`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.slice.js), [`es.array.join`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.join.js), [`es.array.unshift`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.unshift.js), [`es.array.index-of`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.index-of.js), [`es.array.last-index-of`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.last-index-of.js), [`es.array.map`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.map.js), [`es.array.filter`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.filter.js), [`es.array.reduce`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.reduce.js), [`es.array.reduce-right`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.reduce-right.js), [`es.array.reverse`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.reverse.js), [`es.array.sort`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.sort.js), [`es.array.flat`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.flat.js), [`es.array.flat-map`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.flat-map.js), [`es.array.unscopables.flat`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.unscopables.flat.js), [`es.array.unscopables.flat-map`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.unscopables.flat-map.js), [`es.array.at`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.at.js), [`es.array.to-reversed`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.to-reversed.js), [`es.array.to-sorted`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.to-sorted.js), [`es.array.to-spliced`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.to-spliced.js), [`es.array.with`](https://github.com/zloirock/core-js/blob/v4/packages/core-js/modules/es.array.with.js).
55

66
## Built-ins signatures
77
```ts
@@ -10,7 +10,6 @@ class Array {
1010
concat(...args: Array<mixed>): Array<mixed>; // with adding support of @@isConcatSpreadable and @@species
1111
copyWithin(target: number, start: number, end?: number): this;
1212
entries(): Iterator<[index, value]>;
13-
every(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): boolean;
1413
fill(value: any, start?: number, end?: number): this;
1514
filter(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): Array<mixed>; // with adding support of @@species
1615
find(callbackfn: (value: any, index: number, target: any) => boolean), thisArg?: any): any;
@@ -19,7 +18,6 @@ class Array {
1918
findLastIndex(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): uint;
2019
flat(depthArg?: number = 1): Array<mixed>;
2120
flatMap(mapFn: (value: any, index: number, target: any) => any, thisArg: any): Array<mixed>;
22-
forEach(callbackfn: (value: any, index: number, target: any) => void, thisArg?: any): void;
2321
includes(searchElement: any, from?: number): boolean;
2422
indexOf(searchElement: any, from?: number): number;
2523
join(separator: string = ','): string;
@@ -32,7 +30,6 @@ class Array {
3230
reverse(): this; // Safari 12.0 bug fix
3331
slice(start?: number, end?: number): Array<mixed>; // with adding support of @@species
3432
splice(start?: number, deleteCount?: number, ...items: Array<mixed>): Array<mixed>; // with adding support of @@species
35-
some(callbackfn: (value: any, index: number, target: any) => boolean, thisArg?: any): boolean;
3633
sort(comparefn?: (a: any, b: any) => number): this; // with modern behavior like stable sort
3734
toReversed(): Array<mixed>;
3835
toSpliced(start?: number, deleteCount?: number, ...items: Array<mixed>): Array<mixed>;
@@ -44,7 +41,6 @@ class Array {
4441
@@unscopables: { [newMethodNames: string]: true };
4542
static from(items: Iterable | ArrayLike, mapFn?: (value: any, index: number) => any, thisArg?: any): Array<mixed>;
4643
static fromAsync(asyncItems: AsyncIterable | Iterable | ArrayLike, mapfn?: (value: any, index: number) => any, thisArg?: any): Array;
47-
static isArray(value: any): boolean;
4844
static of(...args: Array<mixed>): Array<mixed>;
4945
}
5046

@@ -59,42 +55,38 @@ core-js(-pure)/es|stable|actual|full/array
5955
core-js(-pure)/es|stable|actual|full/array/from
6056
core-js(-pure)/es|stable|actual|full/array/from-async
6157
core-js(-pure)/es|stable|actual|full/array/of
62-
core-js(-pure)/es|stable|actual|full/array/is-array
63-
core-js(-pure)/es|stable|actual|full/array(/virtual)/at
64-
core-js(-pure)/es|stable|actual|full/array(/virtual)/concat
65-
core-js(-pure)/es|stable|actual|full/array(/virtual)/copy-within
66-
core-js(-pure)/es|stable|actual|full/array(/virtual)/entries
67-
core-js(-pure)/es|stable|actual|full/array(/virtual)/every
68-
core-js(-pure)/es|stable|actual|full/array(/virtual)/fill
69-
core-js(-pure)/es|stable|actual|full/array(/virtual)/filter
70-
core-js(-pure)/es|stable|actual|full/array(/virtual)/find
71-
core-js(-pure)/es|stable|actual|full/array(/virtual)/find-index
72-
core-js(-pure)/es|stable|actual|full/array(/virtual)/find-last
73-
core-js(-pure)/es|stable|actual|full/array(/virtual)/find-last-index
74-
core-js(-pure)/es|stable|actual|full/array(/virtual)/flat
75-
core-js(-pure)/es|stable|actual|full/array(/virtual)/flat-map
76-
core-js(-pure)/es|stable|actual|full/array(/virtual)/for-each
77-
core-js(-pure)/es|stable|actual|full/array(/virtual)/includes
78-
core-js(-pure)/es|stable|actual|full/array(/virtual)/index-of
79-
core-js(-pure)/es|stable|actual|full/array(/virtual)/iterator
80-
core-js(-pure)/es|stable|actual|full/array(/virtual)/join
81-
core-js(-pure)/es|stable|actual|full/array(/virtual)/keys
82-
core-js(-pure)/es|stable|actual|full/array(/virtual)/last-index-of
83-
core-js(-pure)/es|stable|actual|full/array(/virtual)/map
84-
core-js(-pure)/es|stable|actual|full/array(/virtual)/push
85-
core-js(-pure)/es|stable|actual|full/array(/virtual)/reduce
86-
core-js(-pure)/es|stable|actual|full/array(/virtual)/reduce-right
87-
core-js(-pure)/es|stable|actual|full/array(/virtual)/reverse
88-
core-js(-pure)/es|stable|actual|full/array(/virtual)/slice
89-
core-js(-pure)/es|stable|actual|full/array(/virtual)/some
90-
core-js(-pure)/es|stable|actual|full/array(/virtual)/sort
91-
core-js(-pure)/es|stable|actual|full/array(/virtual)/splice
92-
core-js(-pure)/es|stable|actual|full/array(/virtual)/to-reversed
93-
core-js(-pure)/es|stable|actual|full/array(/virtual)/to-sorted
94-
core-js(-pure)/es|stable|actual|full/array(/virtual)/to-spliced
95-
core-js(-pure)/es|stable|actual|full/array(/virtual)/unshift
96-
core-js(-pure)/es|stable|actual|full/array(/virtual)/values
97-
core-js(-pure)/es|stable|actual|full/array(/virtual)/with
58+
core-js(-pure)/es|stable|actual|full/array(/prototype)/at
59+
core-js(-pure)/es|stable|actual|full/array(/prototype)/concat
60+
core-js(-pure)/es|stable|actual|full/array(/prototype)/copy-within
61+
core-js(-pure)/es|stable|actual|full/array(/prototype)/entries
62+
core-js(-pure)/es|stable|actual|full/array(/prototype)/fill
63+
core-js(-pure)/es|stable|actual|full/array(/prototype)/filter
64+
core-js(-pure)/es|stable|actual|full/array(/prototype)/find
65+
core-js(-pure)/es|stable|actual|full/array(/prototype)/find-index
66+
core-js(-pure)/es|stable|actual|full/array(/prototype)/find-last
67+
core-js(-pure)/es|stable|actual|full/array(/prototype)/find-last-index
68+
core-js(-pure)/es|stable|actual|full/array(/prototype)/flat
69+
core-js(-pure)/es|stable|actual|full/array(/prototype)/flat-map
70+
core-js(-pure)/es|stable|actual|full/array(/prototype)/includes
71+
core-js(-pure)/es|stable|actual|full/array(/prototype)/index-of
72+
core-js(-pure)/es|stable|actual|full/array(/prototype)/iterator
73+
core-js(-pure)/es|stable|actual|full/array(/prototype)/join
74+
core-js(-pure)/es|stable|actual|full/array(/prototype)/keys
75+
core-js(-pure)/es|stable|actual|full/array(/prototype)/last-index-of
76+
core-js(-pure)/es|stable|actual|full/array(/prototype)/map
77+
core-js(-pure)/es|stable|actual|full/array(/prototype)/push
78+
core-js(-pure)/es|stable|actual|full/array(/prototype)/reduce
79+
core-js(-pure)/es|stable|actual|full/array(/prototype)/reduce-right
80+
core-js(-pure)/es|stable|actual|full/array(/prototype)/reverse
81+
core-js(-pure)/es|stable|actual|full/array(/prototype)/slice
82+
core-js(-pure)/es|stable|actual|full/array(/prototype)/sort
83+
core-js(-pure)/es|stable|actual|full/array(/prototype)/splice
84+
core-js(-pure)/es|stable|actual|full/array(/prototype)/to-reversed
85+
core-js(-pure)/es|stable|actual|full/array(/prototype)/to-sorted
86+
core-js(-pure)/es|stable|actual|full/array(/prototype)/to-spliced
87+
core-js(-pure)/es|stable|actual|full/array(/prototype)/unshift
88+
core-js(-pure)/es|stable|actual|full/array(/prototype)/values
89+
core-js(-pure)/es|stable|actual|full/array(/prototype)/with
9890
```
9991

10092
## Examples

0 commit comments

Comments
 (0)