Phoenix v1.5.0 released!

If you want to submit a PR that adds this feature directly to Phoenix.LiveReloader, we will gladly accept it. Although it probably needs to be made a bit more general:

plug Phoenix.LiveReloader, exclude: ["/dashboard", "/foo/bar"]
6 Likes

The app is used by non-live routes.

Ah my bad, didn’t realize it was a default. I assumed I would see a config that states that somewhere and was surprised to not find it.

I was mainly asking because when I tried the —live generator it wouldn’t work with the flag for no webpack.

I would assume it’s because the generator is not setup to produce the correct code to include the missing packages and its assumed you will be doing it yourself since its not the default.

I just visited the Phoenix Framework website. I really like the new design :+1:

9 Likes

I’m trying to create a new Phoenix app, but I’m not lucky with the “npm install” step:

npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.12: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

> node-sass@4.14.0 install /usr/src/hello/assets/node_modules/node-sass
> node scripts/install.js

internal/modules/cjs/loader.js:983
  throw err;
  ^

Error: Cannot find module '../lib/extensions'
Require stack:
- /usr/src/hello/assets/node_modules/node-sass/scripts/install.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/usr/src/hello/assets/node_modules/node-sass/scripts/install.js:9:10)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/src/hello/assets/node_modules/node-sass/scripts/install.js' ]
}

What should i do? :confused:

/edit: nevermind, worked now after using node 10 instead of 12

Is there any way to get HTTP requests over time stats? on Phoenix Live Dashboard?

I want to get stats of my application, how many POST request have been being made. to a specific Address over time.

LiveDashboard is (at least at the moment) live. If you need aggregation over time you’ll need to look at persisting the metrics to postgres or via statsd to a more dedicated db. Luckily with telemetry it should be simple to use the same set of events for both usecases.

1 Like

Great news. Our dear authors, please update your books!

then question falls on:
how to add http request stats to Telemetry and then to dashboard to show it?

Oh, my point was intended for something different. You can use telemetry’s data to be put into a metrics db and something like grafana to read it from there. For historical data it’s not just about showing a graph, but also a lot about querying/joining data, which are things LiveDashboard doesn’t do right now. I’m not sure how much of this might be planed though.

2 Likes

Very Good, thank you.
What is the link for 1.4 to 1.5 upgrade guide?

Maybe this…

3 Likes

if anyone has done an upgrade from 1.4.x to 1.5 and is able to use the new phx.gen.live functionality I’d love to read what you had to do. From what I understand (https://github.com/phoenixframework/phoenix/issues/3774) the generator uses functions that are created by having the --live option passed to phx.new.

I’m about to start down the pathway of diffing, or maybe just migrating over some of what I have since this particular app isn’t that big but already has some prototyping cruft. If anyone has already done it and wants to save me and others some time, please share :slight_smile:

In addition to the upgrade gist you may want to look at phoenix diff:

https://www.phoenixdiff.org/?source=1.4.16&target=1.5.1

6 Likes

It would be super awesome if someone contributed a feature that allowed you to optionally pass the --live flag to a given version on phoenixdiff.org.

6 Likes

This code

<!-- View Specific Javascript -->
<%= render_existing @view_module, "_javascript.html", assigns %>

Use to work in my layouts for doing view specific javascript.
What is the recommended way to do that now with the new @inner_content?

1 Like

You can use view_module(conn) and view_template(conn) to access these values from the template.

2 Likes