metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.5k stars 604 forks source link

Update package to es6 module syntax #1306

Open jbloomstrom-wac opened 2 months ago

jbloomstrom-wac commented 2 months ago

Modernize Flickity Codebase to ES6 Modules

Overview: This PR modernizes the Flickity codebase by converting it from CommonJS to ES6 module syntax. The following changes have been made to improve the maintainability and future-proofing of the codebase:

Changes:

  1. Convert to ES6 Modules:

    • Replaced all require statements with import statements.
    • Used export default for module exports.
  2. Updated Individual Module Files:

    • core.js: Updated to use ES6 syntax and exports.
    • drag.js: Converted the module to ES6 syntax, ensuring all functionality remains intact.
    • prev-next-button.js: Refactored using ES6 classes and modules.
    • page-dots.js: Refactored using ES6 classes and modules.
    • player.js: Refactored using ES6 classes and modules.
    • add-remove-cell.js: Updated to ES6 syntax.
    • lazyload.js: Updated to ES6 syntax.
    • imagesloaded.js: Updated to ES6 syntax.
  3. Main Entry File:

    • Converted the main entry point to use ES6 imports and export the Flickity module.