Skip to content

Docs: state the supported browser baseline (v28 raised it to ES2022) #2197

Description

@happycappie

Summary

v28.0.0 added two Object.hasOwn calls on the init path. Object.hasOwn is ES2022. The library therefore requires Safari 15.4, Chrome 93, or Firefox 92. The release notes and the README do not state this requirement.

Call sites

  • packages/core/src/js/core/options.ts — option validation.
  • packages/core/src/js/data/country-data.ts — dial-code to ISO2 map.

Evidence

I grepped the published tarballs for Object.hasOwn:

Version Count
24.0.0, 25.0.0, 25.3.1, 27.0.0 0
28.0.0, 29.0.0, 29.2.3 2

tsconfig.base.json sets "target": "ES2022". The output matches the target. This report concerns the documentation, not the target.

Request

  1. Add a "Browser support" section to the README. Name the minimum browser versions.
  2. Add one line to the v28.0.0 release notes. State that v28 raised the runtime baseline.

Both call sites also accept Object.prototype.hasOwnProperty.call(obj, key). That substitution restores the v27 baseline. Make it only if you want to keep support for older browsers.

Context

Dependabot bumped one project from 26.9.2 to 29.1.0. Customers on Safari 15.1 then lost the page. That project calls intlTelInput() inside a React effect, so the throw unmounted the whole form. We polyfilled Object.hasOwn on our side. We file this report so the next project finds the baseline in the docs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions