Conversation
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>
📝 WalkthroughWalkthroughThis pull request reorganizes SDK documentation by moving all SDK-related pages under a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
🧩 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 -100Repository: 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.mdxRepository: 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/). |
There was a problem hiding this comment.
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.
| 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/).").
| ```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); | ||
| ``` |
There was a problem hiding this comment.
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.
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
Summary by CodeRabbit