Skip to content

polyfill usage with /base is counterintuitive #95

@roippi

Description

@roippi

Hi there. The how the polyfill works section states:

The "standard" version of the web-vitals library includes some of the same logic found in polyfill.js

This means that you must include the polyfill, even on browsers (ie chrome) that natively support First Input Delay. Omitting the polyfill will break FID on chrome. (Cannot read property 'firstHiddenTime' of undefined)

This is rather counterintuitive: it means the polyfill is doing more than just polyfilling. It's bundling some application logic in with the polyfill. I've never seen another polyfill on the web that acts this way - a reasonable developer expectation is that polyfills replace missing browser functionality, and no more.

Can we make the polyfill pure, and leave application logic inside the app? Alternately, calling this something other than a "polyfill" since it's really a polyfill + helper script. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions