herminiotorres

herminiotorres

Programming Phoenix LiveView: Typo

Hi! I know not the intentions behind this narrative when called, on page XI:

mount() |> handle_event() |> render()

but the correct flow, it’s:

mount() |> render()  |> handle_event() |> render()

On page XII, it’s missing the content about chapter 1.

Marked As Solved

SophieDeBenedetto

SophieDeBenedetto

Author of Programming Phoenix LiveView

Thank you so much for helping by pointing these out! You’ll find most of the fixes applied in an upcoming Beta release. Not the next release, but probably the one after that :smiley:

Also Liked

froucoux

froucoux

On page 22 : Finally, we return a tuple in the shape that LiveView expects—{:ok, socket}

Shouldn’t it be: {:noreply, socket} ?

cro

cro

Thanks for the pointer. I had to manually update the dependency versions in mix.exs, mix hex.outdated gave me what I pasted below. After I did that and ran mix deps.update --all it cleared up.

$ mix hex.outdated
Dependency              Current  Latest  Update possible
ecto_sql                3.5.4    3.5.4
floki                   0.30.0   0.30.0
gettext                 0.18.2   0.18.2
jason                   1.2.2    1.2.2
phoenix                 1.5.8    1.5.8
phoenix_ecto            4.2.1    4.2.1
phoenix_html            2.14.3   2.14.3
phoenix_live_dashboard  0.2.0    0.4.0   No
phoenix_live_reload     1.3.0    1.3.0
phoenix_live_view       0.12.1   0.15.4  No
plug_cowboy             2.4.1    2.4.1
postgrex                0.15.8   0.15.8
telemetry_metrics       0.4.2    0.6.0   No
telemetry_poller        0.5.1    0.5.1
SophieDeBenedetto

SophieDeBenedetto

Author of Programming Phoenix LiveView

Hi there! Thanks for you feedback and questions :slight_smile:

  • p.75, Ch 1, §“Handle Events”: “Finally, we return a tuple in the shape that LiveView expects—{:ok, socket}.” For handle_event I think the tuple has to be {:no_reply, socket} or {:reply, socket}?

You are correct! You’ll find this updated in the next Beta release :cupcake:

  • p.98, P 1 Ch 2, §“Reducers in Plug”: The second representation of the pipeline using pipe operators still has plug in the last three lines, but I think shouldn’t?

Yes I think this example will be more clear with the change you are suggesting. You’ll find it in the next release!

p.71, Ch 1, § “Render the Live View”: Just wondering, since the links you’re rendering go nowhere, if the semantics here aren’t better represented by <buttons> ? And similarly the <h2> tag could be replaced by an ordered list?

Great suggestions and I think if I was building a “real” game, cleaning up the code in that way would be the way to go. But the current approach will suffice for this example :slight_smile:

Popular Pragmatic Bookshelf topics Top

kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
New
johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=&gt; (create-...
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
New
a.zampa
@mfazio23 I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
A Hero’s Journey with Chris Pine @chrispine Chris Pine, author of Learn to Program, Third Edition, discusses his journey to beco...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New