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

avoid bundling and execution of modules just of watching #4053

Merged
merged 2 commits into from Mar 2, 2023

Conversation

sokra
Copy link
Member

@sokra sokra commented Mar 2, 2023

Description

  • use completions to signal additional invalidations for evaluation
  • avoid adding these modules as runtime entries, since that will unnecessarily code generate, bundle and execute these modules
  • gets rid of the watch_files_hack

Testing Instructions

  • change postcss.config, next.config.js, etc. -> changes will be reflected by the app and process restarts
  • Auto label

use completions to signal additional invalidations for evaluation
@sokra sokra requested a review from a team as a code owner March 2, 2023 09:05
@vercel
Copy link

vercel bot commented Mar 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
examples-svelte-web 🔄 Building (Inspect) Mar 2, 2023 at 10:00AM (UTC)
9 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
examples-cra-web ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
examples-tailwind-web ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
examples-vite-web ⬜️ Ignored (Inspect) Mar 2, 2023 at 10:00AM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Mar 2, 2023 at 10:00AM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

🟢 CI successful 🟢

Thanks

vec![
JsonValueVc::cell(request),
JsonValueVc::cell(dir.to_string_lossy().into()),
],
routes_changed,
CompletionsVc::all(vec![next_config_changed, routes_changed]),
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated to the current PR, but it feels like ::all should be a static method on CompletionVc instead of CompletionsVc.

#[turbo_tasks::function]
pub async fn all(self) -> anyhow::Result<CompletionVc> {
pub fn all(completions: Vec<CompletionVc>) -> CompletionVc {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunate that we can't use [CompletionVc; N] here. This seems like a very easy mistake to make.

/// Returns a completion that changes when the content of the given asset
/// changes.
#[turbo_tasks::function]
pub async fn content_changed(asset: AssetVc) -> Result<CompletionVc> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't mark this as pub until we have another use for it.

@sokra sokra merged commit 197eb0f into main Mar 2, 2023
@sokra sokra deleted the sokra/web-676-avoid-execution-modules-that-are-used branch March 2, 2023 11:02
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Benchmark for 444b11e

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9876.90µs ± 67.17µs 9897.25µs ± 55.33µs +0.21%
bench_hmr_to_commit/Turbopack RCC/1000 modules 12.59ms ± 0.26ms 12.63ms ± 0.17ms +0.33%
bench_hmr_to_commit/Turbopack RSC/1000 modules 528.20ms ± 2.00ms 524.49ms ± 1.50ms -0.70%
bench_hmr_to_commit/Turbopack SSR/1000 modules 10.10ms ± 0.03ms 10.07ms ± 0.04ms -0.22%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8829.93µs ± 29.46µs 8835.34µs ± 44.10µs +0.06%
bench_hmr_to_eval/Turbopack RCC/1000 modules 11.05ms ± 0.07ms 11.08ms ± 0.08ms +0.34%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8968.72µs ± 24.06µs 9007.49µs ± 52.40µs +0.43%
bench_hydration/Turbopack RCC/1000 modules 3775.34ms ± 16.48ms 3759.22ms ± 11.94ms -0.43%
bench_hydration/Turbopack RSC/1000 modules 3388.03ms ± 14.71ms 3428.72ms ± 19.51ms +1.20%
bench_hydration/Turbopack SSR/1000 modules 3457.42ms ± 8.68ms 3449.18ms ± 11.97ms -0.24%
bench_startup/Turbopack CSR/1000 modules 2685.36ms ± 7.68ms 2673.84ms ± 5.85ms -0.43%
bench_startup/Turbopack RCC/1000 modules 2213.49ms ± 5.03ms 2232.20ms ± 6.84ms +0.85%
bench_startup/Turbopack RSC/1000 modules 2168.40ms ± 8.32ms 2168.69ms ± 4.91ms +0.01%
bench_startup/Turbopack SSR/1000 modules 2121.31ms ± 4.28ms 2132.05ms ± 3.61ms +0.51%

ijjk added a commit to vercel/next.js that referenced this pull request Mar 2, 2023
jridgewell pushed a commit to vercel/next.js that referenced this pull request Mar 10, 2023
…o#4053)

### Description

* use completions to signal additional invalidations for evaluation
* avoid adding these modules as runtime entries, since that will
unnecessarily code generate, bundle and execute these modules
* gets rid of the watch_files_hack

### Testing Instructions

* change postcss.config, next.config.js, etc. -> changes will be
reflected by the app and process restarts
sokra added a commit to vercel/next.js that referenced this pull request Mar 13, 2023
…o#4053)

### Description

* use completions to signal additional invalidations for evaluation
* avoid adding these modules as runtime entries, since that will
unnecessarily code generate, bundle and execute these modules
* gets rid of the watch_files_hack

### Testing Instructions

* change postcss.config, next.config.js, etc. -> changes will be
reflected by the app and process restarts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants