Hacker Newsnew | past | comments | ask | show | jobs | submit | hasanhaja's commentslogin

But don't you need to need to understand the platform you're building on, warts and all?

How else can you fully grasp what's possible on that platform and the costs of different abstractions?


I don't think so. If your framework is high level enough, you've successfully outsourced the bad stuff to someone else.

But if you don't know the underlying platform, how can you be sure that your framework is high level enough or that it can do everything that's possible on the platform? You either have a framework with escape hatches (that'll require you to drop down to the bad stuff) or you have to wait until the framework catches up to the platform. Actually now that I think about it, React would fall in both camps.

You won't need to do "everything that's possible on the platform." You want to constrict yourself to the parts that work well.

Yeah, this is my gut-feeling too! Because the alternative for "complex" being discussed is Next.js, but that doesn't really help you with "complex" applications, and you still have to bootstrap a lot of infrastructure yourself (with dependencies, or by yourself).

What do you mean by complex?

More than a blog or a simple static website.

Like what specifically? And why do you think Astro is not a good fit for it?

What about DX in terms of template execution speed? There are many implementations of template fragments on various platforms like Go and Rust [1], which might arguably perform better than their JavaScript counterparts. Wouldn't quicker execution give you a faster feedback loop when developing, and also give you a faster UX?

[1] https://htmx.org/essays/template-fragments/#known-template-f...


> Wouldn't quicker execution give you a faster feedback loop when developing, and also give you a faster UX?

Yes, I've used stuff like Templ for Go or Razor Pages for .NET.

Even if the raw HTML rendering performance is significantly better, there are other factors to consider in terms of dx.

1) Most backend languages will not hot reload modules in the client which is what Vite gives you.

Very often the whole backend application needs to be recompiled and restarted. Even with something like the .NET CLI which does have a hot reload feature (and it's absolute garbage btw) the whole page needs to be reloaded.

PHP has an advantage here since every request typically "runs the whole application".

But even with PHP, JS and CSS assets do not have hot reload unless you're also running Vite in parallel (which is what Laravel does).

With Astro you can run a single Vite dev server which takes care of everything with reliable and instant hot reload.

2) With Astro you will get islands which are simply not feasible with any non-JS backend. Islands are so much more powerful than old school progressive enhancement techniques. When we were using eg jQuery 15+ years ago it was a massive pain to coordinate between backend dynamic HTML, frontend JS code, and CSS. Now with islands you can encapsulate all that in a single file.

3) You also get CSS co-location. Meaning you can write an Astro server component with its own CSS scoped to the particular piece of markup. Again, CSS colocation is a huge win for dx. These days I write vanilla CSS with PostCSS but with Astro it's trivial to integrate any other CSS workflow: Tailwind, SCSS, etc.

4) Finally, you have to consider bundling of frontend assets. I don't think it's an exaggeration to say that solutions like Vite are really the best you can get in this space. Internally it uses Go and Rust but it's all abstracted for you.

If you have a use case where you really need exceptional HTML rendering performance in a monolithic application, Astro (or really anything in JS) is definitely a bad fit. But you can easily run an Astro server app on eg Cloudflare Workers which could would work in many of those use cases too and reduce latency and adapt dynamically to load.


Do you have an intuition of when something becomes hefty and complicated, and would require a full stack solution like Next.js?

I do not but I think I'm growing one!

Potentially the heuristics would be about the level of user state management - e.g. if you're needing to do various workflows vs just presenting content.


> there wasn’t a developer experience by which you could build a website or web app (or both) as a single, cohesive unit, covering both front-end and back-end

How much of the frontend and how much of the backend are we talking about? Contemporary JavaScript frameworks only cover a narrow band of the problem, and still require you to bootstrap the rest of the infrastructure on either side of the stack to have something substantial (e.g., more than just a personal blog with all of the content living inside of the repo as .md files).

> while avoiding the hydration performance hit

How are we solving that today with Islands or RSCs?


It can cover as much of the back-end that your front-end uses directly as you’d care to deploy as one service. Obviously if you’re going to have a microservices architecture, you’re not going to put all those services in the one Next.js app. But you can certainly build a hell of a lot more in a monolith that a personal blog serving a handful of .md files.

In terms of the front-end, there’s really no limit imposed by Next.js and it’s not limited to a narrow band of the problem (whatever that gibberish means), so I don’t know what you’re even talking about.

> How are we solving that today with Islands or RSCs?

Next.js/RSC solves it by loading JavaScript only for the parts of the page that are dynamic. The static parts of the page are never client-side rendered, whereas before RSC they were.


There are a lot of moving parts when building an application and the abstractions that Next.js provides doesn't cover the same stuff when compared to frameworks like Ruby on Rails, Django and Laravel. The narrow band of problems Next.js solves for you are things like data fetching, routing, bundling assets and rendering interactive UI. It leaves things like auth, interacting with a database, logging, mailing, crons, queues, etc up to you to build yourself or integrate with 3rd party services. When you work with one of those frameworks, they pretty much solve all of those problems for you and you don't have to leave the framework often to get things done.

This is fine generally because you have the choice to pick the right tool for the job, but in the context of "a single, cohesive unit" you can only get that with Next.js if you all that you care about are those specific abstractions and want your backend and frontend to be in the same language. Even then you run into this awkwardness where you have to really think about where your JavaScript is running because it all looks the same. This might be a personal shortcoming, but that definitely broken the illusion of cohesion for me.

> The static parts of the page are never client-side rendered, whereas before RSC they were.

Didn't the hydration performance issues start when we started doing the contemporary SSR method of isomorphic javascript? I think Islands are great and it's a huge improvement to how we started doing SSR with things like Next.js Pages Router. But that's not truly revolutionary industry wide because we've been able to do progressive enhancement long before contemporary frameworks caught up. The thing I'm clarifying here is the "before RSC" only refers to what was once possible with frameworks like Next.js and not what was possible; you could always template some HTML on the server and progressively enhance it with JavaScript.


Been wanting to learn browser APIs like Service Workers and IndexedDB in depth, and HTMX, so started building a Todo App: https://github.com/hasanhaja/tasks-app

It's meant to work entirely offline and the service worker acts as the backend for the application.


You can just sprinkle in some <script> tags and not have to rely on UI frameworks. I appreciate that Astro let's you do this rather than invent it's own way of doing things.


For sure, but there is room for improvement there. Similar to how the <style> tag has scoping built in. An integrated way to access the data objects directly and a way to reference elements and events would be ergonomic.


How do you think it compares to Vaadin?


Why wouldn't simple HTML be a great starting point for simpler sites? What's it missing that React solves, in your opinion?


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: