-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move App Pages rendering into bundle (#52290)
Transitions the App Pages renderer into the entrypoint bundle. - Adjusts the static path detection to handle route module's with App Pages - Fixes bug in font manifest loading on Edge
- Loading branch information
Showing
9 changed files
with
157 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
packages/next/src/server/future/route-modules/app-page/module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import type { IncomingMessage, ServerResponse } from 'http' | ||
import type { AppPageRouteDefinition } from '../../route-definitions/app-page-route-definition' | ||
import type RenderResult from '../../../render-result' | ||
import type { RenderOpts } from '../../../app-render/types' | ||
import type { NextParsedUrlQuery } from '../../../request-meta' | ||
import type { LoaderTree } from '../../../lib/app-dir-module' | ||
|
||
import { renderToHTMLOrFlight } from '../../../app-render/app-render' | ||
import { | ||
RouteModule, | ||
type RouteModuleOptions, | ||
type RouteModuleHandleContext, | ||
} from '../route-module' | ||
|
||
type AppPageUserlandModule = { | ||
/** | ||
* The tree created in next-app-loader that holds component segments and modules | ||
*/ | ||
loaderTree: LoaderTree | ||
} | ||
|
||
interface AppPageRouteHandlerContext extends RouteModuleHandleContext { | ||
page: string | ||
query: NextParsedUrlQuery | ||
renderOpts: RenderOpts | ||
} | ||
|
||
export type AppPageRouteModuleOptions = RouteModuleOptions< | ||
AppPageRouteDefinition, | ||
AppPageUserlandModule | ||
> | ||
|
||
export class AppPageRouteModule extends RouteModule< | ||
AppPageRouteDefinition, | ||
AppPageUserlandModule | ||
> { | ||
public handle(): Promise<Response> { | ||
throw new Error('Method not implemented.') | ||
} | ||
|
||
public render( | ||
req: IncomingMessage, | ||
res: ServerResponse, | ||
context: AppPageRouteHandlerContext | ||
): Promise<RenderResult> { | ||
return renderToHTMLOrFlight( | ||
req, | ||
res, | ||
context.page, | ||
context.query, | ||
context.renderOpts | ||
) | ||
} | ||
} | ||
|
||
export default AppPageRouteModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters