Skip to content

Commit

Permalink
update for changes in app manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Dec 21, 2022
1 parent cf3e889 commit 23f6cc3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
2 changes: 1 addition & 1 deletion crates/next-core/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@vercel/turbopack-runtime": "latest",
"anser": "^2.1.1",
"css.escape": "^1.5.1",
"next": "^13.0.6",
"next": "^13.0.8-canary.2",
"platform": "1.3.6",
"react-dom": "^18.2.0",
"react": "^18.2.0",
Expand Down
15 changes: 8 additions & 7 deletions crates/next-core/js/src/entry/app-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async function runOperation(renderData: RenderData) {
const pageModule = pageItem.page!.module;
const Page = pageModule.default;
let tree: LoaderTree = ["", {}, { page: [() => Page, "page.js"] }];
layoutInfoChunks["page.js"] = pageItem.page!.chunks;
layoutInfoChunks["page"] = pageItem.page!.chunks;
for (let i = LAYOUT_INFO.length - 2; i >= 0; i--) {
const info = LAYOUT_INFO[i];
const components: ComponentsType = {};
Expand All @@ -122,7 +122,7 @@ async function runOperation(renderData: RenderData) {
}
const k = key as FileType;
components[k] = [() => info[k]!.module.default, `${k}${i}.js`];
layoutInfoChunks[`${k}${i}.js`] = info[k]!.chunks;
layoutInfoChunks[`${k}${i}`] = info[k]!.chunks;
}
tree = [info.segment, { children: tree }, components];
}
Expand All @@ -145,23 +145,24 @@ async function runOperation(renderData: RenderData) {
if (name === "__ssr_module_mapping__") {
return manifest;
}
if (name === "__client_css_manifest__") {
return {};
if (name === "__entry_css_files__") {
return __entry_css_files__;
}
return new Proxy({}, proxyMethodsForModule(name as string, css));
},
};
};
const manifest: FlightManifest = new Proxy({} as any, proxyMethods(false));
const serverCSSManifest: FlightCSSManifest = {};
serverCSSManifest.__entry_css__ = {};
const __entry_css_files__: FlightManifest["__entry_css_files__"] = {};
for (const [key, chunks] of Object.entries(layoutInfoChunks)) {
const cssChunks = chunks.filter((path) => path.endsWith(".css"));
serverCSSManifest[key] = cssChunks.map((chunk) =>
serverCSSManifest[`${key}.js`] = cssChunks.map((chunk) =>
JSON.stringify([chunk, [chunk]])
);
__entry_css_files__[key] = cssChunks;
}
serverCSSManifest.__entry_css__ = {
serverCSSManifest.__entry_css_mods__ = {
page: serverCSSManifest["page.js"],
};
const req: IncomingMessage = {
Expand Down
20 changes: 2 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23f6cc3

Please sign in to comment.