Skip to content

OWD project: Fix how MDN distributes Polyfills #27

@Elchi3

Description

@Elchi3

This project proposes that we work on fixing how MDN distributes Polyfills.

Originally proposed in the MDN discourse https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 but never rolled out, because the MDN wiki didn't really allow to make mass changes. This is now much more approachable with MDN in git.

Problem statement

MDN reference pages often contain large code blocks of Polyfills. This is bad for a few reasons.

  • The UX is terrible: The polyfills are distributed in the reference page inside the usual <pre> code blocks which are normally used for static code examples and create a giant blocks of code you normally don’t want to read, but need to copy & paste into your project in order to make use of the polyfill.
  • Maintenance is an impossible task: The MDN staff contributors and the core community lacks knowledge and time for of looking after changes to polyfills. Code of polyfills can be really complicated as it implements functions and algorithms described in e.g. the ECMAScript specification or needs to handle weird edge cases. The code aims to be correct and fast, which can be tricky, too. There are bugs filed against MDN polyfills; they remain unresolved.
  • Translations outdate, too. I haven’t even looked at how bad polyfills are on outdated wiki translations.
  • We do not conform to the advice for polyfill distributors from the W3CTag:
    • We don’t check if we host bad polyfills that are hurting the web. They were in the wiki and editable at any time.
    • We do track spec changes more or less, but we are unable to update the polyfills accordingly.
    • We’re not a CDN for polyfills, we don’t bundle them (someone apparently started doing that for MDN), nor can we guarantee any integrity, or checksums, caching, or anything the like.

Priority assessment

This table checks this project against the OWD prioritization criteria.

Criteria Assessment
Effort Medium. Need to identify how many pages involved but it is not all reference pages.
Dependencies Need to agree on trusted Polyfill sources
Community enablement Yes. This task is quite self-contained and contributions to update as many pages as possible are welcome
Momentum N/A
Enabling learners Not really. Sometimes remove large distracting code blocks from reference pages
Enabling professionals Probably. You want to trust MDN about its Polyfill recommendation
Underrepresented topics / ethical web N/A
Operational necessities N/A
Addressing needs of the Web industry Might help address compat pain point as Polyfills are part of the story there.

Proposed solutions

  • We should remove polyfill code blocks from the MDN pages.
  • We still want to offer polyfills to MDN readers but we should link to a trusted polyfill source rather than providing untrusted ones inline on the pages.

Task list

  • Confirm Polyfill removal and linking to trusted sources is the way forward.
  • Figure out trusted sources for Polyfills
  • Replace inline Polyfill code with links to trusted Polyfill sources

More information

Open Web Docs (OWD) is a non-profit collective funded by corporate and individual donations.

In order for this project to happen, please consider donating to OWD on https://opencollective.com/open-web-docs.
For more information on sponsorship and membership tiers, see https://openwebdocs.org/membership/

More information is available at https://openwebdocs.org.
For questions, please reach out to florian@openwebdocs.org.

Metadata

Metadata

Assignees

Labels

proposal (actionable)Enough information is provided and the work is scoped well. Actionable but not prioritized right now

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions