Let’s talk about how we can build your commerce project — tailored to your business, powered by Rigby
Fast load times, efficient rendering, and flexible architecture are essential for building modern eCommerce websites that support online purchases, and mobile commerce. Technical decisions such as choosing the right front-end framework directly affect performance, security, and developer productivity.
Next.js 15, the latest version of the popular framework by Vercel, is a true game-changer for eCommerce application developers. With new features such as Server Actions, the App Router, streaming, and optimized rendering and data fetching, we can now build faster, lighter, and more responsive stores.
In this article, I’ll show you how the latest features of Next.js 15 can significantly improve the development and user experience of online retail sales.
App Router - A new standard in architecture
The new App Router, introduced in Next.js 13 and expanded in versions 14 and 15, replaces the old pages/ routing system. It’s based on the app/ folder, giving you greater control over application structure.
Benefits for eCommerce:
- Modular store structure - e.g. separate layouts for checkout, user panel, and homepage
- Isolated logic and data - easier management of cart state, promotions, and user sessions
- Automatic loading and fallback management via loading.tsx, error.tsx, and not-found.tsx
Server Actions - Mutating data without API routes
The biggest addition in Next.js 15 is the stable version of Server Actions - a feature that allows server-side logic execution without creating separate API routes.
How it works:
You define a function marked with use server:
'use server'
export async function addToCart(productId: string) {
await db.cart.add(productId)
return {
message: "Product added to cart",
}
}
And then call it directly from your component.
<form action={addToCart}>
<button type="submit">Add to cart</button>
</form>
Use cases in eCommerce:
- Adding a product to the cart
- Handling login/registration
- Submitting forms (e.g. newsletter, contact)
- Updating user account data
This eliminates complex fetch calls, error handling, and spinners - everything works natively within React.
React Server Components - Performance first
Next.js 15 fully supports React Server Components, which are rendered on the server without sending their code to the client.
Advantages:
- Smaller bundle = faster page loads
- Less JavaScript on the client
- Better FCP and SEO - crucial in eCommerce
Example use:
Product lists, user data, and recommended items - all rendered server-side without burdening the browser.
Streaming and partial rendering - Native app-like UX
Next.js now supports content streaming – loading parts of the UI as soon as they’re generated, instead of waiting for all data at once.
Examples:
- The layout appears instantly, while product listings stream in seconds later
- In checkout, user data and cart items load separately without blocking the interface
Result? Perceived faster loading and a smoother user experience.
Layouts & Templates - Better page structure management
The new layout.tsx and template.tsx system enables differentiated layouts for various parts of the store:
- Checkout with simplified navigation
- Customer panel with a side menu
- Campaign landing pages with unique layouts
This not only improves UX but also simplifies code maintenance and testing.
New hooks - useFormStatus and useFormState
These hooks allow for dynamic form handling without managing local state. Users get immediate interface feedback - spinners, "sending..." messages, and success or error indicators.
Best use cases:
- Order forms
- Login/registration
- Reviews and comments
- Contact forms
Image and font optimization - Built-in
Next.js 15 further enhances its media optimization tools:
- next/image with lazy loading and WebP support
- next/font loads fonts without flash of invisible text (FOIT)
Better CLS, LCP, and Web Vitals - which translate to SEO and conversion improvements.
Middleware and API routes - Flexible logic without a server
Middleware in Next.js lets you dynamically react to requests - e.g., redirecting users to a localized store version or blocking access to the account panel if they're not logged in.
You can still create API routes to handle data access, payments, or ERP integrations.
Summary: Is Next.js 15 worth using in eCommerce?
Absolutely. Here’s a quick overview of key features and their value:
Next.js 15 is the ultimate tool for building an online store that looks great, loads instantly, converts users efficiently, and scales with your business.
If you're planning to build a new online store, improve an existing eCommerce business, or migrate it, our team will help to change your platform with modern tools like Next.js.