Loading
Commits on Source 13
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
-
Matt d'Entremont authored
The existing ESM entry points (`libphonenumber-js`, `/min`, `/max`, `/mobile`, `/core`) are named "es6" internally, but they aren't actually modern-syntax builds: `@babel/preset-env` runs without a target and therefore still transpiles classes, destructuring, `for...of`, etc. to older JavaScript. That keeps backwards compatibility, but modern consumers pay for Babel helper code that their own browser targets don't need. Keep those existing entry points unchanged and add opt-in modern subpackages instead: * `libphonenumber-js/min/es6` * `libphonenumber-js/max/es6` * `libphonenumber-js/mobile/es6` * `libphonenumber-js/core/es6` The default package entry points remain on the current transpilation path, so this is not a breaking change. Consumers that want the smaller modern build can opt in explicitly by importing from the new `/es6` subpaths. The new `BABEL_ENV=es6-modern` build writes source modules to `es6-modern/` using `@babel/preset-env` with `modules: false`, `bugfixes: ...
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
Add modern ESM subpackages See merge request !29 The existing ESM entry points (`libphonenumber-js`, `/min`, `/max`, `/mobile`, `/core`) are named "es6" internally, but they aren't actually modern-syntax builds: `@babel/preset-env` runs without a target and therefore still transpiles classes, destructuring, `for...of`, etc. to older JavaScript. That keeps backwards compatibility, but modern consumers pay for Babel helper code that their own browser targets don't need. Keep those existing entry points unchanged and add opt-in modern subpackages instead: * `libphonenumber-js/min/es6` * `libphonenumber-js/max/es6` * `libphonenumber-js/mobile/es6` * `libphonenumber-js/core/es6` The default package entry points remain on the current transpilation path, so this is not a breaking change. Consumers that want the smaller modern build can opt in explicitly by importing from the new `/es6` subpaths. The new `BABEL_ENV=es6-modern` ...
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored
-
Nikolay Kuchumov authored