Astro Is Doing WHAT?!

preview_player
Показать описание
The Astro JS team is considering adding a client router option in their framework, which comes as a surprise considering the general direction frameworks followed in the past years.

💬 Topics:
- Astro JS;
- SPAs vs MPAs
- SSR vs CSR

#javascript
Рекомендации по теме
Комментарии
Автор

I wonder if your videos have any real purpose. Every time I click, it's just some aim less, random talk

sumanth
Автор

Checkout the "astro" branch in the solid-start repo. Solid-start will be using Astro as base to build off instead of writing their own. Tan-stack start will do the same for react.

XArthieX
Автор

The client side router is about preserving page state across navigation. It still renders everything on the server and Islands are still Islands. Everything works the way it did the only change is that the page will not refresh on navigation so things like tabs and scroll positions are preserved without workarounds like using local storage. It makes the UX much better and adds support for features like the View transactions API which is super cool.

No Astro is not turning into another meta framework. There are still no data loading patterns or mutation primitives. Astro components still render only on the server. The router just swaps the changed head and body elements that's it

TechBuddy_
Автор

What is dead is the MPA/SPA dichotomy.

Now there can be a variable mix of server and client routing as required by any specific use case.

Back in 2015 there was a Perficient blog post: “Mixing MPA and SPA: worst of both worlds”.

But now the Gen 3 mantra is “what *can* be done of the server will be done on the server; what *needs* to be done on the client will be done on the client”.

With Rails & Alpine you are grafting the Alpine application on top of the Rails application; “one web application for the price of two”.

Gen 3 frameworks approach server and client as part of the same application.

PeerReynders
Автор

1:36 I'd like to add that Solid-Start's file based routing is optional.

nathanoy_
Автор

Okay, hear me out: server side routing, client side navigation

JLarky
Автор

But don't most of the SSR framework in JS work that way?

The initial page is using file system routing and after that the client takes control.

NextJS, RemixJS, SolidStart, SvelteKit work like that, helps to achieve smooth transitions.

neociber
Автор

At this rate, we are all going back to PHP and come full circle.

jack
Автор

I much prefer an "app like" experience than loading each page over and over

brian-mcbride
Автор

ever wonder large companies are slow to adopt to new tech stacks? this

archmad
Автор

What about using HTMX in Astro? My overall impression is that it just needs some equivalent of Rails turbolinks or Laravel livewire to be able to reload part of a page instead of the entire page as a progressive enhancement, which is not the same thing as abandoning MPA. It's just catching up to what PHP or Rails can do

One step past that would be to have a liveview like Phoenix, but I don't know if Javascript is the right platform for that

BosonCollider
Автор

If astro manage to include an option to give the ability to activate the client routing, or even better, partial client routing between couple of page, well, astro will cover all the use case and in my opinion, it make no sence to choose another framework. It is a verry good idea for them, and i truly hope they will eneable this feature. I'm tired to switch from angular, sveltekit and astro following the use case of the project.

lucasgiunta
Автор

They should maybe take some inspiration from StimulusReflex and how they handle the client-side state on the server.

mikopiko
Автор

You suggest Ruby on Rails with Alpine JS and not with Turbo and Hotwire?

Way_Of_The_Light
Автор

Any body used solid-router with Astro ???

indramal
Автор

Rich Harris gave a talk recently where he gave a bunch of spicy takes, one of them being that MPA's are dead. I had to do a double take because I feel like it was just yesterday that the headline read "SPA's are dead". The javascript community is honestly exhausting to be on top of right now.

I think I am going to build my apps in Elixir's Phoenix until the javascript community settles down. It's really great and liveview gets you 90% of the client side interactivity you need. The only time I really need Javascript is when I work in three.js and pure SPA's are best suited for that work anyway.

alexnahas
Автор

javascript is becoming php before php frameworks.

fafaratze
Автор

Yeah.. So they want to be Sveltekit...

greendsnow
Автор

Alpine not the best approach becuase it is not safe

mzerone-gm