Replaced by: 

Drupal core browser requirements make this module obsolete, since most browsers covered support ES6 module syntax. The only exception is Opera Mini but its JavaScript capabilities are limited anyway.

Adds the ability to differentially serve JavaScript on the basis of whether the current browser supports ES6 modules or not. This allows users to pay less of a penalty for when a site needs to support older browsers.

There is some extra wrangling to support edge cases where a browser may not respect the nomodule attribute and would then potentially execute more scripts than desired.

Usage

In extension.libraries.yml:

scripts:
  js:
    modern.js: { differential_serve: 'modern' } # ES6 only.
    legacy.js: { differential_serve: 'legacy' } # ES5 only.

Gotcha: initial attached legacy scripts may not get their Drupal behavior attach() methods called on the initial page load, due to the async nature of their loading.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Obsolete
    Use of this project is deprecated.
  • Project categories: Developer tools, Performance
  • Created by wongjn on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases