Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct communication link between user JS and JL with WebIO support #991

Closed
wants to merge 22 commits into from

Conversation

dralletje
Copy link
Collaborator

@dralletje dralletje commented Mar 11, 2021

Some things are still needed before merging, like writing the small HTTP-interop types for making AssetRegistry more generic.

Also, I just copied in Require to prevent a dependency, but I admit this is not the most elegant. EDIT: we decided that this is the simplest way to go

Also, tests

@fonsp
Copy link
Owner

fonsp commented Mar 11, 2021

wow!

@fonsp
Copy link
Owner

fonsp commented Mar 11, 2021

@dralletje Can you share your testing notebooks? i want to try it out

@dralletje
Copy link
Collaborator Author

Sii

@fonsp
Copy link
Owner

fonsp commented Mar 11, 2021

With an extra channel to trigger a bond update: https://github.com/fonsp/Pluto.jl/tree/webio-trigger-reactivity-api

Diff: https://github.com/fonsp/Pluto.jl/compare/webio...webio-trigger-reactivity-api?expand=1

mostly for fun, should probably not be part of this pr

Base automatically changed from master to main March 11, 2021 21:33
@fonsp
Copy link
Owner

fonsp commented Mar 11, 2021

@SimonDanisch we were stuck on this because we were having a hard time coming up with the "perfect" api to build webio support on top of. But now we decided to just support webio & assetregistry, and the api that we build that on will not be public yet, until we come up with something nice.

TLDR we are working on webio support, it will stay supported in the future, and eventually we want to also provide our own API that is more low-level and hopefully more plutonian

@dralletje
Copy link
Collaborator Author

@dralletje
Copy link
Collaborator Author

Dash but even cooler (no actual server starting, all implicitly)
https://gist.github.com/dralletje/98187e573c5de39b65757cb6a3a72d5d

@fonsp
Copy link
Owner

fonsp commented Mar 15, 2021

One thing I realised is that AssetRegistry won't work with our cool new static state export (and perhaps more that we haven't come up with yet). Right now, it's WYSIWYG, which is VERY cool, because everything goes through dralbase.

Is there a way to make webio support work through dralbase? For example, can we put the assets in the statefile and use the serviceworker to capture the requests?

@dralletje dralletje marked this pull request as ready for review March 15, 2021 14:17

"Still a bit unsure about this, but it will for now give you the (relative) path for your module requests"
function get_base_url(module_name::Union{AbstractString, Symbol})
"/integrations/$(string(module_name))/$(workspace_info.notebook_id)"
Copy link
Owner

@fonsp fonsp Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we flip these two?

/integrations/$(workspace_info.notebook_id)/$(string(module_name))

@fonsp
Copy link
Owner

fonsp commented Mar 16, 2021

What are your thoughts about tests?

@fonsp
Copy link
Owner

fonsp commented Mar 16, 2021

this is very cool!!!

@sglyon
Copy link

sglyon commented Aug 23, 2021

I didn't realize that WebIO was so ... dead :(

Perhaps it would be best for me to move PlotlyJS to something else.

I haven't heard of JSServe.jl. Is that something that we think live on?

@SimonDanisch
Copy link

SimonDanisch commented Aug 23, 2021

https://github.com/SimonDanisch/JSServe.jl
Well, as I said, I / we maintain it as part of Makie...Since Makie is doing pretty well right now, it should have pretty solid future ;)

In short, I developed it, because it was pretty impossible to write WGLMakie in a modular way based on WebIO - and things like offline support etc were also pretty impossible, and I never really liked the dom, observable + scope API, which I replaced by building upon an existing DOM abstraction, namely Hyperscript.
It was also supposed to be more lightweight, but I guess at this point it rather offers a super set of WebIO 😅

I've never really pushed it as an WebIO alternative, but now that WebIO is in a coma, it seems like a reasonable way forward...
The only problem right now is Jupyter support, which has been bit rotting away, and because of JuliaLang/IJulia.jl#1002, I haven't had a chance to fix it yet...

@empet
Copy link

empet commented Aug 23, 2021

The above issue related to IJulia with Julia 1.16+ is not real. IJulia works on both Windows 10 and Ubuntu 18.04

@SimonDanisch
Copy link

The above issue related to IJulia with Julia 1.16+ is not real. I

lol, tell that both my Windows computers...

@pfitzseb
Copy link

I'd love JSServe as a WebIO alternative, FWIW. :)

@empet
Copy link

empet commented Aug 23, 2021

On my own it works :)

@dralletje
Copy link
Collaborator Author

@SimonDanisch you happen to remember what we came up with? I vague recall JSServe not having the same kind of hook-able-ness that WebIO provides, but that might be better now? I'd still love to ship JSServe compatibility with this PR

@SimonDanisch
Copy link

I vague recall JSServe not having the same kind of hook-able-ness that WebIO provides, but that might be better now?

Not sure, i thought it was the other way around :D @fonsp and I took another look some time ago, and it looked like we could get things ready with a few lines of code ^^ But it's all a bit fuzzy

@twavv
Copy link

twavv commented Sep 13, 2021

Hewwo, WebIO isn't dead, but could do with some more maintainers besides just me.

At the very least, I've updated WebIO for compat with Observables 0.4.

@diegozea
Copy link
Contributor

Hi! Nice to hear that WebIO isn't dead :) What is the state of this PR? Best,

@dralletje
Copy link
Collaborator Author

We're creating a system for creating longer lived cells that have state now.. will update this PR when that comes out (@Pangoraw is working on it so expect it soon 😏)

@sashmit
Copy link

sashmit commented Dec 23, 2021

TableView.jl works! @pfitzseb @pankgeorg

https://gist.github.com/fonsp/9e4f5b0052e959427d9575cea049dd1d

Schermopname.2021-03-16.om.12.02.52.mov

This tableview example (and indeed a lot of webio packages) don't seem to be working still.

@dralletje
Copy link
Collaborator Author

@sashmit Are you testing against this PR? This indeed isn't in Pluto still.

@sashmit
Copy link

sashmit commented Dec 23, 2021

@sashmit Are you testing against this PR? This indeed isn't in Pluto still.

doh! I tried the webio branch, and it worked there. FYI, the version of webio can be bumped up one reevision here:
https://github.com/fonsp/Pluto.jl/pull/991/files#diff-7b616cf57a0d73b7dd6d3357b38ec19ded099ea2ab755bee15c006f3087c9c8dR28

@fonsp fonsp changed the title WebIO support (and opening up for more third party stuff) Direct communication link between user JS and JL (and maybe WebIO support) Jun 15, 2022
@fonsp fonsp marked this pull request as draft June 15, 2022 16:27
@fonsp fonsp changed the title Direct communication link between user JS and JL (and maybe WebIO support) Direct communication link between user JS and JL Nov 24, 2022
@fonsp fonsp changed the title Direct communication link between user JS and JL Direct communication link between user JS and JL with WebIO support Nov 24, 2022
@fonsp
Copy link
Owner

fonsp commented Nov 24, 2022

Superseded by #2392

@fonsp fonsp closed this Nov 24, 2022
@fonsp fonsp added enhancement New feature or request frontend Concerning the HTML editor other packages Integration with other Julia packages display & PlutoRunner & AbstractPlutoDingetjes.jl publishing Notebooks as static documents on the web labels Oct 30, 2023
@fonsp
Copy link
Owner

fonsp commented Nov 21, 2023

Replaced by #2726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display & PlutoRunner & AbstractPlutoDingetjes.jl enhancement New feature or request frontend Concerning the HTML editor other packages Integration with other Julia packages publishing Notebooks as static documents on the web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebIO & PlotlyJS support?