-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move App Pages rendering into bundle #52290
Merged
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e57c905
feat: expose routeModule from app pages module
wyattjoh d6ef6fb
fix: revert changes to render flow
wyattjoh 3432a5f
feat: enable module rendering mode
wyattjoh dab75e3
feat: use correct normalizers
wyattjoh 85885d8
fix: moved app page module bundling to shared layer
wyattjoh 64f1a31
Merge branch 'canary' into wyattjoh/NEXT-987
wyattjoh 1cfc501
fix: moved react to client layer
wyattjoh 5a8a225
Merge branch 'canary' into wyattjoh/NEXT-987
wyattjoh 5af6b7e
fix: fixed route module detection
wyattjoh 43c7571
Merge branch 'canary' into wyattjoh/NEXT-987
wyattjoh 9c47387
fix: linting
wyattjoh 7e08b5b
fix: fixed detection of static params from static path analysis
wyattjoh 928e341
Merge branch 'canary' into wyattjoh/NEXT-987
wyattjoh b4696df
fix: linting
wyattjoh e341d17
fix: pass fonts manifest to extendedRenderOpts
wyattjoh 4595f14
fix: enhanced types for render and fixed race with test
wyattjoh d671c24
fix: revert changes to render
wyattjoh 09c964f
Merge branch 'canary' into wyattjoh/NEXT-987
wyattjoh 4fc31aa
fix: fixed load components return type
wyattjoh d4686cb
Merge branch 'canary' into wyattjoh/NEXT-987
wyattjoh 8a6bce0
Merge branch 'canary' into wyattjoh/NEXT-987
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to correct to me 🤔 cc @shuding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems right to me though I propose we rename this layer to ssr to clarify it is the client bundle running on the server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or is the thing that you are saying is wrong that this should be the issuerlayer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gnoff is right, the
client
layer is technically the SSR layer. A rename would be helpful, I can swap it out in a separate PR. @shuding suggested the following:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep agreed that it's better to rename
.server
and.client
layers to be.rsc
and.ssr
, perhaps.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's rename them 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming in a follow-up sounds ideal to me to keep changes isolated