Skip to content

ES6 Update

Choose a tag to compare

@cybercussion cybercussion released this 20 Jan 04:59
· 621 commits to v5 since this release

v5.0.0: Modernization & ES Modules

This major release completely modernizes the SCOBot library, transitioning from a legacy IIFE/Global architecture to a standard ES Module system with modern tooling.

🚀 Key Features

  • ES Modules: Native ESM support. Import only what you need: import { SCOBot } from 'scobot'.
  • Modern Architecture: All core logic refactored into ES6 Classes (SCOBot, SCOBotBase, SCOBotUtil).
  • TypeScript Support: Includes generated type definitions (.d.ts) for better DX.
  • Local Persistence: The Mock API (SCOBot_API_1484_11) now persists student data to localStorage, allowing for resumable sessions during local testing.
  • Data Compression: Built-in support for lz-string to compress suspend_data before sending to the LMS.

🛠 Tooling & Infrastructure

  • Vite: Fast build system generating both ESM (dist/scobot.js) and UMD (dist/scobot.umd.js) bundles.
  • Vitest: Modern unit testing suite replacing QUnit.
  • CI/CD: Automated testing and NPM publishing via GitHub Actions.

⚠️ Breaking Changes

  • Module System: The library is now primarily an ES Module. While a UMD bundle is provided for legacy script tags, the recommended usage is via import.
  • Global Layout: SCOBot does not automatically attach to the global window object unless you explicitly do so or use the UMD build.
  • Configuration: Gruntfile.js and .travis.yml have been removed in favor of vite.config.js and GitHub Actions.