Weeknotes 2021 WK 28

We saw my wife’s parents for the first time in 15months this week. It was really great. Somewhat surreal.

At the same time, we’re busy hiding from the masses as the next wave builds. I see many people not wearing masks. I do wonder about that.


Continuing with Alpine.js

Digging deeper into Alpine.js. I'm still having a lot of fun. There’s a sweet-spot very close to what Alpine offers for the 80% case.

A couple of thoughts:

  • When using x-formake sure to provide the :key argument. I won’t go into exactly why I bother mentioning that but, providing it avoids much head-scratching. 🥳
  • Alpine’s Reactivity is super. You update the component x-data, and it handles the re-render automatically for you. This works for nested structures to at least a moderate level of complexity — maybe beyond, but I can’t say for sure.

    This Reactivity is reminiscent of the kind of unidirectional data flow made popular by The Elm Architecture, and others since. It simplifies state handling: you update the data store and the UI is handled automatically, against having to go through each part of your UI making sure that was correctly updated too.

    The interesting topic, for me here, is how far to push Alpine before it makes sense to make the jump to something more fully featured, which for me would be Elm.

    There’s certainly a Full Components approach that’s explicitly out-of-scope for Alpine. I’ve found it to work well enough for a moderately complex tree-like data structure. That, though, was on the cusp. Complex data structure operations are going to be much nicer in Elm’s functional approach, vs raw JS. There won’t be doubts about whether this is too complex or not. Nonetheless, I’ve been pleased that Alpine has gone with me everywhere I’ve tried to push it so far, with very little code for that too.

    I'm still learning.

Django bits from the week

  • Began working on the next update for django-filter. Nothing major, but a little backlog to work through.
  • Progress helping Anna update the Django Girls site. The essence of it is that it’s not been updated in a while, so there’s a cascade of issues on changing something. Next up is the JS build parts. 🤨 We’ll likely have it under control by the end of the Summer.
  • We’re midway through GSoC. Both the projects, on migrations and the Redis cache backend, are going well at this stage.
  • There’s some nice work going on Django. Both Forms and the DTL are getting some love. Various cleanups to the Forms API are in the works, and there’s a suggestion for a decent optimisation to template parsing performance. Neither perhaps seem like much, but they’re the kind of improvement that adds up, and keeps Django relevant in the long-haul. So, I was pleased to see them come in.