Skip to content

Comments

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

Merged
christianhg merged 1 commit intomainfrom
remove-change-observable
Feb 24, 2026
Merged

feat!: remove change$ observable and rxjs dependency#2184
christianhg merged 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 23, 2026 10:46pm
portable-text-example-basic Ready Ready Preview, Comment Feb 23, 2026 10:46pm
portable-text-playground Ready Ready Preview, Comment Feb 23, 2026 10:46pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: 62f937e

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
@christianhg christianhg force-pushed the remove-change-observable branch from b568462 to c767b8b Compare February 13, 2026 12:30
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.

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
@christianhg christianhg enabled auto-merge (rebase) February 24, 2026 05:54
@christianhg christianhg merged commit 79b69a5 into main Feb 24, 2026
17 of 18 checks passed
@christianhg christianhg deleted the remove-change-observable branch February 24, 2026 05:57
@ecoscript ecoscript bot mentioned this pull request Feb 24, 2026
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