Use SvelteKit Instead of Next.js #49855
Unanswered
suprabhaat
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
I propose that we use SvelteKit instead of Next.js for the frontend.
The goal is not to choose a framework based on popularity, but to choose the technology that gives us the best combination of performance, simplicity, maintainability, developer experience, and long-term flexibility.
For this project, SvelteKit is a better fit because it provides the capabilities we need without requiring as much framework/runtime complexity.
Why SvelteKit / Svelte ?
Svelte takes a compiler-first approach.
Instead of shipping a large framework runtime and having the browser interpret component behavior at runtime, much of the work is performed during the build.
This can result in:
Svelte components are generally much more direct.
For example:
<script lang="ts"> let count = 0; </script><button onclick={() => count++}>
{count}
There is no need for a separate hook system or additional abstractions just to express simple component state.
This makes components easier to read and reduces the amount of framework specific boilerplate.
And I hate boilerplate.
Next.js often comes with a comparatively heavy development stack, particularly when combined with the broader React ecosystem. A typical project can involve multiple layers of tooling for React, Next.js, bundling, server/client boundaries, development servers, and framework-specific configuration.
This can result in:
One of the important requirements of this project is that the frontend should be capable of being deployed as a static application.
SvelteKit handles this very well.
Pages that do not require server-side processing can be prerendered into static HTML/CSS/JS.
without requiring a Node.js server to be running.
This reduces infrastructure complexity and hosting requirements.
Svelte's compiler-based architecture, gives us a strong foundation for a fast dashboard.
One of the biggest advantages of Svelte is that the framework tends to stay out of the way.
The application can be written using relatively standard:
rather than requiring developers to learn a large collection of framework-specific APIs.
This lowers the barrier for new contributors and makes the codebase easier to understand.
This project contains many interactive elements:
Svelte is particularly good at building these kinds of interfaces without requiring large amounts of client-side framework code.*
Framework choice affects the project for years, not just during initial development.
A simpler component model means:
Svelte provides a very pleasant development experience:
The developer mostly works with familiar web technologies while the compiler handles framework-level optimization.
This makes it possible to write expressive UI code without constantly thinking about the framework's runtime behavior.
Another important advantage is deployment flexibility.
The same SvelteKit application can be configured for different deployment models depending on the requirements:
This means we are not locked into a particular hosting architecture. ( Vercel )
Why not Next.js?
Next.js is a very capable framework and has a much larger ecosystem.
However, its popularity alone should not be the deciding factor.
For this project, Next.js introduces several considerations that we do not necessarily need:
For this project, SvelteKit offers a better balance of:
Performance + simplicity + maintainability + deployment flexibility + developer experience.
and in cases where you want to take maximum juice out your server, yeah a nextjs server is bad.
Therefore, SvelteKit should be preferred unless there is a specific requirement that can only reasonably be satisfied by the React/Next.js ecosystem.
All reactions