Skip to content

Commit

Permalink
Merge 68fb1e8 into 7c6da54
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding authored Mar 7, 2023
2 parents 7c6da54 + 68fb1e8 commit 87275b3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 65 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.1.7-canary.30",
"next": "13.2.4-canary.6",
"platform": "1.3.6",
"react-dom": "^18.2.0",
"react": "^18.2.0",
Expand Down
36 changes: 18 additions & 18 deletions crates/next-core/js/src/entry/app-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,32 +137,32 @@ async function runOperation(renderData: RenderData) {
tree = [info.segment, { children: tree }, components];
}

const proxyMethodsForModule = (
id: string,
css: boolean
): ProxyHandler<FlightManifest[""]> => ({
get(target, name, receiver) {
return {
id,
chunks: JSON.parse(id)[1],
name,
};
},
});
const proxyMethods = (css: boolean): ProxyHandler<FlightManifest> => {
const proxyMethods = (): ProxyHandler<FlightManifest> => {
return {
get(target, name, receiver) {
if (name === "__ssr_module_mapping__") {
get(_target, key: string) {
if (key === "__ssr_module_mapping__") {
return manifest;
}
if (name === "__entry_css_files__") {
if (key === "__entry_css_files__") {
return __entry_css_files__;
}
return new Proxy({}, proxyMethodsForModule(name as string, css));

// The key is a `${file}#${name}`, but `file` can contain `#` itself.
let pos = key.lastIndexOf("#");
if (pos === -1) pos = key.length;

const file = key.slice(0, pos);
const name = key.slice(pos + 1);

return {
id: file,
chunks: JSON.parse(file)[1],
name: name || "*",
};
},
};
};
const manifest: FlightManifest = new Proxy({} as any, proxyMethods(false));
const manifest: FlightManifest = new Proxy({} as any, proxyMethods());
const serverCSSManifest: FlightCSSManifest = {};
const __entry_css_files__: FlightManifest["__entry_css_files__"] = {};
for (const [key, chunks] of Object.entries(layoutInfoChunks)) {
Expand Down
92 changes: 46 additions & 46 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 87275b3

Please sign in to comment.