Skip to content

Commit 80dd8c1

Browse files
fcollonvalbrichet
andauthored
[2.x] Support @jupyter/ydoc 2.x (#316)
* Support @jupyter/ydoc 2.x * Fix yarn.lock * Fix @jupyter/ydoc range in collaboration-extension * Ignore new resource warning from anyio * Fix pattern to ignore from anyio * update snapshots * Check if 'user' is defined in the state (server awareness can have no user defined) * Allow the user to not be defined in the awareness state --------- Co-authored-by: Frédéric Collonval <[email protected]> Co-authored-by: Nicolas Brichet <[email protected]>
1 parent 53a7b6e commit 80dd8c1

9 files changed

+18
-47
lines changed

packages/collaboration-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"dependencies": {
5656
"@jupyter/collaboration": "^2.1.4",
5757
"@jupyter/docprovider": "^2.1.4",
58-
"@jupyter/ydoc": "^1.1.0-a0",
58+
"@jupyter/ydoc": "^1.1.0 || ^2.0.0",
5959
"@jupyterlab/application": "^4.0.5",
6060
"@jupyterlab/apputils": "^4.0.5",
6161
"@jupyterlab/codemirror": "^4.0.5",

packages/collaboration/src/collaboratorspanel.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class CollaboratorsPanel extends Panel {
7575
state.forEach((value: ICollaboratorAwareness, key: any) => {
7676
if (
7777
this._currentUser.isReady &&
78+
value.user &&
7879
value.user.username !== this._currentUser.identity!.username
7980
) {
8081
collaborators.push(value);
@@ -114,6 +115,10 @@ export class CollaboratorsBody extends ReactWidget {
114115
let separator = '';
115116
let currentFileLocation = '';
116117

118+
if (!value.user) {
119+
return <></>;
120+
}
121+
117122
if (value.current) {
118123
canOpenCurrent = true;
119124
const path = value.current.split(':');

packages/collaboration/src/tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface ICollaboratorAwareness {
8484
/**
8585
* The User owning theses data.
8686
*/
87-
user: User.IIdentity;
87+
user?: User.IIdentity;
8888

8989
/**
9090
* The current file/context the user is working on.

packages/docprovider/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"watch": "tsc -b --watch"
4242
},
4343
"dependencies": {
44-
"@jupyter/ydoc": "^1.1.0-a0",
44+
"@jupyter/ydoc": "^1.1.0 || ^2.0.0",
4545
"@jupyterlab/coreutils": "^6.0.5",
4646
"@jupyterlab/services": "^7.0.5",
4747
"@lumino/coreutils": "^2.1.0",
Loading
Loading
Loading
Loading

yarn.lock

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,21 +1503,7 @@ __metadata:
15031503
languageName: node
15041504
linkType: hard
15051505

1506-
"@codemirror/language@npm:^6.0.0, @codemirror/language@npm:^6.3.0, @codemirror/language@npm:^6.4.0, @codemirror/language@npm:^6.6.0":
1507-
version: 6.6.0
1508-
resolution: "@codemirror/language@npm:6.6.0"
1509-
dependencies:
1510-
"@codemirror/state": ^6.0.0
1511-
"@codemirror/view": ^6.0.0
1512-
"@lezer/common": ^1.0.0
1513-
"@lezer/highlight": ^1.0.0
1514-
"@lezer/lr": ^1.0.0
1515-
style-mod: ^4.0.0
1516-
checksum: bb9411620e2f231653a3f0c4429e0d19a3843bff5dbc117df4649d7bf783ec4ad809c0add8bc0887a4ec3f48b4f8f941621168e47d76101d5383f0d670af1722
1517-
languageName: node
1518-
linkType: hard
1519-
1520-
"@codemirror/language@npm:^6.8.0":
1506+
"@codemirror/language@npm:^6.0.0, @codemirror/language@npm:^6.3.0, @codemirror/language@npm:^6.4.0, @codemirror/language@npm:^6.6.0, @codemirror/language@npm:^6.8.0":
15211507
version: 6.9.0
15221508
resolution: "@codemirror/language@npm:6.9.0"
15231509
dependencies:
@@ -2035,7 +2021,7 @@ __metadata:
20352021
dependencies:
20362022
"@jupyter/collaboration": ^2.1.4
20372023
"@jupyter/docprovider": ^2.1.4
2038-
"@jupyter/ydoc": ^1.1.0-a0
2024+
"@jupyter/ydoc": ^1.1.0 || ^2.0.0
20392025
"@jupyterlab/application": ^4.0.5
20402026
"@jupyterlab/apputils": ^4.0.5
20412027
"@jupyterlab/builder": ^4.0.5
@@ -2090,7 +2076,7 @@ __metadata:
20902076
version: 0.0.0-use.local
20912077
resolution: "@jupyter/docprovider@workspace:packages/docprovider"
20922078
dependencies:
2093-
"@jupyter/ydoc": ^1.1.0-a0
2079+
"@jupyter/ydoc": ^1.1.0 || ^2.0.0
20942080
"@jupyterlab/coreutils": ^6.0.5
20952081
"@jupyterlab/services": ^7.0.5
20962082
"@jupyterlab/testing": ^4.0.5
@@ -2144,17 +2130,17 @@ __metadata:
21442130
languageName: node
21452131
linkType: hard
21462132

2147-
"@jupyter/ydoc@npm:^1.1.0-a0":
2148-
version: 1.1.0-a0
2149-
resolution: "@jupyter/ydoc@npm:1.1.0-a0"
2133+
"@jupyter/ydoc@npm:^1.1.0 || ^2.0.0":
2134+
version: 2.1.3
2135+
resolution: "@jupyter/ydoc@npm:2.1.3"
21502136
dependencies:
21512137
"@jupyterlab/nbformat": ^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0
21522138
"@lumino/coreutils": ^1.11.0 || ^2.0.0
21532139
"@lumino/disposable": ^1.10.0 || ^2.0.0
21542140
"@lumino/signaling": ^1.10.0 || ^2.0.0
21552141
y-protocols: ^1.0.5
21562142
yjs: ^13.5.40
2157-
checksum: 0099bacb2884a460867658e7f5a944e4d6eca7c4d3d68a6b31102be77d8fc9b6ba162af55c20f81c70f7fef4e9d9329eee4da32063c0caa0c6e3f10a488f95b5
2143+
checksum: 61b38e3f89accebc8060eb0aacc11bf812befb9b1cec085d1b0153be851037a3a26b5576d58e5bc65d8c0697ef9f1e535afa73af1b1deef0523d749ff4ac0ac9
21582144
languageName: node
21592145
linkType: hard
21602146

@@ -2544,16 +2530,7 @@ __metadata:
25442530
languageName: node
25452531
linkType: hard
25462532

2547-
"@jupyterlab/nbformat@npm:^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0":
2548-
version: 4.0.0
2549-
resolution: "@jupyterlab/nbformat@npm:4.0.0"
2550-
dependencies:
2551-
"@lumino/coreutils": ^2.1.1
2552-
checksum: 152da6b9622c7683543ad2bd9525857a8a39b4b8a5474998e921232f108c366dd8625daeb14e2cc2aa8aac124b9a5d16f285310cd241c9769d51af80730dbd59
2553-
languageName: node
2554-
linkType: hard
2555-
2556-
"@jupyterlab/nbformat@npm:^4.0.5":
2533+
"@jupyterlab/nbformat@npm:^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0, @jupyterlab/nbformat@npm:^4.0.5":
25572534
version: 4.0.5
25582535
resolution: "@jupyterlab/nbformat@npm:4.0.5"
25592536
dependencies:
@@ -3110,7 +3087,7 @@ __metadata:
31103087
languageName: node
31113088
linkType: hard
31123089

3113-
"@lumino/coreutils@npm:^1.11.0 || ^2.0.0, @lumino/coreutils@npm:^1.11.0 || ^2.1.2, @lumino/coreutils@npm:^2.1.0, @lumino/coreutils@npm:^2.1.1, @lumino/coreutils@npm:^2.1.2":
3090+
"@lumino/coreutils@npm:^1.11.0 || ^2.0.0, @lumino/coreutils@npm:^1.11.0 || ^2.1.2, @lumino/coreutils@npm:^2.1.0, @lumino/coreutils@npm:^2.1.2":
31143091
version: 2.1.2
31153092
resolution: "@lumino/coreutils@npm:2.1.2"
31163093
checksum: 7865317ac0676b448d108eb57ab5d8b2a17c101995c0f7a7106662d9fe6c859570104525f83ee3cda12ae2e326803372206d6f4c1f415a5b59e4158a7b81066f
@@ -4028,18 +4005,7 @@ __metadata:
40284005
languageName: node
40294006
linkType: hard
40304007

4031-
"@types/react@npm:^18.0.26, @types/react@npm:^18.0.27":
4032-
version: 18.2.6
4033-
resolution: "@types/react@npm:18.2.6"
4034-
dependencies:
4035-
"@types/prop-types": "*"
4036-
"@types/scheduler": "*"
4037-
csstype: ^3.0.2
4038-
checksum: dea9d232d8df7ac357367a69dcb557711ab3d5501807ffa77cebeee73d49ee94d095f298e36853c63ed47cce097eee4c7eae2aaa8c02fac3f0171ec1b523a819
4039-
languageName: node
4040-
linkType: hard
4041-
4042-
"@types/react@npm:~18.0.26":
4008+
"@types/react@npm:^18.0.26, @types/react@npm:^18.0.27, @types/react@npm:~18.0.26":
40434009
version: 18.0.38
40444010
resolution: "@types/react@npm:18.0.38"
40454011
dependencies:

0 commit comments

Comments
 (0)