Ancestors

Written by Florimond Manca (en) on 2025-02-02 at 20:39

Am I crazy for pushing back on "#JS #SPA frontend by default"?

For 2 years. I've been in a team working on a French public service business logic app, mostly lists and forms w/ neat UX.

The tech is boring. PHP, Symfony, Twig templates. Treat: Turbo, Stimulus, custom elements, for those required bits of interactivity.

Hell it works. It's fast. It doesn't break. We been updating deps monthly w/o breaking changes. Never had to rewrite!

Am I crazy, or are we fooled by the JS industrial complex?

=> More informations about this toot | More toots from florimond@fosstodon.org

Written by Florimond Manca (en) on 2025-02-02 at 20:47

Another anecdote. We had an internal CRM app at work, built in 2021 with the backend / API / frontend architecture.

Nest on the backend. TypeORM broke several times, preventing smooth upgrade. Nest was stable enough though.

The frontend was built using #Svelte and Sapper. OK, Sapper was a beta at the time. Replaced with SvelteKit in 2022. We tried to migrate. Twice. Resources were limited: the app was useful to us, but not paying our salaries. Migration would taken weeks.

=> More informations about this toot | More toots from florimond@fosstodon.org

Written by Florimond Manca (en) on 2025-02-02 at 20:52

In 2023, two years after being built, the app was legacy. Couldn't upgrade the frontend.

Sure Svelte was less heavy than React. But why did the login page, as bare as it was, need JS anyway, let alone 100kB of it?

I took a week off my main project and did the app a favor: rewrite, but moving *out *of the "JS by default" paradigm.

I replaced the API routes with controller methods returning HTML rendered by Nunjucks #templates.

A third of the codebase disappeared!

=> More informations about this toot | More toots from florimond@fosstodon.org

Written by Florimond Manca (en) on 2025-02-02 at 20:56

I had to write glue code between Nunjucks and Nest, because Nest doesn't have actual integration with any templating engine. The glue code is kind of ugly, but it's small, and it works.

Now the team gets to write templates on a whim. We have half or more less dependencies to care about. I am fairly confident about upgrading the deps.

AND the app is faster, more lightweight than ever before. The login page weighs 8 kB. As a logo-2-fields-and-a-button page SHOULD.

=> More informations about this toot | More toots from florimond@fosstodon.org

Toot

Written by Florimond Manca (en) on 2025-02-02 at 21:01

No dogma: I did not refuse Svelte!

It's still there, used by the library that powers the CRM calendar.

But it's wrapped in a custom element. Treated as an implementation detail. As it should!

The JS gradient: vanilla JS, custom elements, interactive islands, SPA.

Not "SPA only".

That's how we can build the #Web for everyone, not the top X%.

=> More informations about this toot | More toots from florimond@fosstodon.org

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113936307241221283
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
275.319757 milliseconds
Gemini-to-HTML Time
1.505313 milliseconds

This content has been proxied by September (3851b).