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
b4d3f84
avoid `Object.getOwnPropertyNames` polyfill dependency since the base…
zloirock Oct 25, 2023
f6e57b4
specify `Math.fround` as an implicit dependency
zloirock Oct 25, 2023
21a157a
add `get-dependencies` helper
zloirock Oct 26, 2023
b588fdc
drop an extra `Symbol.isRegisteredSymbol` lookup
zloirock Oct 26, 2023
d0af0d6
prototype `build-entries` script
zloirock Oct 30, 2023
2ef49f5
avoid an extra check
zloirock Oct 31, 2023
a5394a0
some minor improvements
zloirock Nov 2, 2023
e4c8c46
move `debug-get-dependencies` to a separate script
zloirock Nov 2, 2023
42dc658
declare some dependencies
zloirock Nov 2, 2023
755fc33
add definitions of proposals, some improvements of `build-entries` sc…
zloirock Nov 2, 2023
519a44e
build indexes
zloirock Nov 2, 2023
ab4b2bd
add entries definitions for `/number/`
zloirock Nov 2, 2023
1a0836a
add entries definitions for `/array/`
zloirock Nov 2, 2023
0fbae4f
add entries definitions for iteration helpers
zloirock Nov 2, 2023
133b34f
add entries definitions for `/reflect/`
zloirock Nov 2, 2023
ad6c34f
add entries definitions for `/function/`
zloirock Nov 3, 2023
47dc609
add entries definitions for `/string/`
zloirock Nov 3, 2023
bfccecd
add entries definitions for some globals
zloirock Nov 3, 2023
621f787
add entries definitions for `/object/`
zloirock Nov 3, 2023
eec9762
add entries definitions for errors
zloirock Nov 4, 2023
47b1258
add entries definitions for `/json/`
zloirock Nov 4, 2023
a0ab415
add entries definitions for `URL`
zloirock Nov 4, 2023
47d9bd4
some fixes
zloirock Nov 4, 2023
8b9b0c2
set method names in some templates
zloirock Nov 4, 2023
6939e51
add entries definitions for `/promise/`
zloirock Nov 4, 2023
d183f20
add entries definitions for `/date/`
zloirock Nov 4, 2023
75d4f4f
add entries definitions for `/map/`
zloirock Nov 4, 2023
d5470f4
add entries definitions for `/set/`
zloirock Nov 4, 2023
a4c4a57
add entries definitions for `/weak-map/`
zloirock Nov 4, 2023
26a7e94
add entries definitions for `/weak-set/`
zloirock Nov 5, 2023
fff5246
add entries definitions for `/iterator/`
zloirock Nov 6, 2023
04bebfa
add entries definitions for `/async-iterator/`
zloirock Nov 6, 2023
4bc0e5d
add entries definitions for `/(async-)disposable-stack/`
zloirock Nov 6, 2023
478fb7b
build `/stage/` entries
zloirock Nov 6, 2023
907a44f
drop `@babel/transform-reserved-words` as not required for ES5+
zloirock Nov 17, 2023
5ef2b73
drop `Map.groupBy` from collections methods proposal
zloirock Nov 20, 2023
28b47bc
drop `@babel/transform-{ member-expression-literals, property-literal…
zloirock Nov 27, 2023
62cc621
drop `esnext.object.group-by` (moved to stable es)
zloirock Nov 27, 2023
f9c369c
drop `esnext.map.group-by` (moved to stable es)
zloirock Nov 27, 2023
586ab1b
drop `esnext.promise.with-resolvers` (moved to stable es)
zloirock Nov 28, 2023
739dd08
drop `arguments` fallback from `Object#toString`
zloirock Dec 1, 2023
7e2a881
drop workarounds for non-enumerable string chars
zloirock Dec 1, 2023
464a558
`chr` -> `char` (unreserved variable name)
zloirock Dec 2, 2023
267704a
avoid usage `forEach` from prototype on runtime
zloirock Dec 3, 2023
6d8c492
`chr` -> `char` (unreserved variable name)
zloirock Dec 5, 2023
212bc15
allow brackets notation on strings instead of `.charAt`
zloirock Dec 5, 2023
2b2baf5
`hasOwn` -> `in`
zloirock Dec 5, 2023
1d3db7d
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
f5af6ff
use `Object.create(null)` in one more case
zloirock Dec 5, 2023
ded011a
drop `Number.fromString` (proposal is dead, semantics is not clear)
zloirock Dec 5, 2023
5afee50
drop `Function.{ isCallable, isConstructor}` (proposal is dead)
zloirock Dec 5, 2023
ca20343
drop `Math.signbit` (proposal is dead)
zloirock Dec 5, 2023
0dcbb0b
drop `Math.{ clamp, DEG_PER_RAD, degrees, fscale, RAD_PER_DEG, radian…
zloirock Dec 5, 2023
111e672
drop `String.prototype.codePoints` (proposal is dead)
zloirock Dec 6, 2023
4721dec
drop `set(Timeout|Interval)` fixes (required for IE9-)
zloirock Dec 6, 2023
1af91a6
consider a way setting of a prototype - `Object.setPrototypeOf` or `_…
zloirock Dec 6, 2023
708346d
drop `es.number.to-precision` (required for ancient engines like IE8-…
zloirock Dec 6, 2023
ea025d6
drop 'es.date.to-iso-string' (required for IE8- and other ancient eng…
zloirock Dec 6, 2023
218f967
drop `es.error.to-string` (required for IE8-, V8 ~ Chrome 32-, FF10-)
zloirock Dec 6, 2023
1d615c3
remove a workaround of V8 ~ Chrome 36- `Object.{ defineProperty, defi…
zloirock Dec 6, 2023
893990e
drop descriptors support detection from compat tests
zloirock Dec 6, 2023
ef54e62
drop `es.object.define-property` (required for ES3 engines and V8 ~ C…
zloirock Dec 6, 2023
1f511c7
drop `es.object.define-properties` (required for ES3 engines and V8 ~…
zloirock Dec 6, 2023
937352e
drop `es.escape` (supported in all popular modern engines)
zloirock Dec 6, 2023
5f5ed1f
drop `es.unescape` (supported in all popular modern engines)
zloirock Dec 6, 2023
650ac54
drop `es.string.substr` (supported in all popular modern engines)
zloirock Dec 6, 2023
b27c5aa
drop `es.date.to-gmt-string` (supported in all popular modern engines)
zloirock Dec 6, 2023
594e39e
drop `es.date. set-year` (supported in all popular modern engines)
zloirock Dec 6, 2023
2926a6d
drop `es.date.get-year` (supported in all popular modern engines, req…
zloirock Dec 6, 2023
4eff8a2
drop `es.array.for-each` (required for ES3 only)
zloirock Dec 6, 2023
bae3d53
drop `es.array.every` (required for ES3 only)
zloirock Dec 6, 2023
ab64977
drop `es.array.some` (required for ES3 only)
zloirock Dec 6, 2023
88c369b
drop PhantomJS from compat data and valid targets since it's planned …
zloirock Dec 6, 2023
2239456
consider `ArrayBuffer` and `DataView` as existent
zloirock Dec 6, 2023
861edae
consider strict mode as supported in tests
zloirock Dec 6, 2023
f22fbf3
consider `ArrayBuffer` and `DataView` as existent in compat tests
zloirock Dec 6, 2023
d54ca56
drop PhantomJS from Karma
zloirock Dec 7, 2023
906417c
consider basic support of `WeakMap`
zloirock Dec 7, 2023
581d678
consider basic support of `%TypedArray%`
zloirock Dec 7, 2023
14b496d
drop fallbacks to ancient FF iterators (with `'@@iterator'` string)
zloirock Dec 8, 2023
9b3ddaf
drop one more extra `ArrayBuffer` check
zloirock Dec 8, 2023
4626e08
direct access to `Reflect.ownKeys` in `own-keys` helper
zloirock Dec 8, 2023
67c8e12
use native `Object.defineProperty` in unit tests constants
zloirock Dec 8, 2023
52b14eb
consider `__proto__` as redefinable (V8 ~ Chrome 27- bug)
zloirock Dec 8, 2023
50ebbc0
drop a workaround of a strict mode lack case
zloirock Dec 9, 2023
fc08341
consider `Array#lastIndexOf` as existent
zloirock Dec 9, 2023
0fe2761
drop IE8- case from tasks / microtasks, drop `.bind` dep from some in…
zloirock Dec 9, 2023
5054106
drop third argument from `copy-constructor-properties` as not used
zloirock Dec 9, 2023
f85d265
drop extra dependency declaration from `array-buffer-byte-length`
zloirock Dec 9, 2023
1b15b14
drop `.bind` dep from some init time cases, simplify with `.forEach`
zloirock Dec 9, 2023
b007b9e
consider `ArrayBuffer` and `DataView` as existent in `web.structured-…
zloirock Dec 9, 2023
c609e32
consider `Uint8Array` as existent in some more cases
zloirock Dec 9, 2023
1d4c8c3
use native `Array#forEach` in one more case
zloirock Dec 9, 2023
68793d9
drop some extra dependencies declaration
zloirock Dec 10, 2023
f405547
drop one more `Object.isFrozen` existence check
zloirock Dec 10, 2023
ce2692d
disable `es/no-typed-arrays` `eslint` rule
zloirock Dec 11, 2023
6e316f5
consider `Array#indexOf` as existent
zloirock Dec 11, 2023
7c91386
consider `Array#lastIndexOf` as existent
zloirock Dec 11, 2023
36d9891
use `Float32Array` in `Math.fround` polyfill
zloirock Dec 11, 2023
c480622
fix `indexOf` and `lastIndexOf` for some old engines
zloirock Dec 11, 2023
db05ab2
drop Opera Presto workaround from `Number` constructor polyfill
zloirock Dec 11, 2023
5728e7a
drop detection of IE8- only bug from `Number#toExponential` polyfill
zloirock Dec 11, 2023
16bd89a
drop detection of ancient V8 only bug from `Number#toFixed` polyfill
zloirock Dec 11, 2023
1eeceb8
consider a way setting of prototype as available in one more place
zloirock Dec 11, 2023
6beebd8
drop a workaround for ancient engines whose `exec` methods don't cons…
zloirock Dec 11, 2023
215893b
drop a workaround for a IE bug with non-enumerable integer keys on `n…
zloirock Dec 11, 2023
bb15540
reuse `internal-state` abstraction in `Symbol` polyfill
zloirock Dec 12, 2023
90eadb8
implicit `parseInt` / `parseFloat` dependencies in `Number.{ parseInt…
zloirock Dec 13, 2023
864d3eb
replace `fastKey` logic with native `Map`
zloirock Dec 14, 2023
f8c3c16
finally drop `internal-metadata` and `hidden-keys` logic, use native …
zloirock Dec 15, 2023
a15d2f9
use native `Map` in `composite-key`
zloirock Dec 15, 2023
2edf675
move some modules above in the order of modules loading to ensure pro…
zloirock Dec 18, 2023
394b2cc
move `internal/object-assign` to `es.object.assign`
zloirock Dec 18, 2023
9edb594
inline `to-uint8-clamped`
zloirock Dec 19, 2023
b1096d5
use array iteration methods in some simple cases
zloirock Dec 20, 2023
da98e08
drop ignore of old V8 / WebKit number conversion bug
zloirock Dec 20, 2023
9117c88
move `DataView`-related features from `internals/array-buffer` to `es…
zloirock Dec 20, 2023
810c8c0
move `ArrayBuffer`-related features from `internals/array-buffer` to …
zloirock Dec 20, 2023
939a9c5
extract `DataView#{ setInt8, setUint8 }` fixes as separate modules
zloirock Dec 20, 2023
33179fc
extract `DataView.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
2c17c19
extract `ArrayBuffer.prototype[@@toStringTag]` as a separate module
zloirock Dec 20, 2023
85c5ae9
extract `ArrayBuffer[@@species]` as a separate module
zloirock Dec 20, 2023
84dd047
extract `{ Map, Set }[@@species]` as a separate module
zloirock Dec 21, 2023
a21e063
join typed array constructors lists
zloirock Dec 23, 2023
505a612
move `ArrayBuffer.isView` logic directly to `es.array-buffer.is-view`
zloirock Dec 23, 2023
62b74bd
extract `a-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
344a9cf
extract `get-typed-array-constructor` helper to a separate module
zloirock Dec 23, 2023
67aeeac
move typed arrays `@@toStringTag` to metadata
zloirock Dec 23, 2023
a979ad5
extract `export-typed-array-static` helper to a separate module
zloirock Dec 23, 2023
498d629
extract `export-typed-array-method` helper to a separate module
zloirock Dec 23, 2023
a84ae35
extract `a-typed-array` helper to a separate module
zloirock Dec 23, 2023
cde6500
extract `is-typed-array` helper to a separate module
zloirock Dec 23, 2023
1769e97
rename `array-buffer-view-core` -> `typed-array-core` since now it's …
zloirock Dec 23, 2023
561cad7
use `classof-raw` in `is-typed-array` to avoid unnecessary `@@toStrin…
zloirock Dec 23, 2023
527b301
extract `%TypedArrayPrototype%[@@toStringTag]` to a separate module
zloirock Dec 24, 2023
4d4cb65
redefine `DOMException#toString` as unsafe
zloirock Dec 24, 2023
1cd30fc
rewrite `export-typed-array-static` helper
zloirock Dec 24, 2023
97eb4eb
rework `export-typed-array-static` helper, fix some `%TypedArray%` me…
zloirock Dec 24, 2023
461187a
update `es.typed-array.subarray` compat data
zloirock Dec 24, 2023
e56ba80
extract `%TypedArray%[@@species]` to a separate module (and fix it)
zloirock Dec 25, 2023
390a727
drop `ARRAY_BUFFER_VIEWS_SUPPORT` check from compat tests
zloirock Dec 25, 2023
52a084c
avoid overwriting `.TypedArrayConstructor` by wrappers in typed array…
zloirock Dec 25, 2023
14c92eb
simplify `prototype.constructor` overwriting in typed array wrappers
zloirock Dec 25, 2023
a1424d6
`BYTES_PER_ELEMENT` constants of typed array constructors and prototy…
zloirock Dec 25, 2023
b03afef
drop typed arrays elements descriptors tests since it's no longer `co…
zloirock Dec 25, 2023
8977b79
drop typed arrays `.sham` flag test since it no longer makes sense
zloirock Dec 25, 2023
01ba66b
enable some tests for all envs
zloirock Dec 25, 2023
127204a
rename for consistency with actual module name
zloirock Dec 25, 2023
8da0d16
reuse `copy-constructor-properties` in `typed-array-constructor`, fix…
zloirock Dec 25, 2023
3c9113d
rework `inherit-if-required`
zloirock Dec 26, 2023
44492b8
rework `typed-array-core`
zloirock Dec 26, 2023
3b86e92
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
b2af4f0
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
f6247d2
use `Object.keys().forEach()` instead of `for-in` in some cases
zloirock Dec 26, 2023
edd2ffd
allow `WeakMap`, `Map` and `Set` in `eslint` config
zloirock Dec 26, 2023
e1601e2
extract `internal-state-getter-for` helper
zloirock Dec 26, 2023
98dc6dc
drop unused `internal-state -> has` helper
zloirock Dec 26, 2023
f5b749a
some changes in `shared-store`
zloirock Dec 27, 2023
12bbd5d
add `object-set-prototype-of-simple` helper
zloirock Dec 27, 2023
315328a
drop `is-forced` logic as not viable in the current form
zloirock Dec 27, 2023
e2f6104
drop extra `global` usage
zloirock Dec 27, 2023
b6307b4
rename internal `global` reference to `globalThis` for consistency wi…
zloirock Dec 27, 2023
2bb7cca
drop a workaround of ancient Nashorn `Object.prototype.propertyIsEnum…
zloirock Dec 28, 2023
25f6f05
drop some typed arrays existence checks
zloirock Dec 28, 2023
1f3e626
simplify `typed-array-core`
zloirock Jan 2, 2024
9c566ac
drop a workaround of Qt Script bug since it's anyway based on unsuppo…
zloirock Jan 3, 2024
361a9b1
bump `DOMException` above the rest web modules in the order of loading
zloirock Jan 3, 2024
4ae4a92
use native `Array#forEach` in `web.dom-collections.for-each`
zloirock Jan 3, 2024
cc80707
don't cash used only on init time built-ins, some other minor improve…
zloirock Jan 3, 2024
3567e6b
drop internal `Iterators` abstraction
zloirock Jan 3, 2024
e2b7777
return internal `Iterators` store for the pure version
zloirock Jan 5, 2024
7a4f3f8
simplify some cases of `Array` normalization logic, split `es.array.i…
zloirock Jan 5, 2024
6fc0679
drop ancient `iterator-define` logic
zloirock Jan 5, 2024
6c88b3e
`iterators-core` -> `iterator-prototype`
zloirock Jan 5, 2024
8d61c99
ensure some dependencies
zloirock Jan 5, 2024
68cb01e
split `es.typed-array.iterator`
zloirock Jan 6, 2024
330d21f
split `web.dom-collections.iterator`
zloirock Jan 6, 2024
0a24987
update readme
zloirock Jan 6, 2024
cdd8afe
use `String#repeat` as an implicit dependency
zloirock Jan 7, 2024
19ca60c
`make-built-in` `options.{ getter, setter -> prefix }`
zloirock Jan 7, 2024
22a7c4e
fix names
zloirock Jan 8, 2024
d6e6228
simplify `make-built-in`
zloirock Jan 8, 2024
ead3c1f
fix names
zloirock Jan 8, 2024
6115cb1
drop `Symbol.withoutSetter`
zloirock Jan 8, 2024
270f6bf
drop keys composition proposal as dead (no activity 5+ years), I hope…
zloirock Jan 10, 2024
9f12bcf
drop new collections methods proposal as dead (no activity 6+ years),…
zloirock Jan 11, 2024
2d22e62
mark `es.array-buffer.species` as not supported by hermes
zloirock Jan 12, 2024
9c54b02
don't use `@@toStringTag` on typed array check
zloirock Jan 13, 2024
8295460
drop unneded `.sham` flag check
zloirock Jan 13, 2024
eec5eeb
drop `copyConstructorProperties` from global version `export` as dupl…
zloirock Jan 14, 2024
53d3f98
drop some obsolete entries definitions
zloirock Jan 17, 2024
b741c56
fix filter in `build-entries` script
zloirock Jan 17, 2024
c1f5696
drop some arity checks for the pure version
zloirock Jan 17, 2024
accf0ed
some changes in export logic
zloirock Jan 18, 2024
d18d3ca
use common export on `Object#toString`
zloirock Jan 18, 2024
2ff4d24
ignore `scripts/clean-dependencies` `package-lock`
zloirock Jan 18, 2024
ce10b0e
build instance entries
zloirock Jan 22, 2024
18f9b5e
add entries definitions for `ArrayBuffer` and `DataView`
zloirock Jan 23, 2024
9c8e524
build entries for common iterators
zloirock Jan 24, 2024
8cdf4fc
add entries definitions for `Symbol`
zloirock Jan 24, 2024
4ccc3e0
build entries for typed arrays
zloirock Jan 24, 2024
a30d770
build entries for regexp
zloirock Jan 25, 2024
5b531a4
build entries for DOM collections
zloirock Jan 25, 2024
dde9f71
add some missed entries definitions
zloirock Jan 25, 2024
aa8ad84
drop /actual/ entries for async iterator helpers since now it's on st…
zloirock Jan 26, 2024
cfa6df5
drop some extra arity tests from the pure version
zloirock Jan 26, 2024
08ce72c
drop unneded `to-string-tag` entries
zloirock Jan 28, 2024
9e18d89
rework / drop some entries and definitions
zloirock Jan 28, 2024
719aa10
drop `stage/4` entry as useless
zloirock Jan 28, 2024
19ca7fd
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
1da215b
tweak some entries definitions and dependencies
zloirock Jan 29, 2024
3de66c3
tweak some entries definitions, dependencies declaration and templates
zloirock Jan 30, 2024
27c1e77
declare some missed dependencies
zloirock Jan 31, 2024
0639b72
tweak some entries definitions
zloirock Feb 1, 2024
7c439db
use generated entries
zloirock Feb 1, 2024
5b0361b
move tests indexes building to `bundle-tests` script
zloirock Feb 1, 2024
84f7a18
drop legacy entries for `ArrayBuffer#transfer` proposal
zloirock Feb 8, 2024
e605f20
restore `Promise.try` proposal
zloirock Feb 8, 2024
95080f7
no longer publish `core-js` on `deno.land/x`
zloirock Feb 13, 2024
a55cd58
fix `access` in `package.json` files
zloirock Feb 13, 2024
f035b11
move `debug-get-dependencies` to tests folder
zloirock Feb 18, 2024
56c5897
rework building entries
zloirock Feb 18, 2024
b4d8c55
update docs
zloirock Feb 18, 2024
8faec5b
`ifModules` -> `necessary`
zloirock Feb 18, 2024
2bbb4d1
build exports fields
zloirock Mar 10, 2024
9feaa5d
change the style of `$namespace` entry template usage
zloirock Mar 19, 2024
c817593
change the style of `$helper` entry template usage
zloirock Mar 19, 2024
4e3a02b
change the style of `$prototypeIterator` entry template usage
zloirock Mar 19, 2024
5dfa1e9
change the style of `$virtualIterator` entry template usage
zloirock Mar 19, 2024
3c9a962
change the style of `$staticWithContext` entry template usage
zloirock Mar 19, 2024
ae81ba0
change the style of `$patchableStatic` entry template usage
zloirock Mar 19, 2024
d09baa0
change the order of some keys
zloirock Mar 19, 2024
c693270
change the style of `$static` entry template usage
zloirock Mar 19, 2024
273d469
change the style of `$prototype` and `$virtual` entry templates usage
zloirock Mar 19, 2024
6011d4b
require `new` for `DataView` constructor
zloirock Mar 20, 2024
929fbd7
update dependencies
zloirock Mar 21, 2024
ea0d46d
patch `DataView` for proper handling `undefined` as `byteOffset` and …
zloirock Mar 21, 2024
4714a2b
change engine keys for compat tools / data
zloirock Mar 24, 2024
fbeaff7
rename some `entries-definitions` params
zloirock Mar 24, 2024
48de650
build entries data for `@core-js/compat` on building entries
zloirock Mar 24, 2024
5e40f26
load `padStart` as an optional dependency
zloirock Mar 28, 2024
0d7f1f0
add a couple of missed entries definitions
zloirock Apr 1, 2024
96b2b5d
add a missed entry
zloirock Apr 2, 2024
f323cf5
start experimental building built-in definitions from entries definit…
zloirock Apr 2, 2024
0821f4e
update dependencies
zloirock Apr 17, 2024
38ea9a4
drop `postinstall`
zloirock Jul 29, 2024
8821be0
drop legacy iterator helpers modules
zloirock Oct 8, 2024
bac941b
drop legacy `Promise.try` modules
zloirock Oct 10, 2024
383db35
replace `internals/math-log2 ` with module dependency
zloirock Nov 24, 2024
b1866af
update after rebasing
zloirock Dec 28, 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 @@ -63,7 +63,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 strictly 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
Loading