-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add support for CSS client references #5397
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
10 Ignored Deployments
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
✅ This change can build |
🟢 CI successful 🟢Thanks |
c8daa18
to
ed15812
Compare
#[turbo_tasks::value] | ||
#[derive(Hash, Debug)] | ||
pub struct InternalCssAssetReference { | ||
asset: AssetVc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asset: AssetVc, | |
source: AssetVc, | |
context: AssetContextVc, |
This should lazily process the source asset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The asset will already have been processed at that point, as we need to process it to compute other references.
CssModule(CssInputTransformsVc), | ||
CssGlobal, | ||
CssModule, | ||
Css { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename to CssInner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think CssGlobal
and CssModule
are explicit enough that Css
on its own is OK.
512d3f1
to
12903ee
Compare
ed15812
to
81d7fbf
Compare
e195ea7
to
f5b8530
Compare
81d7fbf
to
c433a30
Compare
Linux Benchmark for 05be8dfClick to view benchmark
|
MacOS Benchmark for 05be8df
Click to view full benchmark
|
f7625f3
to
4f392bd
Compare
74ada12
to
fcbb760
Compare
4f392bd
to
9487de0
Compare
Linux Benchmark for b0429e1Click to view benchmark
|
9487de0
to
6419597
Compare
Linux Benchmark for fe4e6b3Click to view benchmark
|
MacOS Benchmark for fe4e6b3
Click to view full benchmark
|
Linux Benchmark for 320cc3fClick to view benchmark
|
MacOS Benchmark for 320cc3f
Click to view full benchmark
|
Linux Benchmark for 1fa6952Click to view benchmark
|
vercel/turborepo#5397 ## Turbopack updates * vercel/turborepo#5419 * vercel/turborepo#5397
MacOS Benchmark for 1fa6952
Click to view full benchmark
|
### Description My recent change in #5397 added a way to create rules that only apply to internal references. In the process, I also made it so the default rules don't apply to internal references as well. However, we still need them to apply to TS and JS files, as we use that with ReferenceType::Internal in Next.js. ### Testing Instructions Next.js CI
vercel/turborepo#5397 ## Turbopack updates * vercel/turborepo#5419 * vercel/turborepo#5397
### Description This PR changes CSS assets to support the CSS client references use case of Next.js, where .css assets in the RSC graph should be replaced with a client reference assets. CSS assets are now processed in two steps: 1. Processing the CSS source asset into either a Global or a Module CSS asset. 2. Inside of Global/Module assets, processing the CSS source asset into a CSS asset. By default, (2.) will create a leaf CSS asset. But in Next.js RSC, this step will be replaced with creating a CSS client reference instead. This client reference can then be detected when walking the RSC graph, and a client CSS chunk can be produced from there. ### Testing Instructions N/A
) ### Description My recent change in vercel/turborepo#5397 added a way to create rules that only apply to internal references. In the process, I also made it so the default rules don't apply to internal references as well. However, we still need them to apply to TS and JS files, as we use that with ReferenceType::Internal in Next.js. ### Testing Instructions Next.js CI
### Description This PR changes CSS assets to support the CSS client references use case of Next.js, where .css assets in the RSC graph should be replaced with a client reference assets. CSS assets are now processed in two steps: 1. Processing the CSS source asset into either a Global or a Module CSS asset. 2. Inside of Global/Module assets, processing the CSS source asset into a CSS asset. By default, (2.) will create a leaf CSS asset. But in Next.js RSC, this step will be replaced with creating a CSS client reference instead. This client reference can then be detected when walking the RSC graph, and a client CSS chunk can be produced from there. ### Testing Instructions N/A
) ### Description My recent change in vercel/turborepo#5397 added a way to create rules that only apply to internal references. In the process, I also made it so the default rules don't apply to internal references as well. However, we still need them to apply to TS and JS files, as we use that with ReferenceType::Internal in Next.js. ### Testing Instructions Next.js CI
### Description This PR changes CSS assets to support the CSS client references use case of Next.js, where .css assets in the RSC graph should be replaced with a client reference assets. CSS assets are now processed in two steps: 1. Processing the CSS source asset into either a Global or a Module CSS asset. 2. Inside of Global/Module assets, processing the CSS source asset into a CSS asset. By default, (2.) will create a leaf CSS asset. But in Next.js RSC, this step will be replaced with creating a CSS client reference instead. This client reference can then be detected when walking the RSC graph, and a client CSS chunk can be produced from there. ### Testing Instructions N/A
) ### Description My recent change in vercel/turborepo#5397 added a way to create rules that only apply to internal references. In the process, I also made it so the default rules don't apply to internal references as well. However, we still need them to apply to TS and JS files, as we use that with ReferenceType::Internal in Next.js. ### Testing Instructions Next.js CI
Description
This PR changes CSS assets to support the CSS client references use case of Next.js, where .css assets in the RSC graph should be replaced with a client reference assets.
CSS assets are now processed in two steps:
By default, (2.) will create a leaf CSS asset. But in Next.js RSC, this step will be replaced with creating a CSS client reference instead. This client reference can then be detected when walking the RSC graph, and a client CSS chunk can be produced from there.
Testing Instructions
N/A