esl icon indicating copy to clipboard operation
esl copied to clipboard

[🚀 for pages]: migrate the polifilling approach to the modern one

Open ala-n opened this issue 3 years ago • 0 comments

As a pages visitor and ESL dev team member, I want to see the most recommended approach to distribute browser sources.

Current approach:

  • there is 3 bundles in the build: localdev.js (code), polyfill-light (for browsers that partially support required browser API), polifill-full - for browsers that do not completely support ES6.
  • the choice to load additional polyfill chunks is on the inline script that validates browser capabilities and then skips or load through the document.write an additional chunk

Proposed approach It is proposed to investigate an alternative scenario:

  • there is a two types of chunks on the project: localdev.js (code) + localdev.legacy.js (code + polyfills)
  • use the module + nomodule technique to detect the browser capabilities (see the following article for details https://jasonformat.com/modern-script-loading/)

Alternative approaches The described approach might be combined with the current one or completely different. The implementation requires additional investigation.

Priority: Normal

ala-n avatar Aug 24 '21 11:08 ala-n