fullcalendar / temporal-polyfill

A lightweight polyfill for Temporal, successor to the JavaScript Date object
MIT License
361 stars 14 forks source link

Update README with ESM guidance for js-temporal/temporal-polyfill #31

Closed joshcanhelp closed 8 months ago

joshcanhelp commented 8 months ago

https://github.com/js-temporal/temporal-polyfill/blob/main/README.md#usage

arshaw commented 8 months ago

Hi @joshcanhelp, thank you for the PR. I think the issue you're posing is more due to a lack of explanation and documentation on my part rather than a text change.

When I'm referring to "global usage", I'm talking about writing an import statement that does not import any new variables but instead causes a side-effect where all other files executing during that runtime also have access to a superglobal Temporal object.

The @js-temporal/temporal-polyfill README says this:

Note that this polyfill currently does not install a global Temporal object like a real implementation will

As you can see, it's not possible to install a truly global Temporal object. Just import a Temporal variable into a specific module.

Do you think I should improve the docs?

joshcanhelp commented 8 months ago

Ah, ok. That makes sense 👍 thanks for the explanation!