Skip to content

1.3.0 - Browser bundle on npm and CDNs

Latest

Choose a tag to compare

@formix formix released this 12 Oct 19:16
b804e51

What's new

Browser bundle on npm and CDNs

The browser bundle (dist/infernal-engine.js, about 7 kB minified, 2.5 kB gzipped) is now part of the npm package, so the jsDelivr and unpkg CDNs serve it. Add it to a page with a <script> tag, which defines the global InfernalEngine class:

<script src="https://cdn.jsdelivr.net/npm/infernal-engine@1.3.0/dist/infernal-engine.js"></script>
<script>
  (async () => {
    const engine = new InfernalEngine();
    await engine.def("count5", async i => {
      if (typeof i !== "undefined" && i < 5) {
        return { "i": i + 1 };
      }
    });
    await engine.assert("i", 1);
    console.log(await engine.peek("i")); // displays 5
  })();
</script>

The same file is on unpkg: https://unpkg.com/infernal-engine@1.3.0/dist/infernal-engine.js

The bundle and its source map are also attached to this release, below, if you prefer to host them yourself.

Bundle works everywhere

The UMD bundle now loads in Node.js (require()) and web workers too, not only in browsers.

Other changes

  • New Installation section at the top of the README, covering Node.js projects and the browser.
  • dist/ is no longer committed to the repository; it's built when packaging and by the release workflow.
  • Fixed npm test with mocha 12, and updated development dependencies.

Install

npm install infernal-engine@1.3.0

Full changelog: 1.2.0...1.3.0