GithubHelp home page GithubHelp logo

Comments (10)

waralex avatar waralex commented on August 25, 2024 1

Hi
What you are now seeing in the master is basically my Dashboards.jl package that provided only basic Dash functionality. Now there is a lot of work on bringing its functionality to the level of Dash in the dev branch.
For example, right now I'm working on the hot reload. But in addition to it, there are many other things that are in Dash that are not yet in Dash.jl. Please be patient, we will definitely bring Dash.jl to the level of other products from the PlotlyDash ecosystem.

from dash.jl.

waralex avatar waralex commented on August 25, 2024 1

@00krishna dev is already very different from master

from dash.jl.

00krishna avatar 00krishna commented on August 25, 2024

Thanks @waralex I totally understand. I am new to even python Dash, so I have a parallel process of pushing my julia code through pyjulia and using python Dash, versus native Julia dash. So that is cool. I will keep playing around with the Julia dash, just to see how it is working. Let me know if I can be of any assistance.

from dash.jl.

rpkyle avatar rpkyle commented on August 25, 2024

Dash for Python's "hot-reloading" feature is described in plotly/dash#66, plotly/dash#362, and plotly/dash-renderer#73.

Supporting this as in the Python and R implementations would require

  • creating a hash at app initialization, and regenerating it on file change
  • adding a route to serve the hash
  • front-end hot reloading (including ability to refresh layout only when CSS updates occur, as well as formatting the JSON response with a modified file manifest)
  • back-end hot reloading (reload the app, restart HTTP.jl)
  • adding parameters for the dev tools UI: dev_tools_hot_reload, dev_tools_hot_reload_interval, dev_tools_hot_reload_watch_interval, dev_tools_silence_routes_logging
  • integration tests for "hard" (restart backend app, reload frontend) and "soft" (CSS only = layout refresh) reloading as in Python and R

On the Python side, we use the Flask debug reloader to reset the hash. We would need to find a comparable approach using HTTP.jl instead.

from dash.jl.

00krishna avatar 00krishna commented on August 25, 2024

@waralex Alexandr, so should the hot-reload feature work now? Seems to indicate that the PR was merged.

from dash.jl.

waralex avatar waralex commented on August 25, 2024

@00krishna Yes, it works in dev branch.

from dash.jl.

00krishna avatar 00krishna commented on August 25, 2024

Oh excellent. Nice to know. I can give it a try. If I have any issues, I can always flip back to master branch.

from dash.jl.

MLackner avatar MLackner commented on August 25, 2024

Maybe this is a stupid question, but how does the hot reloading work practically?
I'm on dev branch and I have my app defined as a module like this:

module MyApp

using Dash
using DashHtmlComponents
using DashCoreComponents

app = dash(external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"])

app.layout = html_div() do
    dcc_input(id = "my-id", value="initial value", type = "text"),
    html_div(id = "my-div")        
end

callback!(app, Output("my-div", "children"), Input("my-id", "value")) do input_value
    "You've entered $(input_value)"
end

end

I tried the following:

(1.3) pkg> activate .
Activating environment at `~/Documents/Julia/MyApp/Project.toml`
julia> using Revise
julia> using MyApp
julia> run_server(MyApp.app, "127.0.0.1", 8080; debug=true)
┌ Warning: Hot reloading is disabled for interactive sessions. Please run your app using julia from the command line to take advantage of this feature.
└ @ Dash ~/.julia/packages/Dash/b6VP7/src/Dash.jl:142
[ Info: Running on http://127.0.0.1:8080

So I put the above code in a file called runserver.jl and from the command line I did

julia --startup-file=no runserver.jl

where I get the following output:

Activating environment at `~/Documents/Julia/MyApp/Project.toml`
Activating environment at `~/Documents/Julia/MyApp/Project.toml`
[ Info: Running on http://127.0.0.1:8080

If I now change the code in my module nothing happens, even if I refresh the page in my browser.
It would be awesome if you guys could give me a hint.

from dash.jl.

waralex avatar waralex commented on August 25, 2024

Hi @MLackner
Yes, this may be my mistake - autoreload will not work in this form. Autoreload monitors the executed file and all files included in it (recursively) via include. However, it does not track changes in external packages connected via using or import. If you change runserver.jl, then a restart should occur

from dash.jl.

rpkyle avatar rpkyle commented on August 25, 2024

This feature was added in #25, and is available now in the version released to the Julia Registry. Closing this issue as resolved.

from dash.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.