diff --git a/crates/next-core/js/package.json b/crates/next-core/js/package.json index 1cad37d1a8ab00..f552142d2101b1 100644 --- a/crates/next-core/js/package.json +++ b/crates/next-core/js/package.json @@ -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", diff --git a/crates/next-core/js/src/entry/app-renderer.tsx b/crates/next-core/js/src/entry/app-renderer.tsx index 966ed2605be510..64f2ba5d0e3939 100644 --- a/crates/next-core/js/src/entry/app-renderer.tsx +++ b/crates/next-core/js/src/entry/app-renderer.tsx @@ -137,32 +137,32 @@ async function runOperation(renderData: RenderData) { tree = [info.segment, { children: tree }, components]; } - const proxyMethodsForModule = ( - id: string, - css: boolean - ): ProxyHandler => ({ - get(target, name, receiver) { - return { - id, - chunks: JSON.parse(id)[1], - name, - }; - }, - }); - const proxyMethods = (css: boolean): ProxyHandler => { + const proxyMethods = (): ProxyHandler => { 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)) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b100e8bc1fc60a..7870b3b88a493f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,7 +134,7 @@ importers: anser: ^2.1.1 css.escape: ^1.5.1 find-up: ^6.3.0 - next: 13.1.7-canary.30 + next: 13.2.4-canary.6 platform: 1.3.6 react: ^18.2.0 react-dom: ^18.2.0 @@ -145,7 +145,7 @@ importers: '@vercel/turbopack-runtime': link:../../turbopack-ecmascript/js anser: 2.1.1 css.escape: 1.5.1 - next: 13.1.7-canary.30_biqbaboplfbrettd7655fr4n2y + next: 13.2.4-canary.6_biqbaboplfbrettd7655fr4n2y platform: 1.3.6 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -1893,8 +1893,8 @@ packages: resolution: {integrity: sha512-urnc6aGE0r34euoenPD6kSdGn+Tzwl+g+m4UaEeLpaPCF2110/rd1WIwR4izqG8hxG6GUBj0R+T0XfFgmyNydg==} dev: true - /@next/env/13.1.7-canary.30: - resolution: {integrity: sha512-j9o0DMVPYSc9Zx9N8bWFoptpWacy6cM7tKjcrdbtodSZ5p7YZnoFQfMx6Nf2cBReM284wUhjerAOPL2U9hws1w==} + /@next/env/13.2.4-canary.6: + resolution: {integrity: sha512-LJ6sSANO6LlO3KU44jIztbFB0+I/fruajv/usXQdB7XIIUrGLD9WrgvNryaxUHivr3UMYYYkDhjDaImndenbCQ==} dev: false /@next/eslint-plugin-next/12.3.1: @@ -1947,8 +1947,8 @@ packages: dev: true optional: true - /@next/swc-android-arm-eabi/13.1.7-canary.30: - resolution: {integrity: sha512-lJhel1+0XLenOgnveGt14HFpIDC3SXzy+EWgYfZU1hjsma/FrVNkYtiDCp33OE9VbCbGBKUS2om8QH1O8vIjRQ==} + /@next/swc-android-arm-eabi/13.2.4-canary.6: + resolution: {integrity: sha512-KzX5/Kfib9tv93XvscxSyxdwNJx5f3USneVONYhexkf0mqQ3Bkp4iD29RIhhbbLmXz1WZLcE+aTQ3fccddBnyQ==} engines: {node: '>= 10'} cpu: [arm] os: [android] @@ -1982,8 +1982,8 @@ packages: dev: true optional: true - /@next/swc-android-arm64/13.1.7-canary.30: - resolution: {integrity: sha512-laeS2L7DK15CB43AWIthoAASKhWULWxFHVm407uo7kAUZHyy0ahRThr2ugsNyqB3q4NLJfxVWUxz760/jyO7Ng==} + /@next/swc-android-arm64/13.2.4-canary.6: + resolution: {integrity: sha512-syKdUPeuRmtIBlYmKXKLyYdmVVvpk/lkRMAxanqWy0PxmT6BWxGEfyFTDSfLvsqmyWOZWD8y2H0u80t+wWAWGA==} engines: {node: '>= 10'} cpu: [arm64] os: [android] @@ -2017,8 +2017,8 @@ packages: dev: true optional: true - /@next/swc-darwin-arm64/13.1.7-canary.30: - resolution: {integrity: sha512-Ghkxdle8TNja+f6RiqeADWGBYV1ylKnDDUpFnJDDW4vkHDYvQ8Am5o34rZA0SLFYipLBJBnNJ8fiahBAelyoyw==} + /@next/swc-darwin-arm64/13.2.4-canary.6: + resolution: {integrity: sha512-82sxT7TrWOY8LAbRWpl4+ngVKbPXLn2HDLUOAYQ/2/9kyHxkd0kY/4PWpHnI+tBd4fgzX0PXrghMW9MRMnmYUg==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -2052,8 +2052,8 @@ packages: dev: true optional: true - /@next/swc-darwin-x64/13.1.7-canary.30: - resolution: {integrity: sha512-rEED9dJT2O1Npth25SQNfPdsgXjbZY3XfStZBCU+hFvn7xh26eyxz2YpOaKPWewbKr78hxJUrt2q4Qv8+CeLXg==} + /@next/swc-darwin-x64/13.2.4-canary.6: + resolution: {integrity: sha512-cfKENPa/PEZpdo34Cz2ycuXvi9z/QPUGsM3kFoim9gK0TNxkbDy9iwEBGiB4001JJlIBjfCnbUiAbc565It6zg==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -2087,8 +2087,8 @@ packages: dev: true optional: true - /@next/swc-freebsd-x64/13.1.7-canary.30: - resolution: {integrity: sha512-BsTyQLWcbLMXoAUgEj1L+/L9SafV3P+8OuG7Jxaw9eqGa8+Tde2DCEt0vpCoAAdTyq/VCfWpnaIRdOUNcjFjwg==} + /@next/swc-freebsd-x64/13.2.4-canary.6: + resolution: {integrity: sha512-CnV7R79bkHWo6SSJds3gvWt5+TnsQWLk/7neiM0FeTzIiLZf/27DS+NEJmaPPWRxO3/OGsNI2D6zCoJHM7NshA==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] @@ -2122,8 +2122,8 @@ packages: dev: true optional: true - /@next/swc-linux-arm-gnueabihf/13.1.7-canary.30: - resolution: {integrity: sha512-rN63QKfpvJ5uI+6raIGqWA26XuG1+Wp9SjtETrxOPY9jFxpTrJsxL3/QIxIW5NLTSqtA2ImV83NjwCwEcJPyTQ==} + /@next/swc-linux-arm-gnueabihf/13.2.4-canary.6: + resolution: {integrity: sha512-iR2GF5G69pbl2XTNnFKeMwHYARn6GHGuhypIs9cOShxxUhCt9iF6RCyHHItipop4SuSbG4hkVZYPIo2DFsRANg==} engines: {node: '>= 10'} cpu: [arm] os: [linux] @@ -2157,8 +2157,8 @@ packages: dev: true optional: true - /@next/swc-linux-arm64-gnu/13.1.7-canary.30: - resolution: {integrity: sha512-dsqKI25EMu0KmBXGyJiWBMsGm3oW5h+VZ57ZIXwsLsgIaXsgvEny8kY0ndyGKweETuq9RDUpwOvutsuy0QHJDQ==} + /@next/swc-linux-arm64-gnu/13.2.4-canary.6: + resolution: {integrity: sha512-b1a8PQHpe4DD7ovd/bq31n1FkGHBTbKn0qJg1iSV8gbZddDwlczcKFQPMKqNcW6ZLjJlIZ9MmubkW1HL/ACzmA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2192,8 +2192,8 @@ packages: dev: true optional: true - /@next/swc-linux-arm64-musl/13.1.7-canary.30: - resolution: {integrity: sha512-wpRimC1MEniQ8bJgFgp3psFBnSAdoUKx83j1D8zyMTc5N7Pa50cYa+bgdAaoUT5jPXCSPKRZJgD8kEZmadOQIQ==} + /@next/swc-linux-arm64-musl/13.2.4-canary.6: + resolution: {integrity: sha512-HGIfFPOFuhfAqreGxUniDw7oQbEg8/thcsOxFjYE6CrmsU9uc453rMGZFtfdFVbyFCO6TITCEPDXNiCbIryG1w==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2227,8 +2227,8 @@ packages: dev: true optional: true - /@next/swc-linux-x64-gnu/13.1.7-canary.30: - resolution: {integrity: sha512-vyUckZ8aJHGrf4nMwaWY89DV8x0CkYhdA8e5fqMsEXkMC8LEE4PSuS3Cl4mj+afRs/8maYr9egwcYq1N4kIaUA==} + /@next/swc-linux-x64-gnu/13.2.4-canary.6: + resolution: {integrity: sha512-7dzH4x9eK2HMX3ExBrlHlxQfGzrgPW7ruDQoe85ad0XKbkjSGjc3YkOahDsnXiK0/whuazliUMvXbRWXy7F6xA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2262,8 +2262,8 @@ packages: dev: true optional: true - /@next/swc-linux-x64-musl/13.1.7-canary.30: - resolution: {integrity: sha512-WmgZdnj5QJSPG//LOPfsNCfc3EzTnfKB4rAhpk0hC/G7Szmd7fkoVOiihSbCSJlWl3zSSyo+JaGQQUjH7aswvQ==} + /@next/swc-linux-x64-musl/13.2.4-canary.6: + resolution: {integrity: sha512-WkSrHGFn7XueW7hP6KRuzLnFfCrOG2KiIlwE45TKpFEq0OFw/8zr/BCtXLF5LnJOi1G87hk2KQ/Ow+4QMPPj9g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2297,8 +2297,8 @@ packages: dev: true optional: true - /@next/swc-win32-arm64-msvc/13.1.7-canary.30: - resolution: {integrity: sha512-CkzUyEEnEFdSZtMoFNXFP2yTtgwQ6Ui8QJgVe+o3UaFsWwKW+jdTibDgwJlt9xjt06EaqMQKGR6lc/W8sEzU9A==} + /@next/swc-win32-arm64-msvc/13.2.4-canary.6: + resolution: {integrity: sha512-SWiZD7QI3jnug1W+v0TrglNJFYUFRnO3QPvH05ILJNr1cbYftTU46HLAt38KvROuQQEEtcfRksXn72m14p1Dhg==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -2332,8 +2332,8 @@ packages: dev: true optional: true - /@next/swc-win32-ia32-msvc/13.1.7-canary.30: - resolution: {integrity: sha512-M7Jzo7TVClWFZ6gAlrBzQhzr/YH/ZDNkNu17VOasMSeBOjIjqUPvlFXkRqbyT2lAdLCb9am32MHtVMyLTc9JoQ==} + /@next/swc-win32-ia32-msvc/13.2.4-canary.6: + resolution: {integrity: sha512-BoaUiTnab0HwD8A83MIJRqF+VNoHAxa+TWZb7rWXyb4SwxcoXMxiIas29zblbmctjV4odlHF9ULSLog+XcJ8Ww==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -2367,8 +2367,8 @@ packages: dev: true optional: true - /@next/swc-win32-x64-msvc/13.1.7-canary.30: - resolution: {integrity: sha512-6nxSJuUNwVOpAlISHhRXWt6EE4QrmZ+KxgTbz9Mh2jYXv+T8EkrMxYQhizwSs5Yu2mhWvYxWgLpvJEZNKGCnVA==} + /@next/swc-win32-x64-msvc/13.2.4-canary.6: + resolution: {integrity: sha512-NSlYeg1hbVnYsIVRgKIqjrkrzfKncnqCrhnLxrN0EuQ2XsRjrBfamcP4dPOvXXwp16XOoyHseW8wIK0ZeZlxdQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -9840,8 +9840,8 @@ packages: - babel-plugin-macros dev: true - /next/13.1.7-canary.30_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-oN7ib4Yb4KkHYP81SdU4OUkvmWhXFcT7cTgp2gH+5wA1dfz9v1mxXFw4550OMu6gDBJxtn0gn57qrRH8CQ5fBQ==} + /next/13.2.4-canary.6_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-FL7nfqaB3E3VidynLAlKJKYa9CbTi36dbCwo65IzI2ZGvnW5u7HNxWV6TGsFJnjKKbP3siSraL9ZhheiL9zQEA==} engines: {node: '>=14.6.0'} hasBin: true peerDependencies: @@ -9861,7 +9861,7 @@ packages: sass: optional: true dependencies: - '@next/env': 13.1.7-canary.30 + '@next/env': 13.2.4-canary.6 '@swc/helpers': 0.4.14 caniuse-lite: 1.0.30001439 postcss: 8.4.14 @@ -9869,19 +9869,19 @@ packages: react-dom: 18.2.0_react@18.2.0 styled-jsx: 5.1.1_react@18.2.0 optionalDependencies: - '@next/swc-android-arm-eabi': 13.1.7-canary.30 - '@next/swc-android-arm64': 13.1.7-canary.30 - '@next/swc-darwin-arm64': 13.1.7-canary.30 - '@next/swc-darwin-x64': 13.1.7-canary.30 - '@next/swc-freebsd-x64': 13.1.7-canary.30 - '@next/swc-linux-arm-gnueabihf': 13.1.7-canary.30 - '@next/swc-linux-arm64-gnu': 13.1.7-canary.30 - '@next/swc-linux-arm64-musl': 13.1.7-canary.30 - '@next/swc-linux-x64-gnu': 13.1.7-canary.30 - '@next/swc-linux-x64-musl': 13.1.7-canary.30 - '@next/swc-win32-arm64-msvc': 13.1.7-canary.30 - '@next/swc-win32-ia32-msvc': 13.1.7-canary.30 - '@next/swc-win32-x64-msvc': 13.1.7-canary.30 + '@next/swc-android-arm-eabi': 13.2.4-canary.6 + '@next/swc-android-arm64': 13.2.4-canary.6 + '@next/swc-darwin-arm64': 13.2.4-canary.6 + '@next/swc-darwin-x64': 13.2.4-canary.6 + '@next/swc-freebsd-x64': 13.2.4-canary.6 + '@next/swc-linux-arm-gnueabihf': 13.2.4-canary.6 + '@next/swc-linux-arm64-gnu': 13.2.4-canary.6 + '@next/swc-linux-arm64-musl': 13.2.4-canary.6 + '@next/swc-linux-x64-gnu': 13.2.4-canary.6 + '@next/swc-linux-x64-musl': 13.2.4-canary.6 + '@next/swc-win32-arm64-msvc': 13.2.4-canary.6 + '@next/swc-win32-ia32-msvc': 13.2.4-canary.6 + '@next/swc-win32-x64-msvc': 13.2.4-canary.6 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros