Closed
Description
Currently, the SSR streaming (the Fizz architecture enabled with concurrentFeatures: true
) server is always bundled as a middleware, targeting the web runtime. This behavior is confusing as well as lacking of flexibility. In order to make the runtime switchable between web
and node
, there are many necessary changes to be done in the near future:
- Create BaseServer, NextServer and NextWebServer on top of it (Create Base Server #32154).
- Update BaseServer to be runtime agnostic.
- Node native APIs
- Make NextServer runtime agnostic #31971
- Refactor the middleware SSR loader #31508
- Use the serverless page handler in the web runtime #31807
- Clean up fs references in the base server #32322
- Abstract out native filesystem usage from the base server #33226
- Move middleware handling to node server #33448
- Move static serving to next server #33475
- Implement abstract methods to get manifest files in the base server #33537
- refactor: move fs based inc cache to next-server #36246
- Use fallbackable path module for node and edge runtime #36306
- Req/res
- 3rd party libs
- Node native APIs
- Implement Web APIs in NextWebServer (Implement web server as the request handler for edge SSR #33635, Ensure rewrites, i18n and middleware are working properly with the web server #33664).
-
Support for passing manifests via constructor options (can be done later) - Support for dynamic routes
- Support for rewrites (relies on Edge Function support)
- Support for i18n
- Support for compression (Add proper headers to responses in web server #34723)
-
- Add Edge Function support to Next.js similar to middleware, use the sandbox if running in Node.js.
- React 18: Separate
concurrentFeatures
andruntime
options #31317: Introduce aruntime
option for all pages and API routes, which defaults tonode
and can be configured toweb
(WIP) - Support custom
_app
and_app.server
at the same time for different pages. (Custom app for switchable runtime #35666) - Statically optimized server pages should also have the flight JSON exported.
Will probably split this into smaller tasks if needed.