10 ms·
Astro is a return to the fundamentals of the web
- inatreecrown2 1y ago[flagged]
- tomashubelbauer 1y agoI misread the title and was quite confused about when the F* programming language connection will take a stage in the article. Spoiler alert: it never does, because the title doesn't make a reference to the F* programming language :D
- diggan 1y agoI'm still a bit dumbfounded, what is the F* a reference to if not the language? Maybe just a typo for some other abbreviation?
- andybak 1y ago> Traditional frameworks hydrate entire pages with JavaScript. Even if you've got a simple blog post with one interactive widget, the whole page gets the JavaScript treatment. Astro flips this on its head. Your pages are static HTML by default, and only the bits that need interactivity become JavaScript "islands." I guess I'd argue "Traditional Frameworks" were the ones that never stopped doing this. Laravel, Django, Rails etc. Then the SPA frameworks came along and broke everything. Also - what on earth is "f*"? I originally assumed it was shorthand for "fuck" but is "fuck dream" a common expression? And wouldn't you normally write it as "f***"?
- jpc0 1y ago> Also - what on earth is "f"? I originally assumed it was shorthand for "fuck" but is "fuck dream" a common expression? And wouldn't you normally write it as "f*" I would thinking F**ing, to delve deeper into the meta discussion
- flir 1y agoI'm reminded of the fat client vs thin client pendulum. Everything old is new agian.
- dang 1y agoI've replaced the submitted title ("Astro is a developers f* dream") with a representative sentence from the article.
- andybak 1y agothank you. it was a horrible title
- thibaultamartin 1y agoI can only approve. To me Astro started as "it's just html and css but with includes." I used it for my personal website, and recently used it when reimplementing the Matrix Conference website. It's really a no-fuss framework that is a joy to use. Among the things I love about Astro: - It's still html and css centric - Once built, it doesn't require js by default - You can still opt-into adding js for interactivity here and there - Content collections are neat and tidy - Astro massively optimizes for speed, and the maintainers know how to do it - It had a very helpful devbar to help you visually figure out what easy fix can make your website snappier (like lazily loading images if it detects them below the fold) For the "optimize for speed" bit, an example is that the css minifier cleverly inlines some CSS to avoid additional queries. The Image component they provide will set the width and height attribute of an image to avoid content layout shifts. It will also generate responsive images for you.
- diggan 1y ago> - It's still html and css centric - Once built, it doesn't require js by default - You can still opt-into adding js for interactivity here and there I've never used Astro so forgive my ignorance, but isn't that just creating a .html file, a .css file and then optionally provide a .js file? What does Astro give you in this case? You'd get the same experience with a directory of files + Notepad basically. It's also even more optimized for speed, since there is no overhead/bloat at all, including at dev-time, just pure files, sent over HTTP. > an example is that the css minifier cleverly inlines some CSS to avoid additional queries Is that a common performance issue in the web pages you've built? I think across hundreds of websites, and for 20 years, not once have "CSS queries" been a bottleneck in even highly interactive webpages with thousands of elements, it's almost always something else (usually network).
- thibaultamartin 1y agoFair questions. For the first one, the main benefits of Astro over static html and css (for my use cases) are the ability to include components and enforce the properties that must be passed. A typical example would be [here][0] where I define a layout for the whole website, and then [on each page that uses it](https://github.com/matrix-org/matrix-conf-website/blob/main/src/pages/index.astro#L21-L24 https://github.com/matrix-org/matrix-conf-website/blob/main/...) I have to pass the right properties. Doable by hand, but it's great to have tooling that can yell at me if I forgot to do it. Content Collections also let me grab content from e.g. markdown or json and build pages automatically from it. The [Content Collections docs][1] are fairly straightforward. As for performance issues, I've spent quite a bit of time on the countryside where connectivity was an issue and every extra request was definitely noticeable, hence the value of inlining it (you load one html file that has the css embedded, instead of loading an html file that then tells your browser to load an extra css file). The same can be true in some malls where I live. [0]: https://github.com/matrix-org/matrix-conf-website/blob/main/src/layouts/BaseLayout.astro#L7-L11BaseLayout.astro#L95 https://github.com/matrix-org/matrix-conf-website/blob/main/... [1]: https://docs.astro.build/en/guides/content-collections/ https://docs.astro.build/en/guides/content-collections/
- diggan 1y ago> Traditional frameworks hydrate entire pages with JavaScript. Even if you've got a simple blog post with one interactive widget, the whole page gets the JavaScript treatment. Astro flips this on its head. Your pages are static HTML by default, and only the bits that need interactivity become JavaScript "islands." Back in my days we called this "progressive enhancements" (or even just "web pages"), and was basically the only way we built websites with a bit of dynamic behavior. Then SPAs were "invented", and "progressive enhancements" movement became something less and less people did. Now it seems that is called JavaScript islands, but it's actually just good ol' web pages :) What is old is new again. Bit of history for the new webdevs: https://en.wikipedia.org/wiki/Progressive_enhancement https://en.wikipedia.org/wiki/Progressive_enhancement
- chrisldgk 1y agoI agree with that it’s not a new concept by itself, but the way it’s being done is much more elegant in my opinion. I originally started as a web developer during the time where PHP+jQuery was the state of the art for interactive webpages, shortly before React with SPAs became a thing. Looking back at it now, architecturally, the original approach was nicer, however DX used to be horrible at the time. Remember trying to debug with PHP on the frontend? I wouldn’t want to go back to that. SPAs have their place, most so in customer dashboards or heavily interactive applications, but Astro find a very nice balance of having your server and client code in one codebase, being able to define which is which and not having to parse your data from whatever PHP is doing into your JavaScript code is a huge DX improvement.
- diggan 1y ago> Remember trying to debug with PHP on the frontend? I wouldn’t want to go back to that. I do remember that, all too well. Countless hours spent with templates in Symfony, or dealing with Zend Framework and all that jazz... But as far as I remember, the issue was debuggability and testing of the templates themselves, which was easily managed by moving functionality out of the templates (lots of people put lots of logic into templates...) and then putting that behavior under unit tests. Basically being better at enforcing proper MVC split was the way to solve that. The DX wasn't horrible outside of that, even early 2010s which was when I was dealing with that for the first time.
- croisillon 1y ago[flagged]
- braebo 1y agoAstro is a fantastic project that I would probably use more if SvelteKit didn’t exist (but it does, so Astro is always a downgrade).
- steve_taylor 1y agoI was all in on SvelteKit until I noticed weird CSS issues thanks to :global.
- pier25 1y agoSveltekit doesn’t have islands. That single feature puts Astro ahead in situations where you don’t want an spa.
- poushkar 1y agoI am feeling old reading the phrase "traditional frameworks" as a reference to SPA/Virtual DOM frameworks all while the actual traditional frameworks like Backbone, jQuery, etc. actually worked the way described in the blogpost.
- diggan 1y ago"Traditional" always been a measure that depends on when we were born. "Traditional" internet for me is 56kbit modems, vbulletin forums, GTA:VC modding and IRC, while for older people "traditional" internet is probably BBS and such, and for the younger crowd things like Discord is part of the "traditional" internet. You see the same thing in political conservative/traditional circles, where basically things were good when they were young, and things today are bad, but it all differs on when the person was born.
- coldtea 1y ago>You see the same thing in political conservative/traditional circles, where basically things were good when they were young, and things today are bad, but it all differs on when the person was born when things decline that's still an accurate represenation, not just an artifact of subjectivity
- oblio 1y agoThe problem is that overall decline is generally subjective while personal decline is objective (we all grow old and sick and ultimately die). People frequently conflate the two.
- sesm 1y agoI remember Backbone being pure SPA-focused with client-side MVC.
- teekoiv 1y agoIt's baffling to me why more SSR frameworks, Astro and NextJS namely, can't adopt static pages with dynamic paths like SvelteKit. So for example, if you have a page /todos/[todoId] you can't serve those in your static bundle and NextJS straight-out refuse building your app statically. Whereas with SvelteKit, it builds happily and does this beautiful catch-all mechanism where a default response page, say 404.html in Cloudflare, fetches the correct page and from user-perspective works flawlessly. Even though behind the scenes the response was 404 (since that dynamic page was never really compiled). Really nice especially when bundling your app as a webview for mobile.
- arminluschin 1y agoI’m also a big fan of static, and nextjs supports this: https://nextjs.org/docs/app/api-reference/functions/generate-static-params https://nextjs.org/docs/app/api-reference/functions/generate...
- teekoiv 1y agoIt doesn't. Those are executed build-time and you can't just set a wildcard so anything outside the given set results in 404. As background, I wanted to make a PoC with NextJS bundled into a static CapacitorJS app somewhat recently and had to give up because of this. You can try tricking NextJS by transforming the pages into "normal" ones with eg query parameters instead of path, but then you need complicated logic changing the pages as well as rewriting links. As you of course want the normal routes in web app. Just a huge PITA.
- littlecranky67 1y agoNot sure why you gave up. All you need to do, is use query params: /todo?id=123 and use `const { id } = useSearchParams()` in your code. Yes, the urls won't be that pretty, but I don't know if this is a road block. I have a NextJS webapp up and running that is 100% SPA (no SSR, full static export) and uses a C#/.NET REST Backend for data [0]. Works (almost) flawlessly. [0]: lockmeout.online
- ansc 1y ago>See that code fence at the top? That runs at build time, not in the browser. Your data fetching, your logic - it all happens before the user even loads the page. I can't with this goddamn LLM blog posts, it just drowns everything.
- esseph 1y agoSome of us actually write like that... :/ Sucks when everything you write sounds like a bot because you're autistic.
- falcor84 1y agoI don't think it should suck at all. As I see it, RLHF empirically validated that this is the writing style people find to be the best.
- esseph 1y agoMaybe you've never been told you sound like a robot, then. Feeling less-than-human isn't great.
- owebmaster 1y agoAre you the post author?
- esseph 1y agoNo, just a human getting tired of things I type online being thought of as LLM spam.
- owebmaster 1y agoThis sounds like what a bot programmed to engage in HN would do, honestly.
- ttoinou 1y agoI spent a small amount of time looking into Astro and I didn’t get the difference with the Fresh framework created by the Deno team.. ? Fresh does this Island architecture already, and benchmarks on Astro website dont include Deno+Fresh to compare. So I’m still wondering what’s the benefit of using Deno+Astro vs. Deno+Fresh
- pier25 1y agoThere are plenty of differences. Eg Fresh can only run on Deno and can only use Preact.
- ttoinou 1y agoSure but I’m trying to see if Astro goes further in the optimization
- niam 1y agoAstro and Fresh were both inspired by the islands idea which was iirc coined by an Etsy frontend architect and further elaborated on by the creator of Preact. My understanding is that Astro is able to more-or-less take a component from any combo of popular frameworks and render it, whereas Fresh is currently limited to just Preact via Deno. I think the limitation is to optimize for not needing a build step, and not having to tweak the frameworks themselves like Astro does (did?). I'm not affiliated; I've just looked at both tools before.
- rckt 1y ago> I've found Astro perfect for marketing sites, blogs, e-commerce catalogues, and portfolio sites Basically, not suitable for anything complex.
- btbytes 1y agoThe number of web projects that fall into these categories vastly outnumber “complex” projects. For complex there is always WASM.
- hasanhaja 1y agoYeah, 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).
- dschuessler 1y agoI find it sad that Astro advertises itself this way, because I think that it is perfectly capable of building web projects of any complexity, simply by means of the component libraries you can plug in. What makes it so great is not that it serves a particular niche (like "content-driven websites") but that it provides a developer experience that makes it incredibly easy to scale from a static website to something very complex and interaction-heavy without compromising UX.
- paintbox 1y agoThat's the point. It's a war on recentish industry standard to develop all projects using same tools made by/for huge organizations working on huge projects. Same thing happened with microservice architecture.
- willtemperley 1y agoYou could have React in one Astro island and SvelteKit in another. That's complex enough.
- hasanhaja 1y ago
- sublinear 1y ago> When I say Astro sites are fast, I mean properly fast. We're talking 40% faster load times compared to traditional React frameworks. That's a really low bar. Why not static pages? Why even use a framework at all if you're thinking of using Astro?
- dschuessler 1y agoPer default, Astro generates static pages. So it makes sense to compare it to an approach that doesn't. Using a framework has upsides over writing static pages manually. Most notably, you can decompose your website into reusable components which makes your implementation more DRY. Also, you can fluently upgrade to a very interaction-heavy website without ever changing tech or architecture. But that's just what I value. I whole-heartedly recommend trying it out.
- oblio 1y agoWhat about static site generators, in that case?
- zffr 1y agoHow do you do server-side rendering without a framework? If you use static pages, how do you make sure that shared UI like navbars all update if you decide to make a change?
- rossant 1y agoStatic site generators?
- input_sh 1y agoPretty much every static site generator has an option of splitting a page into reusable components, so something like: <html> {% include "components/head.html" %} <body> {% include "components/navbar.html" %} ... </body> </html> Some even allow you to pass variables, so something like: {% include "components/button.html" text="example" url="https://example.com" %}
- rasmus1610 1y agoI recently build a website for a medical practice using Astro. I was amazed by how easy it was compared to my experience with Wordpress for this several years ago. And I can host it for free on something like Netlify and I don’t need to worry about the site being hacked, like with WP. I even built a very simple git-based CMS so that the client can update the content themselves. Web dev has really come a long way, despite what a lot of people say.
- ewuhic 1y agoWere you commissioned by a friend? How does one find a gig building a medical practice website?
- rasmus1610 1y agoI’m a doctor myself and thus have contacts to people having medical practices :) But at least in Germany there are some agencies doing nothing else.
- steve_taylor 1y agoBe careful with Netlify. Their bandwidth charges are even more egregious than Vercel’s.
- rustc 1y ago> Be careful with Netlify. Their bandwidth charges are even more egregious than Vercel’s. $550/TB for those who want to save a search.
- rasmus1610 1y agoYes, good point. Although the traffic for these websites is so small, that I think I‘m good there for a long time.
- throwaway77385 1y agoUntil you get DDoS'ed and they won't let you set a billing cut-off -.-
- pjmlp 1y agoFundamentals of the Web haven't gone away, anyone still coding across PHP, Spring, Quarkus, ASP.NET MVC hasn't noticed that much how bad things have become with JS frameworks. Unfortunately in fashion driven industry, it isn't always easy to keep to the basics.
- camillomiller 1y ago>> See that code fence at the top? That runs at build time, not in the browser. Your data fetching, your logic - it all happens before the user even loads the page. You get brilliant TypeScript support without any of the complexity of hooks, state management, or lifecycle methods. This is satire, right? If only there was any other server side language that could do the same and produce static compliant super-light HTML-first pages!
- tajd 1y agoI ported my personal website from Jekyll to Astro a few weeks back and I really liked it. Astro is much easier to build and extend for me (and that is a personal preference point - I (and by I mostly mean claude) - and it's cool to add react components in to create more interactive points (but I haven't deployed that element yet). Speed is probably the same as jekyll - but relative to my react vite and nextjs apps it's about 10 times faster. I would definitely use Astro for more complicated websites than content driven - but would probably return to nextjs or more hefty full stack solutions for complicated web apps.
- hasanhaja 1y agoDo you have an intuition of when something becomes hefty and complicated, and would require a full stack solution like Next.js?
- tajd 1y agoI 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.
- kh_hk 1y agoTo me no, it's not. It works well for some of the use cases, but if all you needed was offline rendering of your js in a build step to generate static html then you really didn't need all that js to begin with. islands work until they don't, and a lot of stuff gets inlined too. I guess it's fine if you stop caring about the final build. I feel a lot of the hype around Astro has more to do with vite than anything else. And there yes, without doubt, vite is amazing.
- rustc 1y ago> islands work until they don't Like when?
- kh_hk 1y agoSetting `client:load` and `client:visible` for (svelte) islands you want to run on the client ends up inlining script type modules all around the html. It looked like a big hack to me. On the positive side their use of web components is a nice bet.
- rustc 1y agoAnd does it break something? I was replying to "islands work until they don't".
- kh_hk 1y agoIt breaks the third wall.
- dannye 1y ago>> On the positive side their use of web components is a nice bet. Web Components are a JavaScript/ECMAscript standard. So this is like saying: _Their use of Arrays is a nice bet_
- kh_hk 1y agoWell I don't see other frameworks besides lit advocating for web components
- deleted 1y ago[deleted]
- lpln3452 1y agoI've only heard of Astro before, but I got interested today and it seems like an intriguing framework. That said, Astro also seems to be developed under a venture-backed company. Is it still less likely to end up like Next.js and React under Vercel's influence?
- Zealotux 1y agoPlease stop recommending Next.js as the de facto React framework, we need some critical thinking back into front-end. Remix (React Router v7) or TanStack are much better alternatives.
- vidyesh 1y agoRemix/React Router v7 was/is on a right path. I hope whatever they are planning with Remix with preact and using web standards will bring back the robust way of building websites. I did not like how Remix to RR7 transition was made though, my project built using Remix was not an easy upgrade and I am rewriting a lot of it on RR7 now.
- Zealotux 1y agoAbsolutely agree, the Remix/RR7 move was awkward and they have a thing for breaking changes, TanStack seems more reasonable on that part.
- c-hendricks 1y agoWe're still on RR5 since they decided to change how nested routes work, a nested router doesn't get all params from parent routes, and after advocating absolute paths they switch to advocating relative paths, which are a mess when you want to use a component in multiple places and harder to debug / verify (all our routes are fully typed safe)
- throwaway77385 1y agoSecond this. Next.js had potential, but it feels like it's gone downhill majorly since Vercel got involved. Been on the Next.js journey since v10, lived through the v13 debacle and even now on v15, I've very much cooled on it. I find both React and Next.js move way too fast and make incredibly radical changes sub-annually. It's impossible to keep up with. Maybe it could be justified if things improved from time to time, but often it just feels like changes for changes' sake.
- ijusthadto 1y ago
- marcosscriven 1y agoDoes this have any advantage over something like Hugo, for a static only website?
- yakshaving_jgt 1y agoGotta say, even as a programmer, my "f* dreams" don't involve programming.
- ygritte 1y agoFor me, a return to web fundamentals would include not having to use NPM.
- fuzzy_biscuit 1y agoAstro didn't introduce island architecture.
- pentagrama 1y agoBut it has a CMS? The author said that replaced WordPress sites with Astro, and on https://astro.build/ https://astro.build/ I see a comparison to WordPress. Astro brings a friendly UI to maintain and update the sites? Like the WordPress panel and editor.
- abound 1y agoNot sure if anything major has changed recently, but I think you bring your own CMS. I've used Astro successfully with Strapi, for example.
- Y-bar 1y agoIf they need to bring in a CMS to edit content and juggle assets they could have used Wordpress in headless mode, which the customer was already used to… Eg. https://www.gatsbyjs.com/docs/glossary/headless-wordpress/ https://www.gatsbyjs.com/docs/glossary/headless-wordpress/
- rob 1y agoIt doesn't, which is why all these solutions breakdown long-term compared to things like WP for small biz brochure stuff. 5 to 10 years from now when you're no longer talking to your client who has absolutely no technical experience, they're not gonna know that their website code is in some random GitHub repository that needs to be compiled with vite and then you need to magically wait for Netlify/etc to pull in your changes. They'll probably be fuming they have to find a developer that knows how to edit and manage that compared to something like WordPress which is used for the majority of those websites.
- pier25 1y agoIt would be cheaper to hire a dev to update some content than to pay a wp host for 5-10 years.
- bogwog 1y agoI just did a search for "wordpress hosting" and picked one of the first results without shopping around, and the (clearly overpriced) plan I saw was $9.99/mo. In ten years that'd be $1200. A WP deployment on a simple shared hosting plan like that could run itself without needed a dev or sysadmin.
- richardfey 1y agoReminds me of Zola (https://www.getzola.org/ https://www.getzola.org/), which was a step up from Hugo for me.
- account-5 1y agoI this not similar to htmx?
- nchmy 1y agoHtmx is just a js library that helps with Ajax. Astro runs on your server to largely do static site generation, and also has htmx-like capabilities. I prefer htmx and, better yet, datastar as they're backend-agnostic.
- jadbox 1y agoWhy do you prefer datastar vs htmx? Afaik htmx tends to allow progressive enhancement without JS, while datastar requires JS to work.
- nchmy 1y agoHtmx IS JavaScript... Datastar does everything htmx does and much more. And, iirc, is also smaller. Just explore their site, docs, essays etc
- jadbox 1y agoOh okay. While Htmx-the-lib is JS, the standard practice is to make the site progressively enhanced by Htmx such that it still works without JS and improves accessibility for screen readers. While this could be possible with Datastar, I've read that it's generally more work to enable progressive enhancement, but maybe that's not a goal.
- nchmy 1y agoAgain, datastar does everything htmx does out of the box, and far more.
- mediumsmart 1y agoI have returned to the fundamentals of the web and there is no sign of Astro here let alone JavaScript.
- nchmy 1y agoWhat are you using?
- righthand 1y agoHtml + Css would be a good guess. Me? I’m using Html + css + xslt.
- mediumsmart 1y agohtml and css - rsync for deploy and jekyll for building. the last hurdle to leave js behind was the responsive nav toggle - that is now a page instead of an overlay and css driven.
- user____name 1y agoHow is this different from something like PHP? I don't get it.
- shreddit 1y agoIt’s actually a lot like php, just without the php language stuff. It’s php for javascript devs?
- nchmy 1y agoThe difference, it seems to me, is that astro is a framework and, specifically, meant for server side generated static pages with a bit of dynamic elements in them. I don't think it is all that capable of doing highly dynamic SSR apps (though their server Islands might make that possible? https://docs.astro.build/en/guides/server-islands/ https://docs.astro.build/en/guides/server-islands/) And, also, "php" in your question could be ruby, go, C or anything else that runs on the server. I prefer htmx or, better yet, Datastar which are both small, backend agnostic, js libraries for making ssr html interactive to varying degrees. You could, in theory, use astro with them but probably better to just use something else.
- aembleton 1y agoPHP needs to be hosted on a server that can parse PHP. Astro generates HTML so can be hosted anywhere that can serve HTML.
- nchmy 1y agoWhat? Astro needs to run on a server that can run node etc And php can equally have its html cached.
- aembleton 1y ago> Astro needs to run on a server that can run node etc It needs to run on your computer to generate the HTML, but you can just run npm run build then copy the contents from the dist folder to your apache server, or whether you want to host it. At least, thats how I do it. I haven't used PHP for about 20 years so I'm sure its changed a lot.
- donatj 1y agoThe title change lead to a bit of an unexpected jolt, I assumed I'd clicked on the wrong link. I'm not sure where that falls on the guidelines though given the circumstances.
- aswerty 1y agoIt's clear to me that the frontend conversation space is broken. Not even just the ecosystem being a mess. Boiling down the conversation I see in the article, it just seems to be: the browser as a HMI vs the browser as a an application runtime. Depending on what you want to do one might be a better fit than the other. But the points it puts forward are fluff arguments like "it's a breadth of fresh air" or "it loads faster". It's difficult to articulate the source of just how broken the discussion space is; nor have I made a particularly strong argument myself. But I think it's important to keep pushing back on conversations that position framework's like they are brands winning hearts and minds. Ala the fashion industry.
- nchmy 1y ago"Loads faster" is fluff? How so?
- deltarholamda 1y agoWrite some straight HTML pages and serve it from bog standard Apache. Heck, get really fancy and do some server-side includes for your CSS or something. It's really fast, you can edit it with Notepad, and you can probably saturate your bandwidth with a consumer level PC. It's fluff because, well, our expectations are so unbelievably low. By the time you've bolted on every whizbang dingus leveraging four different languages (two of which are some flavor of Javascript), your twelve page site takes a couple of minutes to compile (what?), and it chokes your three load-balanced AWS compute nodes. Web applications are hard. I get that. Web sites? They were, by design, incredibly simple. We make them complicated for often unclear reasons. I appreciate what the Astro folks are trying to do, and it's very clever. But your basic Web site need not require freaking npm in order to "return to the fundamentals of the Web".
- nchmy 1y agoBut astro literally generates straight html which can be cached wherever you want... As for build time, I don't have a clue - I haven't used astro (and don't plan to. Datastar + whatever backend framework you want is better). But I'm generally in favour of the direction they're bringing JS frameworks.
- evklein 1y agoMy personal website is written with Astro. I love it! Admittedly I'm still a little trigger-happy with my JS usage, but overall the ability to write templated pages and utilize islands that don't require big dependencies is the most friendly web development experience I've had. https://evklein.com https://evklein.com
- oblio 1y agoYour website isn't loading for me.
- evklein 1y agoGive it another shot. Azure static web apps are no bueno when it comes to reliable hosting...
- oblio 1y agoThe second shot didn't go well :-) Edit: Ah, finally, it loaded after about 30 seconds. Edit 2: Fairly neat.
- evklein 1y agoFrom what I understand static web apps have a 'cold start' where if they haven't been touched in so long they get killed. I need to just add a function app that pings it periodically so it never goes down. Thank you! Appreciate you sticking around and trying it again :) I am fairly proud of it, even in its simplicity.
- andrewwy 1y agoneither for me
- evklein 1y agoTry again, I had to adjust my hosting plan.
- hiAndrewQuinn 1y agoI've become pretty convinced everyone working in software should have a something like a static site generator somewhere in their back pocket. It could be Astro, Hugo (my choice), or even pandoc running in server mode, which is unhackable because you would have to first understand the Haskell type system to hack it. But it should be there for all the little times you just want to spin up something fast, cheap, and content-driven.
- thinkindie 1y agoWhat I don't understand from these conversation is the main selling proposition for Astro: if you have a content-heavy website, you should ship zero Javascript. And I agree with that, most of the websites heavy in content will at most have a couple of pages consumed in a single session. But if my "website" is an application, Javascript makes the whole user experience better, if implemented well. It doesn't matter that the user will wait for 1 more second if they will have to spend the entire day working on it.
- sadeshmukh 1y agoThe selling point is that you can ship JS, but only when necessary, and only scoped to the components that need it. It's not at all about removing the framework entirely.
- deleted 1y ago[deleted]
- sktrdie 1y agoNext.js hydrates only client components - so effectively it's doing island architecture. And it's react end to end. How's that different from Astro? Stating things like "Components without the complexity" doesn't really mean anything unless you do some comparisons?
- voat 1y agoClient vs server routing
- wackget 1y ago"The fundamentals of the web" does not include a build step or the use of a package manager.
- nchmy 1y agoBackend stuff is orthogonal to web fundamentals. What matters is ssr html. Still, yes, I prefer other tooling in the backend. But astro is a good thing for JS devs
- FabHK 1y agoCould someone compare it like I'm 5 to static site generators like Hugo, Jekyll? Does it make it easier to throw in necessary JS (e.g. for comments)? Thanks.
- todotask2 1y agoComing from Go, I don’t enjoy working with the Go or other template engine, I have comparing various 3rd party Go template libraries, and settle down with JSX-like syntax, which is just way easier. You should try it out, not comparing.
- ijusthadto 1y agoAstro is, and should be treated, as a static site generator. > Does it make it easier to throw in necessary JS (e.g. for comments)? With astro you can combine html, css and js in a single file (.astro). You write plain JS (TypeScript) within <script> tag. There, you can, e.g. import your comment library, point to separate .js/*.ts file or write whatever logic you want for client-side JS. See the docs for example JS usage in astro components: https://docs.astro.build/en/guides/client-side-scripts/#web-components-with-custom-elements https://docs.astro.build/en/guides/client-side-scripts/#web-...
- todotask2 1y agoJust curious if non-techy folks might ask whether Astro is reliable enough for production use, such as e-commerce, marketing sites, etc.
- ijusthadto 1y agoNon-techy folks often don't touch terminal. With astro, you start with terminal. Can it be reliable for production use? Yes. Can non-techy make it reliable for production use? Who knows. E-commerce and marketing sites are at the two opposite sides of complexity spectrum. Astro would be perfect for marketing page (non-techy could approach that) and doable for e-commerce (for experienced dev). Whether it SHOULD be used for e-commerce would be another question.
- todotask2 1y agoI mean those are decision-makers, like managers or directors, small business owners, who will outsource or delegate the tech decisions to their developers or designers since they don’t have the skillset to design their site and branding themselves.
- paradox460 1y agoReturn? It never left for many of us Seriously. This is how things are done in most nonjs frameworks
- exiguus 1y agoI think the main benefit is that you are not forced to use any other library or framework like React or Vue on top of it. You can simply use HTML or Web Components. However, Astro can perform similar tasks to Next or Nuxt, such as SSR, ISR, static site generation, and middleware. Another differences and benefit of Astro is the island architecture, compared to other frameworks. This means you can implement micro frontends. Island architecture and micro frontends are features that companies or projects may want if they have multiple teams. For example, one team could be working on the checkout process, another on the shopping basket, and another on product listings. Now, you can use Astro to combine these components on a single route or page. And you control how this components are rendered. Astro also allows you to share global state between these islands. This approach is beneficial because teams can develop and ship a single feature while having full responsibility for it. However, it also has downsides, and similar outcomes can be achieved with non-island architectures. For instance, if all teams use React, it is common for each team to use a different version of React, forcing the browser to load all these versions. The same issue arises if one team uses Vue, another uses Angular, and another uses React or any other framework. I'am not fully convinced that it will change the web. It is basically a Next or Nuxt without the library/framework login. And it overs the Island-Architecture, that is usually only beneficial for very huge projects. But, you should try it. I work with Astro since there first release, now for several years, and I can recommend you to give it a try. It is also a nice tool, if you want to get ride of React or Vue and move to web-components or if you want to replace Next or Nuxt. You can do this with Astro, step by step.
- pks016 1y agoI tired Astro but not for me. I was upgrading my personal website from Jekyll to Astro couple of years back. It was a steep learning curve with lots of folders. Things used to break all the time. Then I switched to raw html and css
- ulrischa 1y agoThe Island concept is really exactly what php is doing since decades
- mrcwinn 1y agoTanstack Start is another nice alternative, if you need a bit more, but don't want to go with Next.js.
- 5350-uiop-1130 1y agoit says static html and css but open the site and first thing i saw is an npm command. yuck.
- ijusthadto 1y agoBecause there is a build step. npm run build -> static html and css
- aiiizzz 1y agoI do not want to go anywhere near "fundamentals of web." E.g. html forms are such a badly designed mess, just look at checkbox form field.
- hasanhaja 1y agoBut 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?
- aiiizzz 1y agoI don't think so. If your framework is high level enough, you've successfully outsourced the bad stuff to someone else.
- hasanhaja 1y agoBut 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.
- aiiizzz 1y agoYou won't need to do "everything that's possible on the platform." You want to constrict yourself to the parts that work well.
- agosz 1y agoHow does this compare to a static site generator like 11ty? What would be the benefits of Astro over that or another site generator?
- microflash 1y agoAlthough Astro is great and all, it collects telemetry by default and requires an opt-out. Zola and 11ty, on the other hand, don’t do such nonsense and have way smaller dependency footprint.
- darqis 1y agoWhy would you SSR with JS when there's Go and Rust? Why? Why waste so many resources on purpose?
- aligundogdu 1y agoI recently migrated my blog from WordPress to Astro (https://aligundogdu.com https://aligundogdu.com). The development process was genuinely enjoyable, and the performance boost especially in SEO and speed scores was a fantastic bonus.
- sureglymop 1y agoAstro is great and I had a good experience using it. However I still don't like the complexity needed. I don't mind a build step per sé but I'd just like to know that todays version of my site can still in ~5 years.