# Stimulus, JS and HTML

2018-01-15

> Stimulus is concerned with manipulating this existing HTML document. Sometimes that means adding a CSS class that hides an element or animates it or highlights it. Sometimes it means rearranging elements in groupings. Sometimes it means manipulating the content of an element, like when we transform UTC times that can be cached into local times that can be displayed.

> […]

> This makes Stimulus very different from the majority of contemporary JavaScript frameworks. Almost all are focused on turning JSON into DOM elements via a template language of some sort. Many use these frameworks to birth an empty page, which is then filled exclusively with elements created through this JSON-to-template rendering.

> Stimulus also differs on the question of state. Most frameworks have ways of maintaining state within JavaScript objects, and then render HTML based on that state. Stimulus is the exact opposite. State is stored in the HTML, so that controllers can be discarded between page changes, but still reinitialize as they were when the cached HTML appears again.

> The Origin of Stimulus (cache)

A different paradigm, an old one actually, revisited. I’m more inclined to use that kind of approach given my usual needs. And if it gets bigger, it’s probably not my fish and I’m happy with that. It looks more robust by default and does not serve a blank page for whatever valid reason.

Other articles in English: On caching links, Bushcraft retrospective, Into the Raft, Into the Bugs, Meritocracy crisis, The Seller, the Teacher and the Wise, Into the Good, Into the Mice, Into the Camp, Into the Wind, Into the Snow, Into the Cold, Async Python Frameworks, Distributed teams, Into the Wild, Without JavaScript, Inclusive Python, Micro-cultures and governance, Resilient Web and Tools, Bitcoin and energy, Team building, Inclusive developer, Cultural Intimacy, Tools and teams, Senior developer, Slow Data, Inclusive communities, Delivery and value(s), Collaboration debt, Communities and leadership, Specifications and APIs. Oh, and most of the 2018 thoughts.