-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Turbopack: Implement TraceRawVcs and NonLocalValue correctly for Effects #89133
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
base: bgw/effect-trait
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Failing test suitesCommit: fd04529 | About building and testing Next.js
Expand output● Test suite failed to run |
Merging this PR will not alter performance
Comparing Footnotes
|
| EffectState::NotStarted(_) => { | ||
| let EffectState::NotStarted(inner) = std::mem::replace( | ||
| &mut *guard, | ||
| EffectState::Started(Event::new(|| || "Effect".to_string())), | ||
| ) else { | ||
| unreachable!(); | ||
| let EffectState::NotStarted(effect) = | ||
| std::mem::replace(&mut *guard, EffectState::Invalid) | ||
| else { | ||
| unreachable!() | ||
| }; | ||
| State::NotStarted(inner) | ||
| let effect: Arc<dyn DynEffect> = Arc::from(effect); | ||
| *guard = EffectState::Started( | ||
| effect.clone(), | ||
| Event::new(|| || "Effect".to_string()), | ||
| ); | ||
| State::NotStarted(effect) |
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.
can't we just capture effect in the match condition and then assign back? i guess that requires an additional clone on the effect Arc?
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 actually tried rewriting it that way, using a manual drop(guard) call. The appears to be some limitation of rustc's analysis here that cause it to think that the future is no longer Send because it thinks the mutex guard might get held across an await point (even though it isn't because of the drop(guard) call).
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **434 kB** → **434 kB** ✅ -11 B81 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
|
8249ad2 to
c11b2a1
Compare
c11b2a1 to
fd04529
Compare

In subsequent PRs, I want to store a
ResolvedVc(specifically, aFileSystemPath, which contains aVc<Box<dyn FileSystem>>) inside of anEffect.To do this in a way that wouldn't break a hypothetical future tracing garbage collector, we must implement
TraceRawVcsonEffect.The previous PR changed the
Effecttype from a closure to a trait in order to enable this.