Skip to content

Commit 5d536dd

Browse files
authored
Merge pull request #599 from btel/jlab-2.0-rebased
compatibility with jupyterlab >= 2.0
2 parents a921bca + 81b9de2 commit 5d536dd

24 files changed

+1986
-2000
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cache:
77
- /home/travis/.yarn-cache/
88
before_install:
99
- nvm install 10
10-
install: pip install pytest pytest-asyncio "jupyterlab~=1.1"
10+
install: pip install --upgrade --upgrade-strategy=eager pytest pytest-asyncio "jupyterlab~=2.0"
1111
script:
1212
# Build the sdist (identical to what will be uploaded to eg pypi on release)
1313
- python setup.py sdist

package.json

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,33 @@
4949
"schemaDir": "schema"
5050
},
5151
"dependencies": {
52-
"@jupyterlab/application": "^1.1.0",
53-
"@jupyterlab/apputils": "^1.1.0",
54-
"@jupyterlab/codemirror": "^1.1.0",
55-
"@jupyterlab/console": "^1.1.0",
56-
"@jupyterlab/coreutils": "^3.1.0",
57-
"@jupyterlab/filebrowser": "^1.1.0",
58-
"@jupyterlab/mainmenu": "^1.1.0",
59-
"@jupyterlab/services": "^4.1.0",
60-
"@jupyterlab/terminal": "^1.1.0",
61-
"@jupyterlab/ui-components": "^1.1.0",
52+
"@jupyterlab/application": "^2.0.0",
53+
"@jupyterlab/apputils": "^2.0.0",
54+
"@jupyterlab/codemirror": "^2.0.0",
55+
"@jupyterlab/console": "^2.0.0",
56+
"@jupyterlab/coreutils": "^4.0.0",
57+
"@jupyterlab/filebrowser": "^2.0.0",
58+
"@jupyterlab/mainmenu": "^2.0.0",
59+
"@jupyterlab/nbformat": "^2.0.0",
60+
"@jupyterlab/services": "^5.0.0",
61+
"@jupyterlab/settingregistry": "^2.0.0",
62+
"@jupyterlab/terminal": "^2.0.0",
63+
"@jupyterlab/ui-components": "^2.0.0",
64+
"@lumino/polling": "^1.0.4",
65+
"@lumino/widgets": "^1.11.1",
6266
"@material-ui/core": "^4.8.2",
6367
"@material-ui/icons": "^4.5.1",
64-
"@phosphor/widgets": "^1.8.0",
6568
"diff-match-patch": "^1.0.4",
66-
"nbdime": "~5.0.1",
67-
"react": "~16.8.4",
68-
"react-dom": "~16.8.4",
69+
"nbdime": "^6.0.0",
70+
"react": "~16.9.0",
71+
"react-dom": "~16.9.0",
6972
"react-textarea-autosize": "^7.1.2",
7073
"typestyle": "^2.0.1"
7174
},
7275
"devDependencies": {
7376
"@babel/core": "^7.5.0",
7477
"@babel/preset-env": "^7.5.0",
75-
"@jupyterlab/testutils": "^1.1.0",
78+
"@jupyterlab/testutils": "^2.0.0",
7679
"@types/codemirror": "^0.0.79",
7780
"@types/diff-match-patch": "^1.0.32",
7881
"@types/enzyme": "3.1.15",
@@ -96,7 +99,7 @@
9699
"tslint": "^5.11.0",
97100
"tslint-config-prettier": "1.18.0",
98101
"tslint-plugin-prettier": "^2.0.0",
99-
"typescript": "~3.5.1",
102+
"typescript": "~3.7.1",
100103
"typescript-tslint-plugin": "^0.5.4"
101104
},
102105
"peerDependencies": {

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def runPackLabextension():
7171
],
7272
install_requires = [
7373
'notebook',
74-
'nbdime >= 1.1.0, < 2.0.0',
74+
'nbdime ~=2.0',
7575
'pexpect'
7676
],
7777
extras_require = {
7878
'test': [
7979
'pytest',
8080
'pytest-asyncio',
81-
'jupyterlab~=1.1',
81+
'jupyterlab~=2.0',
8282
],
8383
},
8484
)

src/components/ActionButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
2-
import { DefaultIconReact } from '@jupyterlab/ui-components';
32
import { classes } from 'typestyle';
3+
import { LabIcon } from '@jupyterlab/ui-components';
44
import { actionButtonStyle } from '../style/ActionButtonStyle';
55

66
/**
@@ -44,7 +44,7 @@ export const ActionButton: React.FunctionComponent<IActionButtonProps> = (
4444
title={props.title}
4545
onClick={props.onClick}
4646
>
47-
<DefaultIconReact tag="span" name={props.iconName} />
47+
<LabIcon.resolveReact icon={props.iconName} />
4848
</button>
4949
);
5050
};

src/components/FileList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import { Dialog, showDialog, showErrorMessage } from '@jupyterlab/apputils';
3-
import { ISettingRegistry } from '@jupyterlab/coreutils';
43
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
5-
import { Menu } from '@phosphor/widgets';
4+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
5+
import { Menu } from '@lumino/widgets';
66
import { GitExtension } from '../model';
77
import { hiddenButtonStyle } from '../style/ActionButtonStyle';
88
import { fileListWrapperClass } from '../style/FileListStyle';

src/components/GitPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import * as React from 'react';
22
import Tabs from '@material-ui/core/Tabs';
33
import Tab from '@material-ui/core/Tab';
44
import { showErrorMessage, showDialog } from '@jupyterlab/apputils';
5-
import { ISettingRegistry } from '@jupyterlab/coreutils';
5+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
66
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
7-
import { JSONObject } from '@phosphor/coreutils';
7+
import { JSONObject } from '@lumino/coreutils';
88
import { GitExtension } from '../model';
99
import {
1010
panelWrapperClass,

src/components/SinglePastCommitInfo.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as React from 'react';
22
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
3-
import { DefaultIconReact } from '@jupyterlab/ui-components';
4-
import { classes } from 'typestyle';
3+
import { fileIcon } from '@jupyterlab/ui-components';
4+
import { insertionsMadeIcon, deletionsMadeIcon } from '../style/icons';
5+
import { classes } from 'typestyle/';
56
import { GitExtension } from '../model';
67
import { Git } from '../tokens';
78
import {
@@ -159,21 +160,27 @@ export class SinglePastCommitInfo extends React.Component<
159160
<div>
160161
<div className={commitClass}>
161162
<div className={commitOverviewNumbersClass}>
162-
<span title="# Files Changed">
163-
<DefaultIconReact name="file" className={iconClass} />
163+
<span>
164+
<fileIcon.react
165+
className={iconClass}
166+
tag="span"
167+
title="# Files Changed"
168+
/>
164169
{this.state.numFiles}
165170
</span>
166-
<span title="# Insertions">
167-
<DefaultIconReact
168-
name="git-insertionsMade"
171+
<span>
172+
<insertionsMadeIcon.react
169173
className={classes(iconClass, insertionsIconClass)}
174+
tag="div"
175+
title="# Insertions"
170176
/>
171177
{this.state.insertions}
172178
</span>
173-
<span title="# Deletions">
174-
<DefaultIconReact
175-
name="git-deletionsMade"
179+
<span>
180+
<deletionsMadeIcon.react
176181
className={classes(iconClass, deletionsIconClass)}
182+
tag="div"
183+
title="# Deletions"
177184
/>
178185
{this.state.deletions}
179186
</span>

src/components/diff/NbDiff.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { nbformat, PathExt } from '@jupyterlab/coreutils';
1+
import { PathExt } from '@jupyterlab/coreutils';
2+
import * as nbformat from '@jupyterlab/nbformat';
23
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
34
import { ServerConnection } from '@jupyterlab/services/lib/serverconnection';
45
import { IDiffEntry } from 'nbdime/lib/diff/diffentries';

src/gitMenuCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
showDialog,
77
showErrorMessage
88
} from '@jupyterlab/apputils';
9-
import { ISettingRegistry } from '@jupyterlab/coreutils';
109
import { FileBrowser } from '@jupyterlab/filebrowser';
10+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
1111
import { ITerminal } from '@jupyterlab/terminal';
1212
import { IGitExtension } from './tokens';
1313
import { doGitClone } from './widgets/gitClone';

src/index.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ import {
33
JupyterFrontEnd,
44
JupyterFrontEndPlugin
55
} from '@jupyterlab/application';
6-
import { IChangedArgs, ISettingRegistry } from '@jupyterlab/coreutils';
6+
import { IChangedArgs } from '@jupyterlab/coreutils';
7+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
78
import {
89
FileBrowser,
910
FileBrowserModel,
1011
IFileBrowserFactory
1112
} from '@jupyterlab/filebrowser';
1213
import { IMainMenu } from '@jupyterlab/mainmenu';
1314
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
14-
import { defaultIconRegistry } from '@jupyterlab/ui-components';
15-
import { Menu } from '@phosphor/widgets';
15+
import { Menu } from '@lumino/widgets';
1616
import { addCommands, CommandIDs } from './gitMenuCommands';
1717
import { GitExtension } from './model';
18-
import { registerGitIcons } from './style/icons';
1918
import { IGitExtension } from './tokens';
2019
import { addCloneButton } from './widgets/gitClone';
2120
import { GitWidget } from './widgets/GitWidget';
21+
import { gitIcon } from './style/icons';
2222

2323
export { Git, IGitExtension } from './tokens';
2424

@@ -68,9 +68,6 @@ async function activate(
6868
): Promise<IGitExtension> {
6969
let settings: ISettingRegistry.ISettings;
7070

71-
// Register Git icons with the icon registry
72-
registerGitIcons(defaultIconRegistry);
73-
7471
// Get a reference to the default file browser extension
7572
const filebrowser = factory.defaultBrowser;
7673

@@ -102,7 +99,7 @@ async function activate(
10299
// Create the Git widget sidebar
103100
const gitPlugin = new GitWidget(gitExtension, settings, renderMime);
104101
gitPlugin.id = 'jp-git-sessions';
105-
gitPlugin.title.iconClass = 'jp-SideBar-tabIcon jp-GitIcon';
102+
gitPlugin.title.icon = gitIcon;
106103
gitPlugin.title.caption = 'Git';
107104

108105
// Let the application restorer track the running panel for restoration of

0 commit comments

Comments
 (0)