Overview
This major release focuses on package size reduction by separating development tools from the core package. The biggest change is the introduction of a standalone js.foresight-devtools package, which dramatically reduces the core package size while maintaining all existing functionality.
| Version | Minified | Minified + gzipped | Download Time | Dependencies |
|---|---|---|---|---|
| 2.2.0 | 77.6 kB | 18.6 kB | 372 ms | 3 |
| 3.0.0 | 25 kB | 7.7 kB | 155 ms | 2 |
| Result | -68% | -58% | -58% | -1 |
Features
Standalone Development Tools Package
- NEW: js.foresight-devtools is now a separate package
- BREAKING: Debugger functionality removed from core js.foresight package
- NEW:
ForesightDebuggerclass for managing development tools - IMPROVED: Development tools are now optional and don't bloat production builds
Event System
- NEW: Event system for monitoring ForesightJS operations
- NEW: Events for element registration, callbacks, trajectory updates, and settings changes
- NEW: Support for AbortController signals for easy event listener cleanup
Monorepo
- NEW: Foresightjs is now a monorepo making it way easier for contributors to make PR's
Documentation
New Documentation Pages
- NEW: Revamped homepage
- NEW: Events documentation - Complete guide to ForesightJS event system
- UPDATED: Development Tools documentation - Updated for standalone package
Migration Guide
If you didnt use the debug functionality, nothing changes and you can safely update
-
Update core package:
pnpm add js.foresight@latest
-
Install development tools separately (if needed):
pnpm add -D js.foresight-devtools@latest
-
Update initialization code:
- Remove
debugproperty fromForesightManager.initialize() - Add separate
ForesightDebugger.initialize()call if using development tools
- Remove
-
Use the new ForesightDebugger
// v2.x (OLD) import { ForesightManager } from "js.foresight" ForesightManager.initialize({ debug: true, // This no longer works }) // v3.0 (NEW) import { ForesightManager } from "js.foresight" import { ForesightDebugger } from "js.foresight-devtools" ForesightManager.initialize({ // Core settings only }) // Separate debugger initialization ForesightDebugger.initialize(ForesightManager.instance, { showDebugger: true, isControlPanelDefaultMinimized: false, })
Removed Properties
- REMOVED:
debugproperty fromForesightManagerSettings - REMOVED: All debugger-related properties from core manager
- MOVED: Debug functionality to
js.foresight-devtoolspackage - REMOVED:
unregisterOnCallback