Scope. Software developers and book authors are equal priorities from the first release; web applications first, desktop and mobile afterward. Technology descriptions below link to primary sources. Architecture, targets, staffing and schedules are recommendations, not measured results or vendor commitments.
Recommendation. Build a framework-independent TypeScript SDK with CodeMirror 6 for code and plain text and Tiptap's open-source packages on ProseMirror for manuscripts. Give both a shared platform for integration, collaboration, comments, versions, search, extensions and optional AI. Ship a small embeddable surface and an optional complete workspace for each audience. The opportunity is to make sophisticated editing easy to integrate, reliable, portable and fully open source.
"Most powerful" should mean a published combination of capability, correctness, responsiveness, accessibility, interoperability and integration quality. No engine is best at every workload. Establish separate profiles and disclose their performance limits.
01What already exists and how to use it
| Project | Available foundation | Decision for this project |
|---|---|---|
| CodeMirror 6 | MIT; composable code editor with transactions, extensibility, mobile input, accessibility and bidirectional text. Architecture, features, license. | Default code and plain-text engine. Reuse its input, selection, rendering, history and language packages. |
| Monaco | MIT; VS Code-derived browser editor. Its FAQ excludes mobile support and says VS Code extensions do not automatically work. Official repository. | Benchmark and potential later adapter for customers with an existing Monaco integration. Avoid maintaining two code backends at launch. |
| Ace | Mature JavaScript editor with language modes and editing commands; BSD-3-Clause. Features, package and license. | Credible alternative and migration source. CodeMirror is my preferred foundation for the new SDK's composition model. |
| ProseMirror + Tiptap OSS | MIT foundations for schema-based documents, transactions and extensions. Tiptap provides a higher-level integration layer. ProseMirror, Tiptap OSS boundary. | Default manuscript engine. Audit each extension; advanced features advertised by Tiptap are not automatically included in its MIT editor. |
| Lexical | MIT editor framework; framework-independent core, optional React bindings and collaboration packages. Repository. | Strong alternative to evaluate against Tiptap during the first month's prototype. Choose one rich-document backend for v1. |
| Slate | Customizable rich-document framework with a React integration; its introduction still describes the core as beta. Documentation. | Useful alternative, but less attractive for our initial stable, broadly embeddable API commitment. |
| CKEditor 5 / TinyMCE | Established rich-text products with GPL/commercial licensing and premium features. CKEditor licensing, TinyMCE licensing. | Feature and usability references. Prefer permissive dependencies for the broadly reusable SDK. |
| Scintilla / Neovim / Zed | Native component, embeddable editor process and native editor respectively. Scintilla, Neovim API, Zed licensing. | Evaluate for later native integrations or architectural lessons. These are different integration categories from browser components; review licenses per component. |
| Yjs / Automerge | Open-source collaboration foundations. Yjs has bindings across code and rich-text engines; Automerge offers another local-first document approach. Yjs, Automerge. | Use Yjs initially to reuse editor bindings. Keep network and storage adapters replaceable; support one collaboration engine at launch. |
Current maintenance nuance: CodeMirror and ProseMirror's archived GitHub repositories point to a move to code.haverbeke.berlin. The archive flags alone do not indicate abandonment. Follow the upstream locations and released packages. CodeMirror notice, ProseMirror notice.
02The product we should own
The SDK has three layers: minimal editing surfaces; optional capability packages; ready-made developer and author workspaces. Host products can adopt any layer. A customer embedding a code field should not download manuscript formatting and export features. A writing app should not load programming-language servers.
| Audience | Complete v1 workflow | Advanced expansion |
|---|---|---|
| Software developer | Open and save UTF-8 source files, multiple cursors, search and replace, syntax highlighting, folding, completion, diagnostics, navigation, formatting and diff. Demonstrate multi-file editing through a host filesystem adapter. | More language integrations, structural editing, refactoring workflows, three-way merge, very large files, richer modal editing. |
| Book author | Organize chapters, outline and navigate a manuscript, format prose, use footnotes and images, count words, search the whole book, comment, save named versions, recover work and export a manuscript. | Attributed tracked changes, advanced citations, research and character notes, publisher templates, sophisticated print layout, continuous whole-book editing. |
| Both | Keyboard access, international input, themes, offline saving, optional live collaboration, review tools, portable backups, extension APIs and optional AI edit proposals. | Branch and review workflows, deeper automation, native platform adapters and an extension ecosystem. |
Treat a code workspace, a novel manuscript and a technical book containing code blocks as the three reference applications. Recruit at least two integration partners from each main audience; validate real author and developer tasks as well as SDK adoption.
03Recommended stack and responsibilities
| Layer | Choice | Purpose |
|---|---|---|
| Public SDK | TypeScript, ES modules, explicit typed capabilities | Framework-independent integration and a stable API. |
| Code surface | CodeMirror 6 and its existing Lezer language packages | Proven browser editing and syntax support. |
| Manuscript surface | Tiptap OSS on ProseMirror | Structured prose, schema extensions, rich paste and embedded content. |
| UI | Optional React reference workspaces; CSS variables and design tokens; thin React, Vue and Svelte adapters and a Web Component | Ready-made experiences without requiring React in the SDK. |
| Collaboration | Yjs, y-codemirror.next, compatible ProseMirror bindings | Shared editing and collaboration-aware undo. |
| Local storage | IndexedDB adapter with visible persistence status | Offline editing and restart recovery. |
| Optional shared service | TypeScript/Node.js with Hocuspocus, PostgreSQL and object storage | Authentication integration, persistent updates, snapshots and attachments. Add distributed infrastructure only when measured load needs it. |
| Code intelligence | Language Server Protocol adapters | Reuse language servers for completion, diagnostics, navigation and rename. |
| Heavy processing | Web Workers first; optional Rust/Wasm after profiling | Keep expensive analysis, diff, search and conversion away from typing. |
| Import/export | Explicit schema converters; Mammoth candidate for DOCX import, docx for export; EPUB packaging and EPUBCheck | Portable manuscript exchange with a documented fidelity contract. |
| Engineering | pnpm workspace, TypeScript, Vite for examples, Vitest, Playwright, property-based testing, automated releases | Consistent development and reproducible compatibility and performance checks. |
| Desktop/mobile later | WebView integrations, with Tauri as a reference application shell | Reuse the web editor while implementing platform-specific file, input and lifecycle behavior. |
Yjs's CodeMirror binding currently recommends stable Yjs v13 with y-codemirror.next while the next major integration remains unstable. Pin and test a compatible dependency set at implementation time. Hocuspocus is available under MIT. Binding guidance, Hocuspocus OSS status.
Lezer supplies syntax parsing within CodeMirror. LSP supplies semantic language services. Tree-sitter is an optional incremental parser for specific language coverage or structural features; avoid paying for two parsers for the same task without evidence. Language servers may run in a browser worker when compatible, a host process, or an isolated remote service. A browser cannot launch arbitrary native language servers. Lezer, LSP, Tree-sitter.
Rust is a later optimization tool, not a prerequisite for an advanced editor. A second mandatory text buffer would create synchronization, position mapping, undo and input complexity. Preserve the engines' proven editing paths until profiling identifies a specific replacement worth making. Likewise, WebAssembly does not supply native selection, input methods or accessibility. Tauri uses system WebViews; true native widgets would be a separate development track. Tauri architecture overview.
04Architecture contracts
Keep source text and structured documents as distinct models. Source files preserve text and supported encoding and line-ending metadata. Manuscripts use a versioned schema for paragraphs, headings, lists, footnotes, media and extensions. Share commands, lifecycle, identifiers, themes, permissions hooks, review metadata and persistence contracts. Engine-specific capabilities remain available through explicit extension interfaces rather than being flattened into a restrictive common API.
A book should be a manifest with stable chapter IDs, ordering, metadata and chapter documents. Load the active chapter and necessary neighbors. Search, counts, named versions and exports still operate across the complete manuscript. Capture a consistent set of chapter revisions for each book snapshot or export. Chapter moves and deletion must preserve or explicitly orphan references and comments. Specify recoverable operations for changes spanning multiple chapter documents.
Each document has one authoritative editing path. When collaboration is enabled, engine bindings project shared state and collaboration-aware undo owns undo behavior. Preserve collaboration state for continued synchronization; portable JSON and text snapshots serve export and recovery purposes. Do not repeatedly re-create the collaborative document from snapshots during normal edits.
Comments need stable anchors with explicit behavior when their target is deleted. Schema versions must be negotiated before clients collaborate; incompatible clients must upgrade or open read-only. Tiptap documents the risk of older schemas removing unfamiliar content. Schema compatibility guidance, Yjs anchors.
For mixed documents, embed CodeMirror in a ProseMirror node view with explicit selection and history bridging. An official example already demonstrates this pattern. Markdown source and manuscript JSON must never be independently editable sources of truth for the same document; conversion requires a declared supported subset. Embedded editor example.
05What "easy to integrate" must mean
- A plain JavaScript developer can embed either profile in under 15 minutes using the quickstart.
- Editing works without an account or mandatory backend. Hosts choose local storage, their own backend, or the reference collaboration service.
- Imports do not assume a browser exists; views mount client-side. Worker, style and language assets have documented loading paths that work with common bundlers and content-security policies.
- Small packages load only selected capabilities. Every instance supports disposal, cancellation and predictable resource cleanup.
- Hosts control themes, keyboard shortcuts, accessibility labels, focus, file access, authentication, telemetry and network providers.
- Stable public APIs use semantic versioning, migration guides and a tested support matrix. Keep engine-native escape hatches explicitly outside the portable API guarantees.
- Web Components are a packaging option; iframe embedding is an optional isolation route. Test focus, clipboard, composition and accessibility for each supported route.
An illustrative target API, not an existing package:
const editor = createEditor({
mount: element,
profile: "manuscript", // or "code"
document: initialDocument,
extensions: [comments(), namedVersions()],
storage: hostStorage,
});
editor.on("change", handleChange);
editor.execute("find", { query: "chapter" });
editor.destroy();
06Reuse versus build
Reuse the editing engines, their parsers, collaboration bindings, language servers, sanitization libraries, conversion primitives and browser-test infrastructure. Prefer upstream contributions over a permanent fork.
Build the SDK contracts, cross-profile review experience, book model, reliable persistence integration, portable schema, conversion mappings, capability registry, performance harness and documentation. Build or adopt independently licensed open-source comments, named versions, and later tracked changes. Tiptap's commercial platform is a useful feature reference, but its managed history and commercial advanced features are not free dependencies. OSS and platform distinction.
AI should be an optional provider interface supporting completion, explanation and proposed edits for both audiences. Proposals carry a document revision and target range, show a reviewable diff, and reject or rebase stale changes. Host applications choose model providers and decide what content can leave the device. Normal editing remains available without AI.
07Authoring and format fidelity
Launch with a written manuscript format contract: paragraphs, headings, emphasis, lists, links, images, simple tables, footnotes, chapter order and book metadata. Implement DOCX import and export for that subset and EPUB export with navigation and metadata. Offer plain text, HTML and a documented Markdown subset too. Keep the original imported file and report unsupported constructs.
Mammoth targets semantic DOCX-to-HTML conversion and explicitly does not reproduce all formatting; evaluate its output against our schema and sanitize it before insertion. The docx library can generate DOCX in JavaScript and TypeScript. Neither dependency gives us faithful round-tripping automatically. Mammoth, docx, DOMPurify.
Validate EPUB output using EPUBCheck and inspect it in representative readers. Keep print and export layout separate from the interactive editing layout. Full Word compatibility, arbitrary imported tracked changes and professional book pagination require additional dedicated work. EPUB format, EPUBCheck.
Comments, named snapshots, comparison and restoration are v1 review capabilities. Attributed tracked changes with accept and reject, formatting edits, collaboration and DOCX interoperability are a separate expansion milestone. This boundary must be visible in the roadmap and product claims.
08Release gates and benchmarks
These are proposed acceptance targets to calibrate during the prototype; none has been measured in this project.
| Area | Target or required evidence |
|---|---|
| Integration | At least five unfamiliar developers embed both profiles from the documentation; median first-working-editor time under 15 minutes. |
| Typing | p95 input-to-next-paint at or below 32 ms on named reference hardware, separately measured for a 1 MB source file and an active manuscript chapter. |
| Manuscripts | 150,000-word, 30-chapter fixture; additionally test a 20,000-word chapter, images, footnotes and hundreds of comments. Measure opening, navigation, search, export and peak memory. |
| Code | Test 10 MB files, exceptionally long lines, many cursors, decorations, malformed syntax and many open editors. Treat 100 MB editing as a later reduced-feature profile. |
| Durability | Fault-injection tests lose no durably acknowledged edits across reload, disconnection or restart. Show distinct local-save and remote-save states. Provide backups and recovery export. |
| Collaboration | Randomized edits, concurrent undo, duplicate and out-of-order updates, reconnect, schema mismatch and permission changes converge within the supported model. |
| Input/accessibility | Manual keyboard and screen-reader checks plus Japanese, Chinese and Korean composition, RTL mixtures, emoji, dictation, paste, focus and selection behavior. Include early mobile-browser checks. |
| Conversion | Semantic round-trip fixtures for the supported DOCX subset, explicit loss reports, EPUB validation and visual export inspection. |
| Packaging | Separate size and startup budgets for each profile, languages, workers and collaboration. Set numerical budgets after the first-month measurements. |
| Compatibility | Published browser and framework matrix; stable API and schema migration tests; no retained editor resources after repeated mounting and disposal. |
Compare alternatives using the same documents, hardware, enabled features and cold and warm conditions. Publish raw results and regression thresholds. Automated browser checks complement manual input and accessibility tests. Playwright documentation.
Untrusted paste and import, shared documents and optional extensions require specific controls: schema validation, sanitization, document-level authorization on the service, resource limits, and isolated conversion jobs where appropriate. Workers protect responsiveness but are not by themselves a sandbox for malicious plugins. Start with trusted plugins; add a separately designed restricted plugin environment before an open marketplace.
09Delivery plan
Planning estimate: 9 to 12 months for a credible scoped web v1 with 8 to 10 experienced engineers, a designer and dedicated QA and accessibility support. This assumes mature engines, constrained format support and no custom renderer. Both audiences participate in every milestone. A three-month prototype is feasible under these assumptions; worldwide leadership is a multiyear maintenance and ecosystem effort.
| Period | Deliverables | Exit gate |
|---|---|---|
| Weeks 1–4 | Compare CodeMirror/Monaco and Tiptap/Lexical on the hardest fixtures. Prototype language services, chaptered books, collaboration and DOCX/EPUB conversion. Recruit design partners and publish architecture decisions. | Select engines; define v1 schema and format support, benchmark budgets and both audience workflows. |
| Months 2–3 | Shared SDK alpha; code editing, language packs and a basic language-service adapter; manuscript chapters, outline, formatting and word counts; vanilla and React examples; local persistence. | Developer and author can each complete an end-to-end workflow in the same SDK; recovery and input basics work. |
| Months 4–6 | Collaboration, stable comment anchors, named versions, source diff, whole-book search, documented DOCX subset, EPUB export, host authentication and storage hooks. | Private beta in real host products; conversion, schema, recovery and concurrent-edit suites pass. |
| Months 7–9 | Public beta; more framework adapters; multi-file and code service hardening; large-manuscript work; accessible reference workspaces; extension and integration documentation. | Independent design partners use both profiles regularly; performance and compatibility budgets hold. |
| Months 10–12 | Stable API and schema; migration tools; self-hosted deployment guide; recovery utilities; dependency and release review; complete v1 support policy. | Release v1 only after both profiles satisfy the agreed gates. |
| After v1 | Desktop and mobile adapters, tracked changes, deeper author tools, structural code editing, optional acceleration and restricted third-party extensions. | Each track is justified by user demand and measured technical evidence. |
Suggested engineering allocation at ten: two code and language engineers; three manuscript, schema and conversion engineers; two shared storage, collaboration and review engineers; one SDK and integration engineer; one performance and accessibility engineer; one test-infrastructure engineer. At eight, combine related roles and use the later end of the schedule. Keep design and independent QA involvement outside those allocations. Funding estimates should use local staffing costs; there is no reliable universal budget from the information supplied.
If fewer people are available, preserve both audience workflows and reduce the number of languages, formats and optional features. Keep recovery, input correctness and accessibility release gates intact.
10Open-source and maintenance plan
Recommend Apache-2.0 for new platform code, preserving all upstream license notices; its express contributor patent grant is useful for a reusable SDK. The exact dependency set still needs a per-package license review, including language servers, grammars, dictionaries, fonts and converters. Apache license.
Keep the editor, advanced capability packages we develop, document formats and the self-hosted reference service open source. Optional managed hosting, support and integration services can fund maintenance. Establish public design proposals, contribution rules, maintainer ownership, security reporting, reproducible releases, a compatibility policy and funding for important upstream projects.
11First-month work package
- Write two acceptance scripts: integrate a developer workspace; integrate an author workspace and edit and export a chaptered manuscript.
- Gather licensed or synthetic benchmark fixtures and representative partner documents.
- Run the engine comparisons and the hardest input, collaboration and conversion experiments.
- Define the public document, command, storage and extension contracts and draft the manuscript schema.
- Publish measured results, a precise v1 feature list, staffing responsibilities and the first alpha backlog.
The first investment decision should follow that evidence. The recommended starting stack is TypeScript + CodeMirror 6 + Tiptap OSS/ProseMirror + Yjs, with a shared integration and review platform that gives developers and authors equal standing.
Where this stands
This is a plan, not a product. It's sized for a team of eight to ten, and I'm one person. The honest next step is the first-month work package above, cut down to what one developer can measure in a few weeks: the engine comparison, the two acceptance scripts, and a draft of the manuscript schema. If you're building something in this space and want to compare notes, or you'd use an SDK like this, I'd like to hear from you.
Get in touch →