glidejs / glide

A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more
https://glidejs.com
MIT License
7.29k stars 772 forks source link

Request for ES6+ Distribution to Avoid Legacy JavaScript Warning #688

Closed basterrika closed 4 months ago

basterrika commented 4 months ago

Description

I'm currently using Glide.js v3.6.0 in my project, and I have encountered an issue with Google Lighthouse reporting the following warning:

"Avoid old JavaScript in modern browsers"

The warning appears to be triggered by the ES5-compatible class syntax present in the glide.min.js distribution file. Since modern browsers can handle ES6+ code more efficiently, having ES5 syntax can negatively impact performance.

Steps to Reproduce

  1. Include glide.min.js v3.6.0 in your project.
  2. Run a Google Lighthouse audit on the page that includes Glide.js.
  3. Observe the warning regarding old JavaScript.

Expected Behavior

Lighthouse should not flag Glide.js as using old JavaScript syntax when running audits for modern browsers.

Current Behavior

Lighthouse reports a warning due to the presence of ES5-compatible class syntax in the /dist/glide.min.js file.

Possible Solution

To resolve this, it would be beneficial to provide a distribution build of Glide.js that targets ES6+ environments.

jedrzejchalubek commented 4 months ago

Glide is distributed as ESM please read more at: https://glidejs.com/docs/setup#using-es-modules