Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should Temporal objects be polyfilled into the global namespace? #2

Open
justingrant opened this issue Jul 7, 2021 · 1 comment
Open

Comments

@justingrant
Copy link
Contributor

Currently, this polyfill requires import-ing or require-ing to use. Another option could be to polyfill Temporal into the global namespace.

tc39/proposal-temporal#778 has discussion about why we didn't do this so far.

But as browsers start shipping Temporal, it may make sense to have this polyfill more closely match built-in behavior.

@12wrigja
Copy link
Contributor

12wrigja commented Jul 8, 2021

So long as the existing module is still available I do think it would be more convenient for most users to automatically assign to the global Temporal symbol.

That being said, I'd strongly prefer this assignment be done separately from the module defining the Temporal namespace object, so that it can still be treated only as a module without having the side-effect of polluting the global namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants