-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Now there is active work on core-js@4
.
One of the decisions that will be realized in core-js@4
and made quite a long time ago is the refusal to support engines without basic ES5 support (for example, IE8-). This will not reduce the full library size significantly (maybe only about 3-4%), it will not significantly reduce the number of modules (only some modules and polyfills only of some features will be removed - too many of them were changed in future ES versions or have bugs), however, it will allow significantly untangle core-js
and reduce the size of minimalistic core-js
bundles that contain only some modules by several times.
As an option, it could be good to bump the lower bar a little above basic ES5 support with similar result. Let's discuss it.
IE11 support is still a strict requirement for some core-js
users, but not IE9 / IE10.
What IE11 could give us in case of dropping IE9 / IE10 support?
- Basic
WeakMap
support. That requires patching for modern semantics and fixes many bugs in polyfill. However, that can be used incore-js
internals and significantly simplify them. It's the main one that we could get. Without it, the rest doesn't matter much. - Basic
Map
andSet
support. That requires full replacement in polyfill. However, that can be used in some internalcore-js
cases. - A way setting of prototype -
Object.setPrototypeOf
or__proto__
. That could simplify some minor internalcore-js
cases. - Basic support of
%TypedArray%
constructors,ArrayBuffer
,DataView
could help to untangle%TypedArray%
-related features and significantly reduce their size. - The strict mode that was missed in IE9 does not have a principal meaning for
core-js
code.
Let's take a look at other engines:
- Basic
WeakMap
support added in Chrome 36, Safari 7.1, FF6 - Basic
Map
andSet
support added in Chrome 38, Safari 7.1, FF13 - A way setting of prototype -
Object.setPrototypeOf
or__proto__
- in all quite popular engines >= IE11 - Basic support of
%TypedArray%
constructors,ArrayBuffer
andDataView
added in Chrome 5, Safari 5.1, FF15
What does it mean?
- Setting the lower bar to something like IE11, Chrome 38, Safari 7.1, FF15, Node 0.11.15 and the like
- End of ancient Android (4.4.3 ~ Chrome 36) support (maybe the most critical case)
- End of PhantomJS (~ IIRC Safari 6.0) support (sadly since it's useful for testing compatibility with old engines on CI)
- End of Duktape support (Invalid global object detected when bundling with esbuild and running on Duktape #1303 (comment))
- End of Opera Presto (12-) support (anyway I don't see any users of this engine in the stats)
- Rising the bar higher makes no sense because of IE11 limitations
It could be slightly tweaked. For example, we could avoid native Map
/ Set
and leave Chrome 36 -> Android 4.4.3 support.
In addition, it will allow us to drop painful workarounds for a dozen bugs of those engines.
What do you think?