Phoenix v1.5.0 released!

Note you will have to import view_template: 1 in your my_app_web.ex file under the def view section.

2 Likes

Super great, without your suggested this site, the migrate guide hardly work.

Here is a list of trick I encountered:

  • install 1.5.1 instead of 1.5.0 in gist
  • donā€™t change fetch_live_fresh to fetch_fresh
  • font size really small now
  • dashboard not working

After I changed to

<%= @inner_content %>

giving this error:

assign @page_index not available in eex template.

How to pass those assign now?

Thats interesting.
I can see from reviewing

@spec view_module(Plug.Conn.t) :: atom
def view_module(conn) do
  conn.private.phoenix_view
end

that view_module is already looking at the connā€™s private to get at the same value I was pattern matching on. So how is it there is not a conflict with the assigns value of @view_module I would have assumed thats where the assigns got its value from in the first place?

Also how do you feel about the naming now that view_module(conn) returns a different value than of the assigns @view_module ? Not that its a big deal, but the naming kind of tickles my OCD.

I have deprecated @view_module in master, exactly because of this reason, so your OCD can thank me once v1.6 is out. :slight_smile:

7 Likes

Is there any way possible

summary(ā€œhttp.request.stop.durationā€, unit: {:native, :millisecond})

to get more stats like this? or where I can read more of http events to summarize in live dashboard?
such as

http.request.stop.duration

http.request.post.time???

Hey,
The LiveDashboard is very awesome, it makes me add more instrumentation to the code. Thank you guys!

I was wondering if there is a way to configure the socket path for live_dashboard?

It is supported on the dashboard master. It can be done by passing :live_socket_path to the live_dashboard router call.

3 Likes

Thanks for adding it, Jose!

Hi @chrismccord, congrats on the new release! :slightly_smiling_face:

Just noticed today after upgrading to 1.5 that the new generators will have a mix setup task.
At least, according to PhoenixDiff, it seems that wayā€¦
I left a note in the guideā€™s gist because npm install --prefix assets doesnā€™t seem to work properly on Windows.

I know you are already aware of this issue because of this comment. So, I wanted to ask if thereā€™s anything that can be done besides running it manually and if not, could we at least document it in the generated projectā€™s README? I think requiring mix setup to be run could be misleading in that case.

PS.: Iā€™ve tested with both Node LTS and current, it simply doesnā€™t work.

Also thanks @axelson for the phoenix diff tip :smile:.

1 Like

Does changing your setup alias to the following work for you?

      setup: ["deps.get", "cmd 'cd assets && npm install'"],

if so maybe that should be the default.

@wojtekmach This is valid CMD but does not work in Powershell (only in newer versions that does not ship with Windows 10 by default). Check this for a better explanation.

Iā€™ve also tested using setup: ["deps.get", "cmd cd assets", "cmd npm install"] but it freezes my terminal every single time for some reason.

Are you aware of a one-liner that would npm install in a portable way across OSes?

Iā€™ve also tested using setup: ["deps.get", "cmd cd assets", "cmd npm install"]

I believe each command is running in subshell so the directory change doesnā€™t persist.

Iā€™m researching what are the options. Iā€™ve tested

Interestingly enough, since the npm repository was moved to GitHub - npm/cli: the package manager for JavaScript; thereā€™s no trace of this problem being discussed, even though the old archived repository has open issues about that :man_shrugging:. Iā€™m not sure wether this is a regression or if it was even fixed at some point.

Iā€™ve got a problem creating a release using Docker, maybe someone can help?
Iā€™m using the Dockerfile from https://hexdocs.pm/phoenix/releases.html#containers
Everything seems fine until it fails short time before finish with following message:

Step 23/26 : COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/my_app ./
COPY failed: stat /var/lib/docker/overlay2/eb170e088a8c087d23f677f13e3f832062014759af8564efe30c4292656da00a/merged/app/_build/prod/rel/my_app: no such file or directory

You probably need to change the name of the file to match the name of your release in that line.

1 Like

Oh man, thx :smiley:
Of course, how could Iā€™ve been so blind, that happens when doing things late at night :smiley:
Working now :stuck_out_tongue:

/edit:
Works fine on Linux, however on Windows I run into the same issue as others here:

Step 14/26 : RUN npm run --prefix ./assets deploy
 ---> Running in 866f8ef90270

> @ deploy /app/assets
> webpack --mode production

/app/assets/node_modules/.bin/webpack: line 1: XSym: not found
/app/assets/node_modules/.bin/webpack: line 2: 0025: not found
/app/assets/node_modules/.bin/webpack: line 3: 04ec15c01fc3c268b6405aedcd29653e: not found
/app/assets/node_modules/.bin/webpack: line 4: ../webpack/bin/webpack.js: not found

npm run --prefix assets does not work on Windows. If you do something like cd assets && npm run deploy then it should be good to go.

1 Like

Thanks for the reply. Iā€™ve tried this already as Iā€™ve seen this suggestion somewhere else, but it does not seem to work for me, the result is the same.
However, itā€™s not critical for me as Iā€™m working mainly with Linux, itā€™s just a bit sad :wink:

Thanks for all your work :+1:t3:

The main problem I see is this being released in the default generators for Phoenix 1.5; despite signaling otherwise. Right now, following the README to setup a brand new project on Windows just fails and could lead someone in a trail to Stack Overflow questions and undocumented NPM behaviors (Also, as I said before, thereā€™s no track of this issue in the new NPM repository).

Could someone say something about the reasoning behind that? Motivations, what changed, etc?
Also, is there anything that can be done to ease the experience with Phoenix 1.5 for Windows users?