Skip to content

Comments

feat!: remove change$ observable and rxjs dependency#2184

Open
christianhg wants to merge 1 commit intomainfrom
remove-change-observable
Open

feat!: remove change$ observable and rxjs dependency#2184
christianhg wants to merge 1 commit intomainfrom
remove-change-observable

Conversation

@christianhg
Copy link
Member

@christianhg christianhg commented Feb 13, 2026

The PortableTextEditor.change$ observable isn't used internally anymore. It's
purely a legacy public API that allows consumers to read editor changes/events
through an Observable rather than through the ordinary subscription API. This
does not justify declaring rxjs as a peer dependency of PTE and therefore
this commit removes the change$ Observable along with the rxjs dependency.

BREAKING CHANGES:

  • Removed PortableTextEditor.change$ property
  • Removed EditorChanges type export (Subject<EditorChange>)
  • Removed PatchObservable type export (Observable<...>)
  • Removed rxjs from peerDependencies

Migration: Replace change$.subscribe() with editor.on() or
<EventListenerPlugin on={...} />. Every active EditorChange type
has a 1:1 equivalent in the new event API.

What's preserved:

  • EditorChange type (still used by sanity's onEditorChange prop)
  • PortableTextEditor class (separate deprecation path)
  • All static methods and schemaTypes property

@vercel
Copy link

vercel bot commented Feb 13, 2026

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

Project Deployment Actions Updated (UTC)
portable-text-editor-documentation Ready Ready Preview, Comment Feb 13, 2026 0:30am
portable-text-example-basic Ready Ready Preview, Comment Feb 13, 2026 0:30am
portable-text-playground Ready Ready Preview, Comment Feb 13, 2026 0:30am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: c767b8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@portabletext/editor Major
@portabletext/plugin-character-pair-decorator Major
@portabletext/plugin-emoji-picker Major
@portabletext/plugin-input-rule Major
@portabletext/plugin-markdown-shortcuts Major
@portabletext/plugin-one-line Major
@portabletext/plugin-paste-link Major
@portabletext/plugin-sdk-value Major
@portabletext/plugin-typeahead-picker Major
@portabletext/plugin-typography Major
@portabletext/toolbar Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@christianhg christianhg force-pushed the remove-change-observable branch from 7a2161c to f1e55bf Compare February 13, 2026 12:03
@christianhg christianhg force-pushed the remove-change-observable branch from f1e55bf to c9249a2 Compare February 13, 2026 12:09
@christianhg christianhg changed the title feat!: remove change$ observable and rxjs dependency feat!: remove change$ observable and rxjs dependency Feb 13, 2026
@christianhg christianhg marked this pull request as ready for review February 13, 2026 12:10
@christianhg christianhg force-pushed the remove-change-observable branch from c9249a2 to b568462 Compare February 13, 2026 12:29
The `PortableTextEditor.change$` observable isn't used internally anymore. It's
purely a legacy public API that allows consumers to read editor changes/events
through an Observable rather than through the ordinary subscription API. This
does not justify declaring `rxjs` as a peer dependency of PTE and therefore
this commit removes the `change$` Observable along with the `rxjs` dependency.

BREAKING CHANGES:
- Removed `PortableTextEditor.change$` property
- Removed `EditorChanges` type export (`Subject<EditorChange>`)
- Removed `PatchObservable` type export (`Observable<...>`)
- Removed `rxjs` from peerDependencies

Migration: Replace `change$.subscribe()` with `editor.on()` or
`<EventListenerPlugin on={...} />`. Every active `EditorChange` type
has a 1:1 equivalent in the new event API.

What's preserved:
- `EditorChange` type (still used by sanity's `onEditorChange` prop)
- `PortableTextEditor` class (separate deprecation path)
- All static methods and `schemaTypes` property
Copy link
Member

@skogsmaskin skogsmaskin left a comment

Choose a reason for hiding this comment

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

Nice! I like that we no longer have rxjs as a dependency here. If someone truly needs it to be an observable, they could create one from the EventListenerPlugin.

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.

2 participants