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:

Where Next?

Popular Pragmatic Bookshelf topics Top

GilWright
Working through the steps (checking that the Info,plist matches exactly), run the demo game and what appears is grey but does not fill th...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
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
dtonhofer
@parrt In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
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
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
New

Sub Categories: