Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] V4 #1310

Open
wants to merge 386 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
386 commits
Select commit Hold shift + click to select a range
6b74b65
untangle `es.array.iterator` deps
zloirock Oct 21, 2023
1ef9c38
specify `Array#forEach` as an implicit dependency where it's required
zloirock Oct 25, 2023
dbe4024
avoid `Object.getOwnPropertyNames` polyfill dependency since the base…
zloirock Oct 25, 2023
49b106c
specify `Math.fround` as an implicit dependency
zloirock Oct 25, 2023
db1240b
add `get-dependencies` helper
zloirock Oct 26, 2023
94bbbe1
drop an extra `Symbol.isRegisteredSymbol` lookup
zloirock Oct 26, 2023
e304da8
prototype `build-entries` script
zloirock Oct 30, 2023
b032636
avoid an extra check
zloirock Oct 31, 2023
63985de
some minor improvements
zloirock Nov 2, 2023
083109b
move `debug-get-dependencies` to a separate script
zloirock Nov 2, 2023
baefe64
declare some dependencies
zloirock Nov 2, 2023
ffdc6a0
add definitions of proposals, some improvements of `build-entries` sc…
zloirock Nov 2, 2023
35c996b
build indexes
zloirock Nov 2, 2023
05604b7
add entries definitions for `/number/`
zloirock Nov 2, 2023
9464a0e
add entries definitions for `/array/`
zloirock Nov 2, 2023
7f34f5c
add entries definitions for iteration helpers
zloirock Nov 2, 2023
041276c
add entries definitions for `/reflect/`
zloirock Nov 2, 2023
1ed2fd7
add entries definitions for `/function/`
zloirock Nov 3, 2023
a18e4ca
add entries definitions for `/string/`
zloirock Nov 3, 2023
6928a6b
add entries definitions for some globals
zloirock Nov 3, 2023
a5d72a9
add entries definitions for `/object/`
zloirock Nov 3, 2023
1e5460a
add entries definitions for errors
zloirock Nov 4, 2023
c99bee8
add entries definitions for `/json/`
zloirock Nov 4, 2023
f6f2f14
add entries definitions for `URL`
zloirock Nov 4, 2023
fc63fbc
some fixes
zloirock Nov 4, 2023
0dbf966
set method names in some templates
zloirock Nov 4, 2023
4efc227
add entries definitions for `/promise/`
zloirock Nov 4, 2023
f0d9f24
add entries definitions for `/date/`
zloirock Nov 4, 2023
d695f12
add entries definitions for `/map/`
zloirock Nov 4, 2023
edf3604
add entries definitions for `/set/`
zloirock Nov 4, 2023
e3971a2
add entries definitions for `/weak-map/`
zloirock Nov 4, 2023
bb250ca
add entries definitions for `/weak-set/`
zloirock Nov 5, 2023
e02a59b
add entries definitions for `/iterator/`
zloirock Nov 6, 2023
b5f86e0
add entries definitions for `/async-iterator/`
zloirock Nov 6, 2023
f08a17b
add entries definitions for `/(async-)disposable-stack/`
zloirock Nov 6, 2023
4f9d8e5
build `/stage/` entries
zloirock Nov 6, 2023
17860d7
drop `@babel/transform-reserved-words` as not required for ES5+
zloirock Nov 17, 2023
59a3bdf
drop `Map.groupBy` from collections methods proposal
zloirock Nov 20, 2023
5d36fc8
drop `@babel/transform-{ member-expression-literals, property-literal…
zloirock Nov 27, 2023
25ff995
drop `esnext.object.group-by` (moved to stable es)
zloirock Nov 27, 2023
fc434c5
drop `esnext.map.group-by` (moved to stable es)
zloirock Nov 27, 2023
77a9c22
drop `esnext.promise.with-resolvers` (moved to stable es)
zloirock Nov 28, 2023
e0dfd48
drop `arguments` fallback from `Object#toString`
zloirock Dec 1, 2023
0915908
drop workarounds for non-enumerable string chars
zloirock Dec 1, 2023
2612d52
`chr` -> `char` (unreserved variable name)
zloirock Dec 2, 2023
afde122
avoid usage `forEach` from prototype on runtime
zloirock Dec 3, 2023
5de97f2
`chr` -> `char` (unreserved variable name)
zloirock Dec 5, 2023
35b6f18
allow brackets notation on strings instead of `.charAt`
zloirock Dec 5, 2023
ade73ff
`hasOwn` -> `in`
zloirock Dec 5, 2023
af80868
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
50a347e
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
40227c5
drop `Number.fromString` (proposal is dead, semantics is not clear)
zloirock Dec 5, 2023
dc798ce
drop `Function.{ isCallable, isConstructor}` (proposal is dead)
zloirock Dec 5, 2023
a8bcbe8
drop `Math.signbit` (proposal is dead)
zloirock Dec 5, 2023
10c8e86
drop `Math.{ clamp, DEG_PER_RAD, degrees, fscale, RAD_PER_DEG, radian…
zloirock Dec 5, 2023
a564461
drop `String.prototype.codePoints` (proposal is dead)
zloirock Dec 6, 2023
d99e2fb
drop `set(Timeout|Interval)` fixes (required for IE9-)
zloirock Dec 6, 2023
3c4b2bd
consider a way setting of a prototype - `Object.setPrototypeOf` or `_…
zloirock Dec 6, 2023
c3a18db
drop `es.number.to-precision` (required for ancient engines like IE8-…
zloirock Dec 6, 2023
7eb58c4
drop 'es.date.to-iso-string' (required for IE8- and other ancient eng…
zloirock Dec 6, 2023
0d6f585
drop `es.error.to-string` (required for IE8-, V8 ~ Chrome 32-, FF10-)
zloirock Dec 6, 2023
1ad5daa
remove a workaround of V8 ~ Chrome 36- `Object.{ defineProperty, defi…
zloirock Dec 6, 2023
411e7fb
drop descriptors support detection from compat tests
zloirock Dec 6, 2023
1273992
drop `es.object.define-property` (required for ES3 engines and V8 ~ C…
zloirock Dec 6, 2023
889ec18
drop `es.object.define-properties` (required for ES3 engines and V8 ~…
zloirock Dec 6, 2023
0c61dd8
drop `es.escape` (supported in all popular modern engines)
zloirock Dec 6, 2023
d9b40eb
drop `es.unescape` (supported in all popular modern engines)
zloirock Dec 6, 2023
3f18217
drop `es.string.substr` (supported in all popular modern engines)
zloirock Dec 6, 2023
9db6e72
drop `es.date.to-gmt-string` (supported in all popular modern engines)
zloirock Dec 6, 2023
9d1acbc
drop `es.date. set-year` (supported in all popular modern engines)
zloirock Dec 6, 2023
54ffa74
drop `es.date.get-year` (supported in all popular modern engines, req…
zloirock Dec 6, 2023
c6b45b9
drop `es.array.for-each` (required for ES3 only)
zloirock Dec 6, 2023
d77399a
drop `es.array.every` (required for ES3 only)
zloirock Dec 6, 2023
3226352
drop `es.array.some` (required for ES3 only)
zloirock Dec 6, 2023
4680259
drop PhantomJS from compat data and valid targets since it's planned …
zloirock Dec 6, 2023
3995635
consider `ArrayBuffer` and `DataView` as existent
zloirock Dec 6, 2023
cac75de
consider strict mode as supported in tests
zloirock Dec 6, 2023
4ee9fad
consider `ArrayBuffer` and `DataView` as existent in compat tests
zloirock Dec 6, 2023
a4f3581
drop PhantomJS from Karma
zloirock Dec 7, 2023
2c3dccd
consider basic support of `WeakMap`
zloirock Dec 7, 2023
d462e65
consider basic support of `%TypedArray%`
zloirock Dec 7, 2023
288d333
drop fallbacks to ancient FF iterators (with `'@@iterator'` string)
zloirock Dec 8, 2023
6317b45
drop one more extra `ArrayBuffer` check
zloirock Dec 8, 2023
c8d59f1
direct access to `Reflect.ownKeys` in `own-keys` helper
zloirock Dec 8, 2023
8671387
use native `Object.defineProperty` in unit tests constants
zloirock Dec 8, 2023
1d1394a
consider `__proto__` as redefinable (V8 ~ Chrome 27- bug)
zloirock Dec 8, 2023
f84d97a
drop a workaround of a strict mode lack case
zloirock Dec 9, 2023
72b7928
consider `Array#lastIndexOf` as existent
zloirock Dec 9, 2023
d8feb4d
drop IE8- case from tasks / microtasks, drop `.bind` dep from some in…
zloirock Dec 9, 2023
7fe0d8b
drop third argument from `copy-constructor-properties` as not used
zloirock Dec 9, 2023
1b363f7
drop extra dependency declaration from `array-buffer-byte-length`
zloirock Dec 9, 2023
969c280
drop `.bind` dep from some init time cases, simplify with `.forEach`
zloirock Dec 9, 2023
3ae5d65
consider `ArrayBuffer` and `DataView` as existent in `web.structured-…
zloirock Dec 9, 2023
4d2b565
consider `Uint8Array` as existent in some more cases
zloirock Dec 9, 2023
a79c3ab
use native `Array#forEach` in one more case
zloirock Dec 9, 2023
67da983
drop some extra dependencies declaration
zloirock Dec 10, 2023
b6baa5f
drop one more `Object.isFrozen` existence check
zloirock Dec 10, 2023
db942b0
disable `es/no-typed-arrays` `eslint` rule
zloirock Dec 11, 2023
b5cf626
consider `Array#indexOf` as existent
zloirock Dec 11, 2023
3854c79
consider `Array#lastIndexOf` as existent
zloirock Dec 11, 2023
551b0eb
use `Float32Array` in `Math.fround` polyfill
zloirock Dec 11, 2023
39119e6
fix `indexOf` and `lastIndexOf` for some old engines
zloirock Dec 11, 2023
9ba6ad1
drop Opera Presto workaround from `Number` constructor polyfill
zloirock Dec 11, 2023
b736cd4
drop detection of IE8- only bug from `Number#toExponential` polyfill
zloirock Dec 11, 2023
dbe8e2b
drop detection of ancient V8 only bug from `Number#toFixed` polyfill
zloirock Dec 11, 2023
6ee5027
consider a way setting of prototype as available in one more place
zloirock Dec 11, 2023
f713778
drop a workaround for ancient engines whose `exec` methods don't cons…
zloirock Dec 11, 2023
227e23f
drop a workaround for a IE bug with non-enumerable integer keys on `n…
zloirock Dec 11, 2023
c0c052f
reuse `internal-state` abstraction in `Symbol` polyfill
zloirock Dec 12, 2023
15f947e
implicit `parseInt` / `parseFloat` dependencies in `Number.{ parseInt…
zloirock Dec 13, 2023
00bdea7
replace `fastKey` logic with native `Map`
zloirock Dec 14, 2023
bd1ef12
finally drop `internal-metadata` and `hidden-keys` logic, use native …
zloirock Dec 15, 2023
0be4182
use native `Map` in `composite-key`
zloirock Dec 15, 2023
ca4c252
move some modules above in the order of modules loading to ensure pro…
zloirock Dec 18, 2023
60a01f3
move `internal/object-assign` to `es.object.assign`
zloirock Dec 18, 2023
de68ae9
inline `to-uint8-clamped`
zloirock Dec 19, 2023
1585dba
use array iteration methods in some simple cases
zloirock Dec 20, 2023
e6f8c34
drop ignore of old V8 / WebKit number conversion bug
zloirock Dec 20, 2023
c32c273
move `DataView`-related features from `internals/array-buffer` to `es…
zloirock Dec 20, 2023
79914d8
move `ArrayBuffer`-related features from `internals/array-buffer` to …
zloirock Dec 20, 2023
283b9f2
extract `DataView#{ setInt8, setUint8 }` fixes as separate modules
zloirock Dec 20, 2023
459e23f
extract `DataView.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
7b22d34
extract `ArrayBuffer.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
042b6bf
extract `ArrayBuffer[@@species]` as a separate module
zloirock Dec 20, 2023
8e26ae3
extract `{ Map, Set }[@@species]` as a separate module
zloirock Dec 21, 2023
3504b83
join typed array constructors lists
zloirock Dec 23, 2023
5bb1c4d
move `ArrayBuffer.isView` logic directly to `es.array-buffer.is-view`
zloirock Dec 23, 2023
d89c9c1
extract `a-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
003934f
extract `get-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
8f3f63d
move typed arrays `@@toStringTag` to metadata
zloirock Dec 23, 2023
cd86409
extract `export-typed-array-static` helper to a separate module
zloirock Dec 23, 2023
eda7566
extract `export-typed-array-method` helper to a separate module
zloirock Dec 23, 2023
f7d4af9
extract `a-typed-array` helper to a separate module
zloirock Dec 23, 2023
6808bc4
extract `is-typed-array` helper to a separate module
zloirock Dec 23, 2023
495dc5f
rename `array-buffer-view-core` -> `typed-array-core` since now it's …
zloirock Dec 23, 2023
dbb6d39
use `classof-raw` in `is-typed-array` to avoid unnecessary `@@toStrin…
zloirock Dec 23, 2023
775a30c
extract `%TypedArrayPrototype%[@@toStringTag]` to a separate module
zloirock Dec 24, 2023
679b0a2
redefine `DOMException#toString` as unsafe
zloirock Dec 24, 2023
9a68fa9
rewrite `export-typed-array-static` helper
zloirock Dec 24, 2023
cd36a24
rework `export-typed-array-static` helper, fix some `%TypedArray%` me…
zloirock Dec 24, 2023
c6194d2
update `es.typed-array.subarray` compat data
zloirock Dec 24, 2023
9911f5f
extract `%TypedArray%[@@species]` to a separate module (and fix it)
zloirock Dec 25, 2023
2fa3f31
drop `ARRAY_BUFFER_VIEWS_SUPPORT` check from compat tests
zloirock Dec 25, 2023
c9d4342
avoid overwriting `.TypedArrayConstructor` by wrappers in typed array…
zloirock Dec 25, 2023
e09be04
simplify `prototype.constructor` overwriting in typed array wrappers
zloirock Dec 25, 2023
81e3421
`BYTES_PER_ELEMENT` constants of typed array constructors and prototy…
zloirock Dec 25, 2023
cce6a8a
drop typed arrays elements descriptors tests since it's no longer `co…
zloirock Dec 25, 2023
b806656
drop typed arrays `.sham` flag test since it no longer makes sense
zloirock Dec 25, 2023
61220d6
enable some tests for all envs
zloirock Dec 25, 2023
a3811e5
rename for consistency with actual module name
zloirock Dec 25, 2023
e929ac7
reuse `copy-constructor-properties` in `typed-array-constructor`, fix…
zloirock Dec 25, 2023
4245ab6
rework `inherit-if-required`
zloirock Dec 26, 2023
850bdc2
rework `typed-array-core`
zloirock Dec 26, 2023
53e2b52
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
fc6c2e5
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
228d1e5
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
e895937
allow `WeakMap`, `Map` and `Set` in `eslint` config
zloirock Dec 26, 2023
18def51
extract `internal-state-getter-for` helper
zloirock Dec 26, 2023
31d1c28
drop unused `internal-state -> has` helper
zloirock Dec 26, 2023
ccfbd0d
some changes in `shared-store`
zloirock Dec 27, 2023
de445d5
add `object-set-prototype-of-simple` helper
zloirock Dec 27, 2023
92e7184
drop `is-forced` logic as not viable in the current form
zloirock Dec 27, 2023
9340a58
drop extra `global` usage
zloirock Dec 27, 2023
8a7f41e
rename internal `global` reference to `globalThis` for consistency wi…
zloirock Dec 27, 2023
4bcbba0
drop a workaround of ancient Nashorn `Object.prototype.propertyIsEnum…
zloirock Dec 28, 2023
d1be3e3
drop some typed arrays existence checks
zloirock Dec 28, 2023
c6e66b8
simplify `typed-array-core`
zloirock Jan 2, 2024
8d6c3b1
drop a workaround of Qt Script bug since it's anyway based on unsuppo…
zloirock Jan 3, 2024
4347d9e
bump `DOMException` above the rest web modules in the order of loading
zloirock Jan 3, 2024
f1d2a27
use native `Array#forEach` in `web.dom-collections.for-each`
zloirock Jan 3, 2024
e32017e
don't cash used only on init time built-ins, some other minor improve…
zloirock Jan 3, 2024
de60373
drop internal `Iterators` abstraction
zloirock Jan 3, 2024
4ded288
return internal `Iterators` store for the pure version
zloirock Jan 5, 2024
fc47a30
simplify some cases of `Array` normalization logic, split `es.array.i…
zloirock Jan 5, 2024
6526ae1
drop ancient `iterator-define` logic
zloirock Jan 5, 2024
fefe571
`iterators-core` -> `iterator-prototype`
zloirock Jan 5, 2024
e6ff60f
ensure some dependencies
zloirock Jan 5, 2024
1dc5b7f
split `es.typed-array.iterator`
zloirock Jan 6, 2024
d1abfa9
split `web.dom-collections.iterator`
zloirock Jan 6, 2024
bfde740
update readme
zloirock Jan 6, 2024
d4a8053
use `String#repeat` as an implicit dependency
zloirock Jan 7, 2024
d7aaba1
`make-built-in` `options.{ getter, setter -> prefix }`
zloirock Jan 7, 2024
4e11406
fix names
zloirock Jan 8, 2024
5fcad68
simplify `make-built-in`
zloirock Jan 8, 2024
24a7b80
fix names
zloirock Jan 8, 2024
5f89bd7
drop `Symbol.withoutSetter`
zloirock Jan 8, 2024
7d5cdd4
drop keys composition proposal as dead (no activity 5+ years), I hope…
zloirock Jan 10, 2024
fe8818b
drop new collections methods proposal as dead (no activity 6+ years),…
zloirock Jan 11, 2024
eb4e82f
mark `es.array-buffer.species` as not supported by hermes
zloirock Jan 12, 2024
f9b3085
don't use `@@toStringTag` on typed array check
zloirock Jan 13, 2024
bcdca06
drop unneded `.sham` flag check
zloirock Jan 13, 2024
6053734
drop `copyConstructorProperties` from global version `export` as dupl…
zloirock Jan 14, 2024
a78265c
drop some obsolete entries definitions
zloirock Jan 17, 2024
823167e
fix filter in `build-entries` script
zloirock Jan 17, 2024
423f21b
drop some arity checks for the pure version
zloirock Jan 17, 2024
8563026
some changes in export logic
zloirock Jan 18, 2024
f92d94d
use common export on `Object#toString`
zloirock Jan 18, 2024
b13e6ee
ignore `scripts/clean-dependencies` `package-lock`
zloirock Jan 18, 2024
b1274fd
build instance entries
zloirock Jan 22, 2024
21c848e
add entries definitions for `ArrayBuffer` and `DataView`
zloirock Jan 23, 2024
039676f
build entries for common iterators
zloirock Jan 24, 2024
eafaf96
add entries definitions for `Symbol`
zloirock Jan 24, 2024
9aa3ca2
build entries for typed arrays
zloirock Jan 24, 2024
6701c24
build entries for regexp
zloirock Jan 25, 2024
af1af0a
build entries for DOM collections
zloirock Jan 25, 2024
4c8de6a
add some missed entries definitions
zloirock Jan 25, 2024
230059c
drop /actual/ entries for async iterator helpers since now it's on st…
zloirock Jan 26, 2024
e153bf0
drop some extra arity tests from the pure version
zloirock Jan 26, 2024
42fd3d1
drop unneded `to-string-tag` entries
zloirock Jan 28, 2024
1d56e26
rework / drop some entries and definitions
zloirock Jan 28, 2024
cb1d4e5
drop `stage/4` entry as useless
zloirock Jan 28, 2024
6d8a1eb
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
6e31cae
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
1b2d213
tweak some entries definitions, dependencies declaration and templates
zloirock Jan 30, 2024
0391505
declare some missed dependencies
zloirock Jan 31, 2024
05e32ba
tweak some entries definitions
zloirock Feb 1, 2024
d6a13e4
use generated entries
zloirock Feb 1, 2024
9c18944
move tests indexes building to `bundle-tests` script
zloirock Feb 1, 2024
0dd16e4
drop legacy entries for `ArrayBuffer#transfer` proposal
zloirock Feb 8, 2024
85492ec
restore `Promise.try` proposal
zloirock Feb 8, 2024
ef27d43
no longer publish `core-js` on `deno.land/x`
zloirock Feb 13, 2024
660b88f
fix `access` in `package.json` files
zloirock Feb 13, 2024
8527470
update dependencies
zloirock Feb 16, 2024
7143a4b
move `debug-get-dependencies` to tests folder
zloirock Feb 18, 2024
c1a4725
rework building entries
zloirock Feb 18, 2024
737a0bf
update docs
zloirock Feb 18, 2024
adc7bb1
`ifModules` -> `necessary`
zloirock Feb 18, 2024
28ff0b3
update dependencies
zloirock Feb 19, 2024
71e1c2e
build exports fields
zloirock Mar 10, 2024
de35912
change the style of `$namespace` entry template usage
zloirock Mar 19, 2024
1df5f9f
change the style of `$helper` entry template usage
zloirock Mar 19, 2024
4817797
change the style of `$prototypeIterator` entry template usage
zloirock Mar 19, 2024
6c8b078
change the style of `$virtualIterator` entry template usage
zloirock Mar 19, 2024
279bff4
change the style of `$staticWithContext` entry template usage
zloirock Mar 19, 2024
a2b1ae6
change the style of `$patchableStatic` entry template usage
zloirock Mar 19, 2024
0df55ce
change the order of some keys
zloirock Mar 19, 2024
0ba29a6
change the style of `$static` entry template usage
zloirock Mar 19, 2024
17369ae
change the style of `$prototype` and `$virtual` entry templates usage
zloirock Mar 19, 2024
6230d30
require `new` for `DataView` constructor
zloirock Mar 20, 2024
ef9d39f
update dependencies
zloirock Mar 21, 2024
715464f
patch `DataView` for proper handling `undefined` as `byteOffset` and …
zloirock Mar 21, 2024
ee0d01f
change engine keys for compat tools / data
zloirock Mar 24, 2024
f1188c5
rename some `entries-definitions` params
zloirock Mar 24, 2024
e745abb
build entries data for `@core-js/compat` on building entries
zloirock Mar 24, 2024
8aff3aa
load `padStart` as an optional dependency
zloirock Mar 28, 2024
3703511
add a couple of missed entries definitions
zloirock Apr 1, 2024
5072b59
add a missed entry
zloirock Apr 2, 2024
48bbb07
start experimental building built-in definitions from entries definit…
zloirock Apr 2, 2024
b043a46
update dependencies
zloirock Apr 17, 2024
0a71595
drop `postinstall`
zloirock Jul 29, 2024
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
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- run: npm ci
- run: npx run-s bundle test-unit-bun

promises-and-observables:
promises:
strategy:
matrix:
node:
Expand All @@ -62,7 +62,7 @@ jobs:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npx run-s test-promises test-observables
- run: npm run test-promises

tests:
strategy:
Expand Down
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ node_modules/
*.bak
*.swp

/packages/core-js/features/
/packages/core-js/es/index.js
/packages/core-js/full/index.js
/packages/core-js/stable/index.js
/packages/core-js/actual/
/packages/core-js/es/
/packages/core-js/full/
/packages/core-js/proposals/
/packages/core-js/stable/
/packages/core-js/stage/
/packages/core-js/index.js
/packages/core-js/LICENSE
/packages/core-js-builder/LICENSE
/packages/core-js-bundle/LICENSE
/packages/core-js-bundle/index.js
/packages/core-js-bundle/minified.js
/packages/core-js-bundle/minified.js.map
/packages/core-js-bundle/postinstall.js
/packages/core-js-compat/LICENSE
/packages/core-js-compat/built-in-definitions.json
/packages/core-js-compat/data.json
/packages/core-js-compat/entries.json
/packages/core-js-compat/external.json
/packages/core-js-compat/modules.json
/packages/core-js-compat/modules-by-versions.json
/packages/core-js-pure/actual/
/packages/core-js-pure/es/
/packages/core-js-pure/features/
/packages/core-js-pure/full/
/packages/core-js-pure/internals/
/packages/core-js-pure/modules/
/packages/core-js-pure/proposals/
/packages/core-js-pure/stable/
/packages/core-js-pure/stage/
/packages/core-js-pure/web/
/packages/core-js-pure/LICENSE
/packages/core-js-pure/index.js
/packages/core-js-pure/configurator.js
/packages/core-js-pure/postinstall.js
/tests/**/bundles/
/tests/compat/*.jar
/tests/compat/compat-data.js
Expand Down
35 changes: 15 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ There is always some ["help wanted" issues](https://github.com/zloirock/core-js/
- The polyfill should properly work in ES3 and all possible engines. If in some engines it cannot be implemented (for example, it striuctly requires more modern ES or unavailable platform features), it should not break any other `core-js` features or application in any way.
- Avoid possible observing / breakage polyfills via patching built-ins at runtime: cache all global built-ins in the polyfills code and don't call prototype methods from instances.
- Shared helpers should be added to the [`packages/core-js/internals`](./packages/core-js/internals) directory. Reuse already existing helpers.
- Avoid direct import from `/modules/` path in `/internals|modules/` since it will break optimizations via Babel / `swc`. Specify such dependencies in `/es|stable|actual/full/` entries and use something like [`internals/get-built-in`](./packages/core-js/modules/get-built-in.js) helpers.
- Avoid direct import from `/modules/` path in `/internals|modules/` since it will break optimizations via Babel / `swc`. Specify such dependencies with comments like `// dependency: es.string.iterator` directly in your module, they will be automatically added to entries, and use something like [`internals/get-built-in`](./packages/core-js/modules/get-built-in.js) helpers.
- For export the polyfill, in all common cases use [`internals/export`](./packages/core-js/modules/export.js) helper. Use something else only if this helper is not applicable - for example, if you want to polyfill accessors.
- If the code of the pure version implementation should significantly differ from the global version (*that's not a frequent situation, in most cases [`internals/is-pure`](./packages/core-js/modules/is-pure.js) constant is enough*), you can add it to [`packages/core-js-pure/override`](./packages/core-js-pure/override) directory. The rest parts of `core-js-pure` will be copied from `core-js` package.
- If the code of the pure version implementation should significantly differ from the global version (*that's not a frequent situation, in most cases [`internals/is-pure`](./packages/core-js/modules/is-pure.js) constant is enough*), you can add it to [`packages/core-js-pure/override`](./packages/core-js-pure/override) directory. The rest parts of `@core-js/pure` will be copied from `core-js` package.
- Add the feature detection of the polyfill to [`tests/compat/tests.js`](./tests/compat/tests.js), add the compatibility data to [`packages/core-js-compat/src/data.mjs`](./packages/core-js-compat/src/data.mjs), how to do it [see below](#how-to-update-core-js-compat-data), and the name of the polyfill module to [`packages/core-js-compat/src/modules-by-versions.mjs`](./packages/core-js-compat/src/modules-by-versions.mjs) (this data is also used for getting the default list of polyfills at bundling and generation indexes).
- Add it to entry points where it's required: directories [`packages/core-js/es`](./packages/core-js/es), [`packages/core-js/stable`](./packages/core-js/stable), [`packages/core-js/actual`](./packages/core-js/actual), [`packages/core-js/full`](./packages/core-js/full), [`packages/core-js/proposals`](./packages/core-js/proposals), [`packages/core-js/stage`](./packages/core-js/stage) and [`packages/core-js/web`](./packages/core-js/web).
- Add it to entries definitions, see [`scripts/build-entries/entries-definitions.mjs`](./scripts/build-entries/entries-definitions.mjs).
- Add unit tests to [`tests/unit-global`](./tests/unit-global) and [`tests/unit-pure`](./tests/unit-pure).
- Add tests of entry points to [`tests/entries/unit.mjs`](./tests/entries/unit.mjs).
- Make sure that you are following [our coding style](#style-and-standards) and [all tests](#testing) are passed.
- Document it in [README.md](./README.md) and [CHANGELOG.md](./CHANGELOG.md).

[A simple example of adding a new polyfill.](https://github.com/zloirock/core-js/pull/1294/files)

## How to update `core-js-compat` data
## How to update `@core-js/compat` data

For updating `core-js-compat` data:
For updating `@core-js/compat` data:

- If you want to add a new data for a browser, run in this browser `tests/compat/index.html` (tests and results for the actual release are available at [`http://zloirock.github.io/core-js/compat/`](http://zloirock.github.io/core-js/compat/)) and you will see what `core-js` modules are required for this browser.

Expand All @@ -42,27 +42,26 @@ For updating `core-js-compat` data:

engine | how to run tests | base data inherits from | mandatory check | mapping for a new version
--- | --- | --- | --- | ---
`android` | browser runner | `chrome`, `chrome-android` | |
`android` | browser runner | `chrome`, `chrome_mobile` | |
`bun` | bun runner | `safari` (only ES) | required |
`chrome` | browser runner | | required |
`chrome-android` | browser runner | `chrome` | |
`chrome_mobile` | browser runner | `chrome` | |
`deno` | deno runner | `chrome` (only ES) | non-ES features | required
`edge` | browser runner | `ie`, `chrome` | required (<= 18) |
`electron` | browser runner | `chrome` | | required
`firefox` | browser runner | | required |
`firefox-android` | browser runner | `firefox` | |
`firefox_mobile` | browser runner | `firefox` | |
`hermes` | hermes runner | | required |
`ie` | browser runner | | required |
`ios` | browser runner | `safari` | | if inconsistent (!= `safari`)
`node` | node runner | `chrome` (only ES) | non-ES features | required
`opera` | browser runner | `chrome` | | if inconsistent (!= `chrome` - 14)
`opera-android` | browser runner | `opera`, `chrome-android` | | required
`phantom` | browser runner | `safari` | |
`quest` | browser runner | `chrome-android` | | required
`react-native` | hermes runner | `hermes` | required |
`opera_mobile` | browser runner | `opera`, `chrome_mobile` | | required
`quest` | browser runner | `chrome_mobile` | | required
`react_native` | hermes runner | `hermes` | required |
`rhino` | rhino runner | | required |
`safari` | browser runner | | required |
`samsung` | browser runner | `chrome-android` | | required
`samsung` | browser runner | `chrome_mobile` | | required

If you have no access to all required browsers / versions of browsers, use [Sauce Labs](https://saucelabs.com/), [BrowserStack](https://www.browserstack.com/) or [Cloud Browser](https://ieonchrome.com/).

Expand All @@ -73,7 +72,7 @@ The coding style should follow our [`eslint.config.js`](./tests/eslint/eslint.co
- Unit tests should use the modern syntax with our [minimalistic Babel config](./babel.config.js). Unit tests for the pure version should not use any modern standard library features.
- Tools, scripts and tests, performed in NodeJS, should use only the syntax and the standard library available in NodeJS 8.

File names should be in the kebab-case. Name of polyfill modules should follow the naming convention `namespace.subnamespace-where-required.feature-name`, for example, `esnext.set.intersection`. The top-level namespace should be `es` for stable ECMAScript features, `esnext` for ECMAScript proposals and `web` for other web standards.
File names should be in the kebab-case. Name of polyfill modules should follow the naming convention `namespace.subnamespace-where-required.feature-name`, for example, `es.set.intersection`. The top-level namespace should be `es` for stable ECMAScript features, `esnext` for ECMAScript proposals and `web` for other web standards.

## Testing

Expand Down Expand Up @@ -110,19 +109,15 @@ You can run parts of the test case separately:
```sh
npx run-s prepare test-promises
```
- [ECMAScript `Observable` test case](https://github.com/tc39/proposal-observable):
```sh
npx run-s prepare test-observables
```
- CommonJS entry points tests:
```sh
npx run-s prepare test-entries
```
- `core-js-compat` tools tests:
- `@core-js/compat` tools tests:
```sh
npx run-s prepare test-compat-tools
```
- `core-js-builder` tests:
- `@core-js/builder` tests:
```sh
npx run-s prepare test-builder
```
Expand Down
Loading