Skip to content

Commit

Permalink
Provide @jupyterlab/shared-models as singleton (#14229)
Browse files Browse the repository at this point in the history
* Provide @jupyterlab/shared-models as singleton

* Improve migration guide

* Fix integrity
  • Loading branch information
fcollonval committed Mar 20, 2023
1 parent 8a598b4 commit bbfc51b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ iframe_figures/
lerna-debug.log
yarn-error.log

# yarn >=2.x local files
.yarn
.pnp.*

# copied changelog file
docs/source/getting_started/changelog.md

Expand Down
1 change: 1 addition & 0 deletions dev_mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
"@jupyterlab/services",
"@jupyterlab/settingeditor",
"@jupyterlab/settingregistry",
"@jupyterlab/shared-models",
"@jupyterlab/statedb",
"@jupyterlab/statusbar",
"@jupyterlab/terminal",
Expand Down
10 changes: 7 additions & 3 deletions docs/source/extension/extension_migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ Instead of using the content API, now the provider opens a WebSocket connection
`jupyter server extension <https://github.com/jupyter-server/jupyter_server_ydoc>`__.

In addition, the shared models' package was moved to an external package called `@jupyter/ydoc
<https://github.com/jupyter-server/jupyter_ydoc>`__. All the extensions that depend on
``@jupyterlab/shared-models`` will need to update to depend in ``@jupyter/ydoc@~0.2.2``; the API should
be the same.
<https://github.com/jupyter-server/jupyter_ydoc>`__. ``@jupyterlab/shared-models`` has been kept
for backward compatibility (except in 3.6.0 and 3.6.1). It is now a proxy to ``@jupyter/ydoc@~0.2.2``;
the API is almost the same; see the required modification for the `example <https://github.com/jupyterlab/extension-examples/pull/224>`_.

**API Changes:**

To be able to fix RTC and make it stable. It was necessary to change the API and make a few breaking changes.
These changes should not affect the vast majority of extensions. They will only affect a couple
of extensions focused on RTC.
Expand All @@ -85,6 +86,9 @@ The involved packages are:

* ``WebSocketProvider.IOptions`` has a new optional attribute, ``user``.

- ``@jupyterlab/shared-models``: It is now a proxy to ``@jupyter/ydoc@~0.2.2``.
- A document model extending ``YDocument`` must define a change interface extending ``DocumentChange``.

- ``@jupyterlab/services``:
* The interface ``IManager`` has a new optional property, ``user`` that implement `User.IManager <../api/interfaces/services.User.IManager.html>`_.

Expand Down

0 comments on commit bbfc51b

Please sign in to comment.