Skip to content

feat!: cross-runtime support, browser OCR client, and switch-to-hashmap refactor#60

Merged
kauandotnet merged 4 commits into
btwld:mainfrom
kauandotnet:main
Feb 9, 2026
Merged

feat!: cross-runtime support, browser OCR client, and switch-to-hashmap refactor#60
kauandotnet merged 4 commits into
btwld:mainfrom
kauandotnet:main

Conversation

@kauandotnet
Copy link
Copy Markdown
Collaborator

@kauandotnet kauandotnet commented Feb 9, 2026

Summary

BREAKING CHANGE — bumps version to 2.0.0

  • Cross-runtime platform abstraction (efcd612): Adds a platform abstraction layer enabling the SDK to run across Node.js, Bun, Deno, Cloudflare Workers, and browsers with unified APIs for HTTP, WebSocket, binary handling, timers, and event emission. Replaces direct Node.js APIs with platform-agnostic adapters.
  • Browser-based OCR client (c599c96): Adds DoclingWebClient for in-browser document conversion using PDF.js and Tesseract.js, with Web Worker support and output converters (Markdown, HTML, JSON, plain text)
  • Switch-to-hashmap refactor (3b2ead5): Replaces 14 switch statements across 9 files with static hash maps, Sets, and mapped-type handler records for improved extensibility and reduced cyclomatic complexity
  • Version bump (ab759bb): Bumps to 2.0.0

Breaking Changes

  • Platform abstraction layer replaces direct Node.js API usage with runtime-agnostic adapters
  • New entry points: browser-entry.ts, web-entry.ts, cli-entry.ts
  • WebSocket client refactored to use platform adapters
  • HTTP client refactored to use ofetch via platform layer

Test plan

  • Unit tests pass (153/153)
  • Integration tests pass (33/33) against live Docling Serve
  • Biome lint and format clean
  • Production build clean (all 5 entry points: index, CLI, browser, web, web-worker)
  • Verify cross-runtime examples (Node, Bun, Deno, browser, Cloudflare Worker)
  • Verify web-ocr example app

🤖 Generated with Claude Code

kauandotnet and others added 3 commits January 30, 2026 20:05
- Add platform abstraction layer (src/platform/) for runtime detection,
  HTTP client, WebSocket, binary handling, events, and timers
- Create separate entry points: main (universal), CLI (Node.js), browser
- Add OpenAPI type generation with adapters for SDK ↔ OpenAPI format
- Refactor HTTP client to use platform-agnostic ofetch wrapper
- Add runtime examples for Node.js, Bun, Deno, Browser, Cloudflare Workers
- Update build configuration with multiple tsup targets

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add DoclingWebClient for in-browser OCR using IBM Granite Docling 258M
model via WebGPU/WASM. Includes converters (HTML, Markdown, JSON, text),
extractors (tables, overlays), PDF renderer, and model caching.

Add examples/web-ocr/ Vite app demonstrating the full web client API
with drag-drop upload, streaming output, and 7-tab result viewer
(Preview, Markdown, Text, Tables, JSON, Raw, Overlays).
Replace 14 switch statements across 9 files with static hash maps,
Sets, and mapped-type handler records for improved extensibility and
reduced cyclomatic complexity. Two table cell-merge switches are
intentionally kept due to complex stateful colspan/rowspan mutations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@docs-page
Copy link
Copy Markdown

docs-page Bot commented Feb 9, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/docling-sdk~60

Documentation is deployed and generated using docs.page.

BREAKING CHANGE: cross-runtime platform abstraction replaces
direct Node.js APIs with platform-agnostic adapters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kauandotnet kauandotnet changed the title feat: cross-runtime support, browser OCR client, and switch-to-hashmap refactor feat!: cross-runtime support, browser OCR client, and switch-to-hashmap refactor Feb 9, 2026
@kauandotnet kauandotnet merged commit ba47e03 into btwld:main Feb 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant