惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 聂微东
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
量子位
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
B
Blog RSS Feed
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
GbyAI
GbyAI
Jina AI
Jina AI
宝玉的分享
宝玉的分享
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Docker
博客园_首页
N
News and Events Feed by Topic
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Help Net Security
Help Net Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cisco Blogs
F
Fortinet All Blogs
SecWiki News
SecWiki News
AI
AI
S
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Last Watchdog
The Last Watchdog
Martin Fowler
Martin Fowler
A
About on SuperTechFans
T
Troy Hunt's Blog
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Hacker News: Ask HN
Hacker News: Ask HN
F
Full Disclosure
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
S
Security @ Cisco Blogs
Project Zero
Project Zero
Simon Willison's Weblog
Simon Willison's Weblog
C
Cyber Attacks, Cyber Crime and Cyber Security
J
Java Code Geeks
N
News | PayPal Newsroom
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
H
Hacker News: Front Page

Next.js Blog

Next.js Security Release and Our Next Patch Release Turbopack: What's New in Next.js 16.3 Next.js 16.3: AI Improvements Next.js 16.3: Instant Navigations Next.js Across Platforms: Adapters, OpenNext, and Our Commitments Next.js 16.2: AI Improvements Next.js 16.2 Turbopack: What's New in Next.js 16.2 Building Next.js for an agentic future Inside Turbopack: Building Faster by Building Less Next.js 16.1 Next.js Security Update: December 11, 2025 Security Advisory: CVE-2025-66478 Next.js 16 Next.js 16 (beta) Next.js 15.5 Next.js 15.4 Next.js 15.3 Building APIs with Next.js Next.js 15.2 Composable Caching with Next.js Next.js 15.1 Our Journey with Caching Next.js 15 Turbopack Dev is Now Stable Next.js 15 RC 2 Next.js 15 RC Next.js 14.2 Next.js 14.1 Next.js 14 How to Think About Security in Next.js Next.js 13.5 Next.js App Router Update Next.js 13.4 Next.js 13.3 Next.js 13.2 Next.js 13.1 Next.js 13 Next.js 12.3 Next.js 12.2 Layouts RFC Next.js 12.1 Next.js 12 Next.js 11.1 Next.js 11 Next.js 10.2 Next.js 10.1 Next.js 10 Next.js 9.5 Next.js 9.4 Next.js 9.3 Next.js 9.2 Next.js 9.1.7 Introducing Create Next App Next.js 9.1 Next.js 9.0.7 Next.js 9 Next.js 8.1 Next.js 8.0.4 Styling Next.js with Styled JSX Next.js 8 Webpack Memory Improvements Next.js 8 Next.js 7 Next.js 6.1 Next.js 6 and Nextjs.org Next.js 5.1: Faster Page Resolution, Environment Config & More Next.js 5: Universal Webpack, CSS Imports, Plugins and Zones
Incrementally Adopting Next.js
Lee Robinson · 2020-11-18 · via Next.js Blog
Back to Blog

Wednesday, November 18th 2020

Posted by

Next.js has been designed for gradual adoption. With Next.js, you can continue using your existing code and add as much (or as little) React as you need. By starting small and incrementally adding more pages, you can prevent derailing feature work by avoiding a complete rewrite.

Many companies need to modernize their tech stack to reduce costs, increase developer productivity, and provide the best experience for their customers. Component-driven development has greatly improved the deployment velocity and reusability of modern codebases.

And with over 8 million downloads/month, React is the leading component-driven choice for developers. Next.js, the React framework for production, enables you to incrementally adopt React.

Motivation

In an increasingly mobile world, improving and tracking your Core Web Vitals is critical for success. Your customers are likely distributed across the world with varying internet speeds. Every second (or millisecond) of additional time spent waiting for a page to load or an action to complete could be the difference between a sale, impression, or conversion.

If you're modernizing your tech stack, you might be facing challenges like:

  • Your application has years of legacy code that is difficult to reason about and would take years (and millions of dollars) to rewrite completely.
  • Your page load times continue to increase as the size and complexity of the application grows. Simple marketing pages are as slow as the most complex pages.
  • You're trying to scale your development team, but are facing issues adding more developers into the existing codebase.
  • You have outdated CI/CD and DevOps processes, which decrease developer productivity and make it difficult to safely and reliably roll out new changes.
  • Your application is not responsive for mobile devices and it's impossible to update the global page styling without breaking other parts of the application.

You know you need to do something, but it can be overwhelming to understand where to start. By incrementally adopting Next.js, you can begin to solve the above issues and transform your application. Let's discuss a few different strategies for adopting Next.js into your existing tech stack.

Strategies

Subpath

The first strategy is to configure your server or proxy such that, everything under a specific subpath points to a Next.js app. For example, your existing website might be at example.com, and you might configure your proxy such that example.com/store serves a Next.js e-commerce store.

Using basePath, you can configure your Next.js application's assets and links to automatically work with your new subpath /store. Since each page in Next.js is its own standalone route, pages like pages/products.js will route to example.com/store/products in your application.

To learn more about basePath, take a look at our documentation.

(Note: This feature was introduced in Next.js 9.5 and up. If you’re using older versions of Next.js, please upgrade before trying it out.)

Rewrites

The second strategy is to create a new Next.js app that points to the root URL of your domain. Then, you can use rewrites inside next.config.js to have some subpaths to be proxied to your existing app.

For example, let's say you created a Next.js app to be served from example.com with the following next.config.js. Now, requests for the pages you’ve added to this Next.js app (e.g. /about if you’ve added pages/about.js) will be handled by Next.js, and requests for any other route (e.g. /dashboard) will be proxied to proxy.example.com.

To learn more about rewrites, take a look at our documentation.

Micro-Frontends with Monorepos and Subdomains

Next.js and Vercel make it easy to adopt micro-frontends and deploy as a Monorepo. This allows you to use subdomains to adopt new applications incrementally. Some benefits of micro-frontends:

  • Smaller, more cohesive and maintainable codebases.
  • More scalable organizations with decoupled, autonomous teams.
  • The ability to upgrade, update, or even rewrite parts of the frontend in a more incremental fashion.

The architecture of a monorepo deployed to Vercel.

Once your monorepo is set up, push changes to your Git repository as usual and you'll see the commits deployed to the Vercel projects you've connected. Say goodbye to outdated CI/CD processes.

An example of Deployment URLs provided by a Git Integration.

Conclusion

Next.js was designed for incremental adoption into your existing tech stack. The Vercel platform makes it a collaborative experience with deploy previews for every code change, by seamlessly integrating with GitHub, GitLab, and Bitbucket.

  • Instantly preview changes locally with Fast Refresh, increasing developer productivity.
  • Push changes to create a Branch Preview, optimized for collaboration with stakeholders.
  • Deploy to production with Vercel by merging the PR. No complicated DevOps.

To learn more, read about subpaths and rewrites or deploy an example with micro-frontends.