Closed datnamer closed 3 years ago
On the technical side, Interact is based on WebIO to actually render and serve the widgets, so the integration would have to be Genie / WebIO (the only other library Interact uses is knockoutjs to sync observables to widget values). To render WebIO nodes in the browser, normally one can use Mux.jl, which has support defined here.
Genie seems to provide features that Mux does not provide so I imagine it could make sense to add Genie integration to WebIO.
Yes, I've been thinking about the idea. And I've also had something similar in mind for many months now. I'm working on something similar, but I'm not sure I'd go this way (with WebIO and Julia Gizmos). My focus at the moment is on building something very similar to Ploty's Dash. I have most of the pieces lined up in Genie's MVC stack already.
To be honest, I also have in mind something like Dash :)
Interact* provides a set of interactive widgets and Observables
that sync the UI data with Julia data (plus support for interactive plots with PlotlyJS and latex with KaTeX)., so it already provides a good starting point in that direction. I'll soon add a UI recipe system so that each package can define simply more complex UIs without taking heavy dependencies (pretty much like Plots recipes). This I think complements quite nicely the deployment / middleware features that Genie can provide.
Are there any specific concerns with respect to WebIO?
Are there any specific concerns with respect to WebIO?
Not at all, I just have a different vision, that's all.
I want to wrap web components into Julia modules and provide a protocol for communication over websockets. Thus I'm thinking Polymer 2, probably with a dash of React on the front. This plays nicely with Genie's narrative (the existing MVC stack and assets [JS, CSS, HTML] management strategy via Webpack).
The downside is that it won't display widgets inside IDEs -- but my focus is on building data dashboards which run in their own web pages and can be hosted.
Other than that, I'd be more than happy to have Genie working with the UI system you're building. Looking at the Mux integration file it looks like what's needed is a web server with web sockets support and routing -- in which case Genie would be overkill. However, if we could use Genie's compiled view templates, or caching, or advanced routing, that'd be useful. What kind of use case do you have in mind?
The current state of the Interact project is the following: it provides a MVVM framework (based on Knockout.js, see Knockout.jl for a port to Julia, I imagine you could also use Polymer for that, not sure what are pros and cons, we could maybe play around and implement an analogous Polymer.jl package) to have a two way data binding between the UI value and a Julia Observable
. You can either choose between a set of premade widgets ro make your own. The logic is very similar to the one you're proposing: the function knockout(template, data)
takes a template that defines the UI representation and is then filled with data (a dict of observables, kept in sync between Julia an the UI). As this sounds quite similar to what you have in mind I was wondering whether you could use parts of this design for your project.
What exactly do you mean with "compiled view templates"? I tried looking here but the docstrings are missing.
In terms of deployment, I guess there are three ways one can do things in principle, as a user:
3 is the one that needs some work and where I hope Genie could help. In particular in terms of authentication and databases (caveat, I have 0 experience in backend development). I'm working on a web app for interactive data visualization and for online usage, I would imagine:
As a web naive end user, the overhead would be significantly lower for me if the web packages coalesced around common components as proposed here by @piever.
Also, Unless there are significant technical or philosophical challenges, I see only benefits from the maintenance, code reuse and community/ innovation perspectives if interact/webio et al is used.
@piever Thanks for the details, I'll take a look. Just as heads up, there's also been a lot of progress with HTTP.jl -- which provides the web server, web sockets integration and a few auth schemes. Dataset upload should be straightforward.
"Some way to prevent the app from making major damage on the server" can be quite tricky, I thought about it myself. I'm thinking something heavily inspired by JuliaBox.
@datnamer Sure, that makes sense. Can't comment more -- I'll have to dig into WebIO as I'm not familiar with the codebase.
I want to wrap web components into Julia modules and provide a protocol for communication over websockets.
This once upon a time worked. escher-jl.org :-) But from its ashes WebIO is rising as a smaller more robust design.
I remember transitioning from Polymer 0.5 to 1.0. They broke everything. Also making a web component for everything was really not worth it.
Yes, it's tricky, but Polymer and web components have come a long way. Polymer is now at v3 and there is much better support for web components.
It's not that I'm a fan of it -- but Predix-UI looks like a low hanging fruit: a large collection of powerful UI elements, distributed under permissive licensing and with an architecture which lends itself to backend integration with the current Genie stack.
My latest thoughts are to set up a custom integration for web components (Predix) and Twitter Bootstrap (for layouts) and separately support Interact.jl (which seems straightforward).
At a more philosophical level, it's good that multiple options emerge. It's a sign of a growing, healthy ecosystem which will benefit both users and developers. However it does feel like a lot of duplication - and that some of the lessons of the past are lost and the same mistakes are being made all over again. We seem to be stuck in a cycle and it's not very clear where each framework is going and when will it get there.
One of the things which excite me most about Julia is solving the web two language problem. This won't go away completely until compilation to WASM is improved, but there are really meaningful steps in the new Interact work by @piever: https://discourse.julialang.org/t/ann-interactbase-a-redesign-of-interact-to-create-and-style-web-apps-in-julia/11471/2
Have you thought about integration with Genie? Doing both UI and backend in julia would be a real advantage over say Django for data scientist types and amateur webdevs.