Skip to content

Add ProseMirror SDK guide#294

Merged
hackerwins merged 3 commits intomainfrom
consolidate-sdks-navigation
Feb 12, 2026
Merged

Add ProseMirror SDK guide#294
hackerwins merged 3 commits intomainfrom
consolidate-sdks-navigation

Conversation

@hackerwins
Copy link
Member

@hackerwins hackerwins commented Feb 12, 2026

What this PR does / why we need it?

Cover installation, quick start, configuration, mark mapping,
remote cursors, sync internals, and lower-level utilities for
the @yorkie-js/prosemirror package.

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • Documentation
    • Reorganized SDK documentation structure for improved navigation
    • Added new SDK overview page
    • Added ProseMirror binding documentation with setup guides and examples
    • Updated cross-references across all documentation to reflect new organization

hackerwins and others added 3 commits February 12, 2026 15:47
Move JS SDK, React, iOS SDK, and Android SDK docs into docs/sdks/
with a new group landing page and ProseMirror placeholder. Update
all internal links across 27 files to reflect the new paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change "JS SDK" link to "SDKs" pointing to /docs/sdks in both
the footer and mobile navigation dropdown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover installation, quick start, configuration, mark mapping,
remote cursors, sync internals, and lower-level utilities for
the @yorkie-js/prosemirror package.

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

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

This pull request reorganizes SDK documentation by moving all SDK-related pages under a new /docs/sdks/ directory namespace. Links throughout the codebase are updated from top-level paths like /docs/js-sdk to the new structure /docs/sdks/js-sdk. Two new documentation pages are added: an SDKs overview and comprehensive ProseMirror integration guide.

Changes

Cohort / File(s) Summary
Navigation Components
components/Layout/Footer.tsx, components/Layout/MobileGnbDropdown.tsx
Updated "JS SDK" label to "SDKs" and changed documentation link target from /docs/js-sdk to /docs/sdks.
New SDK Documentation
docs/sdks.mdx, docs/sdks/prosemirror.mdx
Added new SDKs overview page listing all available SDKs and comprehensive ProseMirror integration guide with installation, configuration, synchronization, and API details.
SDK Documentation Pages
docs/sdks/js-sdk.mdx, docs/sdks/react.mdx, docs/sdks/ios-sdk.mdx, docs/sdks/android-sdk.mdx
Updated document order metadata and internal cross-references to use new /docs/sdks/ paths.
Getting Started Guides
docs/getting-started/with-js-sdk.mdx, docs/getting-started/with-react.mdx, docs/getting-started/with-ios-sdk.mdx, docs/getting-started/with-android-sdk.mdx
Updated all SDK documentation links to point to /docs/sdks/ namespace.
Advanced Documentation
docs/advanced.mdx, docs/advanced/architecture-patterns.mdx, docs/advanced/projects.mdx, docs/advanced/resources.mdx, docs/advanced/revisions.mdx, docs/advanced/security.mdx
Bulk updates of internal documentation links from /docs/js-sdk to /docs/sdks/js-sdk with consistent anchor references.
Internals Documentation
docs/internals.mdx, docs/internals/crdt-concepts.mdx, docs/internals/document-lifecycle.mdx, docs/internals/synchronization.mdx
Updated prerequisite and cross-reference links to reflect new /docs/sdks/js-sdk paths across CRDT, lifecycle, and synchronization sections.
Glossary and Index
docs/glossary.mdx, docs/index.mdx
Updated 14+ glossary term links and index section links to point to /docs/sdks/ paths; added Dashboard and CLI references to index.
Tools Documentation
docs/tools.mdx, docs/tools/admin-api.mdx, docs/self-hosted-server/cluster-addons.mdx
Updated tool documentation links to reference new /docs/sdks/js-sdk paths.
Example and Product Pages
pages/examples/codemirror.tsx, pages/examples/prosemirror.tsx, pages/products.tsx
Updated external SDK documentation URLs and links from /docs/js-sdk and individual SDK paths to unified /docs/sdks/ namespace.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #286: Modifies the same documentation files (glossary.mdx, index.mdx, getting-started guides, advanced docs) with overlapping path update changes.
  • PR #263: Updates the same navigation components (Footer.tsx, MobileGnbDropdown.tsx) to modify SDK documentation link rendering and targets.

Poem

🐰 Hoppity hop through paths anew,
SDKs grouped in a cleaner view,
From scattered docs to organized space,
Every link finds its proper place!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add ProseMirror SDK guide' accurately describes the main change: adding comprehensive documentation for the ProseMirror SDK binding, which is reflected in the new docs/sdks/prosemirror.mdx file (+293 lines).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch consolidate-sdks-navigation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hackerwins hackerwins merged commit b77b5b2 into main Feb 12, 2026
2 checks passed
@hackerwins hackerwins deleted the consolidate-sdks-navigation branch February 12, 2026 07:03
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@docs/advanced/resources.mdx`:
- Line 98: Replace the incorrect anchor link "#documentsubscribesnapshot" with
the correct anchor "#subscribing-to-changes" in the two occurrences found in the
document (the links that reference the "Document Events" / snapshot handling
section); update both instances so the text points to "#subscribing-to-changes"
to match the "#### Subscribing to Changes" heading.

In `@docs/sdks/ios-sdk.mdx`:
- Line 136: The link text "/docs/sdks/js-sdk/#custom-crdt-types/" contains
unnecessary trailing slashes that can break anchor navigation; update the link
(the string "/docs/sdks/js-sdk/#custom-crdt-types/") to remove the slash before
the fragment and the trailing slash after it so it reads
"/docs/sdks/js-sdk#custom-crdt-types" wherever it appears (e.g., in the sentence
"We support element types for Primitives, and [Custom CRDT
types](/docs/sdks/js-sdk/#custom-crdt-types/).").

In `@docs/sdks/prosemirror.mdx`:
- Around line 270-283: The example misuses the same identifier pmPos for both
input and output causing a TDZ/confusion; fix by using distinct variable names
and declaring the input before calling the converter functions (e.g., declare an
inputPmPos, call pmPosToYorkieIdx(map, inputPmPos) to get yorkieIdx, then call
yorkieIdxToPmPos(map, yorkieIdx) to produce mappedPmPos), updating usages in the
snippet that reference pmPos; the functions to edit are buildPositionMap,
pmPosToYorkieIdx, and yorkieIdxToPmPos occurrences in this example so readers
can copy-paste without runtime errors.


<Alert status="info">
When a client receives a snapshot instead of incremental changes, a `snapshot` event is triggered. Your application should handle this event to update its state. See [Document Events](/docs/js-sdk#documentsubscribesnapshot) for more details.
When a client receives a snapshot instead of incremental changes, a `snapshot` event is triggered. Your application should handle this event to update its state. See [Document Events](/docs/sdks/js-sdk#documentsubscribesnapshot) for more details.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Look for all headings in js-sdk.mdx that might match the anchor
rg -n '^#{1,6}\s+' docs/sdks/js-sdk.mdx | grep -E -i 'subscribe|snapshot|document|changes'

Repository: yorkie-team/yorkie-team.github.io

Length of output: 298


🏁 Script executed:

# Get broader context around document subscription sections
rg -n -A2 -B2 'subscribe|snapshot' docs/sdks/js-sdk.mdx | head -100

Repository: yorkie-team/yorkie-team.github.io

Length of output: 4666


🏁 Script executed:

# Check lines 98 and 194 in resources.mdx
sed -n '96,100p; 192,196p' docs/advanced/resources.mdx

Repository: yorkie-team/yorkie-team.github.io

Length of output: 617


Change the anchor from #documentsubscribesnapshot to #subscribing-to-changes.

The anchor #documentsubscribesnapshot does not exist in docs/sdks/js-sdk.mdx. The document subscription and snapshot event handling are covered under the "#### Subscribing to Changes" heading (line 364), which generates the anchor #subscribing-to-changes. Update both lines 98 and 194 to use the correct anchor.

🤖 Prompt for AI Agents
In `@docs/advanced/resources.mdx` at line 98, Replace the incorrect anchor link
"#documentsubscribesnapshot" with the correct anchor "#subscribing-to-changes"
in the two occurrences found in the document (the links that reference the
"Document Events" / snapshot handling section); update both instances so the
text points to "#subscribing-to-changes" to match the "#### Subscribing to
Changes" heading.

```

We support element types for Primitives, and [Custom CRDT types](/docs/js-sdk/#custom-crdt-types/).
We support element types for Primitives, and [Custom CRDT types](/docs/sdks/js-sdk/#custom-crdt-types/).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Trailing slashes in the link may break anchor navigation.

The link /docs/sdks/js-sdk/#custom-crdt-types/ has a trailing slash both before the # and after the fragment identifier. Other links across this PR consistently use the format without trailing slashes (e.g., /docs/sdks/js-sdk#document). The trailing slash in the fragment (#custom-crdt-types/) is likely to prevent the anchor from resolving correctly.

Proposed fix
-We support element types for Primitives, and [Custom CRDT types](/docs/sdks/js-sdk/#custom-crdt-types/).
+We support element types for Primitives, and [Custom CRDT types](/docs/sdks/js-sdk#custom-crdt-types).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
We support element types for Primitives, and [Custom CRDT types](/docs/sdks/js-sdk/#custom-crdt-types/).
We support element types for Primitives, and [Custom CRDT types](/docs/sdks/js-sdk#custom-crdt-types).
🤖 Prompt for AI Agents
In `@docs/sdks/ios-sdk.mdx` at line 136, The link text
"/docs/sdks/js-sdk/#custom-crdt-types/" contains unnecessary trailing slashes
that can break anchor navigation; update the link (the string
"/docs/sdks/js-sdk/#custom-crdt-types/") to remove the slash before the fragment
and the trailing slash after it so it reads
"/docs/sdks/js-sdk#custom-crdt-types" wherever it appears (e.g., in the sentence
"We support element types for Primitives, and [Custom CRDT
types](/docs/sdks/js-sdk/#custom-crdt-types/).").

Comment on lines +270 to +283
```typescript
import {
buildPositionMap,
pmPosToYorkieIdx,
yorkieIdxToPmPos,
} from '@yorkie-js/prosemirror';

const treeJSON = JSON.parse(tree.toJSON());
const map = buildPositionMap(pmDoc, treeJSON);

// Convert positions between coordinate systems
const yorkieIdx = pmPosToYorkieIdx(map, pmPos);
const pmPos = yorkieIdxToPmPos(map, yorkieIdx);
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Variable pmPos used before its const declaration — misleading example.

In the position mapping example, line 281 references pmPos as an input, but line 282 declares const pmPos as an output. In actual TypeScript/JavaScript, this would be a temporal dead zone (TDZ) error since const declarations are hoisted but not initialized. The example should use distinct variable names to avoid confusing readers who copy-paste.

Proposed fix
 // Convert positions between coordinate systems
 const yorkieIdx = pmPosToYorkieIdx(map, pmPos);
-const pmPos = yorkieIdxToPmPos(map, yorkieIdx);
+const resolvedPmPos = yorkieIdxToPmPos(map, yorkieIdx);
🤖 Prompt for AI Agents
In `@docs/sdks/prosemirror.mdx` around lines 270 - 283, The example misuses the
same identifier pmPos for both input and output causing a TDZ/confusion; fix by
using distinct variable names and declaring the input before calling the
converter functions (e.g., declare an inputPmPos, call pmPosToYorkieIdx(map,
inputPmPos) to get yorkieIdx, then call yorkieIdxToPmPos(map, yorkieIdx) to
produce mappedPmPos), updating usages in the snippet that reference pmPos; the
functions to edit are buildPositionMap, pmPosToYorkieIdx, and yorkieIdxToPmPos
occurrences in this example so readers can copy-paste without runtime errors.

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