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 42744f3 commit f14409c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/next-core/js/src/entry/app-renderer.tsx
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 @@ -146,21 +146,21 @@ async function runOperation(renderData: RenderData) {
return manifest;
}
if (name === "__entry_css_files__") {
return {
page: layoutInfoChunks["page.js"],
};
return __entry_css_files__;
}
return new Proxy({}, proxyMethodsForModule(name as string, css));
},
};
};
const manifest: FlightManifest = new Proxy({} as any, proxyMethods(false));
const serverCSSManifest: FlightCSSManifest = {};
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_mods__ = {
page: serverCSSManifest["page.js"],
Expand Down

0 comments on commit f14409c

Please sign in to comment.