Optimize Server-Side API Routes with a Dedicated Build/Development Command or Watch Mode #73290
tayloraucoin
started this conversation in
Ideas
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.
-
Goals
Non-Goals
Background
Next.js provides an excellent framework for creating server-side API routes within the same codebase as the client application. However, for applications with extensive server-side functionality—such as those leveraging Prisma and service APIs through Next.js API routes—development workflows can become inefficient.
Currently, small client-side changes often trigger a full rebuild of all API routes, significantly increasing development iteration times. This can be especially frustrating for larger projects where such rebuilds are frequent.
While alternatives like splitting the API logic into a separate backend repository exist, they introduce added complexity to the development process, undermining one of Next.js’s strengths: simplicity and the all-in-one architecture.
To maintain Next.js's hallmark developer experience while addressing this bottleneck, a dedicated mechanism for handling server-side API routes more efficiently in development is needed.
Proposal
We propose adding a dedicated command or mode that optimizes the development experience for applications with extensive server-side API routes. Specifically:
This feature would align with Next.js’s all-in-one philosophy while addressing a key pain point for teams leveraging server-side functionality.
Beta Was this translation helpful? Give feedback.
All reactions