Skip to content

v0.8.0

Latest

Choose a tag to compare

@lbutler lbutler released this 20 Apr 14:13
· 135 commits to master since this release

epanet-js v0.8.0

This release modernises the build, adds dual ESM/CJS support and improves memory safety for multi-project workloads. It also includes one small but important breaking API change — workspace initialisation is now asynchronous.

⚠️ Breaking change — Workspace now requires await

The Emscripten engine is no longer loaded eagerly in the Workspace constructor. You must now call await ws.loadModule() before creating a Project.

Before (v0.7.0):

const ws = new Workspace();
const model = new Project(ws);

After (v0.8.0):

const ws = new Workspace();
await ws.loadModule(); // must be awaited
const model = new Project(ws);

Calling workspace methods before loadModule() resolves will throw EPANET engine not loaded. Call loadModule() first. This change requires top-level await support or running inside an async function.