Conversation
There was a problem hiding this comment.
Pull request overview
This PR delivers Swiffy Slider v2.0.0 as an ESM-only package with a new esbuild/lightningcss build pipeline, shipped TypeScript declarations, and modernized CSS + documentation updates to match the new loading pattern.
Changes:
- Replace legacy IIFE/dual-build output with a single ESM distribution (core + extensions) and updated package exports.
- Add hand-written
.d.tsfiles for both modules and expand JSDoc on public APIs. - Modernize CSS (gap, range media queries, reduced-motion handling) and update docs/examples to ESM module loading.
Reviewed changes
Copilot reviewed 31 out of 62 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/swiffy-slider.js | Core slider module refactor to exported ESM object + JSDoc + behavior fixes. |
| src/swiffy-slider.esm.js | Removes legacy separate ESM source entry (now redundant). |
| src/swiffy-slider.d.ts | Adds TypeScript declarations for core module API. |
| src/swiffy-slider.css | CSS modernization (gap, reduced motion, MQ range syntax, fixes). |
| src/swiffy-slider-extensions.js | Extensions module refactor to exported ESM object + improved drag timer handling. |
| src/swiffy-slider-extensions.d.ts | Adds TypeScript declarations for extensions module API. |
| package.json | Bumps to 2.0.0, switches exports to dist output + types, updates scripts and Node engine. |
| docs/index.html | Updates docs site homepage to load v2 assets and ESM init patterns. |
| docs/examples/index.html | Updates examples page to ESM module loading + new CSS path. |
| docs/docs/slider-sizes/index.html | Updates docs page to ESM module loading + new CSS path. |
| docs/docs/slider-options/index.html | Updates docs page to ESM module loading + new CSS path. |
| docs/docs/slider-navigation/index.html | Updates docs page to ESM module loading + new CSS path. |
| docs/docs/slider-indicators/index.html | Updates docs page to ESM module loading + new CSS path. |
| docs/docs/slider-animation/index.html | Updates docs page to ESM module loading + minor copy fix. |
| docs/docs/index.html | Major docs refresh for v2 loading, API, TS guidance, and removed legacy guidance. |
| docs/configuration/index.html | Updates configurator to use ESM modules and updated init calls. |
| docs/concept.html | Removes outdated concept page. |
| docs/assets/js/swiffy-slider.min.js.map | Removes legacy minified asset sourcemap. |
| docs/assets/js/swiffy-slider.min.js | Removes legacy minified asset. |
| docs/assets/js/swiffy-slider.js.map | Adds new built ESM sourcemap for docs. |
| docs/assets/js/swiffy-slider.js | Adds new built ESM core bundle for docs. |
| docs/assets/js/swiffy-slider.esm.min.js.map | Removes legacy minified ESM asset sourcemap. |
| docs/assets/js/swiffy-slider.esm.min.js | Removes legacy minified ESM asset. |
| docs/assets/js/swiffy-slider-extensions.min.js.map | Removes legacy extensions minified asset sourcemap. |
| docs/assets/js/swiffy-slider-extensions.min.js | Removes legacy extensions minified asset. |
| docs/assets/js/swiffy-slider-extensions.js.map | Adds new built ESM extensions sourcemap for docs. |
| docs/assets/js/swiffy-slider-extensions.js | Adds new built ESM extensions bundle for docs. |
| docs/assets/css/swiffy-slider.min.css.map | Removes legacy minified CSS sourcemap. |
| docs/assets/css/swiffy-slider.min.css | Removes legacy minified CSS. |
| docs/assets/css/swiffy-slider.css | Adds new built CSS output for docs (with sourcemap reference). |
| dist/js/swiffy-slider.min.js.map | Removes legacy minified dist sourcemap. |
| dist/js/swiffy-slider.min.js | Removes legacy minified dist JS. |
| dist/js/swiffy-slider.js.map | Adds new dist ESM sourcemap for core. |
| dist/js/swiffy-slider.js | Replaces dist output with ESM export build. |
| dist/js/swiffy-slider.esm.min.js.map | Removes legacy minified ESM dist sourcemap. |
| dist/js/swiffy-slider.esm.min.js | Removes legacy minified ESM dist JS. |
| dist/js/swiffy-slider.esm.js | Removes legacy separate ESM dist entry. |
| dist/js/swiffy-slider.d.ts | Adds dist-shipped TypeScript declarations for core. |
| dist/js/swiffy-slider-extensions.min.js.map | Removes legacy extensions minified dist sourcemap. |
| dist/js/swiffy-slider-extensions.min.js | Removes legacy extensions minified dist JS. |
| dist/js/swiffy-slider-extensions.js.map | Adds new dist ESM sourcemap for extensions. |
| dist/js/swiffy-slider-extensions.js | Replaces extensions dist output with ESM export build. |
| dist/js/swiffy-slider-extensions.d.ts | Adds dist-shipped TypeScript declarations for extensions. |
| dist/css/swiffy-slider.min.css.map | Removes legacy minified dist CSS sourcemap. |
| dist/css/swiffy-slider.min.css | Removes legacy minified dist CSS. |
| build.js | Adds new build orchestrator (esbuild + lightningcss + copy to docs/assets). |
| SECURITY.md | Adds a security policy and reporting instructions. |
| LICENSE | Updates copyright year range. |
| Changelog.md | Adds v2.0.0 changelog entry and highlights breaking changes. |
| CLAUDE.md | Adds repo/build/dev workflow guidance and architecture notes. |
| .vscode/settings.json | Removes editor-specific VS Code pipeline configuration. |
| .vscode/readme-extensions-used.txt | Removes outdated docs about VS Code extension-based build. |
| .gitignore | Adds node_modules/ ignore. |
| .github/workflows/publish.yml | Adds tag-triggered npm publish workflow. |
| .github/workflows/ci.yml | Adds PR CI build workflow. |
| .github/CONTRIBUTING.md | Adds contributor guidance and project expectations. |
| .claude/settings.local.json | Adds local Claude tool permissions config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- setVisibleSlides: observe only direct children (:scope > *) to avoid applying slide-visible to nested elements and excess observer load - configuration/index.html: use Promise.all to avoid race condition between core and extensions imports overwriting window.swiffyslider - build.js: rewrite sourceMappingURL in docs CSS copy to use relative path so browser devtools can resolve the map from docs/assets/css/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
window.swiffysliderglobal or auto-init. Use<script type="module">or a bundler and callswiffyslider.init()explicitly.npm run build/npm run dev..d.tsfiles shipped for both the core and extensions module. No@types/package needed.grid-gap→gap, removed obsolete-webkit-overflow-scrolling, media queries updated to range syntax,prefers-reduced-motionsupport added, several bugs fixed.Breaking changes
<script src defer>→<script type="module">window.swiffyslider— use named ESM importdata-noinitremoved — v2 never auto-initializesswiffyslider.extensions.*→swiffysliderextensionsfromswiffy-slider/extensionsswiffy-slider.min.js/swiffy-slider.esm.min.js→swiffy-slider.jsTest plan
npm run build— should complete without errorshttp://localhost:5501vianpm run devand verify sliders work on the docs sitedist/js/contains.js,.js.map, and.d.tsfor both modules🤖 Generated with Claude Code