Closed littledan closed 1 year ago
BTW it's fine, from my perspective, to use the polyfill in a global mode, as long as it overrides the global unconditionally. It's the conditionality, not module vs global, which is most impactful in terms of avoiding creating web compatibility issues.
Related: https://github.com/tc39/proposal-temporal/issues/778
Via https://github.com/js-temporal/temporal-polyfill#usage, which links to https://github.com/tc39/proposal-temporal/issues/778 here:
Note that this polyfill currently does not install a global Temporal object like a real implementation will. This behavior avoids hiding the global Temporal object in environments where a real Temporal implementation is present. See this issue for more background on this decision.
I totally understand. I will implement this for the next release, which will be sometime this week. I'll remove the conditionality of the main entrypoint, effectively making it the same as the impl
entrypoint
Released in v0.1.0
I only made the change for the 'polyfill' endpoint which is temporal-polyfill/global
. I still need to make the change for the temporal-polyfill
endpoint
Fixed in the ponyfill here: https://github.com/fullcalendar/temporal/commit/3a9cc0ccb2281712cd57dc7085e7550e46c8929b
Released in v0.1.1. This issue can finally be closed out.
Temporal is still undergoing some changes. If an automatic fallback is shipped in websites, those sites could break when the proposal changes. Ultimately, unfortunately, the deployment of the polyfill could block the proposal from evolving! This has repeatedly prevented TC39 from making changes to the language, e.g., in the famous #smooshgate incident.
For this reason, it's generally recommended (W3C TAG polyfill guidelines) that polyfills only defer to native implementations once they reach a "tipping point":
When no native implementation exists yet, we haven't yet reached this tipping point. I stongly recommend exposing the option of fallback to native Temporal only once Temporal has shipped in at least one web browser. Until then, it would be best to stick with only the
impl
entrypoint.