Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Update VSCode webview proxy

Open sebibek opened this issue 2 years ago โ€ข 9 comments
trafficstars

The vs code proxy is currently sitting at Pluto v0.17.3, update to 0.19.32! (I'm using it :)

sebibek avatar Oct 29 '23 12:10 sebibek

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/sebibek/Pluto.jl", rev="vscode-webview-proxy")
julia> using Pluto

github-actions[bot] avatar Oct 29 '23 12:10 github-actions[bot]

Currently, the UI is coming up, but no notebook cells visible. TBH, I don't get it, so feel free to take over or close this PR!

sebibek avatar Nov 04 '23 12:11 sebibek

Maybe the failing frontend tests can help you debug? It looks like the frontend tests never manage to open a notebook. You can see this by running the tests locally (check out tests/frontend/README) or the screenshots generated by the GHA

test-screenshot-artifacts (4).zip

Did you try to just run Pluto normally (without vscode) using this branch?

fonsp avatar Nov 05 '23 12:11 fonsp

Did you try to just run Pluto normally (without vscode) using this branch?

Yes, this worked on fonsp:vscode-webview-proxy, as well (so I assumed this should work here, too). Will try the frontend tests you mentioned, thx ๐Ÿ’ฏ .

edit: I noticed that the previews open as expected, soon as I hit "Edit or run..", it goes back to the "Loading"-screen. Bildschirmfoto 2023-11-05 um 14 36 46

sebibek avatar Nov 05 '23 13:11 sebibek

I could only find out so much: Bildschirmfoto 2023-11-26 um 17 51 52 When the frontend opens, this is logged in the JS console, so:

            // let's say hello
            console.log("Hello?")
            const u = await send("connect", {}, connect_metadata) // HERE IS THE BUG
            console.log("Hello!")

never succeeds.

sebibek avatar Nov 26 '23 16:11 sebibek

PR Analysis

  • ๐ŸŽฏ Main theme: Updating the VSCode webview proxy and making various improvements and fixes across the codebase.
  • ๐Ÿ“ PR summary: This PR updates the VSCode webview proxy to version 0.19.32 and includes a wide range of improvements and fixes. These include refactoring and enhancing the handling of package contexts, updating registry caches, modifying compatibility entries, and improving error handling. The PR also includes changes to the frontend components and tests.
  • ๐Ÿ“Œ Type of PR: Enhancement
  • ๐Ÿงช Relevant tests added: No
  • โฑ๏ธ Estimated effort to review [1-5]: 4, because the PR includes a large number of changes across multiple files, including both backend and frontend. The changes are complex, involving updates to core functionalities and require a deep understanding of the codebase to review effectively.

PR Feedback

  • ๐Ÿ’ก General suggestions: The PR includes a wide range of improvements and fixes which are generally well-implemented. However, it would be beneficial to split such a large PR into smaller, more manageable PRs, each focusing on a specific issue or enhancement. This would make the review process more efficient and ensure each change is thoroughly reviewed. Additionally, adding relevant tests for the new changes would help ensure the stability and reliability of the code.

  • ๐Ÿค– Code feedback:
    • relevant file: src/packages/PkgCompat.jl
      suggestion: Consider adding error handling for the case when the project file does not exist in
      relevant line:

How to use

Instructions

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.
/add_docs: Generate docstring for new components introduced in the PR.
/generate_labels: Generate labels for the PR based on the PR's contents.
see the tools guide for more details.

To edit any configuration parameter from the configuration.toml, add --config_path=new_value.
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, add a /config comment.

CodiumAI-Agent avatar Dec 09 '23 07:12 CodiumAI-Agent

good news, after resetting the frontend folder by hard-copying, I managed to get Pluto to start up from a separate dev environment. notably, changes like these were needed (to Editor.js):

if (await confirm("This cell is still running - would you like to interrupt the notebook?")) {

(since create_alert_confirm in alert_confirm.js returns Promises)

also: create_vscode_connection opts to use base64_arraybuffer now:

const buffer = await base64_arraybuffer(raw.base64_encoded)

PlutoConnection.js and Editor.js were the pain points that needed manual merges. I somehow need to test if the vscode integration still works, I didn't find that out yet... edit: maybe this eases reviewing: https://github.com/fonsp/Pluto.jl/compare/main...sebibek:Pluto.jl:vscode-webview-proxy?expand=1

sebibek avatar Dec 10 '23 10:12 sebibek

For the record: I created the file use_local_pluto.txt as mentioned here and with minor modifications, I could get it to launch. Sadly, no file is opened but rather the screen stays loading, while the backend (URL) functions.

sebibek avatar Dec 10 '23 13:12 sebibek

@pankgeorg to conclude: I managed to get Pluto to work again, but I struggle testing it using the https://github.com/JuliaComputing/pluto-vscode repo. In my case, the backend URL functions perfectly fine, but in vscode it just hangs at the "Loading" page. Pls try it if you want, or close the PR! An idea for reviewing changes could be: https://github.com/fonsp/Pluto.jl/compare/main...sebibek:Pluto.jl:vscode-webview-proxy?expand=1 (maybe something is missing)

sebibek avatar Jan 13 '24 11:01 sebibek