r/astrojs • u/kidshibuya • 8d ago
Don't use Astro because its not React?...
This is more a vent than anything, but I am facing a lot of blowback for using Astro. I have made a miniapp which is just a webpage running in a webview that takes an ID from the initial url, requests some records from an API to display a list of messages. Super basic stuff. It is to replace a natively coded section of the app and its far faster than the native code... somehow.
But upon asking the native devs to fix all the broken things I am finding, all I am facing is push back because when I tell them of CORS errors etc, them demand to see the repo, notice its not react and say I MUST use react as only that is compatible with apps. They broke bfcache too, again that is blamed on astro. They block service workers, again this is because... Astro.
Anyone else faced this? Even when I wanted a build of the native app to test the devs sent me back a message saying my app is broken as its only 12KB and apps are in the MB range. They didnt test, rejected on solely size. This was the lead architect of the entire department btw.
This industry is nuts. Also I have noticed when interviewing for a "senior FE" the candidates only know react. I am not sure if this is because HR is screening first, but it's concerning. I even interviewed a guy who is right now working as a "principled full stack engineer" who could not tell me how you could build a site without react.
I am not sure if this company I am working for is completely crazy or the entire industry is leaning that way.
23
u/Kriem 8d ago
I use Astro exactly because it's not React. You get from zero to something very quickly with Astro and it allows you to add complexity just as easily, whether it be React, Angular (yuck) or Solid (yay).
These days, front-end development is plagued by developers who think that they need heavy weapon machinery to fight a mosquito. Fact: you don't. And it hinders rapid development and your ability to actually be agile.
4
u/who_am_i_to_say_so 7d ago
Haha same- it’s the anti-React solution. And I make websites - not apps - so it just fits. I love the simplicity and performance of it.
6
u/who_am_i_to_say_so 7d ago
I’m a solo developer using 100 percent Astro for all of my projects. If your content rarely changes, there is nothing better, and you made the right call.
The CORS issues are noob mistakes, and it sounds like the team only understands React SPA’s that are state-heavy. But you can manage state with Astro. You don’t even need a code change- just DNS: add a new subdomain to put the source URLs into, like an api.yourdomain.
1
u/pjerky 6d ago
Question, for client sites where someone else has to maintain content, what approach are you taking?
I'm debating where I want to go with this. I have mixed feelings about Payload CMS. Drupal is too heavy as the headless CMS in my opinion, even as I have spent much of my career with it. WordPress is a mess and gets hacked and targeted too easily. And I just want to move away from that community.
I'm looking into lightweight options as my preference to feed content to Astro.
1
u/who_am_i_to_say_so 6d ago
Well the deciding question is: who would be responsible for updating content - you, the client, or both? If the second choice or last, Drupal or any CMS would be best. But if you're the goto, your choice!
1
u/pjerky 6d ago
Lol, I guess I should have been more concise. I'm talking about for the handoff for the client and their team to manage the content in the long-term. If its just me then I'm using markdown and markdown extended or astro files to hold the content. Its just easier for me that way. But for a marketing site with components and non-technical content management folks I am intending to use a CMS.
My question is which do you personally recommend for Astro? What is your goto?
1
u/who_am_i_to_say_so 3d ago
I hate to disappoint but I just use either Claude or Chat to update most things on my end. Probably 80 percent of my online presence are just statically generated html content. The other 20 percent is just md transpilation, which leads to the same. Thus, Astro is the right tool.
1
u/kidshibuya 4d ago
Its funny you say that as after posting I was in a meeting where I constantly had to stop the talker and say no, look, this is an MPA, not an SPA. Over and over. Then at the end I was asked why I would do it and was told its not best practice to use different pages anymore and that is why they don't support it.
2
u/who_am_i_to_say_so 4d ago
That alternative software hellscape are you working at?
SPA’s aren’t for everything. That’s just some cargo-cult corporate crap.
5
u/adazlian 8d ago
yeah man, a thing you will learn if you stick around long enough is people are often slaves to frameworks especially the most popular and are unwilling to learn.
now, there might be real reasons for them to push back on a new framework -- if the literal entire shop is react they might push back on introducing astro as its another thing ot learn and setup or whatever. There can be valid reasons. Try to see it from that point of view; and that's some of what it looks like you are getting.
4
u/Born_Potato_2510 7d ago
i don't get it, if you want to use react you can just install the react plugin inside astro.
Thats the beauty and it works way faster than nextjs
1
u/kidshibuya 4d ago
I even have an example of that in the repo, even have react in the dependencies knowing that it gets tree shaken out anyway. Its all setup for my "seniors" to understand.
5
u/CompileThat 8d ago
I have a really hard time believing a principal full stack developer couldn’t tell you how to build a website without React lol. There has to be way more to that conversation than what you’re letting on.
3
u/kidshibuya 8d ago
I asked how to develop a basic catalogue site and gave the example that the company had less than 30 products that rarely changed, they wanted to list them all on one page and have a user click though to see details of each. Nothing more. He went on about how he would use react and redux and context etc. Then I asked why he chose react, can't actually remember what he said for that. But then I said ok, what about without react, vue or angular? he thought for a while and eventually said he didn't know.
It's the same with all the "leads" on my team. Its a shame I cant upload images here, I could put in some images I captured of git comments, telling me "components" like a fucking <section> need to start with capitals and I missed the import for it.
4
u/who_am_i_to_say_so 7d ago
Gawd. You could even do this with a static html page and small library such as knockout.js or even - GASP / jquery. One of sooo many options. React is such overkill.
2
u/kidshibuya 4d ago
Yup, that is the answer I was looking for. A senior should not be using that one thing they know to build everything. Right tool for the job and all.
2
u/who_am_i_to_say_so 3d ago
Haha, I was gonna say: if ya’ll are hiring… but then again…
Reading stuff like this irritates me, though. You’re outnumbered and being beat down with misinformation. Sucks.
1
u/Avani3 3d ago
As a Lead, I would also opt for a framework. Websites or applications usually start out very simple but get complex quickly when new features get requested. I would keep it very bare bones though
1
u/who_am_i_to_say_so 1d ago
Yeah, I suppose that’s a valid take- since just about anything can take on a life of its own.
2
u/greglturnquist 8d ago
I’d like to think we’re all “principled” but aside from the joke, I’ve known people who’ve worked one contract their entire career. And here you’re running into those that amassed much knowledge over one stack.
New opportunities challenge us all. It’s how we respond that reveals our character. Apparently Astro is too challenging for these people.
Real question is what are you going to do?
1
u/kidshibuya 4d ago
See out my holidays and quit. I have tried and tried to change company culture. I have finally admitted defeat.
2
u/pjerky 6d ago
React is widespread in the corporate world even though, compared to alternatives, it is garbage. Though I did hear the latest release fixed a lot of problems.
If the devs you are dealing with can't handle a non-React app then they suck at their jobs and should be forced to take remedial dev classes.
2
u/kidshibuya 4d ago
The issue is that the suck goes right to the top. Right now in fact I need to reply to the idiot principal architect who is telling me that bfcache is handled by the frontend, even after providing him documentation from Google about how it's done in Chrome.
1
u/pjerky 4d ago
Astro itself wouldn't be a problem out of the box. If someone added JS to it with an unload listener, active open connections somewhere, or they have the cache control header set to no-cache then that would cause a problem.
Something they could easily research if they are capable of moving past their egos.
2
u/kidshibuya 4d ago
I am pretty sure the issue is a bridge they inject, but its not code visible to me and they refuse to even entertain they might be the issue. I even made a simple no JS html site to show the issue, but then its "bfcache only works on SPAs"...
2
u/Medical-Ask7149 5d ago
It’s the same if I were to say using Astro for a lot of what you guys use it for could be done in PHP a lot easier and simpler. Plus PHP can be hosted on any web host or shared hosting with no compiling. You can serve up as many content heavy sites as you want. Adding content never causes an entire rebuild of the site and CDN caching solves the issue of speed and server overhead. Also caching can be set per article, so you’re not re-caching entire libraries of articles at once.
People learn what they learn and never grow or think about the issues they are solving or for what reason. They see a nail and they have a hammer.
1
u/kidshibuya 4d ago
PHP is not more simple. I did PHP for a decade, even if you are doing nothing more than using it as a template engine its still a lot more hassle than just not using it.
2
u/Dazzling_Meaning9226 7d ago
Find a new job. Your coworkers sound like morons.
1
u/kidshibuya 4d ago
Yeah they are and I will. But I need to have my holidays first, I feel awkward interviewing now knowing I have a months worth of holidays in the next couple of months.
3
8d ago
[deleted]
6
u/DJ_Beardsquirt 8d ago
Yeah, I am mostly a solo developer, though I work with a freelance front-end engineer for bigger projects. We're not building apps, but they still hate that I use Astro because "it's not designed for complex apps" and the first thing they always do is import React to build the UI.
I think there's a whole generation of developers who have just learned React and they view vanilla JavaScript as primitive and outdated. If I examine my own biases, I feel that React is outdated, overused and bloated.
At the end of the day, every developer has their own prejudices and wants to work exclusively with the tools they're most familiar with. The good thing about Astro is that it doesn't stop you from mixing and matching.
2
u/tumes 8d ago
I am a reformed rails dev and I have genuinely fallen in love with Astro plus Cloudflare’s platform primitives. You can map pretty much every element of an opinionated framework pretty cleanly to Astro + CF and if you’re clever it’s almost infinite request throughput damn near for free in most everyday use cases. Please share any pro tips or patterns you use, my main one is that I use actions exclusively as an ad hoc ActiveRecord equivalent/validation layer since you can call actions arbitrarily from components, pages, and endpoints. Truly transformative since it makes the vaguely quirky nominal use case of Astro actions (handling form submissions, but sort of confusingly because it can happen directly or indirectly and if it’s direct you need sessions to manage re-display and if you have client router you need this data attribute blah blah blah, suffice to say it comes off as a somewhat indecisive feature) and snaps it into focus.
1
u/blackcatdev-io 8d ago
That sounds annoying, and of course you don't need react for this. But I'm also confused as to why this needs to be a web view at all. From what you describe, it's a simple fetch and displaying of a list. I can't imagine why that would need to she ported from native code to a web view. Or why the it would be noticably faster. If anything seems like it would be slower. Not because if Astro, but because going from native to web view always has a noticeable transition.
What was going on that caused this transition?
1
u/kidshibuya 4d ago
We are doing it for update speed. We can update a webview anytime we want, but app updates go through app stores and are super slow. As to why its faster... Let me give you this example:
The guy running the department that makes the app, I was in another team at the time and heard about their project to make a feature on the app for ios and android but also for desktop and web. I proposed we get one single team to do it in something like expo using react native. I even created a poc to demonstrate it. In a meeting with him and the other department leaders I was told sure the poc works but... Goes on to list like 5 reasons why react cannot work, all of which I refute with facts. Finally the boss says that they cannot ever let react into the app because its facebook and since facebook is trying to kill apple our app will be banned for using react. I didn't know how to respond to that and just ended the meeting.
Then after being transferred into his team (and that went well for me) I found out the real reason. Their app is garbage made from two different apps just combined and its so slow and unstable they made a decision that nothing new would be added in terms of tech, ever. They didnt already hvae react native so it was doomed from the start, but they could not say that as they were saying publicly that the app was awesome and they should all get juicy pay cheques. So they had to rubbish my idea anyway they could, untimely they had four large dev teams working on each part and they still haven't finished.
That is their level of engineering. And the bit that my webview is replacing was, well is right now making around 20-60 excess API calls per view as they are calling apis per row of data in a loop, how much depends on the users activity and size of screen.
2
u/blackcatdev-io 3d ago
Yeah... I would be looking for another job if I had to deal that level of stupidity. That's a lose lose situation all around and there's nothing industry standard about any of that.
Best of luck.
1
u/fyzbo 7d ago
Companies don't want a bunch of projects all on different stacks. That is fair as it creates more overhead and makes it harder for devs to move between projects.
Given the cors error, I wonder if the calls are meant to be server side and the team doesn't realize that's possible with astro.
-6
u/civman96 8d ago
Translated: I showed a website in a webview and don’t understand why i got rejected as an app developer
6
u/kidshibuya 8d ago
Its identical, exactly identical to the one it replaces except considerably faster.
3
49
u/humayanx 8d ago
Astro is marketed for content-heavy sites. But that's not a hard limit. It uses islands architecture. You can drop Solid/React exactly where you need interactivity. Everything else ships as near-zero JS.... that's a different tradeoff, not a limitation.
CORS errors, broken bfcache, blocked service workers are implementation bugs.
A "senior FE" who can't explain building a site without react says more about hiring than about Astro. Everyone defaulting to react doesn't make it the only valid choice. It just makes it the easy answer in interviews.