Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Tounai14033dI am currently writing a nextjs app right now and things are : messy. I deeply regret not going for react as I find SSR totally useless, especially for what I am doing, and I try to bother with the less stuff I can. I am more focused on backend and infra stuff usually so it might explain my incompetence partially, but when it comes to frontend, my approach is the shortest path to working. The guy before you probably did the same and I won’t blame him for that.
-
Nmeri172123d@Tounai I don't think he used nextjs for anything, it's all react. I looked up the differences after seeing your comment. It's just ssr and authentication. He used neither. He used more of typescript though (tsx)
The main feature of nextjs, which is writing back end on the same codebase and sending it to the view before page load, we don't have that. BUT, I'm grateful regardless. I've used react native in the past and now nextjs, but never react itself. All the "context", redux, hooks and stuff sucks and makes me sick. I see them in articles and am glad I never have to actually put up with it -
devJs13492dEnterprise app with tons of features? Ok Nextjs is maybe the right tool for that. I learned that it is swiss army knife but people at most need like just the clipper and maybe the toothpick!
I would never choose nextjs for my personal project/saas project as there is Astro, lord and saviour that ships minimum js in the bundle. Has ssr, has client side, has hybrid, borrows good things from next and you can use react/vue/svelte all at once if you want (you don't, but you can) with islands.
Next js is in my opinion ok tool, but it can become dumpster fire quickly if devs are not super familiar with the framework.
I inherited a nextjs project from an unknown guy and am fangirling the codebase
But the deeper I familiarise myself with it, the more the cracks begin to appear:
1) The dude Is incapable of grasping the basics of DRY concept. He actually setup a ton of stuff I may have done poorly if I'd started working straight out of the docs, so I feel like I owe him a shower of praise. I guess being new to nextjs makes it look more impressive than it actually is. He was paid off, yet getting the credit seems unearned to me. I'm just afraid reaching out to him might turn around to bite me in the ass
***
I had the above in my drafts, contemplating sending him a token to show some appreciation for unknowingly showing me the ropes. I was going to find him on LinkedIn using his commit names. But after doing everything I've done, undergoing the anxiety and severe pressure I faced at the hands of the project owners, I'm not sharing a farthing with anybody
Yes, I may not have known about zustand and persist middleware. Yes, he did all the ui. Yes, he created the base components and fancy wrappers around form and button html elements. For those, I'm grateful
But the amount of refactoring I had to do to, for an opportunity to implement my own target features, I'd say I can lay as much claim to the project as he does.
Side note #1: I have some newfound respect for front end devs. We used to discriminate against them for doing just css but that was only relevant in the jquery days. Now, they have to use cryptic css frameworks (sass, less, tailwind), they have to learn esoteric syntax of some js framework and write controllers/components as the case may be. They have to (the worst part), bind this data to an API, which would never make sense to me coming from a php ssr-natural world
Back rewarding the guy, some of the challenges I came back from were:
1) Next server outages: I still don't know the workaround this. The app terminates, browser giving an error about using up memory. I have to wait for about 10 minutes before I can access the app again
2) spring Webflux authentication not hydrating: I was unexpectedly asked to work on the back end too, where I got tortured with this horrifying condition. The most poorly documented framework for the Web has no upto date guide on how to implement jwt security measures. I opened a question on stackoverflow. A day later, both my question and the helpful answer got downvoted
3) Zustand not retrieving any data from localstorage once page reloads, until I miraculously stumbled on a hack: there's a config callback for reading state after rehydration or thereabout. So I interact with the state there. That's the only way content clearly in localstorage can get transmuted into dynamic format accessible by the code
4) Mongo database suddenly disconnecting: for no apparent reason, this bailed. Accessible on compass. This was even when I realised it was responsible for front end requests not going through. Eventually created a new database and requests surprisingly began connecting again. Thankfully, my laravel background taught me about seeders so I had them on standby from the onset. Wasn't difficult to just port to a fresh database after confirming the first one was inaccessible to the app
After this painful odyssey and the time constraints, threats of moving forward with someone else, I deserve every dime they deem me worthy of and more
rant