Build a DApp with Next.js? A dumb idea.
Recently the project I’ve worked on is facing a time for refactoring. We used to construct the application with “vanilla React,” which is not well constructed.
Recently the project I’ve worked on is facing a time for refactoring. We used to construct the application with “vanilla React,” which is not well constructed.
Yes, we used state management and many magical tools, but it is my first React application. It works, barely, and the code inside is such a mess. Duplications are everywhere and, not well organized, not easy to maintain.
I know refactoring is necessary, but it is not an easy task. For average react projects, migrating to SSR frameworks can improve both the structure and user experience vastly. But mine is a DApp, aka Decentralized Application, and carries a custom-designed SDK. Basically eliminates the possibility of running tasks in a server-side environment.
But still, I decide to use Next.js. The Next Conf has just passed, and Next.js brings many new features to this framework. I watch a lot of videos and read a lot of articles about it, and I feel great about Next.js. But, there’s always a but. But I can’t enjoy the most valuable part of Next.js. Is it worth it?
I think the answer is probably no. Although things like Image Optimization and Font optimization sound delicious, the core feature of Next.js is easy-to-use SSR, which makes it almost a backend framework. And nothing about a DApp is SSR. Everything is CSR (Client-Side Rendering). And it is irresponsible for me to let my colleague make another version of SDK just to support SSR, which is very irresponsible.
And yes, I will use Next.js in the future, but not in this project, not in a DApp. I’ve looked into it for a long time, and frankly, I love it. But just like love, it is not about whether you like it. It’s about whether it suits you.
Don’t be foolish by love, and don’t be foolish by using Next.js everywhere. And swap a new framework will resolve no issue on your code, just be responsible to your code.
Sigh. man.