Hacker News new | ask | show | jobs
by kelthuzad 338 days ago
From a cursory reading of Astro's docs their model/philosophy seems to be more like "fast by default."

So their philosophy is to start with zero client-side javascript, even when one is using components from javascript-heavy frameworks like React or Vue. Interactivity is apparently something one has to explicitly opt-in to by adding a client:* directive, rather than it being the default.

The migration guide states, "Astro projects can also be SSG or SSR with page level prerendering," which puts it on par with Nuxt in that regard.

A difference I've noticed regarding server-side features is that Astro allows one to "define and call backend functions with type-safety."[0] which even Nuxt doesnt offer in such a convenient and type-safe manner. I'm pretty happy with what i'm seeing in Astro's docs so far.

[0] https://docs.astro.build/en/guides/actions/

1 comments

I think you're fundamentally missing the difference between these two frameworks.
I think that you should substantiate your claims instead of making low effort comments with zero elaboration. I've cited relevant passages from Astro's docs and I realized that it offers me the features I'm looking for, so I'm not sure what you're on about. Here are the "Key differences between Nuxt and Astro"[0] according to the docs:

- Nuxt is a Vue-based SPA (single-page application). Astro sites are multi-page apps built using .astro components, but can also support React, Preact, Vue.js, Svelte, SolidJS, AlpineJS, and raw HTML templating.

- Page Routing: Nuxt uses vue-router for SPA routing, and vue-meta for managing <head>. In Astro, you will create separate HTML page routes and control your page <head> directly, or in a layout component.

- content-driven: Astro was designed to showcase your content and to allow you to opt-in to interactivity only as needed. An existing Nuxt app may be built for high client-side interactivity. Astro has built-in capabilities for working with your content, such as page generation, but may require advanced Astro techniques to include items that are more challenging to replicate using .astro components, such as dashboards.

[0] https://docs.astro.build/en/guides/migrate-to-astro/from-nux...

https://nuxt.com/docs/getting-started/server

Nuxt is a server-side JavaScript framework with a complete HTTP application stack, built on top of Nitro (which includes an even larger suite of capabilities) and H3.

https://nitro.build https://v1.h3.dev

Astro is markup generation.

They are only comparable in that "both can print markup".

The idea that Astro and Nuxt are only alike because they "print markup" is factually incorrect. Astro is designed to give you the same flexibility as Nuxt when it comes to building dynamic, server-rendered sites. One can even use React or Vue within Astro. You can create API endpoints, use SSR, and even define backend functions with type-safety. The migration guide from Nuxt to Astro makes it clear that both frameworks support similar workflows, from file-based routing to dynamic data fetching. Astro’s islands architecture[0] just means you get more control over how and when interactivity is delivered, but under the hood, it’s every bit as much a server-side javascript framework as Nuxt.

[0] https://docs.astro.build/en/concepts/islands/#server-islands

If Astro is "designed to give me the same flexibility" it fails to do so in hilarious ways.