Skip to content

Conversation

@dlqqq
Copy link
Collaborator

@dlqqq dlqqq commented Jun 10, 2025

Description

This PR allows jupyter_server_documents to be installed on top of jupyter_collaboration~=4.0. This means that any package depending on jupyter_collaboration~=4.0 can optionally install jupyter_server_documents to upgrade to the new RTC experience provided by this extension. 🎉

The backend has also been updated to provide compatibility with server extensions depending on jupyter_collaboration~=4.0. Specifically:

  • The extension now emits events to the same event schema IDs as jupyter_collaboration. This allows consumers to get notified when a new room is created.

  • The extension now provides the same API as jupyter_collaboration under self.settings["jupyter_server_ydoc"]. This allows consumers to get a JupyterYDoc for a room.

Details

  • The changes to jupyter-config/server-config/jupyter_server_documents.json disable the jupyter_server_ydoc server extension when this package is installed.

  • The changes to package.json disable the @jupyter/docprovider-extension labextension, which we override entirely. This required adding an extra optional plugin; see changes to src/index.ts for more details.

  • Events are emitted to jupyter_events via a new YRoomEventsAPI class. Each YRoom instance initializes one to use.

  • Fixes the plugin IDs for each plugin provided by our extension. Plugin IDs should always take the syntax <npm-package-name>:<plugin-name>.

Reviewer instructions

I've added a new devenv-jcollab.yaml file that replaces the older dev environments. This creates an environment with jupyterlab>=4.4 & jupyter_collaboration>=4.0. You can use this environment file to test this branch:

# checkout this branch locally
git fetch dlqqq && git switch jcollab-compatibility

# create new dev env w/ JCollab 4
conda create -f devenv-jcollab.yaml

# dev install JSD on top of JCollab 4
jlpm dev:install

Everything should work as expected.

@ellisonbg
Copy link
Collaborator

Nice! QQ: what do you think about jupyter_server_documents overriding settings["jupyter_server_ydoc"] with an API compatible object that has the needed get_documents function so server extension just work?

@dlqqq
Copy link
Collaborator Author

dlqqq commented Jun 10, 2025

@ellisonbg I can explore if "perfect compatibility" is possible. Will look into it and make the changes if they're simple enough. 👍

@dlqqq
Copy link
Collaborator Author

dlqqq commented Jun 10, 2025

@ellisonbg Done. The backend API should now be compatible with any extension using jupyter_collaboration~=4.0. 👍

@dlqqq dlqqq force-pushed the jcollab-compatibility branch from cb68aec to 17f9fca Compare June 10, 2025 19:53
@dlqqq
Copy link
Collaborator Author

dlqqq commented Jun 10, 2025

Rebased onto main and addressed conflicts w/ #103. 👍

@dlqqq dlqqq force-pushed the jcollab-compatibility branch from 5019b63 to 1ce7e7d Compare June 10, 2025 21:42
Copy link
Collaborator

@3coins 3coins left a comment

Choose a reason for hiding this comment

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

@dlqqq
This looks great 🚀 . Tested, and everything with server docs works.

One minor question about the store in the yroom events.

@dlqqq dlqqq merged commit 8b6b2b6 into jupyter-ai-contrib:main Jun 10, 2025
2 of 6 checks passed
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.

Emit to jupyter_events Add compatibility with jupyter_collaboration in the same environment

3 participants