Recent dev notes
When there are no tests in your fav open-source project... 😱
I'm working on making some upgrades to Paul Bratslavsky's strapi-community-astro-loader and was looking to add some testing. Why? Because I'm not a savage.
Testing an Astro loader properly requires some mocking/spying of Astro's content layer. I started looking around to see if there was already best practices around testing loaders. There has to be, right? I mean, devs would never release a community library to integrate Astro and not have tests around it. That kind of library would never become popular.
(This is written word, but I'm sure you can still hear the sarcasm.)
The search inevitably led to disappointing results. Browsing through Astro's list of community loaders turned up a whole bunch of src
directories, but very few test
directories.
There are two collections of loaders - from ascorbic and lin-stephanie - that seem to make up the bulk of the popular loaders. Neither are tested.1
Same for some other loaders I randomly clicked on (astro-obsidian-loader and github-discussions-blog-loader).
I'm not trying to shame these authors. They're strapped for time and most likely doing this work in their free time. Of course they moved fast and skipped the testing.
The story isn't a story about these individual developers but about the lack of resources in open source. Sporadically, I stumble across something like this and can't help but marvel at an industry that is built upon creating valuable products with underfunded open-source tools and frameworks. And somehow it "works." 🤷
A RSC demo app
I stumbled across Jürgen Leschner's RSC demo app. He's using it to demo RSC specifically in RedwoodSDK, but I love the concept of doing this for every framework's RSC implementation. RSC requires a bit of a mental model shift so seeing this laid out like this via examples is helpful, especially since the time-based examples illustrate when things are calculated.
In progress
- Open PR to strengthen the Astro integration for strapi-community-astro-loader.
- Working on moving this blog to a CMS (Strapi to be specific).
Footnotes
-
@ascorbic/airtable-loader
does have a single test suite, but it tests the Airtable schema mapping, not the loader itself. ↩