getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.58k stars 443 forks source link

Remove unnecessary `polyfill.io` #3763

Closed SukkaW closed 4 months ago

SukkaW commented 4 months ago

Pull Request Checklist

Description

I haven't updated the AUTHORS.txt as I though small changes like this should not qualify.

The PR replaces all polyfill.io with cdnjs.cloudflare.com/polyfill in the docs and the template.

polyfill.io was acquired by a China-based CDN company "Funnull", see the announcement from the polyfill.io domain owner's Twitter and https://github.com/polyfillpolyfill/polyfill-service/issues/2834. Despite Funnull's claims of operating in the United States, the predominance of Simplified Chinese on its website suggests otherwise, and it turns out that "Funnull" is notorious for providing service for the betting and pornography industries.

The original creator of the polyfill.io has voiced his concern on Twitter. And since the acquisition, numerous issues have emerged (https://github.com/polyfillpolyfill/polyfill-service/issues/2835, https://github.com/polyfillpolyfill/polyfill-service/issues/2838, https://github.com/alist-org/alist/issues/6100), rendering the polyfill.io service extremely unstable. Since then, Fastly (Announcement) and Cloudflare (Announcement) has hosted their own instances of polyfill.io service.

Kwpolska commented 4 months ago

I’m wondering if we actually need the polyfills. They were required for Safari, but Safari seems to have added this feature in 2020. Do you have access to a Mac to verify?

SukkaW commented 4 months ago

I’m wondering if we actually need the polyfills. They were required for Safari, but Safari seems to have added this feature in 2020. Do you have access to a Mac to verify?

I only have a Apple-Silicon powered Mac thus can't install the Safari 14. But many repositories I've opened a PR to are suggesting removing the polyfill entirely, and we could do the same.

On the other hand, removing the polyfill could be a breaking change though.

Kwpolska commented 4 months ago

Could you still test in whichever newer Safari version you have? If the feature actually works there in different languages, we can remove the polyfill altogether (we’ll just assume the information about 2020/Safari 14 is correct), Apple users will probably be on a recent version anyway.

SukkaW commented 4 months ago

Could you still test in whichever newer Safari version you have? If the feature actually works there in different languages, we can remove the polyfill altogether (we’ll just assume the information about 2020/Safari 14 is correct), Apple users will probably be on a recent version anyway.

So I opened the MDN page on my Safari (Safari 17.4) and ran the example, it does work though.

image
Kwpolska commented 4 months ago

Great, in that case, please remove the polyfill altogether :)

aknrdureegaesr commented 4 months ago

Side remark: For web sites that try to comply with EU GDPR, one needs a signed written agreement of a certain kind with any CDN or similar entity, before sending traffic their way. I vividly remember a concerted effort across many dev teams to remove Google fonts from all web presences of a big German business that was my employer at the time. From a legal point of view, it is much safer to self-hosting all resources needed.

SukkaW commented 4 months ago

@felixfontein @Kwpolska I've rebased the PR and all polyfill.io usages are removed.

Kwpolska commented 4 months ago

Thanks for bringing this to our attention and fixing it!