Live data from Hacker News

Astro: Ship Less JavaScript

astro.build

31–40 of 171 posts

Re: Astro: Ship Less JavaScript

#31
post #13

Earlier quoted context omitted.

Hey! Do you have any live demos or real(ish) apps made with Astro that we could check out?

There are a few sites in the wild already built with Astro that you can check out: - https://www.snowpack.dev/ - https://divriots.com/

That snowpack site is definitely pretty %*(&ing fast :D

Re: Astro: Ship Less JavaScript

#33
post #2

:wave: Hey everyone, one of the Astro creators here! Happy to talk Astro or answer any questions you have about what we're building. Our README has a bunch more info that we couldn't fit into the release post: https://github.com/snowpackjs/astro

Congrats on the release. For some reason when I heard of Astro, I thought it was a dynamic server-side rendering framework, not a static site builder. But I'm sure someone else will take on SSR with islands if they haven't already.

Also:

> Astro is and always will be free. It is an open source project released under the MIT license.

> We care deeply about building a more sustainable future for open source software. At the same time, we need to support Astro's development long-term. This requires money (donations alone aren't enough.)

Why make it harder for yourselves by choosing such a permissive license? Developers shouldn't be ashamed to not just ask for, but demand, compensation, for the software itself, by choosing a more restrictive license. Even if that means you can't call it free software or open source, e.g. a source-available license that requires payment for commercial use. By now we should be ready to accept that free software with no strings attached just isn't sustainable except for projects with big corporate backers.

Re: Astro: Ship Less JavaScript

#34
post #2

:wave: Hey everyone, one of the Astro creators here! Happy to talk Astro or answer any questions you have about what we're building. Our README has a bunch more info that we couldn't fit into the release post: https://github.com/snowpackjs/astro

How does this compare to Elder.js[1] which released a little while ago? You seem to have similar goals - mostly static site with small amounts of interactivity, minimum JS to achieve that - but Astro supports multiple frameworks, while Elder.js is restricted to Svelte. Are there any other big differences? [1]: https://elderguide.com/tech/elderjs/

Hey Elder.js author here. Only browsed their docs but here are the things that stand out in very quick read:

- Framework agnostic but uses their own .astro language/filetype. Elder.js is Svelte only.

- Both support partial hydration and they appear to offer similar options as Elder.js

- Elder.js’ target isn’t building a small site but a large one. So data flow and making the data model pluggable via hooks and plugins really makes this possible in a way we haven’t seen other framework approach it. We’ve heavily dogfooded Elder.js for building major SEO assets. Fetch as the main way of getting external data in Astro where Elder.js leaves that up to you and gives you complete control allowing various database or filesystem sources.

- Unclear on their build process.

- Elder.js is express middleware (SSR) and a static site generator. Astro appears to just be a SSG. (Some of our sites are outgrowing SSG so the flexibility matters).

- No shortcode support, hooks, or plugins.

My take is that Astro might be a good fit for simpler use-cases but may stumble when you need more control or go against their model. Elder.js has similar opinions but tries to put you in full control. That comes at a complexity cost which Astro appears to do a good job of simplifying but I’d need to dig in deeper to see what tradeoffs were made in order to make things simpler.

Happy to see more people taking partial hydration seriously.

Edit: formatting

Re: Astro: Ship Less JavaScript

#38
post #37

https://dayssincelastjavascriptframework.com/

It's sort of ironic that page loads 213kB of JavaScript from 8(!) separate scripts to show a large 0.

To be fair (but not too much), the devs did compress and minify their JS and host everything on the same domain, so with HTTP/2 the network impact should not be too high in comparison.

In comparison to a "normal" web page that loads 213KiB of script that's not necessary because the HTML already shows the big zero regardless. At least the CSS is fairly minimal.

The web is a terrible place. Google should rank Javascriptless websites higher in search results to push for less scripting, it's the only way I can see this situation improving.

Re: Astro: Ship Less JavaScript

#39
At the moment I'm using Gatsby but the client side js bundle turns me off. However, one thing I really like about Gatsby is the dynamic image component.

Is there any way (or are there any plans) for generating responsive images when using Astro? As Astro is framework agnostic, I don't think so, right?

Post reply on HN