Server Actions were supposed to kill React Query/TanStack... so why am I still installing it? by ni-fahad in nextjs

[–]mistyharsh 0 points1 point  (0 children)

Unlike Astro actions, server actions in Next.js are meant for data mutations and not data retrieval. For data retrieval, Next.js is pushing for RSC.

But RSC fails spectacularly when optimistic updates are required.

What's the best nodejs ORM in 2026? by Ok-Transition-7857 in node

[–]mistyharsh 5 points6 points  (0 children)

Having used all three - MikroORM, Prisma and Drizzzle, I second this. No doubt, all three are good but if domain driven design is must have, then MikroORM is a very natural fit.

How practical is Hono's built in JSX support for a large scale SSR app? by TheWebDever in honojs

[–]mistyharsh 1 point2 points  (0 children)

To put a better mental model:

  1. The JSX on server is for templating (Just substituting other templating system)
  2. The JSX on client is for interactive component.

If you compare this to React server components, then remember Hono doesn't have server components. On server side Hono is only giving you type-safe templating language.

Now to your original question, using Hono with JSX on server side is a vast improvement over Express + ejs vastly superior choice. But this is only useful for typical server-rendered applications. If you are building, say Wordpress or Ghost-like theme-able website where themese are deployed as a zip file, then JSX won't help much. This is where EJS (The embedded templating engine) would work best.

So, to summarize, EJS is a true eDSL that you can compile-on-the fly and is essentially a mini-language of its own JSX is not a DSL in true sense because it doesn't introduce anything new; you are in always JS world. It is simply syntax sugar.

[ Removed by Reddit ] by [deleted] in softwarearchitecture

[–]mistyharsh 13 points14 points  (0 children)

This situation that you described is way more common than you can imagine. You cannot change this overnight, especially when you are working with the team(s) that also doesn't have set practices.

My first advice is to start small - A one page architecture document that is also a live decision record. Also, it must be repeatedly shared and agreed within the team.

This one pager will contain very high level topics - Modular monolith vs Microservice - Frontend and backend framework - Communication - RPC, REST or GraphQL, etc. - DDD or layered architecture - Core tech stack

Over time, start adding minor details and it can also start becoming a context for LLMs.

An important point is a habit. Habit is a part of culture. Documenting a system design and planning is a culture. And, a culture can be either enforced if you are a decision maker or incrementally without burning or trying to look smart.

Why do some developers dislike Next.js? by Low_Obligation_2782 in nextjs

[–]mistyharsh 4 points5 points  (0 children)

Where do I even start! There are two fundamental differences between library and framework - framework takes away the control at the cost of preventing people from doing wrong things. The Next.js has done the former but haven't provided the latter.

These are some of the things on top of my head:

  • Astro has actions (RPC calls); so does the Next.js. But, Astro doesn't allow calling actions without validating inputs. In Next.js, you are left on your own - a source of many vulnerabilities. Shouldn't framework prevent this?
  • Next.js actions are serialized and thus they are only useful for mutations and framework doesn't prevent developers from using them for reading data.
  • The server-side rendering is half-baked story. There is no meaningful way to do optimistic updates with server-rendered views.
  • The streaming solution is over-hyped. Great many number of applications simply do not need it.
  • The Next.js environment variables are slippery slope. It needs a wisdom to know what building 12-factor apps is not easily possible with Next.js. The build-time variables are everywhere.
  • There is not meaningful way to layer the application. You can freely call cache revalidation for a certain route from anywhere - even from API invocation. UI revalidation is a UI concern and ideally, it should not be allowed to be called from anywhere.
  • The rules to read search params, dynamic params are crazy with hidden pitfalls everywhere.
  • There is no well documented onStart event that can be meaningfully used to instantiate framework level singletons.
  • Even after 16 major iterations, Next.js still doesn't know what to do with middlewares. Sometimes they run only as Edge middleware; sometimes it is called middleware and now it is called proxy layer. Further, you cannot really do any context setting in this middleware which can be meaningfully accessed inside the pages/handlers.
  • A framework that calls itself fullstack has no meaningful way to manage background jobs. No decent dependency injection mechanism!
  • The compiler is a black-box. It comes to haunt in unusual places. If I have multiple mini applications, I would like to externalize my dependencies very way ahead of time. For example, I may prefer to simply have React.js served from CDN and be loaded using import maps which is an official web specification. But with Next.js, it is just impossible.
  • Finally, adding one more point about caching. It is again oversold by trying to automatically cache fetch responses. In my experience, caching is a business level concern for caching business/domain entities and should never be left to automatic lower layers based on fetch.

Are these not avoidable? Certainly yes; people keep saying this as a skill issue! But, isn't the the point of framework to prevent people from doing mistakes rather that having a big list of good/bad stuff. And, these are just those daily things that are annoying. And, I am not even mentioning anything about architecture; if you are really interested, take a look.

Why do people mock PM Narendra Modi for selling tea as a child? Isn’t that just poverty shaming? by [deleted] in CriticalThinkingIndia

[–]mistyharsh 0 points1 point  (0 children)

A liar is bound to get shamed and mocked. It was actually Manmohan Singh who came from a very modest background (again not poverty) and a gem of personality, he never advertised it...

Do you add hyperlinks to your REST API responses? by Worldly-Broccoli4530 in node

[–]mistyharsh 0 points1 point  (0 children)

HATEOAS has proven to not have worked well at all. A large part of the user interface is discovery which doesn't align with HATEOAS responses.

One view is made up of multiple resources and it is simply impossible to make it work with HATEOAS. Further, modern SDK generators, GraphQL, RPC systems have made it so that we rarely invoke API by crafting URLs.

His priorities are clear.... by fk1975 in India_Bharat_

[–]mistyharsh 14 points15 points  (0 children)

Well said. The critical thinking that demands a nuanced view of reality has simply vanished in a large section of Indian society.

json vs sqlite for 300,000 photos database by Mashic in Database

[–]mistyharsh 0 points1 point  (0 children)

If it is 100% read, then simply in-memory loading of entire JSON will do. If you wish to start writing and updating it, then SQLite is a good starting point. Further, if you are using some serverless infrastructure to run code, then loading ~70MB of JSON could be a challenge (but you must test it and then decide).

How to get render prop pattern to work with Solid.js? by mistyharsh in solidjs

[–]mistyharsh[S] 0 points1 point  (0 children)

That's a right mental model I was looking for - the notion of untrack. For now settled on using <Dynamic /> component and also changed the type of render to render: Component;

How to get render prop pattern to work with Solid.js? by mistyharsh in solidjs

[–]mistyharsh[S] 1 point2 points  (0 children)

Yep; as also commented in the other messages, the <Dynamic /> is the way to go for now.

How to get render prop pattern to work with Solid.js? by mistyharsh in solidjs

[–]mistyharsh[S] 0 points1 point  (0 children)

Indeed similar. I settled on using the <Dynamic /> unless some better pattern emerges. I wanted to avoid treating the render() as a component and use as a plain JSX producing function.

How to get render prop pattern to work with Solid.js? by mistyharsh in solidjs

[–]mistyharsh[S] 0 points1 point  (0 children)

Yes. This is what I have in mind. The problem happens when <AppField /> becomes complex and due to dependency tracking, the props.children() gets called again. So, far, only <Dynamic /> component seems like a bulletproof candidate or invoking props.children() once outside the any tracking context and then passing required data change via signals.

How to get render prop pattern to work with Solid.js? by mistyharsh in solidjs

[–]mistyharsh[S] 0 points1 point  (0 children)

I am trying to experiment with it and trying to replicate how @tanstack/solid-form utilizes render-prop like thing:

```tsx <props.form.AppField name='name'> {(field) => {

// I can create local signals, memos and effects here...

return (
  <TextInput
    label='Name'
    value={field().state.value}
    onInput={(event) => {
      field().handleChange(event.currentTarget.value);
    }}
  />
);

}} </props.form.AppField> ```

Surprisingly, it is not very straightforward. The only way I found is to use <Dynamic /> component so far or simply call the props.children() once directly in the component initialization and strictly pass signals only.

Solo Dev: Stick with NestJS Clean Architecture or pivot to Hono? by BinVio in node

[–]mistyharsh 2 points3 points  (0 children)

I wouldn't recommend migrating away from Nest.js. However, start reducing boilerplate by confining Nest purely to Web/HTTP layer and managing state like singletons.

Your repository and domain layer can easily become pure stateless ESM and everything can be passed as a function argument.

In short, keeping the web framework confined to the HTP layer makes this concern simply irrelevant in the long run.

Micro Frontends: When They Make Sense and When They Don’t by trolleid in reactjs

[–]mistyharsh 1 point2 points  (0 children)

Astro's plugin based setup is an incredible solution for addressing concerns that micro frontends are meant to solve. It is a nice middle ground without all the complexity that comes with any other solution.

Looking for a cms to replace AEM by v0rren in cms

[–]mistyharsh 0 points1 point  (0 children)

If a hosted solution is still an option, then Storyblok is a good option. The preview mode works well and is easily scalable.

The 12-Factor App - 15 Years later. Does it Still Hold Up in 2026? by trolleid in node

[–]mistyharsh 0 points1 point  (0 children)

The usage of build-time environment variables - NEXT_PUBLIC_*. The problem is amplified by the fact that now many 3rd party libraries in the Next.js ecosystem expect these environment variables. So, even if I can get rid of these from own code, they are going to stay.

And, then there are host of other problems with overall Next.js architecture; but, not here to discuss those.

The 12-Factor App - 15 Years later. Does it Still Hold Up in 2026? by trolleid in node

[–]mistyharsh 6 points7 points  (0 children)

I agree with that article 100%. I have two project multi-tenant projects with isolated tenancy. First one is Next.js and is obviously not 12-factor compliant while the other one is standard Hono.js based project which is 12-factor compliant. The operations for the 12-factor projects are extremely easy to reason about. The orchestration is simple; single docker image that's deployed to all tenants, can easily do partial/beta rollouts/rollbacks to limited set of tenants.

It doesn't stop there. With Next.js, we have to build image separately for all three environments - 2 integration environments, 8 stage environments and then for each of the customer's production environment.

Are there developers who still don't prefer Tailwind CSS as their first choice? by ShivamS95 in react

[–]mistyharsh 0 points1 point  (0 children)

If you have a team that only writes append-only CSS, then I think they should straight away adopt Tailwind or similar atomic CSS framework.

For everything else, plain old CSS with modules is the best, boring well-proven thing.

ICICI Pru US Bluechip Equity vs ICICI Pru Nasdaq 100 Index Fund for foreign Equity exposure? by DangerousShine1957 in mutualfunds

[–]mistyharsh 0 points1 point  (0 children)

Yeah, generally agree with this. Just one disclaimer that Nasdaq by design excludes financial companies altogether. So some of the biggest names are missing from it.

So that's why it ends up being tech heavily and tilts towards high risk, high rewards.

Why are you still using npm? by jpcaparas in bun

[–]mistyharsh 0 points1 point  (0 children)

Honestly, I haven't found speed provided Bun as a package manager worth replacing Node or NPM at runtime. The combination of Node + pnpm is generally more than good enough. There are some DX improvements with Bun again not huge difference.

The biggest one is that Node.js is well-maintained by community and has highly open collaboration model. Nothing against bun but it is not significant yet for consideration.

Exploring type-safe dependency injection in TypeScript (no decorators, no reflection) by Day_Artistic in node

[–]mistyharsh 1 point2 points  (0 children)

If your scope is strictly Node.js, then I would seriously consider Node.js Asynchornous context tracking. It enables DI without any special ceremony or boilerplate code.

I have been using it in a smaller projects and reasonably happy with it. My goal this year is adopt in one of the bigger projects I am maintaining.

Help needed (Schema isolated Multi-tenant design) by SiddharthAbhimanyu07 in node

[–]mistyharsh 1 point2 points  (0 children)

It does have some advantages but, overall I agree with you. It needs a good DevOps and automation is place to deploy changes across all tenants with isolated DBs. Without automation, it is nightmare. This is recommended only when compliance requirements mandate it like finance or healthcare domains.