Major modernization of the basket.js library, focusing on modern JavaScript practices while maintaining API compatibility.
- ES Module support (import/export)
- CommonJS compatibility layer
- Interactive demo with real-world examples
- Jest-based test suite with modern mocks
- Proper TypeScript type definitions
- Vite-based build system
- Import maps support for modern browsers
- Modernized to ES6+ syntax
- Improved Promise handling
- Enhanced error reporting
- Optimized localStorage management
- Reduced bundle size (3.24 kB ESM, 2.47 kB gzipped)
- Updated documentation with modern examples
- Migrated from Bower to npm
- Replaced manual script injection with modern module loading
- Bower dependency
- Grunt build system
- Legacy IE8 support
- Manual AMD/CommonJS wrappers
- Legacy build artifacts
- Travis CI configuration (preparing for modern CI)
The API surface remains the same, so existing code should continue to work. However, importing the library has changed:
// Old (0.x)
<script src="basket.js"></script>
// New (1.0.0) - ESM
import basket from 'basket.js';
// New (1.0.0) - CommonJS
const basket = require('basket.js');
Key differences:
- Installation now uses npm instead of Bower
- Module loading is preferred over script tags
- Promises follow modern conventions
- IE8 compatibility removed
- Built with modern tooling (Vite)
Last version before modernization. Focused on legacy browser support and traditional loading mechanisms.
Notable features:
- Script loading and caching
- localStorage support
- Promise-based API
- AMD/CommonJS support
- Bower package manager
- Grunt build system