Live data from Hacker News

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

astro.build

161–170 of 256 posts

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

#161
post #151

Earlier quoted context omitted.

TypeScript, that's the differentiator. Having fully typed variables in the templates cannot be replicated in templating languages (well technically they might be able to but that's not as ergonomic as fact).

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.

For sure. I'm a big fan of type safety in larger codebases with reasonably stable domains. But when a project's small or new enough to be relatively volatile, the overhead just isn't worth it for me.

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

#162

Sometimes all the frameworks that re-invent MVC (but in a detached fashion) and tout "server side rendering" just feel like we've come full circle where we're just serving a static view cache that was generated from models and data using a controller. The big difference here (as with other JavaScript-based renderers) is of course the "use one tool/language for everything" aspect which to me is a bit of a 'meh'-benefi…

I think edge computing and CDNs might be what is making this all more interesting. It is not just where you render (Server vs. Client), it is where you render (Dallas vs. Rio). If you can get your app to re render small sections and have the framework figure out that these sections are static and can chuck them in a CDN (or they are not and need an edge server, or a central server) then you can get lots of optimizati…

> I think edge computing and CDNs might be what is making this all more interesting

You know what's old-fashioned way of doing this? Buy multiple VPS around the world and deploy website files using a script.

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

#163
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 things that really bit me were tons of examples of JavaScript, which included strange lines like 'import', and I had no idea how to get my website's JavaScript to understand what an import is or any of the other syntax. Nothing would work! I didn't realise there was a whole ecosystem around how to build your code so that it can make use of these things. Every guide assumed I had things going, and I just didn't understand that I needed this other infrastructure in place first before I could do anything.

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

#164
post #37

Earlier quoted context omitted.

For me it's the pre-rendering. I've used Next.js, Nuxt.js, Remix etc and they all server-render great. But for deploying SPAs to file-hosting (S3 + Cloud Front or Firebase Hosting) without a server runtime, you end up with empty HTML on request which is worse for SEO, social previews etc. There are solutions to pre-rendering for these stacks but they're more focused on deploying to Vercel or Netlify functions, or hav…

I can just do a `nuxt generate` and put it on CF+S3 as well, right? how is that any different to what Astro does?

Yeah you can, but there's more configuration involved. The default `nuxt generate` output is an HTML page that just has a loading element and a bunch of JavaScript tags*. On my Astro apps all of components that don't explicitly have a "client" attribute are prerendered

* unless something changed since my last Nuxt project

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

#165
> Astro was a catalyst that caused developers to ask, ‘Do we really need to ship all that JavaScript?’ The reintroduction of multi-page apps (MPAs) in a modern context is a huge opportunity for developers in the Jamstack ecosystem to make the web better for users.

So we're back to multi-page websites now? K.

I'm still writing my html and CSS by hand.

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

#166

Earlier quoted context omitted.

Use any SSG not written in javascript and you'll be fine. Hugo, Zola, Jekyll, etc. Though if I was starting from scratch I might avoid Jekyll just because of the Ruby dependency.

Honest q: what’s the problem with Ruby? Compile time? Gem management? I’m using Jekyll and sometimes wonder if I’m missing anything from the newer systems. My compile time is negligible, and once I figured out how to integrate Tailwind, I’ve had no issues.

Personal preference mostly. rvm/gem/bundle is just a lot to set up and keep in your head compared to running a statically-linked binary. It feels like a relic of a previous era. Plus compiled languages are faster, and massively easier to set up if you have contributors running Windows.

But like sibling said, if you're happy with your setup, keep it.

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

#167

Earlier quoted context omitted.

Use any SSG not written in javascript and you'll be fine. Hugo, Zola, Jekyll, etc. Though if I was starting from scratch I might avoid Jekyll just because of the Ruby dependency.

> Use any SSG not written in javascript and you'll be fine. Commonly stated but not actually true. For example: https://github.com/getzola/zola/blob/master/Cargo.lock https://github.com/gohugoio/hugo (scroll to the bottom of the README)

If that scares you, you must be terrified of modern Linux distros.

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

#168
post #43

I used a static site generator for all of these benefits in the past, but the rebuilding process is a total nightmare. The site has about 20 categories, and each category has about 100 images. Every time the team adds a new image or category, the deployment/building task clones the repo and then the build process generates all the optimally sized images again and then re-uploads multiple gigabytes to the host. Is the…

A makefile

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

#170
post #72

Earlier quoted context omitted.

So they have moved all the previously frontend stuff to backend and output Hot-wired / Liveview / Livewire instead?

I wish. AFAIK it's just classic server-side rendering with full-page navigation. Mind you, that's the optimal solution in many cases. But a full-stack JavaScript web framework with something like Phoenix's channels and LiveView built in would be a killer combination.

Check out https://liveviewjs.com
Post reply on HN