Skip to content

Commit

Permalink
Drop support for the old visualizer (#375)
Browse files Browse the repository at this point in the history
* Drop support for the old visualizer

* remove redundant scripts

* add changeset
  • Loading branch information
Andarist authored Oct 5, 2023
1 parent 75351ee commit 89f275f
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 316 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-elephants-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'stately-vscode': major
---

Removed support for the deprecated visualizer.
8 changes: 1 addition & 7 deletions apps/extension/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
"publisher": "statelyai",
"contributes": {
"commands": [
{
"command": "stately-xstate.visualize",
"title": "Open Inspector",
"category": "XState"
},
{
"command": "stately-xstate.edit",
"title": "Open Visual Editor",
Expand Down Expand Up @@ -90,7 +85,7 @@
"active"
],
"default": "beside",
"description": "Target for opening the Visual Editor and Inspector. Beside opens in a group next to the current file, while active opens in the current group of the current file."
"description": "Target for opening the Visual Editor. Beside opens in a group next to the current file, while active opens in the current group of the current file."
}
}
},
Expand All @@ -103,7 +98,6 @@
"scripts": {
"lint": "tsc",
"test": "jest --passWithNoTests",
"webview:viz:build": "esbuild src/vizWebviewScript.ts --bundle --outfile=scripts/vizWebview.js",
"vscode:build": "esbuild --bundle --platform=\"node\" src/extension.ts --outfile=dist/index.js --external:vscode --format=cjs --sourcemap",
"vscode:build:dev": "yarn vscode:build --define:process.env.NODE_ENV=\\\"development\\\"",
"vscode:build:prod": "yarn vscode:build --define:process.env.NODE_ENV=\\\"production\\\""
Expand Down
2 changes: 0 additions & 2 deletions apps/extension/client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as vscode from 'vscode';
import { handleTypegenNestingConfig } from './checkTypegenNesting';
import { initiateEditor } from './initiateEditor';
import { initiateTypegen } from './initiateTypegen';
import { initiateVisualizer } from './initiateVisualizer';
import { TypeSafeLanguageClient } from './typeSafeLanguageClient';

let languageClient: TypeSafeLanguageClient | undefined;
Expand All @@ -21,7 +20,6 @@ export async function activate(context: vscode.ExtensionContext) {
await languageClient.onReady();

handleTypegenNestingConfig();
initiateVisualizer(context, languageClient);
initiateEditor(context, languageClient);
initiateTypegen(context, languageClient);
}
Expand Down
144 changes: 0 additions & 144 deletions apps/extension/client/src/initiateVisualizer.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/extension/client/src/typeSafeVsCode.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import * as vscode from 'vscode';

export interface XStateCommands {
// those are related to the editor
'stately-xstate.edit': [];
'stately-xstate.edit-code-lens': [uri: string, machineIndex: number];
// those are related to the visualizer
'stately-xstate.visualize': [];
'stately-xstate.inspect': [uri: string, machineIndex: number];
}

export function registerCommand<Name extends keyof XStateCommands>(
Expand Down
137 changes: 0 additions & 137 deletions apps/extension/client/src/vizWebviewScript.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/extension/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,6 @@ connection.onCodeLens(({ textDocument }) => {
arguments: [textDocument.uri, index],
},
},
{
range: getRangeFromSourceLocation(callee.loc!),
command: {
title: 'Open Inspector',
command: 'stately-xstate.inspect',
arguments: [textDocument.uri, index],
},
},
];
},
);
Expand Down Expand Up @@ -891,8 +883,6 @@ connection.onRequest('getNodePosition', ({ path }) => {
];
});

// TODO: editor and visualizer should have separate states for this
// they can be opened for different machines at the same time
connection.onRequest('setDisplayedMachine', ({ uri, machineIndex }) => {
displayedMachine = { uri, machineIndex };
});
Expand Down
12 changes: 0 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,13 @@
],
"cache": false
},
"webview:viz:build": {
"outputs": [
"scripts/vizWebview.js"
],
"cache": false
},
"vscode:build:dev": {
"dependsOn": [
"webview:viz:build"
],
"outputs": [
"dist/**"
],
"cache": false
},
"vscode:build:prod": {
"dependsOn": [
"webview:viz:build"
],
"outputs": [
"dist/**"
],
Expand Down

0 comments on commit 89f275f

Please sign in to comment.