Skip to content

v2.1.0 - Bundle Size Optimization

Choose a tag to compare

@LudoLoops LudoLoops released this 12 Jan 21:40
· 110 commits to main since this release
2900600

🚀 Rune Scroller v2.1.0 - Bundle Size Optimization

Bundle size reduced by 12% (unpacked) and 9% (gzipped) while maintaining 100% feature parity and test coverage.

📊 Improvements

Bundle Metrics

  • Gzipped: 14.3KB → 13.0KB (-1.3KB, -9%)
  • Unpacked: 47.4KB → 41.8KB (-5.6KB, -12%)

Per-File Optimization

File Before After Savings
animations.css 3.9KB 2.5KB -36%
runeScroller.js 5.7KB 5.0KB -12%
dom-utils.js 4.5KB 3.4KB -24%
useIntersection.svelte.js 2.7KB 2.2KB -18%
observer-utils.js 1.6KB 773B -52%
Type definitions (.d.ts) 9.0KB 6.0KB -33%
Total JS 18.0KB 15.8KB -12%

✨ Technical Changes

CSS Optimization

  • Migrated to CSS custom properties: --tx, --ty, --scale, --rx, --ry, --rotate
  • Consolidated animation rules from 8 lines per animation to 2-3 lines
  • Reduced animations.css from 179 lines to 69 lines
  • All 14 animations working identically

JavaScript Optimization

  • JSDoc comments optimized: kept type info, removed verbose descriptions/examples
  • Console warnings wrapped with NODE_ENV checks (dev-only)
  • Stripped 155+ lines of comments

Production Ready

  • NODE_ENV guards ensure clean production builds
  • All warnings only shown in development
  • Minification-ready code

✅ Quality Assurance

  • ✅ 121/121 tests passing (100% coverage maintained)
  • ✅ All 14 animations tested and working
  • ✅ Zero breaking changes
  • ✅ Full TypeScript support via JSDoc
  • ✅ SSR compatible (SvelteKit ready)
  • ✅ Accessibility preserved (prefers-reduced-motion)

🔄 What's Included

  • CSS optimized with custom properties
  • JSDoc comments optimized for smaller bundle
  • Production-ready with NODE_ENV guards
  • Complete test suite (121 tests)
  • Updated documentation and CHANGELOG

📦 Installation

npm install rune-scroller@2.1.0
# or
pnpm add rune-scroller@2.1.0

🔗 Resources


Created by ludoloops @ LeLab.dev