Live data from Hacker News

Astro 1.0 – a web framework for building fast, content-focused websites

astro.build

181–190 of 256 posts

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#181
post #172
post #151

Earlier quoted context omitted.

Talk about sledgehammer to crack a nut - honestly, why does anyone need type safety in a simple templating operation? Dynamic languages have their uses, you know. Type safety is a tool, not an ideology.

because it's nice to know whether that `post` variable contains a property `createdAt` or `published` At without leaving the template. Arguing "I don't use it why should you" is unproductive.

Agreed, you get all the benefits of type inference even in a template. It's a pain to debug template variables that don't exist, I've written enough Handlebars to know.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#182

Earlier quoted context omitted.

Think of JSX as a macro, rather than "regular" templating, which is typically string substitution. For static sites, this means that you get functions and objects the entire way through the render pipeline right up until there is a full tree built and the final output is rendered. You still get all the separation powers of contexts, the component based reusability, etc, and it is all regular JavaScript / typescript e…

Some day we have to stop repeating this nonsense. JSX requires much more learning than simple templating, there is no inherent benefit. Even a simple conditional is more complex than your average template.

The thing is, if you know JS, then a conditional is JSX is the same as in JS. Contrast that with every new templating language under the sun which might have its own way of doing conditionals and loops and control flow. That to me is much more annoying.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#183
post #114
post #111

Earlier quoted context omitted.

Also out of the box: - Tailwind support - Optional choice of UI framework (React, SolidJS, Svelte etc...) - Partial hydration. Generates _actual HTML_ on the server-side rather than JS blobs (which is what some other frameworks call SSR). It really does work nicely. It's very fast, minimal config required.

As someone who started building web pages in the 90s, the "islands architecture" (generating HTML server-side) of Astro and others makes me laugh because it's literally what we used to do with XMLHttpRequest in IE 5/6 20+ years ago. We generated page partials (or used static ones) and pulled them in with "Ajax" (for the oldies out there) and then inserted them in the right place on the page using innerHTML. There's n…

In early 00s, we even had frameworks that would do this all for you.

https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.up...

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#184
post #20

Earlier quoted context omitted.

It's interesting their blog post doesn't mention some of the benefits. Neither does the doc page you linked—at least it doesn't do it succinctly. Essentially Astro lets you build sites using a JS framework like React or Vue without requiring that framework to be loaded on the frontend. By default, components are just HTML content. Super nice for building very fast static sites using a technology you may already be fl…

Not getting it tbh. Why would you go nuclear and develop a React or Vue app and then not actually use it on the browser side? For content-oriented websites there are much simpler workflows based on SGML and other classic markup processing and content management practices. I mean the point of "content-oriented" and web sites in general really is that an expert in the field, rather than a web developer, can achieve use…

It might be all you know.

I'm not a web dev by trade but I have a website for a hobby project. I had taught myself React thinking I might make an app. (I never did.)

So now I want to maintain this thing on the side with not much effort using what I already know. And that keeps those skills fresh, which is great.

I'm very interested in Astro.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#185
post #47

It always annoys me when I read something like: To try Astro on your local machine, run npm create astro@latest in any terminal. because it doesn't make it clear to me what to do before this command will actually do anything. No, running this command will not work in any terminal.

A few years ago when I was trying to understand the new JavaScript world with React and all its toys (moving from my background of PHP and other 'old-school' server-side rendered solutions), I hit problems similar to this. This particular example isn't too bad -- looking at that line, it would be clear to me that I'm missing 'npm', and the solution is obvious -- find out what npm is, and get it installed. But the thi…

I’d recommend reading this[1] (fantastic) article that came out a few years ago. It’s exactly the kind of guide you’re looking for.

[1] https://peterxjang.com/blog/modern-javascript-explained-for-...

Some notes of things that have changed in the last five years:

- bundling is (almost) no longer needed for simple import/export as we now have a native module capability (esmodules). The biggest issue you’re likely to have here is waiting for any dependencies you have to upgrade from common js to esmodules.

- transpiling is not as necessary unless you explicitly have to support IE11, or require something in the latest ecmascript spec.

It really speaks to the maturation of front-end development that after five years that article is still fairly accurate.

About time too - I’m too old to put up with that level of churn anymore.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#186
post #173

Earlier quoted context omitted.

So what do you use for shell scripting?

I like using Nim or Rust, or TypeScript, depends on the script. If it's just a few lines, sure I'll write it in bash, but if it gets a little larger, I convert it into a real programming language.

Rust as a replacement for a bash script?

My bash scripts are often edited, I could not imagine using a compiled language where I would have to store the source as a separate file from the executable, then compile it each time.

I'd love to know your more specific use cases, if you don't mind. I'm always happy to learn something new. Could you share some Rust that most people would script in Bash as an example? What's your build and deploy (to ~/.local/bin I presume) strategy?

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#187
post #173

Earlier quoted context omitted.

So what do you use for shell scripting?

I like using Nim or Rust, or TypeScript, depends on the script. If it's just a few lines, sure I'll write it in bash, but if it gets a little larger, I convert it into a real programming language.

But TypeScript doesn’t have ADTs which you stated was a hard requirement. It has some other features that can achieve similar things though, so maybe that’s good enough?

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#188
post #20

Earlier quoted context omitted.

It's interesting their blog post doesn't mention some of the benefits. Neither does the doc page you linked—at least it doesn't do it succinctly. Essentially Astro lets you build sites using a JS framework like React or Vue without requiring that framework to be loaded on the frontend. By default, components are just HTML content. Super nice for building very fast static sites using a technology you may already be fl…

Not getting it tbh. Why would you go nuclear and develop a React or Vue app and then not actually use it on the browser side? For content-oriented websites there are much simpler workflows based on SGML and other classic markup processing and content management practices. I mean the point of "content-oriented" and web sites in general really is that an expert in the field, rather than a web developer, can achieve use…

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.

Re: Astro 1.0 – a web framework for building fast, content-focused websites

#189

Earlier quoted context omitted.

Assuming that 7-10 users are FTE, the company is already spending more than $1M on salary and related costs. I imagine the annual Enterprise pricing for Vercel for that numbers of users would hover around 1/4 of an FTE's salary, which is reasonable considering the value provided.

The increase in value provided by these services is very much linear w.r.t. number of users. The 10x+ leap in cost with enterprise pricing is not at all justified by additional value provided. I don't mind paying a fair, pre-disclosed price for services that provide value. I do mind opaque enterprise sales tactics that try to take full percentage points off my available runway for no discernable increase in value whe…

Add me to the list of voices who are highly skeptical about Vercel.

I recall watching a video on their YouTube account a few months ago where their head of devrel tried to interview a famous personality from the “cloud native” community (Kelsey Hightower) as a way to introduce their “edge functions” nonsense.

The entire thing was a train wreck from about ten minutes in when he started asking questions about how it actually worked and what kind of trade offs it would imply.

I remember they had to do a bunch of obvious hard cuts presumably to remove the more embarrassing stuff and it always stood out as a snake oil company to me ever since then.

The fact that they also seem to rely on deceptive pricing and dark patterns for sales seems very on brand with what I recall thinking about them at the time.

The interview in question is here in case anyone is interested https://youtu.be/yuxd2kurpzk

Post reply on HN