Skip to content

Releases: asciidoctor/asciidoctor.js

v4.0.0-alpha.1

04 May 10:48

Choose a tag to compare

Summary

This release is a complete rewrite of Asciidoctor.js — the Opal runtime and transpiled Ruby code have been replaced by a native JavaScript implementation.
The public API has been preserved as closely as possible from version 3, but there are breaking changes.
Please refer to the migration guide before upgrading.

Release meta

Released on: 2026-05-04
Released by: Guillaume Grossetie
Published by: GitHub

Logs: full diff

Changelog

Breaking Changes

  • @asciidoctor/core is now a native JavaScript implementation — no more Opal transpilation

  • API is now fully asynchronous (convert, load, etc. return a Promise)

  • No factory call required, objects and functions are exported directly as named exports

    import { convert } from '@asciidoctor/core'
    
    await convert('Hello _world_')
  • AbstractNode#getAttribute(name) returns null (not undefined) when the attribute is absent

  • AbstractNode#getAttr() is removed — use getAttribute() instead

  • Requires Node.js ≥ 24

  • @asciidoctor/cli is deprecated — the CLI is now built into the asciidoctor package itself

Improvements

  • Complete rewrite from the Ruby source using Claude Code (claude-sonnet-4-6), reviewed by a human
  • Pure ESM library with no external runtime dependencies
  • TypeScript type definitions (.d.ts) are now generated from JSDoc annotations — no separate hand-written types file required
  • HTTP includes and remote image inlining use the standard fetch API instead of XMLHttpRequest
  • File I/O (loadFile, convertFile, include directives) uses node:fs/promises — all operations are fully async, no blocking sync calls
  • CLI is now implemented using the Node.js built-in parseArgs — no third-party CLI framework required
  • Native binaries are now built with Node.js Single Executable Applications (SEA) instead of pkg
  • Significantly faster — early performance benchmarks show 3–4× speed improvements over version 3
  • Browser bundle is ~700 kB (unminified), down from ~1.74 MB with version 3 (Opal runtime included)
  • ContentModel constants exported (COMPOUND, SIMPLE, VERBATIM, RAW, EMPTY) for discoverable access to block content model values

Infrastructure

  • Replaced ESLint + Standard with Biome for linting and formatting
  • Browser tests run via vitest --browser (Playwright/Chromium) in addition to the Node.js test runner
  • Test suite ported from Asciidoctor Ruby — over 2,600 tests covering the full feature set
  • Use npm workspaces to simplify dependency installation (#1746)
  • Added id-token permission to CI workflows to enable trusted publishing

v2.2.9

29 Apr 22:31

Choose a tag to compare

Summary

This release is based on Asciidoctor 2.0.23 and Opal 0.11.99.dev (31d26d69).

Release meta

Released on: 2026-04-30
Released by: @ggrossetie
Published by: GitHub Actions

Logs: full diff

What's Changed

  • Replace glob by fast-glob
  • Bump unxhr to 1.2

v2.2.8

02 Jun 07:59

Choose a tag to compare

Summary

This release is based on Asciidoctor 2.0.23 and Opal 0.11.99.dev (31d26d69).

Release meta

Released on: 2024-06-02
Released by: @ggrossetie
Published by: GitHub Actions

Logs: full diff

What's Changed

v2.2.7

17 Mar 20:12

Choose a tag to compare

Summary

This release is based on Asciidoctor 2.0.22 and Opal 0.11.99.dev (31d26d69).

Release meta

Released on: 2024-03-17
Released by: @ggrossetie
Published by: GitHub Actions

Logs: full diff

What's Changed

v3.0.4

12 Feb 11:19

Choose a tag to compare

Summary

This release is based on Asciidoctor 2.0.20 and Opal 1.7.3 and fixes a regression introduced in 3.0.3.

Release meta

Released on: 2024-02-12
Released by: @ggrossetie
Published by: GitHub Actions

Logs: full diff

Changelog

Bug Fixes

  • Default condition should be last one in conditional exports otherwise the following error is thrown: "Module not found: Error: Default condition should be last one" (#1722) - thanks @roseckyj & @korva

Infrastructure

  • Update development dependencies

New Contributors

Full Changelog: v3.0.3...v3.0.4

v3.0.3

13 Jan 08:36

Choose a tag to compare

Summary

This release is based on Asciidoctor 2.0.20 and Opal 1.7.3.

Release meta

Released on: 2024-01-13
Released by: @ggrossetie
Published by: GitHub Actions

Logs: full diff

Changelog

Bug Fixes

  • Fix types exports in package.json - thanks @sinedied
  • Addd context and node_name accessor in the type definition - thanks @RayOffiah

Infrastructure

  • Update development dependencies

New Contributors

Full Changelog: v3.0.2...v3.0.3

v3.0.2

24 Jun 16:38

Choose a tag to compare

Summary

This release is based on Asciidoctor 2.0.20 and Opal 1.7.3.

Release meta

Released on: 2023-06-24
Released by: @ggrossetie
Published by: GitHub Actions

Logs: full diff

Changelog

Breaking Changes

  • Remove Asciidoctor namespace in TypeScript:

    import asciidoctor, { Document } from '@asciidoctor/core'
    
    const Asciidoctor = asciidoctor()
    Asciidoctor.convert('Hello _world_')
  • Publish @asciidoctor/core as an ES6 module

Bug Fixes

  • Strip alternate BOM that uses char code 65279 when input passes through a Buffer (#1344)
  • Map Document.append (#1681)
  • Bridge converter pass as option (#1666)
  • Add getSectionNumeral() function by @benjaminleonard (#1659)
  • Fix getDocinfo and findBy type definition (#1621)
  • Bridge common Ruby object methods (#1491)
  • parseContent now calls toHash on attrs (#1519)

Improvements

  • Map this.super.<method> to call the parent function (#1682)

  • Map AbstractBlock.getContentModel and AbstractBlock.setContentModel (#1680)

  • Map Document.getSyntaxHighlighter (#1667)

  • Map CompositeConverter#convert (#1649)

  • Simplify table option checks by @mojavelinux (#1656)

  • Support Stream.Writable as to_file (#1624)

    const data = []
    const writableStream = new Writable({
      write (chunk, encoding, callback) {
        data.push(chunk.toString())
        callback()
      }
    })
    const doc = Asciidoctor.convert(text, { to_file: writableStream, safe: safe })
    const html = data.join('')

Infrastructure

  • Upgrade GraalVM to 20.1.0 (#1035)

Documentation

  • Improve contributing guide by @cunka (#1676)
  • Remove call to convert() on return value of process method for inline macro extension by @mojavelinux (#1653)

New Contributors

v3.0.0-rc.2

19 Apr 17:36

Choose a tag to compare

3.0.0-rc.2

v3.0.0-rc.1

10 Apr 13:59

Choose a tag to compare

3.0.0-rc.1

v3.0.0-alpha.4

12 Jan 11:39

Choose a tag to compare

v3.0.0-alpha.4 Pre-release
Pre-release

Summary

Same as https://github.com/asciidoctor/asciidoctor.js/releases/tag/v3.0.0-alpha.3, tweak a few things regarding the release/publish process.