Hacker News new | ask | show | jobs
by manigandham 1406 days ago
Component-based UI frameworks and ecosystem has made building frontends much nicer, especially when you need some optional interactivity since you're already writing in JS.

Having that productivity and flexibility without the SPA complexity and other JS cruft has real value.

1 comments

In that case, it'd be interesting to see the benefits of Astro vs something like Gatsby
Frameworks like Gatsby didnt have any special support for interactive islands. You can choose to have:

a. A completely static site with no frontend javascript and no client side hydration, or

b. client hydration in which case all the components needed in the page will need to be loaded in the client.

If you want something in between, ie. only some sections need to be interactive, it requires jumping through some hoops eg. creating separate webpack entrypoints that call ReactDOM.render for specific DOM nodes. It is doable but more work and maintenance effort.

Astro simplifies handling for these kind of islands by using a server side templating language that is component aware and familiar to users already writing jsx.