CraftEntries

Thomas Sausen

Reactive Craft CMS frontends with Datastar

Ben Croker on Datastar, server-sent events, and real-time Craft sites in Twig

2025-03-09 76 min Thomas Sausen

Description & Show Notes

Ben Croker of PutYourLightsOn returns to talk about Datastar, the open source hypermedia framework he has worked on almost full time since late 2024. He explains why Datastar keeps state on the back end, how Craft developers can write all their logic in Twig, and where his Sprig plugin reaches its limits. Ben describes how Delaney Gillilan created Datastar, why server-sent events are its killer feature, and how his Spark plugin turned into the PHP SDK and the Datastar plugin for Craft. He demos a real-time multiplayer to-do list built with Craft and talks about scalability, Craft Cloud, and why learning Datastar is mostly about unlearning old habits.

Ben explains Datastar's lightweight architecture, which enhances performance and real-time interactions by managing state on the backend. He also discusses its advantages over his component framework, Sprig, and highlights its potential for collaborative applications. The episode delves into technical details, scalability, and community resources for Datastar.

Links