Skip to content

[Polyfill] Usage and Install recommendations #778

Description

@romulocintra

The actual readme recommends to import the polyfill as a Module.

import { Temporal } from 'proposal-temporal/lib/index.mjs';

IMHO, documentation should be more specific and explore different ways of using the polyfill :

This polyfill is intended to be used as a library without global namespace pollution, or can I use it globally as a script tag with umd version?

My feedback is that different strategies must be explained independent of having a recommendation, also should include different scenarios, patterns or use cases, having in mind a future "migration" path for the time that Temporal is shipped to the browsers.

Personally one of the biggest advantages of Temporal is being a proposal with a polyfill, but if I use it as recommended, it may include a future build step, when migrating to the final API that is likely to be on the global namespace.

In my personal use case, I would go for the umd version and treat Temporal the same as I do with other polyfills, load through a service doing feature-detection then loading as it is needed. IMHO is the clean migration path for those that already supporting browsers >=IE11.

Activity

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

Metadata

Metadata

Assignees

Labels

documentationAdditions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Sponsor
    SponsoredKunjungi sekarang
    Promo