Weird thing: my Firefox is pumping memory if I leave the Live Dashboard open:
Do you recall what those other priorities were?
I don’t believe he specified.
Will the advent of LiveDashboard make Prometheus integration obsolete?
No, the dashboard is good to see what’s going on right now, but it has no persistence. You’d still want to hook a real metrics system eventually that can keep history beyond node restarts.
Cool, I wasn’t aware of that. I guess they can serve complementary roles then.
There are no updates on the upload front but LV 0.12.0 adds phx-trigger-action, which allows you to submit the form to an URL at any given moment. So you can still use LiveView to provide validation and what not and then submit the form to a controller that does the upload for you. phx-trigger-action is also useful when you need to set the session or cookies, like login pages.
Which page are you on? The charts page? If ti is the charts page, it is because the charts accumulate data forever. We probably want to find a way to prune it. Please confirm.
It’s on the metrics page
Thank you sir @josevalim for the tips! will try that one!
Wow, GREAT JOB ! thank you guys so much !
I just wanted to say the request logger in the dash is bad ass!!! Thank you!
Is there anyway to use LiveView without Webpack/NPM?
I haven’t tried this yet but I’m pretty sure you can copy the minified JS from Github into your
/priv/static/js then use
<script> tags in your layout like this:
<script src="<%= Routes.static_path(@conn, "/js/phoenix-v1.5.0-rc.0.js") %>"></script> <script src="<%= Routes.static_path(@conn, "/js/phoenix_live_view-v0.12.1.js") %>"></script> <script src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
The new LiveDashboard is awesome, I found the Request Logger an excellent help to debug the application.
Is there a way to exclude the LiveDashboard from reloads by the LiveReload?
My use case is the following: I have 2 browser tabs open, one with my app, the other one with the LiveDashboard. I enable the cookie parameter on the Request Logger, so the requests appear live. Then I change my app, say, the layout or a template, so LiveReload kicks in, reloads my app, which is fine, but at this point I expected the Request Logger show the new logs.
Instead, the whole LiveDashboard is reloaded, so I have to enable the cookie again. If we could make the Dashboard opt-out of live reload somehow, the workflow would so much better.
You can conditionally call the plug
if code_reloading? do socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket - plug Phoenix.LiveReloader + plug :live_reloader, exclude: ["/dashboard"] plug Phoenix.CodeReloader plug Phoenix.Ecto.CheckRepoStatus, otp_app: :drive_in end + defp live_reloader(conn, exclude: excludes) do + if conn.path_info in excludes do + conn + else + Phoenix.LiveReloader.call(conn, Phoenix.LiveReloader.init()) + end + end
Thanks Chris! This worked fine. For the record, I changed it a bit to:
if code_reloading? do socket("/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket) plug :live_reloader, exclude: "dashboard" plug(Phoenix.CodeReloader) end defp live_reloader(conn, exclude: exclude) do if exclude in conn.path_info do conn else Phoenix.LiveReloader.call(conn, Phoenix.LiveReloader.init()) end end
You will need to acquire the js libs for phoenix and manager the resources your self like you would back in the day. As far as I know there is no dependency on Webpack or Npm as Webpack is just a packager and Npm is just a package look up tool.
Though to be honest if you didn’t already know this, then you probably would greatly benefit from the services of both. That said I still have rage fits with Webpack even after using it for almost 3 years. Don’t get me started on tree shaking in production!
Reviewing a newly generated app using the --live option I noticed there is a few small changes to the layouts.
Mostly the addition of the
put_root_layout helper in the router and the new template/layouts.
As noted before I see that the
put_root_layout is calling on the
root.html.leex layout and the
live_view macro is calling on the
That said I can’t seem to find anywhere that is calling on the
app.html.eex is that to say its an orphaned file produced by the generator? Is it assumed to be used at some later point?
I think the news about 1.5.0 has been missed by the fact this pin still says 1.5.0-rc0. Maybe update the title?