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 Prag Prog topics Top

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
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
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
alanq
This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_ST...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
New
Henrai
Hi, I’m working on the Chapter 8 of the book. After I add add the point_offset, I’m still able to see acne: In the image above, I re...
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

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. http://f...
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
AstonJ
Chris Seaton, the creator of TruffleRuby has died. It appears from suicide :cry: He left this note on Twitter on the weekend: And one...
New

Latest in PragProg

View all threads ❯