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 389 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
389 commits
Select commit Hold shift + click to select a range
f187fae
specify `Math.fround` as an implicit dependency
zloirock Oct 25, 2023
22aa269
add `get-dependencies` helper
zloirock Oct 26, 2023
b29ed90
drop an extra `Symbol.isRegisteredSymbol` lookup
zloirock Oct 26, 2023
f451304
prototype `build-entries` script
zloirock Oct 30, 2023
46c63bf
avoid an extra check
zloirock Oct 31, 2023
70dbb9e
some minor improvements
zloirock Nov 2, 2023
ce88e7a
move `debug-get-dependencies` to a separate script
zloirock Nov 2, 2023
3b927ce
declare some dependencies
zloirock Nov 2, 2023
dc50696
add definitions of proposals, some improvements of `build-entries` sc…
zloirock Nov 2, 2023
ffde5e2
build indexes
zloirock Nov 2, 2023
95cb1c5
add entries definitions for `/number/`
zloirock Nov 2, 2023
89b1fd0
add entries definitions for `/array/`
zloirock Nov 2, 2023
547c078
add entries definitions for iteration helpers
zloirock Nov 2, 2023
168eed6
add entries definitions for `/reflect/`
zloirock Nov 2, 2023
b4a9de5
add entries definitions for `/function/`
zloirock Nov 3, 2023
bdee561
add entries definitions for `/string/`
zloirock Nov 3, 2023
0314ec8
add entries definitions for some globals
zloirock Nov 3, 2023
8a707e0
add entries definitions for `/object/`
zloirock Nov 3, 2023
42704e2
add entries definitions for errors
zloirock Nov 4, 2023
08a1c64
add entries definitions for `/json/`
zloirock Nov 4, 2023
f0bc8ca
add entries definitions for `URL`
zloirock Nov 4, 2023
9689bcb
some fixes
zloirock Nov 4, 2023
c0cfd71
set method names in some templates
zloirock Nov 4, 2023
3531e41
add entries definitions for `/promise/`
zloirock Nov 4, 2023
e47c294
add entries definitions for `/date/`
zloirock Nov 4, 2023
fd8b6fd
add entries definitions for `/map/`
zloirock Nov 4, 2023
cb73ff0
add entries definitions for `/set/`
zloirock Nov 4, 2023
8e9bfd2
add entries definitions for `/weak-map/`
zloirock Nov 4, 2023
6b13eca
add entries definitions for `/weak-set/`
zloirock Nov 5, 2023
6d4650c
add entries definitions for `/iterator/`
zloirock Nov 6, 2023
62c580f
add entries definitions for `/async-iterator/`
zloirock Nov 6, 2023
281d72f
add entries definitions for `/(async-)disposable-stack/`
zloirock Nov 6, 2023
6641346
build `/stage/` entries
zloirock Nov 6, 2023
9d9a447
drop `@babel/transform-reserved-words` as not required for ES5+
zloirock Nov 17, 2023
bb40a60
drop `Map.groupBy` from collections methods proposal
zloirock Nov 20, 2023
ac4bddd
drop `@babel/transform-{ member-expression-literals, property-literal…
zloirock Nov 27, 2023
55d5483
drop `esnext.object.group-by` (moved to stable es)
zloirock Nov 27, 2023
535dac6
drop `esnext.map.group-by` (moved to stable es)
zloirock Nov 27, 2023
c5c1349
drop `esnext.promise.with-resolvers` (moved to stable es)
zloirock Nov 28, 2023
2046135
drop `arguments` fallback from `Object#toString`
zloirock Dec 1, 2023
91757fd
drop workarounds for non-enumerable string chars
zloirock Dec 1, 2023
dc58a2c
`chr` -> `char` (unreserved variable name)
zloirock Dec 2, 2023
6e851b4
avoid usage `forEach` from prototype on runtime
zloirock Dec 3, 2023
0b3b846
`chr` -> `char` (unreserved variable name)
zloirock Dec 5, 2023
59b8cfe
allow brackets notation on strings instead of `.charAt`
zloirock Dec 5, 2023
371a4af
`hasOwn` -> `in`
zloirock Dec 5, 2023
e4d0848
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
c3d21bc
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
362ea50
drop `Number.fromString` (proposal is dead, semantics is not clear)
zloirock Dec 5, 2023
a265cef
drop `Function.{ isCallable, isConstructor}` (proposal is dead)
zloirock Dec 5, 2023
8301a9a
drop `Math.signbit` (proposal is dead)
zloirock Dec 5, 2023
64d064f
drop `Math.{ clamp, DEG_PER_RAD, degrees, fscale, RAD_PER_DEG, radian…
zloirock Dec 5, 2023
1066491
drop `String.prototype.codePoints` (proposal is dead)
zloirock Dec 6, 2023
690140f
drop `set(Timeout|Interval)` fixes (required for IE9-)
zloirock Dec 6, 2023
8b0d697
consider a way setting of a prototype - `Object.setPrototypeOf` or `_…
zloirock Dec 6, 2023
5d45600
drop `es.number.to-precision` (required for ancient engines like IE8-…
zloirock Dec 6, 2023
53565ac
drop 'es.date.to-iso-string' (required for IE8- and other ancient eng…
zloirock Dec 6, 2023
95e8f0e
drop `es.error.to-string` (required for IE8-, V8 ~ Chrome 32-, FF10-)
zloirock Dec 6, 2023
3505fbd
remove a workaround of V8 ~ Chrome 36- `Object.{ defineProperty, defi…
zloirock Dec 6, 2023
e133030
drop descriptors support detection from compat tests
zloirock Dec 6, 2023
1db0442
drop `es.object.define-property` (required for ES3 engines and V8 ~ C…
zloirock Dec 6, 2023
c19f467
drop `es.object.define-properties` (required for ES3 engines and V8 ~…
zloirock Dec 6, 2023
ece832c
drop `es.escape` (supported in all popular modern engines)
zloirock Dec 6, 2023
f686cc2
drop `es.unescape` (supported in all popular modern engines)
zloirock Dec 6, 2023
8298182
drop `es.string.substr` (supported in all popular modern engines)
zloirock Dec 6, 2023
6c9367a
drop `es.date.to-gmt-string` (supported in all popular modern engines)
zloirock Dec 6, 2023
f49bbf0
drop `es.date. set-year` (supported in all popular modern engines)
zloirock Dec 6, 2023
81731f6
drop `es.date.get-year` (supported in all popular modern engines, req…
zloirock Dec 6, 2023
5cbe953
drop `es.array.for-each` (required for ES3 only)
zloirock Dec 6, 2023
415521f
drop `es.array.every` (required for ES3 only)
zloirock Dec 6, 2023
074c53e
drop `es.array.some` (required for ES3 only)
zloirock Dec 6, 2023
37c6a73
drop PhantomJS from compat data and valid targets since it's planned …
zloirock Dec 6, 2023
2de234a
consider `ArrayBuffer` and `DataView` as existent
zloirock Dec 6, 2023
e1320d0
consider strict mode as supported in tests
zloirock Dec 6, 2023
9d0efb3
consider `ArrayBuffer` and `DataView` as existent in compat tests
zloirock Dec 6, 2023
3b40726
drop PhantomJS from Karma
zloirock Dec 7, 2023
a7963a4
consider basic support of `WeakMap`
zloirock Dec 7, 2023
2b4d6f2
consider basic support of `%TypedArray%`
zloirock Dec 7, 2023
02de70c
drop fallbacks to ancient FF iterators (with `'@@iterator'` string)
zloirock Dec 8, 2023
9b53477
drop one more extra `ArrayBuffer` check
zloirock Dec 8, 2023
0e29848
direct access to `Reflect.ownKeys` in `own-keys` helper
zloirock Dec 8, 2023
a60fe6c
use native `Object.defineProperty` in unit tests constants
zloirock Dec 8, 2023
9e4e670
consider `__proto__` as redefinable (V8 ~ Chrome 27- bug)
zloirock Dec 8, 2023
5f274a9
drop a workaround of a strict mode lack case
zloirock Dec 9, 2023
6602ef1
consider `Array#lastIndexOf` as existent
zloirock Dec 9, 2023
af49f6c
drop IE8- case from tasks / microtasks, drop `.bind` dep from some in…
zloirock Dec 9, 2023
fdb8d63
drop third argument from `copy-constructor-properties` as not used
zloirock Dec 9, 2023
4478769
drop some deps declarations from `array-buffer-transfer`
zloirock Dec 9, 2023
d38f64f
fix dependency declaration in `array-buffer-is-detached`
zloirock Dec 9, 2023
f733105
drop extra dependency declaration from `array-buffer-byte-length`
zloirock Dec 9, 2023
08311d5
drop `.bind` dep from some init time cases, simplify with `.forEach`
zloirock Dec 9, 2023
39e0ea9
consider `ArrayBuffer` and `DataView` as existent in `web.structured-…
zloirock Dec 9, 2023
7954144
consider `Uint8Array` as existent in some more cases
zloirock Dec 9, 2023
95e644b
use native `Array#forEach` in one more case
zloirock Dec 9, 2023
1b55c03
drop some extra dependencies declaration
zloirock Dec 10, 2023
0751a82
drop one more `Object.isFrozen` existence check
zloirock Dec 10, 2023
5f6a193
disable `es/no-typed-arrays` `eslint` rule
zloirock Dec 11, 2023
b9b243f
consider `Array#indexOf` as existent
zloirock Dec 11, 2023
f831989
consider `Array#lastIndexOf` as existent
zloirock Dec 11, 2023
95a8870
use `Float32Array` in `Math.fround` polyfill
zloirock Dec 11, 2023
1f9d1f2
fix `indexOf` and `lastIndexOf` for some old engines
zloirock Dec 11, 2023
4127806
drop Opera Presto workaround from `Number` constructor polyfill
zloirock Dec 11, 2023
2d0f48f
drop detection of IE8- only bug from `Number#toExponential` polyfill
zloirock Dec 11, 2023
cd092d6
drop detection of ancient V8 only bug from `Number#toFixed` polyfill
zloirock Dec 11, 2023
5f420cc
consider a way setting of prototype as available in one more place
zloirock Dec 11, 2023
698dca8
drop a workaround for ancient engines whose `exec` methods don't cons…
zloirock Dec 11, 2023
195f399
drop a workaround for a IE bug with non-enumerable integer keys on `n…
zloirock Dec 11, 2023
d3c1a2f
reuse `internal-state` abstraction in `Symbol` polyfill
zloirock Dec 12, 2023
b21677c
implicit `parseInt` / `parseFloat` dependencies in `Number.{ parseInt…
zloirock Dec 13, 2023
1b012fc
drop some unused `eslint` directives
zloirock Dec 13, 2023
75455f2
replace `fastKey` logic with native `Map`
zloirock Dec 14, 2023
2c14b4c
finally drop `internal-metadata` and `hidden-keys` logic, use native …
zloirock Dec 15, 2023
3b07d5a
use native `Map` in `composite-key`
zloirock Dec 15, 2023
ad084ca
move some modules above in the order of modules loading to ensure pro…
zloirock Dec 18, 2023
34af2af
move `internal/object-assign` to `es.object.assign`
zloirock Dec 18, 2023
6ca29cf
inline `to-uint8-clamped`
zloirock Dec 19, 2023
aaf4d66
use array iteration methods in some simple cases
zloirock Dec 20, 2023
e615ec3
drop ignore of old V8 / WebKit number conversion bug
zloirock Dec 20, 2023
319a0f6
move `DataView`-related features from `internals/array-buffer` to `es…
zloirock Dec 20, 2023
3a92d5a
move `ArrayBuffer`-related features from `internals/array-buffer` to …
zloirock Dec 20, 2023
12c510f
extract `DataView#{ setInt8, setUint8 }` fixes as separate modules
zloirock Dec 20, 2023
03aa7c5
extract `DataView.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
4d2e29d
extract `ArrayBuffer.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
2c8a3fa
extract `ArrayBuffer[@@species]` as a separate module
zloirock Dec 20, 2023
4a2876f
extract `{ Map, Set }[@@species]` as a separate module
zloirock Dec 21, 2023
8442ce6
join typed array constructors lists
zloirock Dec 23, 2023
9a0741a
move `ArrayBuffer.isView` logic directly to `es.array-buffer.is-view`
zloirock Dec 23, 2023
13d9168
extract `a-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
6051656
extract `get-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
c347eab
move typed arrays `@@toStringTag` to metadata
zloirock Dec 23, 2023
71b89c1
extract `export-typed-array-static` helper to a separate module
zloirock Dec 23, 2023
ccb8a3c
extract `export-typed-array-method` helper to a separate module
zloirock Dec 23, 2023
bdd3f77
extract `a-typed-array` helper to a separate module
zloirock Dec 23, 2023
3b4475d
extract `is-typed-array` helper to a separate module
zloirock Dec 23, 2023
61b24fa
rename `array-buffer-view-core` -> `typed-array-core` since now it's …
zloirock Dec 23, 2023
7055e29
use `classof-raw` in `is-typed-array` to avoid unnecessary `@@toStrin…
zloirock Dec 23, 2023
f18f463
extract `%TypedArrayPrototype%[@@toStringTag]` to a separate module
zloirock Dec 24, 2023
d6cf02f
redefine `DOMException#toString` as unsafe
zloirock Dec 24, 2023
0eed83d
rewrite `export-typed-array-static` helper
zloirock Dec 24, 2023
1855c5f
rework `export-typed-array-static` helper, fix some `%TypedArray%` me…
zloirock Dec 24, 2023
f2068f2
update `es.typed-array.subarray` compat data
zloirock Dec 24, 2023
5e59eb7
extract `%TypedArray%[@@species]` to a separate module (and fix it)
zloirock Dec 25, 2023
989cd26
drop `ARRAY_BUFFER_VIEWS_SUPPORT` check from compat tests
zloirock Dec 25, 2023
62f0e59
avoid overwriting `.TypedArrayConstructor` by wrappers in typed array…
zloirock Dec 25, 2023
2401959
simplify `prototype.constructor` overwriting in typed array wrappers
zloirock Dec 25, 2023
d602260
`BYTES_PER_ELEMENT` constants of typed array constructors and prototy…
zloirock Dec 25, 2023
8c40bc2
drop typed arrays elements descriptors tests since it's no longer `co…
zloirock Dec 25, 2023
7b1f8c5
drop typed arrays `.sham` flag test since it no longer makes sense
zloirock Dec 25, 2023
328640f
enable some tests for all envs
zloirock Dec 25, 2023
276c761
rename for consistency with actual module name
zloirock Dec 25, 2023
1e4c37c
reuse `copy-constructor-properties` in `typed-array-constructor`, fix…
zloirock Dec 25, 2023
10a09ea
rework `inherit-if-required`
zloirock Dec 26, 2023
05971ed
rework `typed-array-core`
zloirock Dec 26, 2023
98b0cff
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
d05c88c
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
1c89513
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
e2ef8d9
allow `WeakMap`, `Map` and `Set` in `eslint` config
zloirock Dec 26, 2023
c067bb7
extract `internal-state-getter-for` helper
zloirock Dec 26, 2023
68c2bfb
drop unused `internal-state -> has` helper
zloirock Dec 26, 2023
3188161
some changes in `shared-store`
zloirock Dec 27, 2023
e301456
add `object-set-prototype-of-simple` helper
zloirock Dec 27, 2023
1158213
drop `is-forced` logic as not viable in the current form
zloirock Dec 27, 2023
2f07d2e
drop extra `global` usage
zloirock Dec 27, 2023
8d3f517
rename internal `global` reference to `globalThis` for consistency wi…
zloirock Dec 27, 2023
16ad10b
drop a workaround of ancient Nashorn `Object.prototype.propertyIsEnum…
zloirock Dec 28, 2023
c893e4d
drop some typed arrays existence checks
zloirock Dec 28, 2023
239962d
simplify `typed-array-core`
zloirock Jan 2, 2024
e9fd499
drop a workaround of Qt Script bug since it's anyway based on unsuppo…
zloirock Jan 3, 2024
4922bfd
bump `DOMException` above the rest web modules in the order of loading
zloirock Jan 3, 2024
e5c5f32
use native `Array#forEach` in `web.dom-collections.for-each`
zloirock Jan 3, 2024
dc7295e
don't cash used only on init time built-ins, some other minor improve…
zloirock Jan 3, 2024
6c127f5
drop internal `Iterators` abstraction
zloirock Jan 3, 2024
73974f2
return internal `Iterators` store for the pure version
zloirock Jan 5, 2024
90b10b7
simplify some cases of `Array` normalization logic, split `es.array.i…
zloirock Jan 5, 2024
3709c9a
drop ancient `iterator-define` logic
zloirock Jan 5, 2024
6f28d6c
`iterators-core` -> `iterator-prototype`
zloirock Jan 5, 2024
3afd930
ensure some dependencies
zloirock Jan 5, 2024
d5f9ad2
split `es.typed-array.iterator`
zloirock Jan 6, 2024
d72f3ef
split `web.dom-collections.iterator`
zloirock Jan 6, 2024
56df115
update readme
zloirock Jan 6, 2024
798963d
use `String#repeat` as an implicit dependency
zloirock Jan 7, 2024
1690180
`make-built-in` `options.{ getter, setter -> prefix }`
zloirock Jan 7, 2024
dc134d3
fix names
zloirock Jan 8, 2024
cc617b0
simplify `make-built-in`
zloirock Jan 8, 2024
80ece4a
fix names
zloirock Jan 8, 2024
56d7528
drop `Symbol.withoutSetter`
zloirock Jan 8, 2024
a322663
drop keys composition proposal as dead (no activity 5+ years), I hope…
zloirock Jan 10, 2024
b7d3296
drop new collections methods proposal as dead (no activity 6+ years),…
zloirock Jan 11, 2024
f034dae
mark `es.array-buffer.species` as not supported by hermes
zloirock Jan 12, 2024
084676e
don't use `@@toStringTag` on typed array check
zloirock Jan 13, 2024
8121477
drop unneded `.sham` flag check
zloirock Jan 13, 2024
dcd2161
drop `copyConstructorProperties` from global version `export` as dupl…
zloirock Jan 14, 2024
c39367e
drop some obsolete entries definitions
zloirock Jan 17, 2024
1b03cd8
fix filter in `build-entries` script
zloirock Jan 17, 2024
bc001a5
drop some arity checks for the pure version
zloirock Jan 17, 2024
0658eb3
some changes in export logic
zloirock Jan 18, 2024
a3774c8
use common export on `Object#toString`
zloirock Jan 18, 2024
9ae2a76
ignore `scripts/clean-dependencies` `package-lock`
zloirock Jan 18, 2024
df72203
build instance entries
zloirock Jan 22, 2024
3bb9f5f
add entries definitions for `ArrayBuffer` and `DataView`
zloirock Jan 23, 2024
a3744eb
build entries for common iterators
zloirock Jan 24, 2024
19bbfb6
add entries definitions for `Symbol`
zloirock Jan 24, 2024
2fbe400
build entries for typed arrays
zloirock Jan 24, 2024
520730b
build entries for regexp
zloirock Jan 25, 2024
4e22337
build entries for DOM collections
zloirock Jan 25, 2024
eb9ab43
add some missed entries definitions
zloirock Jan 25, 2024
a89d8a2
drop /actual/ entries for async iterator helpers since now it's on st…
zloirock Jan 26, 2024
f85461a
drop some extra arity tests from the pure version
zloirock Jan 26, 2024
4eae739
drop unneded `to-string-tag` entries
zloirock Jan 28, 2024
f4bc740
rework / drop some entries and definitions
zloirock Jan 28, 2024
9045e8f
drop `stage/4` entry as useless
zloirock Jan 28, 2024
091b5f5
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
65cfdcc
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
72defc8
tweak some entries definitions, dependencies declaration and templates
zloirock Jan 30, 2024
c59d560
declare some missed dependencies
zloirock Jan 31, 2024
a524b30
tweak some entries definitions
zloirock Feb 1, 2024
bbecfde
use generated entries
zloirock Feb 1, 2024
db10bc1
move tests indexes building to `bundle-tests` script
zloirock Feb 1, 2024
5c44f39
drop legacy entries for `ArrayBuffer#transfer` proposal
zloirock Feb 8, 2024
885d3a4
restore `Promise.try` proposal
zloirock Feb 8, 2024
f5fa8c5
no longer publish `core-js` on `deno.land/x`
zloirock Feb 13, 2024
5d7c86b
fix `access` in `package.json` files
zloirock Feb 13, 2024
a9d44ff
update dependencies
zloirock Feb 16, 2024
add8269
move `debug-get-dependencies` to tests folder
zloirock Feb 18, 2024
e630992
rework building entries
zloirock Feb 18, 2024
f135728
update docs
zloirock Feb 18, 2024
b56526f
`ifModules` -> `necessary`
zloirock Feb 18, 2024
dc9bb5f
update dependencies
zloirock Feb 19, 2024
fafb0a8
build exports fields
zloirock Mar 10, 2024
1a611c9
change the style of `$namespace` entry template usage
zloirock Mar 19, 2024
59230fa
change the style of `$helper` entry template usage
zloirock Mar 19, 2024
a638ad4
change the style of `$prototypeIterator` entry template usage
zloirock Mar 19, 2024
84c898c
change the style of `$virtualIterator` entry template usage
zloirock Mar 19, 2024
9c29542
change the style of `$staticWithContext` entry template usage
zloirock Mar 19, 2024
986a2e2
change the style of `$patchableStatic` entry template usage
zloirock Mar 19, 2024
3c0d60d
change the order of some keys
zloirock Mar 19, 2024
0a76e09
change the style of `$static` entry template usage
zloirock Mar 19, 2024
de9c571
change the style of `$prototype` and `$virtual` entry templates usage
zloirock Mar 19, 2024
dd30ebf
drop unused `@babel/plugin-transform-property-literals` dependency
zloirock Mar 19, 2024
9c33000
require `new` for `DataView` constructor
zloirock Mar 20, 2024
a603c7e
update dependencies
zloirock Mar 21, 2024
f4a740b
patch `DataView` for proper handling `undefined` as `byteOffset` and …
zloirock Mar 21, 2024
91b231f
change engine keys for compat tools / data
zloirock Mar 24, 2024
f010904
rename some `entries-definitions` params
zloirock Mar 24, 2024
88e7871
build entries data for `@core-js/compat` on building entries
zloirock Mar 24, 2024
981d814
load `padStart` as an optional dependency
zloirock Mar 28, 2024
d7e2a12
add a couple of missed entries definitions
zloirock Apr 1, 2024
0d0827a
add a missed entry
zloirock Apr 2, 2024
7507192
start experimental building built-in definitions from entries definit…
zloirock Apr 2, 2024
885e4fc
update dependencies
zloirock Apr 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
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
Expand Up @@ -32,7 +32,7 @@ jobs:
- run: npm ci
- run: npx run-s bundle test-unit-karma

promises-and-observables:
promises:
strategy:
matrix:
node:
Expand All @@ -48,7 +48,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
14 changes: 8 additions & 6 deletions .gitignore
Expand Up @@ -6,10 +6,13 @@ 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
Expand All @@ -18,21 +21,20 @@ node_modules/
/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
Expand Down
35 changes: 15 additions & 20 deletions CONTRIBUTING.md
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