Skip to content

Conversation

@agcty
Copy link

@agcty agcty commented Jan 3, 2026

Summary

This PR adds support for yjs 14.x (beta) while maintaining backwards compatibility with yjs 13.x.

Changes

  • Updated peerDependencies to accept both yjs ^13.6.14 and ^14.0.0-0
  • Added documentation explaining version differences in the module header
  • Updated @ts-expect-error to @ts-ignore for cross-version type compatibility

Background

yjs 14.x introduces several TypeScript-level breaking changes:

Feature yjs 13.x yjs 14.x
AbstractType generic <EventType> <EventDelta, Self> with constraints
Type constraints Loose Stricter (T extends YValue)
doc.share type Map<string, AbstractType<YEvent<any>>> Map<string, YType>
Event handlers 3 parameters 4 parameters (added transaction)

All changes are type-level only - runtime behavior is unchanged. The sync protocol and CRDT encoding remain compatible between versions.

Testing

  • Tested with yjs 13.6.28 (stable)
  • Tested with yjs 14.0.0-16 (beta)

Related

This allows projects using yjs 14 beta to use y-partyserver without npm override hacks.


🤖 Generated with Claude Code

This change adds support for yjs 14.x (beta) while maintaining
backwards compatibility with yjs 13.x.

Changes:
- Updated peerDependencies to accept both yjs ^13.6.14 and ^14.0.0-0
- Added documentation explaining version differences
- Updated @ts-expect-error to @ts-ignore for cross-version compatibility
- Added YSharedType type alias for version-agnostic type references

Key differences between yjs 13 and 14:
- AbstractType generic signature changed from <EventType> to <EventDelta, Self>
- Stricter type constraints (T extends YValue) in yjs 14
- doc.share type changed from Map<string, AbstractType<YEvent<any>>> to Map<string, YType>
- Event handler signatures have additional parameters in yjs 14

All changes are type-level only; runtime behavior is unchanged.
@changeset-bot
Copy link

changeset-bot bot commented Jan 3, 2026

⚠️ No Changeset found

Latest commit: 5c9fc1c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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.

1 participant