KrMob
← All articles

Technology

Ask AI which framework for a site? Surprisingly often it says Astro.js

Sławomir Król 10 min read

Some time ago I ran a simple test. I asked Codex, Claude Code and Gemini the same question: which framework should I choose for a lightweight company website with a blog. I expected all of them to say Next.js or React, since those are the names that come up most often in this field. Instead, an answer kept coming back that I had not considered at all. Astro, and not as an aside: as the first recommendation on the list.

That intrigued me enough to look into where the agreement came from. Astro is hardly a giant, with fewer projects behind it and far less publicity than the big two, and yet the models named it confidently. A small detail says a good deal about that: almost nobody types Astro on its own into a search box, because the word leads to astrology and video games. People look the framework up as Astro.js, and that is the name I will use here too, even though its authors write simply Astro.

What follows is an attempt to take that mechanism apart. Not to sell Astro as a cure-all, because it certainly is not one. What interests me is something more revealing: an assistant asked to pick a tool looks for a fit with the job described, and in certain uses Astro comes out ahead. I write this as someone who builds applications in Flutter day to day, and who used Astro for our own company site.

Where the recommendation comes from

It is tempting to assume that a language model works like a download ranking and recommends a name all the more readily the more often it has seen it. Were that the case, Next.js or React would win every time. A well-guided assistant answers a different question: what will work in this particular situation.

When you describe a concrete task, the model tries to match a tool to that description. A lightweight site, a lot of content, an emphasis on loading speed. The model has seen every one of those phrases before, because the data it learned from contains thousands of discussions, tutorials and comparisons that add up to a reasonably consistent picture. Within that picture, Astro comes out well again and again for content-driven sites.

The model itself has no experience of this. It has seen enough cases where that pairing of task and tool produced a good outcome, and that is enough for a recommendation, even though Astro remains less popular overall than its competitors.

Why Astro.js suits content-driven sites

There is nothing mysterious about it. For this type of work Astro is an objectively strong choice, and the reasons can be set out plainly.

The first is speed, which follows from a fundamental design decision: by default Astro sends no JavaScript to the browser at all and instead assembles plain HTML on the server, either when the project is built or, if we set it up that way, on every request. The browser gets a finished document rather than a bundle of scripts to unpack and execute. The content appears almost immediately, and for a site whose purpose is text rather than interaction, it is hard to ask for a better or faster start.

That translates into measurable ground in search. Our company site scores a full hundred points in PageSpeed Insights on both mobile and desktop, and its Core Web Vitals, the speed and stability measurements Google takes from real page loads, sit inside the green thresholds. Google lists those measurements among the signals it weighs when ordering results, so a fast site begins the race for position from a better place. Reaching that score in Astro takes no acrobatics, because the absence of unnecessary JavaScript is the starting point here rather than the result of later optimisation.

The second point is a clearly chosen direction. Astro.js was built for fast content sites: blogs, documentation, portfolios, company pages and shops. That does not mean it stops at the blog, since the same engine carries sites with authentication and an API of their own. The point is that the defaults are tuned for content, and a smaller number of moving parts means fewer places where something can go wrong.

The third is the concept of islands. Where interactivity is genuinely required, whether in a form, a carousel or a counter, we bring that one part to life deliberately and locally, while the rest of the document stays static. So we do not pay a performance price for machinery that nobody is using in that part of the page.

Finally there are content collections, an orderly way of describing repeating entries together with a check on their structure through the Zod library. For a long time they read Markdown files only; today they can also reach into a content management system, a database or an external API. We do not use them ourselves, because our articles live in a database and are assembled on each request, so that the editorial panel works without a deployment after every correction. Astro supports both approaches and the choice does not have to be made at the start.

Astro is also comfortable for the assistant itself

This recommendation has a second layer, though. Astro is good for the task and, on top of that, unusually comfortable for the model, which subtly reinforces its inclination to propose that particular tool.

A model working on a project does essentially what a developer entering an unfamiliar repository does: it studies the directory layout, tries to work out the prevailing conventions and looks for something to anchor to. The more predictable the project, the less it has to guess.

In that respect Astro has several characteristics that plainly help it. The file layout leaves no room for doubt: the address in the browser follows directly from the file path inside the pages directory, and that is the only directory the framework genuinely requires. The rest, components and layouts, is a convention everyone has adopted, so the model keeps to it as well. There is no hidden configuration layer deciding that something renders elsewhere, so when I ask an agent to add a subpage, it knows exactly where to put it.

The same goes for the component file itself, which looks almost like ordinary HTML. A separate section with the logic at the top, and below it a template readable by anyone who has ever looked at the source of a web page. There is no dense syntax that forces you to hold ten rules in your head at once, and the model processed enormous quantities of HTML during training, so it moves through this comfortably.

The most important factor, though, seems to me the sparing use of mechanisms that operate in the background. In the jargon these are called "magic", meaning everything that happens underneath without being written explicitly in the code: automatic dependency injection, hidden reloads, invisible rendering rules. For an experienced developer magic can be convenient; for a model it is a trap, because there is no way to see what is not in the files. Astro consistently requires every interactive element to be marked as such, which keeps a clear line between what is static and what runs in the browser.

The effect is simple. The agent has less context to hold and finds it easier to produce a correct component on the first attempt. So it recommends the tool it handles best itself.

What artificial intelligence still will not do for you

I would be dishonest to leave you with a picture in which asking the assistant settles the matter. Several things still require human attention.

The most ordinary of them is recent changes within Astro itself. The framework develops quickly while models learn from data with a cut-off date. When a newer feature or a change in some mechanism comes into play, the agent may reach for a pattern that no longer applies. That happened to us several times while building this site, and it always ended the same way: back to the documentation, then a manual correction. It would be unfair to hold that against Astro, since it is the nature of tools that learn from the past.

Integrations are worse: external services and payment systems. The model usually knows the broad outline of such an integration but loses the configuration details, and those can shift from one version to the next and forgive no mistakes. Work of that kind is still worth keeping an eye on yourself, ideally with the documentation to hand.

The most serious matter, however, is the choice of technology itself. The assistant will suggest Astro because the description of the task fits, but it does not know your full context. Will the site grow into a substantial application within a year? Does the team already know a different tool? What are the plans for the years ahead? Those decisions depend on the goal of the project, the budget and the people who will work on it, which is knowledge the model has no access to. Its recommendation remains a starting point rather than a finished answer.

A well-designed tool speaks for itself

Once you add it all up, the conclusion turns out to be fairly ordinary. Artificial intelligence recommends Astro because it is well designed for a particular kind of task.

What goes into that is a predictable structure, explicit boundaries, few hidden mechanisms and syntax close to what the model knows best anyway. On top of that comes a real advantage in speed where content is what counts. All of it has always been considered a virtue in a framework from a human point of view, and it now turns out that what is good for a developer is equally good for the machine assisting that developer, and for the machine recommending the tool.

That is worth keeping in mind, because we will increasingly come to know new tools through an assistant. The model rewards fit and order, so a framework that is clear and explicit will win this contest through design discipline rather than marketing. Astro also shows something reassuring: a lesser-known tool, provided it is solidly built, can still win out over better-known ones.

I built our company website in Astro myself, so I can hardly claim to be impartial, though I do have direct experience. We write applications in Flutter day to day, so the company site was never our main line of work. What mattered to me was a project that would be fast, light and easy to maintain, and Astro met those expectations in full.

I am not claiming this is the only sensible path, because everything depends on what you are building. If you are planning a light and fast site, though, Astro is worth considering, especially since your assistant will probably suggest it to you anyway. And if you would rather talk specifics or see what we have worked on, have a look at our portfolio or simply write to us.

Frequently asked questions

Why does AI recommend Astro.js when Next.js and React are more popular? +

Because a well-guided assistant does not vote for popularity. It looks at how the tool fits the task. For a lightweight content site, Astro.js collects good reviews over and over in the data the model learned from. Hence its confidence. Popularity helps, but it is not the only criterion. Sometimes a lesser known tool simply fits the description better.

Is Astro.js suitable for large applications? +

Astro.js works best for content sites. I mean blogs, documentation, portfolios, company websites and shops. You can build bigger things in it, since it renders on the server and will handle authentication or an API layer of your own. Its authors do advise against it for products that behave like an application in the browser, meaning admin panels and live collaboration tools. Astro shines where content is the point.

Astro.js or Next.js - which should you choose? +

It depends on what you are building. Is content the point and do you care about fast loading with minimal JavaScript? Then Astro.js is the natural choice. Are you building an extensive, heavily interactive application with a lot of logic in the browser? Next.js gives more tools for that scenario. Both are good. They simply aim at slightly different tasks.

Is Astro.js fast? +

Yes, and that is its main strength. By default it ships zero JavaScript to the browser. The plain HTML is produced on the server, either at build time or on each request, depending on the setup. The browser gets a finished document instead of a bundle of scripts to unpack. As a result the page appears instantly. You add interactivity deliberately, only where it is genuinely needed. So you do not pay in performance for nothing.

Can you reach 100/100 in PageSpeed Insights with Astro.js? +

Yes, and it takes no tricks. Our company site holds a full hundred points on both mobile and desktop. The largest part of that comes from shipping no JavaScript to the browser by default. The rest is basics: images in WebP, fonts served from our own server and no heavy libraries. The score itself is not a position in Google's ranking, but the Core Web Vitals behind it are among the signals taken into account.

Can I trust an AI framework recommendation? +

Treat it as a good starting point, not a verdict. The assistant will match the tool to the task description accurately. But it does not know your full context: plans for the future, budget, which tools your team knows. You have to add those yourself. An AI recommendation narrows the field and saves time. A human still makes the final decision.

Can I use React in Astro.js? +

Yes. Astro lets you plug in components from popular libraries, React included, as islands of interactivity. You bring a given fragment of the page to life with such a component. The rest of the document stays static and light. You can also mix different libraries in one project. Just remember that islands share no state with each other, so common data has to come from the server or live outside the components.

Astro or Astro.js - what is the framework actually called? +

The official name is Astro, and that is how its authors write it. The npm package is called astro as well. In search, though, the form Astro.js has caught on, because the word Astro on its own leads to astrology, astronomy and video games. Both names mean the same tool. The documentation lives at docs.astro.build.

This article was originally written in Polish. Read the original version