Week 21, year 2024
- Using markup for fallbacks when fetching data - Juntao Qiu's next data fetching pattern looks at how to specify fallback behavior using markup. This allows developers to pull such declarations out of the JavaScript components and into the markup they use while laying out the rest of the page. Juntao's React example shows how this works with the Suspense element, with a similar approach in vue.js. [Martin Fowler]
- Test-Driving HTML Templates - When building a server-side rendered web application, it's valuable to test the HTML that's generated through templates. While these can be tested through end-to-end tests running in the browser, such tests are slow and more work to maintain than unit tests. My colleagueMatteo Vaccari has written an article on how to use TDD to test drive these templates using xunit-style tools which can be run easily from the command line or as part of build scripts. In this first installment Matteo describes how such tests can check the generated HTML for validity, with examples in Java and Go. [Martin Fowler]
- A short note on how I use and render footnotes - Last week I added a small feature to this website, changing the way it renders footnotes. That prompted me to write this quick note about how I use footnotes, and how that influences the best way to render them. [Martin Fowler]
- Testing the contents of generated HTML - Matteo Vaccari continues his testing of template-generated HTML by describing tests for the contents of that HTML. He shows how to gradually build up the template, using Test-Driven Development in Go and Java. [Martin Fowler]
- Code Splitting in Single-Page Applications - Single-Page Applications often require a lot of code to be downloaded to the browser, which can delay a page's initial appearance. Juntao Qiu's next pattern, Code Splitting, describes how this code can be divided up, so that modules are only loaded if they are going to be needed, and the dangers of doing so. [Martin Fowler]
- Why you should batch message processing and how to do it with .NET AsyncEnumerable - AsyncEnumerable is a sneaky abstraction. It allows simplified and performant usage for iterating on pull-based and push-based sources. “Pull… [Event-Driven by Oskar Dudycz]
- The Economics of Writing Technical Books - Yes, you can make money writing books. But never do it for that. [The Architect Elevator]