[012.5] Elm Weekly Drip #12 and Exercise: Enhance `elm-phoenix-socket`


We cover why walking's great but the existence of legs doesn't magically make bicycles not amazing; `child->parent` communication; Porting a module to 0.17 with detailed discussion; Vega Lite, which should be great for charting from Elm but I haven't tried yet; modal dialogs; Static Type Checking; the reasoning behind the Elm Logo; and filtering on `Sub`.

Subscribe now

NOTE: There are a ton of links today, because I have a big backlog and want to get caught up without having to drop any juicy ones. Hope it's not overwhelming...actually, I hope it's kind of awesome.

We cover why walking's great but the existence of legs doesn't magically make bicycles not amazing; child->parent communication; Porting a module to 0.17 with detailed discussion; Vega Lite, which should be great for charting from Elm but I haven't tried yet; modal dialogs; Static Type Checking; the reasoning behind the Elm Logo; and filtering on Sub.

  • TypeScript is a Bicycle - This is about TypeScript, but the arguments apply equally well to Elm.
  • Child-Parent Communication in Elm - This is an oft-discussed topic that we haven't yet covered. This article shows a concrete implementation of suggestions I'd seen re: child components returning a 3-tuple for their update to solve this problem.
  • Porting a module to Elm 0.17 - @hoelzro wrote up his port of his Drag module to 0.17.
  • Introducing Vega Lite - Vega Lite is a high-level format for rapidly creating visualizations for analysis and presentation. It's a data-driven way to produce graphs, and given Vega's immutability focus it strikes me as a good candidate from bringing in visualizations for Elm applications until we have a good Elm-native solution. I learned of it in this ML post
  • Elm Dialog - A modal widget for Elm. @krisajenkins built this and it looks super nice, and since it's a thing that comes up often I thought it would be useful to share it.
  • Elm Architecture Plus Tutorial - The Elm Architecture with easy child-parent communication. Further examples of child -> parent communication in Elm, courtesy of @gyzerok
  • Debugger as a library - @szabba posted this a month ago in the Elm slack, and I saw someone report it being nice to use, but I haven't gotten a chance yet. Thought it shouldn't disappear into the ether.
  • Static Type Checking in Elm v. Java - An ML discussion comparing Elm-style type checking with what people might be familiar with from less-amazing languages.
  • The original reasoning behind the Elm logo - From evancz himself!
  • How to filter on Sub - great, but lengthy, discussion of filtering on Sub

Whew. Take a break or something, that was intense.

Exercise: Enhance elm-phoenix-socket

Alright, so this week we've added support for Phoenix Presence to the elm-phoenix-socket package, and we've added it to our application. There are a few options for this week's exercise:

  • Implement the list function from phoenix.js and send in a Pull Request to my fork's appropriate branch. We'll review these next Tuesday and talk about them, if anyone does it.
  • Fork from my fork and suggest better type structures or variable/function names. We'll talk through these as well next Tuesday.
  • Write up considerations for how we should deal with callbacks in the style of the existing phoenix.js API (see the syncState and syncDiff implementations), or if we should...I have my own opinions I'll cover on this in the 'solution' portion next week

I know we've stayed on the Elm<->Phoenix kick for quite a while, but I felt like having a concrete project to write some non-trivial code on was a Good Thing! See you soon!

Published on 06.18.2016