zagoli

zagoli

Programming Phoenix LiveView: All the errata I found

Hi, I just finished reading Programming Phoenix LiveView B10 PDF edition.
I found some typos and errata, and I will report them all in this post.
Note that when I refer to a page number, I’m referring to the PDF page number, and not the number present on the book.

PAGES WHERE THERE IS SOME CODE WITHOUT THE USUAL HEADER (file name with a link)
189, 190, 200, 204, 206, 211, 227, 271, 317, 357, 368, 376, 377, 381, 384, 393, 394 and in almost all the paragraphs relating to tests.

TYPOS

  • Page 90: replace updated_at with :updated_at
  • Page 92: the sentence “[…] and the sku to be unique” does not end with a full stop
  • Page 117: replace “once LiveVie” with “once LiveView”
  • Page 155: replace “on longer” with “no longer”
  • Page 172: params_with_image is not highlighted
  • Page 260: replace “dataset for our chat” with “dataset for our chart”
  • Page 285: replace “let’s you render” with “lets you render”
  • Page 376: replace “rastor graphics” with “raster graphics”

OTHER ERRATA

  • Page 120: header/0 should be header/1
  • Page 153: says to try the code written so far but it won’t compile because the form is not assigned in the mount method
  • Page 170: there is a missing <% end %> in the code
  • Page 194: queries other than base should be removed because they will be added later
  • Page 195: you don’t use preload/2 in with_user_ratings but in the other function. The book does not even explain what it means to preload something in a query
  • Page 210: use Phoenix.HTML is no longer supported, use should add it to mix.deps and import it
  • Page 230: there is no handler for the validate event
  • Page 235: remove the call to rating live show
  • Page 258: assign_products_with_average_rating/2 should be assign_products_with_average_rating/1
  • In the chart template section, there is the code for the gender filter, but it won’t compile because all the other code should be implemented by the user in the exercises, remove it
  • Page 306: the mentioned code is swapped with the code at the next page
  • Page 316: remove :register_and_log_in_user from the setup
  • Page 314: in create_user_attrs and create_user2_attrs the education field is missing; it should be there if the user followed the exercises.
  • Page 322: code is not matching description
  • Page 326: URL should be /admin/dashboard
  • Page 322: HTML tag is not title but text so the assert condition should be changed
  • Page 334: URL should be /admin/dashboard
  • Page 363: alias of Shape is missing
  • Page 375: the subdirectory should not be called pento but game_live
  • Page 381: code does not compile because GameLive.Colors is not yet defined, so you should not tell the reader to try it
  • Page 381: svg attribute should be viewBox instead of view_box
  • Page 383: no need to create another file called component.ex, we already did that
  • Page 388: factors are 4 and 5, not 3 and 4
  • Page 386: code has no header, and it should be called palette instead of draw
  • Page 394: the code should call Board.to_shapes instead of Board.to_shape and should not encapsulate the result in another list
  • Page 397: function should not be called draw and does not render inner_block correctly
  • Page 398: function should not be called draw
  • Page 398: No braces encapsulating rotate in the code because it is svg function
  • Page 398: The function is not triangle/1 but triangle/4
  • Page 398: attribute fill cannot be equal to the color of shape because there is no shape here
  • Page 411: setting a flash inside a live_component does not work! (Phoenix.LiveView — Phoenix LiveView v0.20.14)
  • Page 415: Code does not work until now because it does not call Board.puzzles()
  • Page 412: the icon component should be called with class="mini' instead of adding mini directly as a class

OTHER SUGGESTIONS

  • Provide solutions to exercises! They are very, very, very useful.
  • Do not give an exercise about creating an Ecto migration before explaining what migrations are at page 133
  • Explain in more detail the difference between Conn.struct and socket
  • Show how to create and authenticate administrators, it’s a common task for which it is useful to have a good practice (or an example at least)
  • At page 329, explain what are the “some params” you mention
  • At page 415 the capture syntax is explained but it’s used in the book before

These are a lot of errata! I hope you will fix them before the “stable” release of the book.

Cheers
Jacopo

First Post!

SophieDeBenedetto

SophieDeBenedetto

Author of Programming Phoenix LiveView

Hi and thanks so much for your feedback!

  • Not all code samples will have the “usual” header. It comes down to some formatting functionality in the publishing software. Where we reference more complex code in it’s “final” form from the codebase that is committed and available for download, you’ll see the header. Where we embed code directly in the prose, you won’t. If there isn’t a header, the surrounding prose text should make it clear what file you are looking at.
  • I’ve done my best to review the errata you submitted, and addressed most of it.

As a general practice, PragProg authors don’t provide solutions to exercises, which is often down to time and resourcing constraints. As you can imagine, we have our hands pretty full writing and providing complete code for such a lengthy book, even as we continue to work hard to keep versions up to date as LiveView has evolved in recent years! We very much encourage readers to share their solutions here though :slight_smile:

Some of the things we don’t explicitly explain in the book–like the capture syntax, or query preloading–we choose not to explain in the interests of time and space and to keep the focus on the complexities of LiveView. Some prior knowledge of Elixir (and things like Ecto) is assumed.

Thanks so much again for your feedback!

Where Next?

Popular Pragmatic Bookshelf topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
Alexandr
Hi everyone! There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
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
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
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
davetron5000
Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
New

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
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
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1143 25883 760
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File &gt; New Rule: And select Deny, O...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
Fl4m3Ph03n1x
Background Lately I am in a quest to find a good quality TTS ai generation tool to run locally in order to create audio for some videos I...
New

Sub Categories: