Skip to content
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

update to latest next.js #3112

Merged
merged 4 commits into from Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/next-core/js/package.json
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
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
1 change: 1 addition & 0 deletions crates/next-core/js/src/entry/app/layout-entry.tsx
@@ -1,6 +1,7 @@
export { default as AppRouter } from "next/dist/client/components/app-router.js";
export { default as LayoutRouter } from "next/dist/client/components/layout-router.js";
export { default as RenderFromTemplateContext } from "next/dist/client/components/render-from-template-context.js";
export { default as GlobalError } from "next/dist/client/components/error-boundary.js";
export { staticGenerationAsyncStorage } from "next/dist/esm/client/components/static-generation-async-storage.js";
export { requestAsyncStorage } from "next/dist/esm/client/components/request-async-storage.js";
import * as serverHooks from "next/dist/esm/client/components/hooks-server-context.js";
Expand Down
2 changes: 1 addition & 1 deletion crates/next-dev/tests/package.json
Expand Up @@ -3,7 +3,7 @@
"devDependencies": {
"@turbo/pack-test-harness": "*",
"autoprefixer": "^10.4.13",
"next": "13.0.1",
"next": "13.0.8-canary.2",
"postcss": "^8.4.20",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down