fonsp / Pluto.jl

๐ŸŽˆ Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.94k stars 285 forks source link

Update VSCode webview proxy #2685

Open sebibek opened 10 months ago

sebibek commented 10 months ago

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

github-actions[bot] commented 10 months ago

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
sebibek commented 10 months ago

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!

fonsp commented 10 months ago

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?

sebibek commented 10 months ago

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 commented 9 months ago

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.

CodiumAI-Agent commented 9 months ago

PR Analysis

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 \**: 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](https://github.com/Codium-ai/pr-agent/blob/main/docs/TOOLS_GUIDE.md) for more details. >To edit any configuration parameter from the [configuration.toml](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/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.
sebibek commented 9 months ago

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 commented 9 months ago

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 commented 8 months ago

@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)