feat!: cross-runtime support, browser OCR client, and switch-to-hashmap refactor#60
Merged
Conversation
- 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>
|
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>
This was referenced Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BREAKING CHANGE — bumps version to
2.0.0efcd612): 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.c599c96): AddsDoclingWebClientfor in-browser document conversion using PDF.js and Tesseract.js, with Web Worker support and output converters (Markdown, HTML, JSON, plain text)3b2ead5): Replaces 14 switch statements across 9 files with static hash maps, Sets, and mapped-type handler records for improved extensibility and reduced cyclomatic complexityab759bb): Bumps to2.0.0Breaking Changes
browser-entry.ts,web-entry.ts,cli-entry.tsofetchvia platform layerTest plan
🤖 Generated with Claude Code