正在加载视频...

视频加载失败

Crazy thought: What if Astro took over views/ for any framework? Got an early Ruby on Rails prototype running. Query in a controller, return props, use them in your component. Like the network isn’t even there 🪄

105,088 次观看 • 2 年前 •via X (Twitter)

11 条评论

Ben Holmes 的头像
Ben Holmes2 年前

Want to streamline this to feel exactly like Ruby on Rails templates. Namely, no “render json” call. Also need to figure out production build best practices. Prototype if you’re curious!

Ben Holmes 的头像
Ben Holmes2 年前

Update: TIL about Concerns. Just "include Astro" in your controller and we can magically render the right template! Ruby is wild

Sean Roberts 的头像
Sean Roberts2 年前

No frickin way

Anthony Holmes 的头像
Anthony Holmes2 年前

Yes! I bet Laravel devs would be very open to this

PatrickJS 的头像
PatrickJS2 年前

Yes

moeritz.io 🦋 的头像
moeritz.io 🦋2 年前

so this is basically inertia.js just with astro

Ben Holmes 的头像
Ben Holmes2 年前

yup

Dan 的头像
Dan2 年前

Would Astro then replace Pug, for example, in Express web apps? 👀

Ben Holmes 的头像
Ben Holmes2 年前

I like the way you think 👀

Diego Enjamio 的头像
Diego Enjamio2 年前

How is this different from inertia? It seems very similar

Ben Holmes 的头像
Ben Holmes2 年前

It's super similar! We're just unlocking Astro templates instead of client-side React, Vue, or Svelte. These let you - start from plain HTML - embed component frameworks when you need it - reach for view transitions to make routing feel nice (notice the fade in my demo)

相关视频