Repository navigation
[lexical-website] Documentation Update: fix the collaboration snippets and two stale playground references - #9225
Merged
Conversation
…s and two stale playground references
## Description
Six corrections across the collaboration guides.
`collaboration/faq.md`:
1. **`createNoOpProvider` does not typecheck** — its `awareness` object omits
`setLocalStateField`, which `ProviderAwareness` requires. Every no-op
provider in the repo includes it.
2. **`withHeadlessCollaborationEditor` is not exported**, but the React guide
imports it from this file.
`collaboration/react.md`:
3. **`<CollaborationPlugin>` is rendered without `shouldBootstrap`**, which is
a required prop. The example this guide is based on passes it.
4. **The import path names a file that does not exist** —
`./withHeadlessCollaborationEditor`. The FAQ snippet it refers to is
`createHeadlessCollaborativeEditor.ts`.
5. **`createBootstrappedYDoc` returns an empty document** — it constructs
`const yDoc = new Doc()` that nothing is ever bound to, while the editor
syncs into the `Doc` created inside `withHeadlessCollaborationEditor`. The
callback already receives that one as `binding.doc`.
6. **Two stale playground references** — `ImageComponent` and
`StickyComponent` are described as using `LexicalNestedComposer`, which
appears nowhere in the playground (both use
`LexicalExtensionEditorComposer`), and `PollOptionComponent` is described
as using `clientID` from the Yjs context, which
`CollaborationContextType` does not have (it reads `name`).
## Test plan
Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the checks are the type requirements and the
playground's actual imports.
### Before
```
$ grep -n "setLocalState" packages/lexical-website/docs/collaboration/faq.md
149: setLocalState: emptyFunction,
$ grep -n "setLocalStateField" packages/lexical-yjs/src/index.ts
55: setLocalStateField: (field: string, value: unknown) => void;
$ grep -n "function withHeadlessCollaborationEditor" packages/lexical-website/docs/collaboration/faq.md
73: function withHeadlessCollaborationEditor<T>(
$ grep -n "shouldBootstrap" packages/lexical-website/docs/collaboration/react.md
$ grep -n "shouldBootstrap" packages/lexical-react/src/LexicalCollaborationPlugin.tsx
55: shouldBootstrap: boolean;
$ grep -rn "LexicalNestedComposer" packages/lexical-playground/src | wc -l
0
$ grep -rn "clientID" packages/lexical-playground/src/nodes/PollComponent.tsx | wc -l
0
```
`setLocalStateField` and `shouldBootstrap` are both non-optional, so the
snippets do not typecheck; the two playground symbols do not exist.
### After
```
$ grep -n "setLocalStateField\|export function withHeadlessCollaborationEditor" packages/lexical-website/docs/collaboration/faq.md
73: export function withHeadlessCollaborationEditor<T>(
150: setLocalStateField: emptyFunction,
$ grep -n "shouldBootstrap\|createHeadlessCollaborativeEditor\|binding.doc" packages/lexical-website/docs/collaboration/react.md
104: shouldBootstrap={true}
124:import {withHeadlessCollaborationEditor} from './createHeadlessCollaborativeEditor';
133: return binding.doc;
$ grep -n "LexicalExtensionEditorComposer\|from the collaboration context" packages/lexical-website/docs/collaboration/react.md
229:- [`ImageComponent`](...) - features use of the `LexicalExtensionEditorComposer` for its nested caption editor.
230:- [`PollOptionComponent`](...) - showcases poll implementation using `name` from the collaboration context.
231:- [`StickyComponent`](...) - features use of the `LexicalExtensionEditorComposer` for its nested editor as well as sticky note position real-time sync.
```
`binding.doc` is the `Doc` passed to `createBinding`
(`collaboration/faq.md:82-85`), and the callback's signature already provides
it (`:75`). Playground sources:
`packages/lexical-playground/src/nodes/ImageComponent.tsx:14,492`,
`StickyComponent.tsx:14,236`, `PollComponent.tsx:58`
(`const {name: username} = useCollaborationContext()`), with the context type
at `packages/lexical-react/src/LexicalCollaborationContextUtils.ts:19-24`.
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
September 24, 2026 16:46
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Sep 24, 2026
Merged
This branch was successfully deployed
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.
Description
Six corrections across the collaboration guides.
collaboration/faq.md:createNoOpProviderdoes not typecheck — itsawarenessobject omitssetLocalStateField, whichProviderAwarenessrequires. Every no-opprovider in the repo includes it.
withHeadlessCollaborationEditoris not exported, but the React guideimports it from this file.
collaboration/react.md:<CollaborationPlugin>is rendered withoutshouldBootstrap, which isa required prop. The example this guide is based on passes it.
./withHeadlessCollaborationEditor. The FAQ snippet it refers to iscreateHeadlessCollaborativeEditor.ts.createBootstrappedYDocreturns an empty document — it constructsconst yDoc = new Doc()that nothing is ever bound to, while the editorsyncs into the
Doccreated insidewithHeadlessCollaborationEditor. Thecallback already receives that one as
binding.doc.ImageComponentandStickyComponentare described as usingLexicalNestedComposer, whichappears nowhere in the playground (both use
LexicalExtensionEditorComposer), andPollOptionComponentis describedas using
clientIDfrom the Yjs context, whichCollaborationContextTypedoes not have (it readsname).Test plan
Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the checks are the type requirements and theplayground's actual imports.
Before
setLocalStateFieldandshouldBootstrapare both non-optional, so thesnippets do not typecheck; the two playground symbols do not exist.
After
binding.docis theDocpassed tocreateBinding(
collaboration/faq.md:82-85), and the callback's signature already providesit (
:75). Playground sources:packages/lexical-playground/src/nodes/ImageComponent.tsx:14,492,StickyComponent.tsx:14,236,PollComponent.tsx:58(
const {name: username} = useCollaborationContext()), with the context typeat
packages/lexical-react/src/LexicalCollaborationContextUtils.ts:19-24.