Skip to main content
@reductoai/docx 0.1.0 has one layout engine: a native addon in Node, engine.wasm in the browser. The TypeScript layout engine of 0.0.x is removed. A document also opens only after the license check passes. This page lists the changes to make when you move from 0.0.x to 0.1.0 or later. The other pages describe 0.1.0 only.

Requirements

  • Node.js 20.11 or newer.
  • REDUCTO_API_KEY on each server, from the organization that made your install token.
  • A license proxy for each browser editor.

Licensing

If your code reads error.code, check it against the list in Troubleshooting. 0.1.0 adds codes, such as unconfigured, unproxied and undelivered.

Removed and changed APIs

Editor

These changes are in the @reductoai/docx-editor release that pairs with @reductoai/docx 0.1.0.

Browser

A page that Vite, webpack or Next.js bundles needs no change. With another bundler, give the engine’s URL with setLayoutEngine(url) or the engine option, or layout throws no layout engine. See The layout engine.

IncrementalLayout

IncrementalLayout (from @reductoai/docx/editor, passed as incremental) does not hold layout memory: the engine keeps it.
  • balances and hfMemo are removed. Remove code that reads or clears them.
  • begin() and forPass() throw TsEngineAbsent. editReach(), probeReach() and keptModel() return undefined. Remove the calls.
  • The fields that a layout records for its caller stay: stats, lastDirtyPages, lastPageCount, lastRestamped, lastStaleAfter, budgetPages, throughPage, lastPages, settling, noteOrdinals and provisionalFrom, with commit(), abandon() and reset().
To use it, create an IncrementalLayout, pass it as incremental, and call reset() to drop it.

Types

These types are opaque in the type declarations. Pass them on; do not read their fields:
  • DocModel (from parseDocx)
  • WordPackage, WmlPackage, ParseMemo, FontMeasurer
DocxSession and IncrementalLayout keep only their documented members.