Back to Blog
Nov 6th, 2023

Your LAST Stack

Written by weaverryan, and stof

Edit
Your LAST Stack

Read the entire series about LAST Stack:

And look out for the 30 Days with Last Stack tutorial.

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.

4 Comments

Sort By
Login or Register to join the conversation
Tac-Tacelosky avatar Tac-Tacelosky 6 months ago HIGHLIGHTED

Awesome tutorial!

I bumped the code to 6.4 and wanted mention that the namespace for Flowbite changed. So twig.yaml should be

twig:
    default_path: '%kernel.project_dir%/templates'
    form_themes: ['@TalesFromADevFlowbite/form/default.html.twig']
1 | Reply |

Hey Tac,

Thanks for sharing this with others!

Cheers!

| Reply |

AMAZING LAST STACK !

| Reply |

Nice and smart LAST stack ! 🚀

| Reply |

Delete comment?

Share this comment

astronaut with balloons in space

"Houston: no signs of life"
Start the conversation!