v131 · javascript
Deprecate getters of Intl Locale Info
Intl Locale Info API is a Stage 3 ECMAScript TC39 proposal to enhance the Intl.Locale object by exposing Locale information, such as week data (first day in a week, weekend start day, weekend end day, minimun day in the first week), and text direction hour cycle used in the locale. https://github.com/tc39/proposal-intl-locale-info We ship our implementat
concepts
-
Intl Locale getters
Synchronous Intl.Locale info getters deprecated; explicit methods replace them.
-
Codemod the getters
Paste a chunk of code and watch a regex codemod rewrite every deprecated getter to its method form, with per-call-site stats.
-
Method vs getter explorer
Pick a locale. Every deprecated getter and its replacement method called side by side. Compare what each returns.
-
Lint rule + auto-fix
Inline regex lint that flags every deprecated call site. Hit "fix all" to apply the codemod across the buffer.
why it shipped
Intl Locale Info API advanced to Stage 3 in Stage 3 in 2021-04 TC39 and v8 ship with that in m99 But in 2022-11 TC39 meeting , TC39 decide to change getters to functions and the spec change merged in Jan 31, 2023 https://github.com/tc39/proposal-intl-locale-info/pull/67