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 388 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
388 commits
Select commit Hold shift + click to select a range
506eaea
avoid `Object.getOwnPropertyNames` polyfill dependency since the base…
zloirock Oct 25, 2023
33d7593
specify `Math.fround` as an implicit dependency
zloirock Oct 25, 2023
b03a31a
add `get-dependencies` helper
zloirock Oct 26, 2023
33476c9
drop an extra `Symbol.isRegisteredSymbol` lookup
zloirock Oct 26, 2023
ce7105d
prototype `build-entries` script
zloirock Oct 30, 2023
c1a7353
avoid an extra check
zloirock Oct 31, 2023
6761955
some minor improvements
zloirock Nov 2, 2023
23d0286
move `debug-get-dependencies` to a separate script
zloirock Nov 2, 2023
ea9f440
declare some dependencies
zloirock Nov 2, 2023
3d24688
add definitions of proposals, some improvements of `build-entries` sc…
zloirock Nov 2, 2023
21b3cf2
build indexes
zloirock Nov 2, 2023
9f74f4b
add entries definitions for `/number/`
zloirock Nov 2, 2023
4e961f9
add entries definitions for `/array/`
zloirock Nov 2, 2023
0c7b425
add entries definitions for iteration helpers
zloirock Nov 2, 2023
ec005c4
add entries definitions for `/reflect/`
zloirock Nov 2, 2023
67f08f2
add entries definitions for `/function/`
zloirock Nov 3, 2023
a2c777a
add entries definitions for `/string/`
zloirock Nov 3, 2023
c3b6ea6
add entries definitions for some globals
zloirock Nov 3, 2023
1a616e8
add entries definitions for `/object/`
zloirock Nov 3, 2023
23da85c
add entries definitions for errors
zloirock Nov 4, 2023
df52834
add entries definitions for `/json/`
zloirock Nov 4, 2023
431ac53
add entries definitions for `URL`
zloirock Nov 4, 2023
94b9e6d
some fixes
zloirock Nov 4, 2023
7ad47cf
set method names in some templates
zloirock Nov 4, 2023
8cd1430
add entries definitions for `/promise/`
zloirock Nov 4, 2023
cda7060
add entries definitions for `/date/`
zloirock Nov 4, 2023
facc891
add entries definitions for `/map/`
zloirock Nov 4, 2023
53faddd
add entries definitions for `/set/`
zloirock Nov 4, 2023
aa1efc5
add entries definitions for `/weak-map/`
zloirock Nov 4, 2023
593e9e5
add entries definitions for `/weak-set/`
zloirock Nov 5, 2023
2713c9e
add entries definitions for `/iterator/`
zloirock Nov 6, 2023
b3188ae
add entries definitions for `/async-iterator/`
zloirock Nov 6, 2023
81a9cd7
add entries definitions for `/(async-)disposable-stack/`
zloirock Nov 6, 2023
8af8c6a
build `/stage/` entries
zloirock Nov 6, 2023
1f36aa7
drop `@babel/transform-reserved-words` as not required for ES5+
zloirock Nov 17, 2023
c5e7c8f
drop `Map.groupBy` from collections methods proposal
zloirock Nov 20, 2023
bf5ee21
drop `@babel/transform-{ member-expression-literals, property-literal…
zloirock Nov 27, 2023
bbf5872
drop `esnext.object.group-by` (moved to stable es)
zloirock Nov 27, 2023
20bf462
drop `esnext.map.group-by` (moved to stable es)
zloirock Nov 27, 2023
de3496f
drop `esnext.promise.with-resolvers` (moved to stable es)
zloirock Nov 28, 2023
483dde5
drop `arguments` fallback from `Object#toString`
zloirock Dec 1, 2023
fe837a4
drop workarounds for non-enumerable string chars
zloirock Dec 1, 2023
2a961da
`chr` -> `char` (unreserved variable name)
zloirock Dec 2, 2023
1050be7
avoid usage `forEach` from prototype on runtime
zloirock Dec 3, 2023
428d989
`chr` -> `char` (unreserved variable name)
zloirock Dec 5, 2023
0615752
allow brackets notation on strings instead of `.charAt`
zloirock Dec 5, 2023
46cf8da
`hasOwn` -> `in`
zloirock Dec 5, 2023
62cd540
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
6c7763b
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
5a0e3af
drop `Number.fromString` (proposal is dead, semantics is not clear)
zloirock Dec 5, 2023
3dae908
drop `Function.{ isCallable, isConstructor}` (proposal is dead)
zloirock Dec 5, 2023
9890c87
drop `Math.signbit` (proposal is dead)
zloirock Dec 5, 2023
875f623
drop `Math.{ clamp, DEG_PER_RAD, degrees, fscale, RAD_PER_DEG, radian…
zloirock Dec 5, 2023
81f6fc3
drop `String.prototype.codePoints` (proposal is dead)
zloirock Dec 6, 2023
36281fc
drop `set(Timeout|Interval)` fixes (required for IE9-)
zloirock Dec 6, 2023
869c0fc
consider a way setting of a prototype - `Object.setPrototypeOf` or `_…
zloirock Dec 6, 2023
de6c8a1
drop `es.number.to-precision` (required for ancient engines like IE8-…
zloirock Dec 6, 2023
20c114e
drop 'es.date.to-iso-string' (required for IE8- and other ancient eng…
zloirock Dec 6, 2023
49a8d8b
drop `es.error.to-string` (required for IE8-, V8 ~ Chrome 32-, FF10-)
zloirock Dec 6, 2023
c46c341
remove a workaround of V8 ~ Chrome 36- `Object.{ defineProperty, defi…
zloirock Dec 6, 2023
41c41b1
drop descriptors support detection from compat tests
zloirock Dec 6, 2023
4588aad
drop `es.object.define-property` (required for ES3 engines and V8 ~ C…
zloirock Dec 6, 2023
c89f386
drop `es.object.define-properties` (required for ES3 engines and V8 ~…
zloirock Dec 6, 2023
875d6c5
drop `es.escape` (supported in all popular modern engines)
zloirock Dec 6, 2023
9d22f7d
drop `es.unescape` (supported in all popular modern engines)
zloirock Dec 6, 2023
8c15d57
drop `es.string.substr` (supported in all popular modern engines)
zloirock Dec 6, 2023
72aaf47
drop `es.date.to-gmt-string` (supported in all popular modern engines)
zloirock Dec 6, 2023
922bfe7
drop `es.date. set-year` (supported in all popular modern engines)
zloirock Dec 6, 2023
6537bfd
drop `es.date.get-year` (supported in all popular modern engines, req…
zloirock Dec 6, 2023
380792b
drop `es.array.for-each` (required for ES3 only)
zloirock Dec 6, 2023
f8a9f77
drop `es.array.every` (required for ES3 only)
zloirock Dec 6, 2023
960032e
drop `es.array.some` (required for ES3 only)
zloirock Dec 6, 2023
d242213
drop PhantomJS from compat data and valid targets since it's planned …
zloirock Dec 6, 2023
15bfaa0
consider `ArrayBuffer` and `DataView` as existent
zloirock Dec 6, 2023
2c37adb
consider strict mode as supported in tests
zloirock Dec 6, 2023
48831f0
consider `ArrayBuffer` and `DataView` as existent in compat tests
zloirock Dec 6, 2023
5bfe3d7
drop PhantomJS from Karma
zloirock Dec 7, 2023
0577ef5
consider basic support of `WeakMap`
zloirock Dec 7, 2023
71ad113
consider basic support of `%TypedArray%`
zloirock Dec 7, 2023
d49babb
drop fallbacks to ancient FF iterators (with `'@@iterator'` string)
zloirock Dec 8, 2023
7b4bab6
drop one more extra `ArrayBuffer` check
zloirock Dec 8, 2023
b88d7ba
direct access to `Reflect.ownKeys` in `own-keys` helper
zloirock Dec 8, 2023
c98eeac
use native `Object.defineProperty` in unit tests constants
zloirock Dec 8, 2023
191e559
consider `__proto__` as redefinable (V8 ~ Chrome 27- bug)
zloirock Dec 8, 2023
6040b49
drop a workaround of a strict mode lack case
zloirock Dec 9, 2023
f9e4b92
consider `Array#lastIndexOf` as existent
zloirock Dec 9, 2023
6c750e7
drop IE8- case from tasks / microtasks, drop `.bind` dep from some in…
zloirock Dec 9, 2023
ed1a2da
drop third argument from `copy-constructor-properties` as not used
zloirock Dec 9, 2023
12305f5
drop extra dependency declaration from `array-buffer-byte-length`
zloirock Dec 9, 2023
eb37db6
drop `.bind` dep from some init time cases, simplify with `.forEach`
zloirock Dec 9, 2023
80612d4
consider `ArrayBuffer` and `DataView` as existent in `web.structured-…
zloirock Dec 9, 2023
e82768c
consider `Uint8Array` as existent in some more cases
zloirock Dec 9, 2023
5feebc8
use native `Array#forEach` in one more case
zloirock Dec 9, 2023
d02c8b5
drop some extra dependencies declaration
zloirock Dec 10, 2023
8b2db56
drop one more `Object.isFrozen` existence check
zloirock Dec 10, 2023
b9f8e74
disable `es/no-typed-arrays` `eslint` rule
zloirock Dec 11, 2023
c4f40fa
consider `Array#indexOf` as existent
zloirock Dec 11, 2023
a455953
consider `Array#lastIndexOf` as existent
zloirock Dec 11, 2023
62c4326
use `Float32Array` in `Math.fround` polyfill
zloirock Dec 11, 2023
93a4cde
fix `indexOf` and `lastIndexOf` for some old engines
zloirock Dec 11, 2023
968c988
drop Opera Presto workaround from `Number` constructor polyfill
zloirock Dec 11, 2023
c8df430
drop detection of IE8- only bug from `Number#toExponential` polyfill
zloirock Dec 11, 2023
f6ff7d4
drop detection of ancient V8 only bug from `Number#toFixed` polyfill
zloirock Dec 11, 2023
ff5789a
consider a way setting of prototype as available in one more place
zloirock Dec 11, 2023
1e572ae
drop a workaround for ancient engines whose `exec` methods don't cons…
zloirock Dec 11, 2023
d3bd8c9
drop a workaround for a IE bug with non-enumerable integer keys on `n…
zloirock Dec 11, 2023
f8c09d0
reuse `internal-state` abstraction in `Symbol` polyfill
zloirock Dec 12, 2023
c2e8897
implicit `parseInt` / `parseFloat` dependencies in `Number.{ parseInt…
zloirock Dec 13, 2023
9b66320
replace `fastKey` logic with native `Map`
zloirock Dec 14, 2023
fe1dcb3
finally drop `internal-metadata` and `hidden-keys` logic, use native …
zloirock Dec 15, 2023
e6d4838
use native `Map` in `composite-key`
zloirock Dec 15, 2023
daf7b8e
move some modules above in the order of modules loading to ensure pro…
zloirock Dec 18, 2023
a03c085
move `internal/object-assign` to `es.object.assign`
zloirock Dec 18, 2023
ae687f4
inline `to-uint8-clamped`
zloirock Dec 19, 2023
d70ed8d
use array iteration methods in some simple cases
zloirock Dec 20, 2023
a46230b
drop ignore of old V8 / WebKit number conversion bug
zloirock Dec 20, 2023
42f6385
move `DataView`-related features from `internals/array-buffer` to `es…
zloirock Dec 20, 2023
191a617
move `ArrayBuffer`-related features from `internals/array-buffer` to …
zloirock Dec 20, 2023
f2aa1f3
extract `DataView#{ setInt8, setUint8 }` fixes as separate modules
zloirock Dec 20, 2023
f435e40
extract `DataView.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
4848ccf
extract `ArrayBuffer.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
4c2df17
extract `ArrayBuffer[@@species]` as a separate module
zloirock Dec 20, 2023
865adf0
extract `{ Map, Set }[@@species]` as a separate module
zloirock Dec 21, 2023
7a24f8b
join typed array constructors lists
zloirock Dec 23, 2023
ddf4018
move `ArrayBuffer.isView` logic directly to `es.array-buffer.is-view`
zloirock Dec 23, 2023
61c37bf
extract `a-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
bdf0934
extract `get-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
3dafdad
move typed arrays `@@toStringTag` to metadata
zloirock Dec 23, 2023
2b73613
extract `export-typed-array-static` helper to a separate module
zloirock Dec 23, 2023
2312d72
extract `export-typed-array-method` helper to a separate module
zloirock Dec 23, 2023
e227573
extract `a-typed-array` helper to a separate module
zloirock Dec 23, 2023
84a9dab
extract `is-typed-array` helper to a separate module
zloirock Dec 23, 2023
8903da0
rename `array-buffer-view-core` -> `typed-array-core` since now it's …
zloirock Dec 23, 2023
5d677ce
use `classof-raw` in `is-typed-array` to avoid unnecessary `@@toStrin…
zloirock Dec 23, 2023
e593bd4
extract `%TypedArrayPrototype%[@@toStringTag]` to a separate module
zloirock Dec 24, 2023
f4a0fcf
redefine `DOMException#toString` as unsafe
zloirock Dec 24, 2023
a5462cc
rewrite `export-typed-array-static` helper
zloirock Dec 24, 2023
2193751
rework `export-typed-array-static` helper, fix some `%TypedArray%` me…
zloirock Dec 24, 2023
5daf300
update `es.typed-array.subarray` compat data
zloirock Dec 24, 2023
0f9c13e
extract `%TypedArray%[@@species]` to a separate module (and fix it)
zloirock Dec 25, 2023
3c8ec46
drop `ARRAY_BUFFER_VIEWS_SUPPORT` check from compat tests
zloirock Dec 25, 2023
ec58a48
avoid overwriting `.TypedArrayConstructor` by wrappers in typed array…
zloirock Dec 25, 2023
210fa94
simplify `prototype.constructor` overwriting in typed array wrappers
zloirock Dec 25, 2023
510f844
`BYTES_PER_ELEMENT` constants of typed array constructors and prototy…
zloirock Dec 25, 2023
b547015
drop typed arrays elements descriptors tests since it's no longer `co…
zloirock Dec 25, 2023
35fdcff
drop typed arrays `.sham` flag test since it no longer makes sense
zloirock Dec 25, 2023
34e6a85
enable some tests for all envs
zloirock Dec 25, 2023
fff33ed
rename for consistency with actual module name
zloirock Dec 25, 2023
a7b5aef
reuse `copy-constructor-properties` in `typed-array-constructor`, fix…
zloirock Dec 25, 2023
07415c5
rework `inherit-if-required`
zloirock Dec 26, 2023
c2eea55
rework `typed-array-core`
zloirock Dec 26, 2023
15578b5
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
b7909ee
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
35222a5
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
d55d9af
allow `WeakMap`, `Map` and `Set` in `eslint` config
zloirock Dec 26, 2023
fe7695f
extract `internal-state-getter-for` helper
zloirock Dec 26, 2023
ac19842
drop unused `internal-state -> has` helper
zloirock Dec 26, 2023
ffb165b
some changes in `shared-store`
zloirock Dec 27, 2023
e0c47a7
add `object-set-prototype-of-simple` helper
zloirock Dec 27, 2023
0ce1e4c
drop `is-forced` logic as not viable in the current form
zloirock Dec 27, 2023
d782cc7
drop extra `global` usage
zloirock Dec 27, 2023
67abeac
rename internal `global` reference to `globalThis` for consistency wi…
zloirock Dec 27, 2023
0d2a57c
drop a workaround of ancient Nashorn `Object.prototype.propertyIsEnum…
zloirock Dec 28, 2023
ef12d5f
drop some typed arrays existence checks
zloirock Dec 28, 2023
073cb81
simplify `typed-array-core`
zloirock Jan 2, 2024
ba090d2
drop a workaround of Qt Script bug since it's anyway based on unsuppo…
zloirock Jan 3, 2024
59d91f0
bump `DOMException` above the rest web modules in the order of loading
zloirock Jan 3, 2024
06ea32a
use native `Array#forEach` in `web.dom-collections.for-each`
zloirock Jan 3, 2024
bf1e07a
don't cash used only on init time built-ins, some other minor improve…
zloirock Jan 3, 2024
63036f5
drop internal `Iterators` abstraction
zloirock Jan 3, 2024
ff429a2
return internal `Iterators` store for the pure version
zloirock Jan 5, 2024
f7322ba
simplify some cases of `Array` normalization logic, split `es.array.i…
zloirock Jan 5, 2024
e4b305b
drop ancient `iterator-define` logic
zloirock Jan 5, 2024
7a77e97
`iterators-core` -> `iterator-prototype`
zloirock Jan 5, 2024
18fc5b3
ensure some dependencies
zloirock Jan 5, 2024
c2d8826
split `es.typed-array.iterator`
zloirock Jan 6, 2024
8b1c865
split `web.dom-collections.iterator`
zloirock Jan 6, 2024
0eefe19
update readme
zloirock Jan 6, 2024
b25a334
use `String#repeat` as an implicit dependency
zloirock Jan 7, 2024
09141d2
`make-built-in` `options.{ getter, setter -> prefix }`
zloirock Jan 7, 2024
348936f
fix names
zloirock Jan 8, 2024
4c484d2
simplify `make-built-in`
zloirock Jan 8, 2024
58a1629
fix names
zloirock Jan 8, 2024
99b5ef5
drop `Symbol.withoutSetter`
zloirock Jan 8, 2024
b5c0cd4
drop keys composition proposal as dead (no activity 5+ years), I hope…
zloirock Jan 10, 2024
38ba89c
drop new collections methods proposal as dead (no activity 6+ years),…
zloirock Jan 11, 2024
d9c5438
mark `es.array-buffer.species` as not supported by hermes
zloirock Jan 12, 2024
e54f863
don't use `@@toStringTag` on typed array check
zloirock Jan 13, 2024
dcaf4ed
drop unneded `.sham` flag check
zloirock Jan 13, 2024
884df50
drop `copyConstructorProperties` from global version `export` as dupl…
zloirock Jan 14, 2024
f075239
drop some obsolete entries definitions
zloirock Jan 17, 2024
9f94bc3
fix filter in `build-entries` script
zloirock Jan 17, 2024
70d19fb
drop some arity checks for the pure version
zloirock Jan 17, 2024
80b986a
some changes in export logic
zloirock Jan 18, 2024
806b0e2
use common export on `Object#toString`
zloirock Jan 18, 2024
2d3c14d
ignore `scripts/clean-dependencies` `package-lock`
zloirock Jan 18, 2024
6718714
build instance entries
zloirock Jan 22, 2024
22f3b64
add entries definitions for `ArrayBuffer` and `DataView`
zloirock Jan 23, 2024
72531db
build entries for common iterators
zloirock Jan 24, 2024
2e8d687
add entries definitions for `Symbol`
zloirock Jan 24, 2024
ae95064
build entries for typed arrays
zloirock Jan 24, 2024
720a6f4
build entries for regexp
zloirock Jan 25, 2024
59c5294
build entries for DOM collections
zloirock Jan 25, 2024
e2222b8
add some missed entries definitions
zloirock Jan 25, 2024
f2d9ec0
drop /actual/ entries for async iterator helpers since now it's on st…
zloirock Jan 26, 2024
8b58e23
drop some extra arity tests from the pure version
zloirock Jan 26, 2024
3754898
drop unneded `to-string-tag` entries
zloirock Jan 28, 2024
ab8b808
rework / drop some entries and definitions
zloirock Jan 28, 2024
14a0530
drop `stage/4` entry as useless
zloirock Jan 28, 2024
1af6477
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
d422d54
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
b8299ba
tweak some entries definitions, dependencies declaration and templates
zloirock Jan 30, 2024
d620d51
declare some missed dependencies
zloirock Jan 31, 2024
6cbbd6c
tweak some entries definitions
zloirock Feb 1, 2024
25384c6
use generated entries
zloirock Feb 1, 2024
9349a54
move tests indexes building to `bundle-tests` script
zloirock Feb 1, 2024
d367f14
drop legacy entries for `ArrayBuffer#transfer` proposal
zloirock Feb 8, 2024
8a0a7d4
restore `Promise.try` proposal
zloirock Feb 8, 2024
e9d610c
no longer publish `core-js` on `deno.land/x`
zloirock Feb 13, 2024
4b30153
fix `access` in `package.json` files
zloirock Feb 13, 2024
3127a79
update dependencies
zloirock Feb 16, 2024
70c75d0
move `debug-get-dependencies` to tests folder
zloirock Feb 18, 2024
da6adeb
rework building entries
zloirock Feb 18, 2024
a2291d1
update docs
zloirock Feb 18, 2024
75e6e65
`ifModules` -> `necessary`
zloirock Feb 18, 2024
a03154d
update dependencies
zloirock Feb 19, 2024
fbb5bd5
build exports fields
zloirock Mar 10, 2024
888e3dc
change the style of `$namespace` entry template usage
zloirock Mar 19, 2024
1e28193
change the style of `$helper` entry template usage
zloirock Mar 19, 2024
940886e
change the style of `$prototypeIterator` entry template usage
zloirock Mar 19, 2024
1fcd879
change the style of `$virtualIterator` entry template usage
zloirock Mar 19, 2024
d0cc051
change the style of `$staticWithContext` entry template usage
zloirock Mar 19, 2024
eb4c75f
change the style of `$patchableStatic` entry template usage
zloirock Mar 19, 2024
50af12d
change the order of some keys
zloirock Mar 19, 2024
217d0cf
change the style of `$static` entry template usage
zloirock Mar 19, 2024
e81876f
change the style of `$prototype` and `$virtual` entry templates usage
zloirock Mar 19, 2024
f0b94b8
require `new` for `DataView` constructor
zloirock Mar 20, 2024
f03ab61
update dependencies
zloirock Mar 21, 2024
dd9936c
patch `DataView` for proper handling `undefined` as `byteOffset` and …
zloirock Mar 21, 2024
ed40db2
change engine keys for compat tools / data
zloirock Mar 24, 2024
868adbc
rename some `entries-definitions` params
zloirock Mar 24, 2024
791ac22
build entries data for `@core-js/compat` on building entries
zloirock Mar 24, 2024
7fd5683
load `padStart` as an optional dependency
zloirock Mar 28, 2024
0ebc020
add a couple of missed entries definitions
zloirock Apr 1, 2024
7975a5f
add a missed entry
zloirock Apr 2, 2024
5d40a8b
start experimental building built-in definitions from entries definit…
zloirock Apr 2, 2024
cc8d2c9
update dependencies
zloirock Apr 17, 2024
769996e
drop `postinstall`
zloirock Jul 29, 2024
892484a
drop legacy iterator helpers modules
zloirock Oct 8, 2024
0c86704
drop legacy `Promise.try` modules
zloirock Oct 10, 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 @@ -7,37 +7,37 @@ node_modules/
*.swp
.DS_Store

/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