Code Monkey home page Code Monkey logo

Comments (8)

jpsamaroo avatar jpsamaroo commented on July 22, 2024 1

Built-time or runtime, I'd like to avoid both. This package has generally been quite small, simple, and pure Julia (as far as I can tell anyway), and it would be nice to keep it that way.

Of course, I'll defer to Shashi on the final decision, but I wanted to make my preferences known.

from mux.jl.

twavv avatar twavv commented on July 22, 2024 1

Whoops I didn't quite finish my comment.

It wouldn't be a runtime dependency but rather a build-time one. You'd probably need Webpack unless you want to use modules: https://caniuse.com/#search=modules.

So I think using the generic http provider would be good™ because it should be able to avoid all of that and leave the messy JS management to the WebIO repo.

I don't really want to make the PR but I might get to it eventually (I'd be very happy to consult/answer questions though!). It's fairly low-priority for me right now because it works, but when we go to release WebIO 1.0 we'll want to do this because it'll allow us to clean up a lot of API concerning registering things as renderable in Mux.

from mux.jl.

shashi avatar shashi commented on July 22, 2024 1

Yeah we definitely shouldn't install NodeJS or typescript compiler to allow people to install Mux. :-)

from mux.jl.

jpsamaroo avatar jpsamaroo commented on July 22, 2024

Can you give a brief overview of what functionality needs adding to Mux? Will we need to add new dependencies to make this work? And will it be generic enough that other packages can make use of the new functionality?

from mux.jl.

twavv avatar twavv commented on July 22, 2024

This is currently what we do to make it work: https://github.com/JuliaGizmos/WebIO.jl/blob/master/src/providers/mux.jl

Here's a PR where I moved the integration into Blink: https://github.com/JuliaGizmos/Blink.jl/pull/201/files

So, roughly,

  • Define a connection type that extends WebIO.AbstractConnection
  • Make sure Mux.Response works for WebIO nodes.

The last point is kind of tricky because ideally you'd want arbitrary things that are WebIO-renderable to just work without defining additional methods.

Response(o) = HTTP.Response(stringmime(MIME"text/html"(), o))

The issue is that we don't want HTML strings to be processed via WebIO, so maybe that would become something like...

Response(s::AbstractString) = HTTP.Response(s)
Response(x) = HTTP.Response("""
<html>
<head>
<script src=...>
</head>
<body>
$(stringmime(MIME("text/html"), WebIO.render(x)))
</body>
</html>
""")

Ping @shashi

from mux.jl.

twavv avatar twavv commented on July 22, 2024

We'd also have to move the JS stuff into Mux. Or just make it work via the existing generic-http-provider which will stay in WebIO (this means you won't have to deal with managing JS bundles in this repo which is a pain).

from mux.jl.

jpsamaroo avatar jpsamaroo commented on July 22, 2024

I would personally prefer if this package doesn't accrue external dependencies like node.js, but if it's just a small bit of plain JS and glue code to make interop less cumbersome, then I won't object.

Would you be willing to make the PR?

from mux.jl.

twavv avatar twavv commented on July 22, 2024

It wouldn't be a runtime dependency but rather a build-time one. You'd probably need Webpack unless you want to use modules: https://caniuse.com/#search=modules.

from mux.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.