Skip to content

Commit 4533881

Browse files
authored
docs: vscode (#366)
* docs: vscode * docs: vscode * docs: vscode * vscode: docs
1 parent 846040f commit 4533881

File tree

7 files changed

+61
-69
lines changed

7 files changed

+61
-69
lines changed

docs/docs/integrations/vscode/index.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@ import ModalImage from "react-modal-image";
22

33
# 🚧 VS Code
44

5+
The `datalayer-notebook` extension for VS Code allows you to edit Jupyer Notebooks files (`ipynb` extensions).
6+
7+
The extensions is available in the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=datalayer.datalayer-jupyter-vscode).
8+
59
<ModalImage
6-
small="https://jupyter-examples.datalayer.tech/jupyter-react-vscode.png"
7-
large="https://jupyter-examples.datalayer.tech/jupyter-react-vscode.png"
10+
small="https://jupyter-examples.datalayer.tech/jupyter-react-vscode.gif"
11+
large="https://jupyter-examples.datalayer.tech/jupyter-react-vscode.gif"
812
alt="Jupyter UI VSCode"
913
/>
1014

1115
## Working Features
1216

13-
- Loading a notebook
14-
- Display a notebook
15-
- Connect to a Jupyter Server by providing its URL with auth token; transfer http request and websocket messages
16-
- Running code
17+
- Load a Notebook.
18+
- Display a Notebook.
19+
- Connect to a Jupyter Server by providing its URL with auth token; transfer http request and websocket messages.
20+
- Run code.
21+
- IPyWidgets support.
1722

1823
## Not Implemented
1924

20-
- Saving the document
21-
- Notifying of updates to have a UI feedback the document is in dirty state
22-
- ipywidgets support
25+
- Save the Notebook.
26+
- Notifying of updates to have a UI feedback the document is in dirty state.
2327

2428
## Known Limitations
2529

26-
- Styling:
27-
- No connection between dark/light vs code theme and notebook theme
30+
Styling
31+
- No connection between dark/light vs code theme and notebook theme
32+
- No resizing with the panel
33+
- Button to select the runtime is not displayed in a toolbar that stays visible - No connection between dark/light vs code theme and notebook theme
2834
- No resizing with the panel
2935
- Button to select the runtime is not displayed in a toolbar that stays visible
30-
- Websocket binary support: for now we forbid the usage of the newer protocol v1.kernel.websocket.jupyter.org. When using it, the message data are failing to be serialized to be transferred from the webview to the extension. And when receiving it, the deserialization fails. The deserialization error may be related to an incorrect binaryType that is not handle in the current code; but in JupyterLab it is forced to 'arraybuffer' for kernel websocket.
31-
32-
## Architecture
33-
34-
The editor is displayed in a webview - aka a iframe. That iframe has Content Security Policies that have been fully relaxed for styling :disappointed: but not for scripts. Not allowing any script will likely induce issue especially with advanced output renderer like plotly or ipywidgets. That policy may be relaxed (but this is going against VS Code recommendation).
3536

36-
The webview being in a separate world, connecting to the server is done through the extension. This requires to proxy http-request and websocket messages to and from the webviews. This is tricky as it requires serialization handled by vscode. And despite using a so called `postMessage` method, the behavior is not matching the Web API `postMessage` especially when transferring complex objects.
3737

38-
The interface point is inspired by JupyterLite approach; aka we define a custom `fetch` method and `WebSocket` class in the server settings used by the service manager.
38+
Websocket binary support: for now we forbid the usage of the newer protocol v1.kernel.websocket.jupyter.org. When using it, the message data are failing to be serialized to be transferred from the webview to the extension. And when receiving it, the deserialization fails. The deserialization error may be related to an incorrect binaryType that is not handle in the current code; but in JupyterLab it is forced to 'arraybuffer' for kernel websocket.

packages/vscode/.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/vscode/README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
[![Become a Sponsor](https://img.shields.io/static/v1?label=Become%20a%20Sponsor&message=%E2%9D%A4&logo=GitHub&style=flat&color=1ABC9C)](https://github.com/sponsors/datalayer)
44

5-
# Jupyter UI for Visual Studio Code
5+
# Jupyter Notebook for Visual Studio Code
66

7-
This is the README for the `datalayer-notebook` extension.
7+
This [Visual Studio Code](https://code.visualstudio.com) extension allows you to edit [Jupyter](https://jupyter.org) Notebooks files (`ipynb` extensions) and is publically available in the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=datalayer.datalayer-jupyter-vscode).
8+
9+
<img src="https://jupyter-examples.datalayer.tech/jupyter-react-vscode.gif" />
10+
11+
## Working Features
12+
13+
- Load a Notebook.
14+
- Display a Notebook.
15+
- Connect to a Jupyter Server by providing its URL with auth token; transfer http request and websocket messages.
16+
- Run code.
17+
- IPyWidgets support.
18+
19+
## Not Implemented
20+
21+
- Save the Notebook.
22+
- Notifying of updates to have a UI feedback the document is in dirty state.
23+
24+
## Known Limitations
25+
26+
Styling
27+
- No connection between dark/light vs code theme and notebook theme
28+
- No resizing with the panel
29+
- Button to select the runtime is not displayed in a toolbar that stays visible - No connection between dark/light vs code theme and notebook theme
30+
- No resizing with the panel
31+
- Button to select the runtime is not displayed in a toolbar that stays visible
32+
33+
34+
Websocket binary support: for now we forbid the usage of the newer protocol v1.kernel.websocket.jupyter.org. When using it, the message data are failing to be serialized to be transferred from the webview to the extension. And when receiving it, the deserialization fails. The deserialization error may be related to an incorrect binaryType that is not handle in the current code; but in JupyterLab it is forced to 'arraybuffer' for kernel websocket.

packages/vscode/README_TEMPLATE.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

packages/vscode/package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
"displayName": "Datalayer Notebook",
44
"description": "A Jupyter Notebook Editor for VS Code",
55
"publisher": "Datalayer",
6-
"version": "0.0.1",
6+
"version": "0.0.2",
77
"icon": "images/datalayer-logo.png",
8+
"categories": [
9+
"AI",
10+
"Data Science",
11+
"Machine Learning",
12+
"Notebooks",
13+
"Visualization"
14+
],
815
"repository": {
916
"type": "git",
1017
"url": "https://github.com/datalayer/jupyter-ui.git",
@@ -13,22 +20,19 @@
1320
"engines": {
1421
"vscode": "^1.98.0"
1522
},
16-
"categories": [
17-
"Data Science"
18-
],
19-
"activationEvents": [],
2023
"main": "./dist/extension.js",
24+
"activationEvents": [],
2125
"contributes": {
2226
"commands": [
2327
{
24-
"command": "datalayer.notebook.new",
28+
"command": "datalayer.jupyter-notebook-new",
2529
"title": "Create new Datalayer Notebook",
2630
"category": "Notebook"
2731
}
2832
],
2933
"customEditors": [
3034
{
31-
"viewType": "datalayer.notebook",
35+
"viewType": "datalayer.jupyter-notebook",
3236
"displayName": "Datalayer Notebook",
3337
"selector": [
3438
{

packages/vscode/src/notebookEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export class NotebookEditorProvider
219219
private static newNotebookFileId = 1;
220220

221221
public static register(context: vscode.ExtensionContext): vscode.Disposable {
222-
vscode.commands.registerCommand('datalayer.notebook.new', () => {
222+
vscode.commands.registerCommand('datalayer.jupyter-notebook-new', () => {
223223
const workspaceFolders = vscode.workspace.workspaceFolders;
224224
if (!workspaceFolders) {
225225
vscode.window.showErrorMessage(
@@ -252,7 +252,7 @@ export class NotebookEditorProvider
252252
);
253253
}
254254

255-
private static readonly viewType = 'datalayer.notebook';
255+
private static readonly viewType = 'datalayer.jupyter-notebook';
256256

257257
/**
258258
* Tracks all known webviews

packages/vscode/src/test/extension.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
*/
66

77
import * as assert from 'assert';
8-
98
// You can import and use all API from the 'vscode' module as well as import your extension to test it
109
import * as vscode from 'vscode';
11-
// import * as myExtension from '../../extension';
10+
// import * as jupyterNotebookExtension from '../../extension';
1211

1312
suite('Extension Test Suite', () => {
1413
vscode.window.showInformationMessage('Start all tests.');

0 commit comments

Comments
 (0)