Skip to content

[lexical-website][lexical-y] Documentation Update: Make the @lexical/y install steps work today, and say what a relay needs - #9534

Open
zurfyx wants to merge 1 commit into
mainfrom
zurfyx/dx29-install-relay
Open

zurfyx wants to merge 1 commit into
mainfrom
zurfyx/dx29-install-relay

Conversation

@zurfyx

@zurfyx zurfyx commented Oct 29, 2026

Copy link
Copy Markdown
Member

Description

The @lexical/y install line (npm i @lexical/y @lexical/extension lexical @y/y@14.0.0-rc.29) does not give a working setup today:

  • @lexical/y is not in a Lexical release yet, so npm's latest for it is
    the placeholder 0.0.0-bootstrap.0. The package only exists as nightlies,
    and each nightly depends on the exact lexical of the same nightly, so
    mixing it with lexical@latest (0.53.0) puts two copies of Lexical in the
    app.
  • The setup example imports @lexical/rich-text, @lexical/list and
    @y/websocket, which the line does not install. npm i @y/websocket gets
    its latest tag, 4.0.0-0, which peers on the earlier yjs@14.0.0-*
    prereleases rather than @y/y, so npm installs a second copy of Yjs next
    to @y/y. @y/protocols' latest (1.0.6-0) has the same problem.
  • Servers says "any Yjs 14 server or relay can host the documents", but the
    latest @y/websocket-server (0.1.5) depends on yjs@^14.0.0-7 and keeps
    each room in a plain Doc with the format cleanup on, which the same
    section says a server must not do. Nothing says what a relay for
    @y/websocket clients needs.

This change:

  • installs everything the example uses in one pinned command
    (--save-exact, every Lexical package @nightly until a release includes
    @lexical/y, @y/websocket@4.0.0-rc.2), says
    why the @y/* latest tags do not fit, and gives npm ls yjs (no
    yjs@14.0.0-*) as the check;
  • says which moduleResolution Lexical's types need: with an older one
    (node10), TypeScript reads the typescript-too-old.d.ts stub, and
    import {createYDoc} from '@lexical/y' fails only with TS2305: Module '"@lexical/y"' has no exported member 'createYDoc' (TypeScript 5.9, with
    and without skipLibCheck: the stub's side-effect import of a module named
    after the fix reports nothing);
  • qualifies "any Yjs 14 server" with the requirements the section lists, and
    adds a relay paragraph: why @y/websocket-server 0.1.5 does not fit, what
    the playground's in-memory collab-y-server.mjs does and needs (with its
    install line and room URL), and how to persist a room without an older
    snapshot replacing a newer one;
  • says the same in the package README (which also gains
    @lexical/rich-text, used by its example), with a [docs] changeset.

Changeset

.changeset/lexical-y-pin-y-packages.md ([docs], the package README).

Test plan

Before

$ npm view @lexical/y dist-tags
{ latest: '0.0.0-bootstrap.0', bootstrap: '0.0.0-bootstrap.0', nightly: '0.53.1-nightly.20261029.0' }
$ npm view @lexical/y@nightly dependencies
{ lexical: '0.53.1-nightly.20261029.0', '@lexical/internal': '0.53.1-nightly.20261029.0', '@lexical/extension': '0.53.1-nightly.20261029.0' }
$ npm i @y/y@14.0.0-rc.29 @y/websocket && npm ls yjs @y/y @y/websocket
├─┬ @y/websocket@4.0.0-0
│ ├─┬ @y/protocols@1.0.6-rc.1
│ │ └── @y/y@14.0.0-rc.29 deduped
│ └── yjs@14.0.0-16
└── @y/y@14.0.0-rc.29
$ npm view @y/websocket-server@0.1.5 dependencies
{ '@y/protocols': '^1.0.6-1', lib0: '^0.2.102', ws: '^6.2.1', yjs: '^14.0.0-7' }
$ node -e "import('yjs').then(Y => console.log(new Y.Doc().cleanupFormatting))"
true

@y/websocket-server's WSSharedDoc extends Y.Doc (from yjs) and never
sets cleanupFormatting.

After

$ npm view @y/websocket@4.0.0-rc.2 peerDependencies
{ '@y/y': '*' }
$ npm view @y/protocols@1.0.6-rc.1 peerDependencies
{ '@y/y': '*' }
$ pnpm run ci-check
...
Found 0 errors
$ pnpm run check-changesets
Changeset check passed: 31 pending changeset(s) valid.

Docs only; no browser checks apply.

…y install steps work today, and say what a relay needs

## Description

The `@lexical/y` install line (`npm i @lexical/y @lexical/extension lexical
@y/y@14.0.0-rc.29`) does not give a working setup today:

- `@lexical/y` is not in a Lexical release yet, so npm's `latest` for it is
  the placeholder `0.0.0-bootstrap.0`. The package only exists as nightlies,
  and each nightly depends on the exact `lexical` of the same nightly, so
  mixing it with `lexical@latest` (0.53.0) puts two copies of Lexical in the
  app.
- The setup example imports `@lexical/rich-text`, `@lexical/list` and
  `@y/websocket`, which the line does not install. `npm i @y/websocket` gets
  its `latest` tag, 4.0.0-0, which peers on the earlier `yjs@14.0.0-*`
  prereleases rather than `@y/y`, so npm installs a second copy of Yjs next
  to `@y/y`. `@y/protocols`' `latest` (1.0.6-0) has the same problem.
- Servers says "any Yjs 14 server or relay can host the documents", but the
  latest `@y/websocket-server` (0.1.5) depends on `yjs@^14.0.0-7` and keeps
  each room in a plain `Doc` with the format cleanup on, which the same
  section says a server must not do. Nothing says what a relay for
  `@y/websocket` clients needs.

This change:

- installs everything the example uses in one pinned command
  (`--save-exact`, every Lexical package `@nightly` until a release includes
  `@lexical/y`, `@y/websocket@4.0.0-rc.2`), says
  why the `@y/*` `latest` tags do not fit, and gives `npm ls yjs` (no
  `yjs@14.0.0-*`) as the check;
- says which `moduleResolution` Lexical's types need: with an older one
  (`node10`), TypeScript reads the `typescript-too-old.d.ts` stub, and
  `import {createYDoc} from '@lexical/y'` fails only with `TS2305: Module
  '"@lexical/y"' has no exported member 'createYDoc'` (TypeScript 5.9, with
  and without `skipLibCheck`: the stub's side-effect import of a module named
  after the fix reports nothing);
- qualifies "any Yjs 14 server" with the requirements the section lists, and
  adds a relay paragraph: why `@y/websocket-server` 0.1.5 does not fit, what
  the playground's in-memory `collab-y-server.mjs` does and needs (with its
  install line and room URL), and how to persist a room without an older
  snapshot replacing a newer one;
- says the same in the package README (which also gains
  `@lexical/rich-text`, used by its example), with a `[docs]` changeset.

## Changeset

`.changeset/lexical-y-pin-y-packages.md` (`[docs]`, the package README).

## Test plan

### Before

```
$ npm view @lexical/y dist-tags
{ latest: '0.0.0-bootstrap.0', bootstrap: '0.0.0-bootstrap.0', nightly: '0.53.1-nightly.20261029.0' }
$ npm view @lexical/y@nightly dependencies
{ lexical: '0.53.1-nightly.20261029.0', '@lexical/internal': '0.53.1-nightly.20261029.0', '@lexical/extension': '0.53.1-nightly.20261029.0' }
$ npm i @y/y@14.0.0-rc.29 @y/websocket && npm ls yjs @y/y @y/websocket
├─┬ @y/websocket@4.0.0-0
│ ├─┬ @y/protocols@1.0.6-rc.1
│ │ └── @y/y@14.0.0-rc.29 deduped
│ └── yjs@14.0.0-16
└── @y/y@14.0.0-rc.29
$ npm view @y/websocket-server@0.1.5 dependencies
{ '@y/protocols': '^1.0.6-1', lib0: '^0.2.102', ws: '^6.2.1', yjs: '^14.0.0-7' }
$ node -e "import('yjs').then(Y => console.log(new Y.Doc().cleanupFormatting))"
true
```

`@y/websocket-server`'s `WSSharedDoc extends Y.Doc` (from `yjs`) and never
sets `cleanupFormatting`.

### After

```
$ npm view @y/websocket@4.0.0-rc.2 peerDependencies
{ '@y/y': '*' }
$ npm view @y/protocols@1.0.6-rc.1 peerDependencies
{ '@y/y': '*' }
$ pnpm run ci-check
...
Found 0 errors
$ pnpm run check-changesets
Changeset check passed: 31 pending changeset(s) valid.
```

Docs only; no browser checks apply.
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lexical Ready Ready Preview Oct 29, 2026 10:40pm UTC
lexical-playground Ready Ready Preview Oct 29, 2026 10:40pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026

Copy link
Copy Markdown
lexical

npm i https://pkg.pr.new/lexical@9534

@lexical/a11y

npm i https://pkg.pr.new/@lexical/a11y@9534

@lexical/clipboard

npm i https://pkg.pr.new/@lexical/clipboard@9534

@lexical/code

npm i https://pkg.pr.new/@lexical/code@9534

@lexical/code-core

npm i https://pkg.pr.new/@lexical/code-core@9534

@lexical/code-prism

npm i https://pkg.pr.new/@lexical/code-prism@9534

@lexical/code-shiki

npm i https://pkg.pr.new/@lexical/code-shiki@9534

@lexical/compiler

npm i https://pkg.pr.new/@lexical/compiler@9534

@lexical/devtools-core

npm i https://pkg.pr.new/@lexical/devtools-core@9534

@lexical/dragon

npm i https://pkg.pr.new/@lexical/dragon@9534

@lexical/eslint-plugin

npm i https://pkg.pr.new/@lexical/eslint-plugin@9534

@lexical/extension

npm i https://pkg.pr.new/@lexical/extension@9534

@lexical/fast-check

npm i https://pkg.pr.new/@lexical/fast-check@9534

@lexical/file

npm i https://pkg.pr.new/@lexical/file@9534

@lexical/hashtag

npm i https://pkg.pr.new/@lexical/hashtag@9534

@lexical/headless

npm i https://pkg.pr.new/@lexical/headless@9534

@lexical/history

npm i https://pkg.pr.new/@lexical/history@9534

@lexical/html

npm i https://pkg.pr.new/@lexical/html@9534

@lexical/internal

npm i https://pkg.pr.new/@lexical/internal@9534

@lexical/link

npm i https://pkg.pr.new/@lexical/link@9534

@lexical/list

npm i https://pkg.pr.new/@lexical/list@9534

@lexical/mark

npm i https://pkg.pr.new/@lexical/mark@9534

@lexical/markdown

npm i https://pkg.pr.new/@lexical/markdown@9534

@lexical/mdast

npm i https://pkg.pr.new/@lexical/mdast@9534

@lexical/offset

npm i https://pkg.pr.new/@lexical/offset@9534

@lexical/overflow

npm i https://pkg.pr.new/@lexical/overflow@9534

@lexical/plain-text

npm i https://pkg.pr.new/@lexical/plain-text@9534

@lexical/react

npm i https://pkg.pr.new/@lexical/react@9534

@lexical/rich-text

npm i https://pkg.pr.new/@lexical/rich-text@9534

@lexical/selection

npm i https://pkg.pr.new/@lexical/selection@9534

@lexical/table

npm i https://pkg.pr.new/@lexical/table@9534

@lexical/tailwind

npm i https://pkg.pr.new/@lexical/tailwind@9534

@lexical/text

npm i https://pkg.pr.new/@lexical/text@9534

@lexical/utils

npm i https://pkg.pr.new/@lexical/utils@9534

@lexical/y

npm i https://pkg.pr.new/@lexical/y@9534

@lexical/yjs

npm i https://pkg.pr.new/@lexical/yjs@9534

commit: 8ddcdfc

no exported member" rather than an error that names the setting.

- **`@nightly` until a Lexical release includes `@lexical/y`.** Until then,
npm's `latest` for `@lexical/y` is a placeholder (`0.0.0-bootstrap.0`)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably not worth documenting a bootstrap version that wouldn’t install a working copy

This branch was successfully deployed

2 active deployments
Preview – lexical — 8ddcdfcc Deployed Oct 29, 2026 by vercel[bot]
Preview – lexical-playground — 8ddcdfcc Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants