Migrating a small application from core-js 2 to core-js 3 without downtime crosses a documented module boundary: core-js/fn/... specifiers become core-js/features/... , and aggregate entry points such as core-js/stable become available. In Babel, the configuration transition moves @babel/preset-env from corejs: 2 to corejs: 3 under useBuiltIns . The unresolv
The core-js library provides polyfills for Map and Set to ensure compatibility with ECMAScript standards in environments lacking native support. A critical requirement of the specification is the use of the SameValueZero algorithm for key comparison, which dictates that NaN should be treated as equal to NaN . When relying on the polyfill rather than a native
When integrating core-js into a reusable library, the goal is to provide modern JavaScript features without altering the consumer’s runtime. The library must avoid polluting global prototypes while still offering a stable API for downstream projects. The main uncertainty lies in selecting between the global build (core-js) that patches built‑ins and the pony
Integration boundary A workspace contains an application plus several shared packages. The app and one package load the global core-js build (core-js 3), while another package imports from core-js-pure to avoid polluting globals. The goal is to decide which mode the shared library should declare as a dependency, given that both builds ship the same implement
A shared JavaScript library consumed by several applications needs to polyfill newer ECMAScript features, and the team must pick one core-js import strategy before publishing. The documented options behave differently: global entry points such as core-js/stable or per-feature paths like core-js/actual/array/group-by patch built-in prototypes and globals, whi
Polyfill Delivery in Shared Libraries When developing a shared library intended for diverse environments, there is a tension between providing necessary polyfills and avoiding side effects in the host application. Core-js provides two primary documented paths for this: core-js/stable , which patches global objects, and core-js/actual , which provides polyfil
Polyfill Specification Compliance The core-js library implements Array.prototype.flat to ensure compatibility with the ECMAScript specification across legacy environments. While the library provides modular imports to minimize bundle size, the internal implementation must balance strict spec compliance with execution efficiency. Execution Trade-offs In certa
Global core-js versus core-js-pure for a distributable component library A distributable component library must support IE11 alongside modern browsers. Assuming a recent core-js major version, the unresolved decision is whether to rely on global core-js polyfills at the application entry point or to import core-js-pure within each module. Global polyfills en
Polyfill Promotion Workflow In core-js version 3, the library distinguishes between stable ECMAScript features and those currently in the proposal stage. This allows developers to opt into experimental functionality via specific proposal imports before they are finalized in the official specification. A challenge arises when a feature transitions from a prop