Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine

Return to symfonycasts.com



Subscribe via RSS or know about updates first by getting on the newsletter.

Who we are

Blog > Your LAST Stack

Your LAST Stack

By weaverryan and 1 other | Tech | Nov 6th 2023 |

Your LAST Stack

Read the entire series about LAST Stack:

And look out for an upcoming 30 Days with Last Stack tutorial. Or join me for my UX + AssetMapper SymfonyCon Workshop!

The mechanics behind the internet - browsers & web servers - have, for most of history, been terrible. We rounded corners using images, did transitions using jQuery, and combined all our JS into a single file, amongst other unsavory things.

Fortunately, times have changed. Browsers let us do amazing things out-of-the-box. HTTP/2+ allows us to serve individual files without a material performance impact and these can be compressed on-the-fly by the web server. This means that we can build apps in a new way, using tools that are simpler precisely because they don't do many things that we no longer need.

And since cool tools deserve cool names, say hello to LAST Stack:

LAST stack is about web standards. AssetMapper (stable in Symfony 6.4) leverages importmaps: a standard that's now supported on all major browsers (and has a polyfill for old browsers). This is built on top of another standard - ES modules and is backed up by the power of HTTP/2 & HTTP/3: allowing us to not worry about bundling our assets. Add in preloading and we have a fast, standards-based way to load our assets!

Next, LAST stack is no build. Yup, it's a zero build time Node-free setup. Thanks to the fact that browsers understand import statements (+ modern JS) and HTTP/2+, there's... nothing left to build! Yes, we're back to opening up a JavaScript file, writing code & refreshing the page. I've been doing this for 6 months and it puts the joy back into my code.

I hope you've noticed that, despite the trendy name, LAST stack is not new nor unique. And that's the third pillar: shared tools. Stimulus and Turbo are open source JavaScript projects used by Ruby on Rails and apps everywhere. When they move forward (Turbo 8 looks huge! and Strada empowers mobile apps), we move forward. The nature of JavaScript modules also means that we can use any JavaScript package we want to solve a problem: nothing is specific to Symfony.

LASTly, LAST stack is about simplicity and productivity. No build, no complexity, and a low cognitive load: an entire system that can be understood by a single developer. Use Twig to render all your HTML, Turbo to transform into a single-page app, Stimulus for an extra sprinkle of JavaScript & Live Components for highly interactive parts of your page (yes, still using Twig!).

The future is here and what's old is new. Welcome to LAST stack.