Closed rashidakanchwala closed 1 month ago
@astrojuanlu @rashidakanchwala
After reviewing the Live Server extension and this Loom video, it seems these tools are primarily helpful for displaying web pages with URLs inside VSCode using its internal simple browser or the Live Server extension. However, they do not provide the required functionality for communication between the VSCode extension(Kedro) and the web app(Kedro-Viz).
To achieve the desired communication mechanism, VSCode offers the WebView API, which appears to be a promising solution. Here are some relevant resources:
I will continue to explore how the VSCode WebView API can be utilized to meet our use case effectively.
Good find. That's what https://github.com/iterative/vscode-dvc seems to be using too
@jitu5 did an impressive demo today to show the possibility to trigger "Go to definition" from the webview using the Webview API and kedro viz as a component. We discussed a few things as next steps:
Hi,
This is the branch under the vscode-kedro repo, vizwebview, which has my latest changes.
If you wanted to play around this please follow below steps.
Please follow development guideline from https://github.com/kedro-org/vscode-kedro/blob/vizwebview/DEVELOPMENT.md
npm run install:webview
npm run build:webview
You can start debug with F5, this should lauch an "Extension Development Host".
In Extension Development Host, Open shift + Cmd + P
and enter 'Kedro: Run Kedro Viz' and hit enter.
This will open Kedro Viz inside VSCode.
To demo Extension to webview/UI communication, Open shift + Cmd + P
and enter 'Kedro: Update Theme' and hit enter.
To demo webview/UI to Extension communication, Click on "Goto: 'prm_spine_table'" button, this will send hardcoded text "prm_spine_table" to Extension and Extension will open file containing "prm_spine_table" text.
I have two ideas when I am exploring how the Webview API can communicate with LSP
The command itself can be used separately, i.e. taking an argument for Go to Definition. (almost like a quick search feature but specifcially for Kedro). The other way of using this command is through the React component.
I have tested it's possible to invoke LSP function from a VSCode command, I haven't test if it can successfully make the editor respond to it, will need a proper ticket to work on this in sprint.
Opened an isuse here https://github.com/kedro-org/vscode-kedro/issues/56
Closing as the spike was finished, we have proper plan of tasks/release here: https://github.com/kedro-org/vscode-kedro/issues/58
Description
Do a technical feasibility spike to determine how Kedro-viz can be embedded into VSCode as an extension.
Tasks to Investigate:
Embedding: Determine whether to embed Kedro-viz as a React component or run it as a Live Preview using the Live Server extension or following this guy's example here
Communication Mechanism: Explore how to enable communication between the code and Kedro-viz. For example:
Run Button: Add a 'run' button in Kedro-viz next to the 'Run Command'. This button should copy/paste the 'run command' to the terminal and execute it.
Context
Why is this change important to you? How would you use it? How can it benefit other users?
Possible Implementation
(Optional) Suggest an idea for implementing the addition or change.
Possible Alternatives
(Optional) Describe any alternative solutions or features you've considered.
Checklist