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

Use ProxiedAsset instead of css_chunk_root_path to expose RSC CSS chunks #48946

Merged
merged 5 commits into from Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
68 changes: 35 additions & 33 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Expand Up @@ -42,11 +42,11 @@ swc_relay = { version = "0.2.5" }
testing = { version = "0.33.4" }

# Turbo crates
turbo-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230427.3" }
turbo-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230428.3" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230427.3" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230428.3" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230427.3" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230428.3" }

# General Deps

Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-core/js/package.json
Expand Up @@ -10,8 +10,8 @@
"check": "tsc --noEmit"
},
"dependencies": {
"@vercel/turbopack-dev": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-dev/js?turbopack-230427.3",
"@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230427.3",
"@vercel/turbopack-dev": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-dev/js?turbopack-230428.3",
"@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230428.3",
"anser": "^2.1.1",
"css.escape": "^1.5.1",
"next": "*",
Expand Down
Expand Up @@ -4,6 +4,7 @@ import type { ReactElement } from 'react'
import { version } from 'next/package.json'
import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack/client'
import { callServer } from 'next/dist/client/app-call-server'
import { linkGc } from 'next/dist/client/app-link-gc'

import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context'

Expand Down Expand Up @@ -153,6 +154,8 @@ function hydrate() {
ReactDOMClient.hydrateRoot(appElement, reactEl)
})
}

linkGc()
}

window.next = {
Expand Down
2 changes: 0 additions & 2 deletions packages/next-swc/crates/next-core/src/app_source.rs
Expand Up @@ -933,7 +933,6 @@ import {}, {{ chunks as {} }} from "COMPONENT_{}";
context.compile_time_info().environment(),
)
.layer("ssr")
.css_chunk_root_path(server_root.join("_next/static/chunks"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will probably lead to CSS chunks being emitted into the output filesystem but nevermind

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I still don't understand why the root path matters for invalidation purposes, but I don't think this is a problem.

.reference_chunk_source_maps(false)
.build();

Expand Down Expand Up @@ -1013,7 +1012,6 @@ impl AppRouteVc {
this.context.compile_time_info().environment(),
)
.layer("ssr")
.css_chunk_root_path(this.server_root.join("_next/static/chunks"))
.reference_chunk_source_maps(false)
.build();

Expand Down