...

/

The Architecture of the Jamstack

The Architecture of the Jamstack

Learn about the Jamstack architecture of the Rails application.

A Jamstack app is a bundle of JavaScript that contains markup, code to render that markup, code to fetch data from a remote server, and code to manage the state driving the dynamic contents of the markup. Sometimes, this code is executed on the server to pre-render the markup for a faster startup time in the browser, but the overall programming model is centered around managing DOM updates in the browser based on browser events and API calls, as shown in the figure below.

Press + to interact
Jamstack rendering
Jamstack rendering

State management is a significant part of a Jamstack application because most technologies provide a programming model where only the part of the DOM affected by state changes is updated when the state does change. Thus, a Jamstack application, in addition to having HTML templates for rendering HTML, also has a significant bit of wiring to make sure markup is connected to the correct state.

There are three benefits to this approach:

  • Highly interactive UIs are easier to
...