Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Install dependencies
run: |
pip install "jupyterlab>=4.0.0,<5"
pip install "jupyterlab>=4.4.0a2,<5"
jlpm install
- name: Run pre-commit
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
name: "sdist"
- name: Install dependencies
run: |
pip install jupyterlab jupyter_collaboration_ui*.tar.gz jupyter_docprovider*.tar.gz jupyter_server_ydoc*.tar.gz
pip install "jupyterlab>=4.4.0a2" jupyter_collaboration_ui*.tar.gz jupyter_docprovider*.tar.gz jupyter_server_ydoc*.tar.gz
- name: Install playwright
env:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
"stylelint-config-standard": "^30.0.1",
"stylelint-prettier": "^3.0.0",
"typedoc": "~0.23.28",
"typescript": "~5.0.4"
"typescript": "~5.1.6"
}
}
20 changes: 10 additions & 10 deletions packages/collaboration-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,25 @@
"@jupyter/collaborative-drive": "^3.1.0",
"@jupyter/docprovider": "^3.1.0",
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/apputils": "^4.2.0",
"@jupyterlab/codemirror": "^4.2.0",
"@jupyterlab/coreutils": "^6.0.5",
"@jupyterlab/services": "^7.0.5",
"@jupyterlab/statedb": "^4.2.0",
"@jupyterlab/translation": "^4.2.0",
"@jupyterlab/ui-components": "^4.2.0",
"@jupyterlab/application": "^4.4.0-alpha.2",
"@jupyterlab/apputils": "^4.4.0-alpha.2",
"@jupyterlab/codemirror": "^4.4.0-alpha.2",
"@jupyterlab/coreutils": "^6.4.0-alpha.2",
"@jupyterlab/services": "^7.4.0-alpha.2",
"@jupyterlab/statedb": "^4.4.0-alpha.2",
"@jupyterlab/translation": "^4.4.0-alpha.2",
"@jupyterlab/ui-components": "^4.4.0-alpha.2",
"@lumino/widgets": "^2.1.0",
"y-protocols": "^1.0.5",
"y-websocket": "^1.3.15",
"yjs": "^13.5.40"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.5",
"@jupyterlab/builder": "^4.4.0-alpha.2",
"@types/react": "~18.3.1",
"npm-run-all": "^4.1.5",
"rimraf": "^4.1.2",
"typescript": "~5.0.4"
"typescript": "~5.1.6"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 3 additions & 1 deletion packages/collaboration-extension/src/collaboration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export const rtcGlobalAwarenessPlugin: JupyterFrontEndPlugin<IAwareness> = {
const data: any = await state.toJSON();
const current: string = data['layout-restorer:data']?.main?.current || '';

if (current.match(/^\w+:RTC:/)) {
// For example matches `notebook:Untitled.ipynb` or `editor:untitled.txt`,
// but not when in launcher or terminal.
if (current.match(/^\w+:.+/)) {
awareness.setLocalStateField('current', current);
} else {
awareness.setLocalStateField('current', null);
Expand Down
12 changes: 6 additions & 6 deletions packages/collaboration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"dependencies": {
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.7.0",
"@jupyterlab/apputils": "^4.0.5",
"@jupyterlab/coreutils": "^6.0.5",
"@jupyterlab/docregistry": "^4.0.5",
"@jupyterlab/services": "^7.0.5",
"@jupyterlab/ui-components": "^4.0.5",
"@jupyterlab/apputils": "^4.4.0-alpha.2",
"@jupyterlab/coreutils": "^6.4.0-alpha.2",
"@jupyterlab/docregistry": "^4.4.0-alpha.2",
"@jupyterlab/services": "^7.4.0-alpha.2",
"@jupyterlab/ui-components": "^4.4.0-alpha.2",
"@lumino/coreutils": "^2.1.0",
"@lumino/signaling": "^2.0.0",
"@lumino/virtualdom": "^2.0.0",
Expand All @@ -57,7 +57,7 @@
"devDependencies": {
"@types/react": "~18.3.1",
"rimraf": "^4.1.2",
"typescript": "~5.0.4"
"typescript": "~5.1.6"
},
"publishConfig": {
"access": "public"
Expand Down
20 changes: 11 additions & 9 deletions packages/collaboration/src/collaboratorspanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
if (
this._currentUser.isReady &&
value.user &&
value.user.username !== this._currentUser.identity!.username

Check warning on line 106 in packages/collaboration/src/collaboratorspanel.tsx

View workflow job for this annotation

GitHub Actions / Run pre-commit hook

Forbidden non-null assertion
) {
collaborators.push(value as ICollaboratorAwareness);
}
Expand Down Expand Up @@ -155,31 +155,30 @@
let currentMain = '';

if (collaborator.current) {
// Discard widget tracker prefix (e.g. `notebook:` or `editor:`)
const path = collaborator.current.split(':');
currentMain = `${path[1]}:${path[2]}`;
currentMain = `${path[1]}`;
}

const documents: string[] = collaborator.documents || [];

const docs = documents.map(document => {
const path = document.split(':');
const fileTypes = props.docRegistry
?.getFileTypesForPath(path[1])
?.getFileTypesForPath(document)
?.filter(ft => ft.icon !== undefined);
const icon = fileTypes ? fileTypes[0].icon! : fileIcon;

Check warning on line 169 in packages/collaboration/src/collaboratorspanel.tsx

View workflow job for this annotation

GitHub Actions / Run pre-commit hook

Forbidden non-null assertion
const iconClass: string | undefined = fileTypes
? fileTypes[0].iconClass
: undefined;

return {
filepath: path[1],
filename:
path[1].length > 40
? path[1]
document.length > 40
? document
.slice(0, 10)
.concat('…')
.concat(path[1].slice(path[1].length - 15))
: path[1],
.concat(document.slice(document.length - 15))
: document,
fileLocation: document,
icon,
iconClass
Expand Down Expand Up @@ -242,7 +241,10 @@
className={'jp-DirListing-itemIcon'}
stylesheet={'listing'}
/>
<span className={'jp-DirListing-itemText'} title={doc.filepath}>
<span
className={'jp-DirListing-itemText'}
title={doc.fileLocation}
>
{doc.filename}
</span>
</li>
Expand Down
4 changes: 2 additions & 2 deletions packages/collaborative-drive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
},
"dependencies": {
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
"@jupyterlab/services": "^7.2.0",
"@jupyterlab/services": "^7.4.0-alpha.2",
"@lumino/coreutils": "^2.1.0",
"@lumino/disposable": "^2.1.0"
},
"devDependencies": {
"rimraf": "^4.1.2",
"typescript": "~5.0.4"
"typescript": "~5.1.6"
},
"publishConfig": {
"access": "public"
Expand Down
24 changes: 7 additions & 17 deletions packages/collaborative-drive/src/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { DocumentChange, IAwareness, YDocument } from '@jupyter/ydoc';
import { Contents } from '@jupyterlab/services';
import { IAwareness } from '@jupyter/ydoc';
import { Contents, SharedDocumentFactory } from '@jupyterlab/services';
import { IDisposable } from '@lumino/disposable';

import { Token } from '@lumino/coreutils';

/**
* The collaborative drive.
*/
export const ICollaborativeDrive = new Token<ICollaborativeDrive>(
'@jupyter/collaboration-extension:ICollaborativeDrive'
);
export const ICollaborativeContentProvider =
new Token<ICollaborativeContentProvider>(
'@jupyter/collaboration-extension:ICollaborativeContentProvider'
);

/**
* The global awareness token.
Expand All @@ -21,18 +22,7 @@ export const IGlobalAwareness = new Token<IAwareness>(
'@jupyter/collaboration:IGlobalAwareness'
);

/**
* A document factory for registering shared models
*/
export type SharedDocumentFactory = (
options: Contents.ISharedFactoryOptions
) => YDocument<DocumentChange>;

/**
* A Collaborative implementation for an `IDrive`, talking to the
* server using the Jupyter REST API and a WebSocket connection.
*/
export interface ICollaborativeDrive extends Contents.IDrive {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we'll want to log that somewhere in the changelog as API breaking change, since other extensions may currently depend on ICollaborativeDrive?

For instance it's the case of JupyterCAD and JupyterGIS:

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like the transition will be smooth because:

  • both extensions used ICollaborativeDrive as an optional dependency (after all it was just added)
  • neither of the extensions actually relied on the Drive part of ICollaborativeDrive - the same properties that they needed will be available on ICollaborativeContentProvider

So when cutting the release we will just need to add a note that migration from ICollaborativeDrive to ICollaborativeContentProvider token for access to shared factory and forks will be required. I do not see a good way to do that right now as the changelog for next version is not there yet - is it ok if we add it during/just after cutting the release?

export interface ICollaborativeContentProvider {
/**
* SharedModel factory for the YDrive.
*/
Expand Down
22 changes: 11 additions & 11 deletions packages/docprovider-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,26 @@
"@jupyter/collaborative-drive": "^3.1.0",
"@jupyter/docprovider": "^3.1.0",
"@jupyter/ydoc": "^2.1.3 || ^3.0.0",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/apputils": "^4.2.0",
"@jupyterlab/docregistry": "^4.2.0",
"@jupyterlab/filebrowser": "^4.2.0",
"@jupyterlab/fileeditor": "^4.2.0",
"@jupyterlab/logconsole": "^4.2.0",
"@jupyterlab/notebook": "^4.2.0",
"@jupyterlab/settingregistry": "^4.2.0",
"@jupyterlab/translation": "^4.2.0",
"@jupyterlab/application": "^4.4.0-alpha.2",
"@jupyterlab/apputils": "^4.4.0-alpha.2",
"@jupyterlab/docregistry": "^4.4.0-alpha.2",
"@jupyterlab/filebrowser": "^4.4.0-alpha.2",
"@jupyterlab/fileeditor": "^4.4.0-alpha.2",
"@jupyterlab/logconsole": "^4.4.0-alpha.2",
"@jupyterlab/notebook": "^4.4.0-alpha.2",
"@jupyterlab/settingregistry": "^4.4.0-alpha.2",
"@jupyterlab/translation": "^4.4.0-alpha.2",
"@lumino/commands": "^2.1.0",
"y-protocols": "^1.0.5",
"y-websocket": "^1.3.15",
"yjs": "^13.5.40"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/builder": "^4.4.0-alpha.2",
"@types/react": "~18.3.1",
"npm-run-all": "^4.1.5",
"rimraf": "^4.1.2",
"typescript": "~5.0.4"
"typescript": "~5.1.6"
},
"publishConfig": {
"access": "public"
Expand Down
Loading
Loading