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

turbopack-cli: modularize code to support turbopack build #5487

Merged
merged 14 commits into from
Jul 20, 2023

Conversation

wbinnssmith
Copy link
Member

This work prepares for turbopack build by extracting code common between dev and build, such as asset context.

This also makes the cli accept a variadic list of entries rather than an unnamed directory parameter. The project directory is now available under --dir or -d.

Test Plan: cargo run -p turbopack-cli dev with a src/index.js present and cargo run -p turbopack-cli dev src/entry.js with src/entry.js present.

This work prepares for `turbopack build` by extracting code common between dev and build, such as asset context.

This also makes the cli accept a variadic list of entries rather than an unnamed directory parameter. The project directory is now available under `--dir` or `-d`.

Test Plan: `cargo run -p turbopack-cli dev` with a `src/index.js` present and `cargo run -p turbopack-cli dev src/entry.js` with `src/entry.js` present.
@vercel
Copy link

vercel bot commented Jul 10, 2023

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

Name Status Preview Comments Updated (UTC)
examples-basic-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 8:43pm
examples-cra-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 8:43pm
examples-native-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 8:43pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm
examples-nonmonorepo ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm
turbo-site ⬜️ Ignored (Inspect) Visit Preview Jul 20, 2023 8:43pm

wbinnssmith added a commit that referenced this pull request Jul 10, 2023
Depends on #5487

This implements a basic version of `turbopack build`, only targeting browser targets. In the future, we could accept a cli or configuration option to target Node.

Test Plan: `cargo run -p turbopack-cli build` with a `src/index.js` present and `cargo run -p turbopack-cli build src/entry.js` with `src/entry.js` present.
@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2023

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)

See workflow summary for details

@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2023

✅ This change can build next-swc

@github-actions
Copy link
Contributor

Linux Benchmark for cdf562d

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5385.02µs ± 34.07µs 5483.17µs ± 79.37µs +1.82%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5034.84µs ± 19.79µs 5214.70µs ± 162.36µs +3.57%
bench_startup/Turbopack CSR/1000 modules 801.98ms ± 0.64ms 803.81ms ± 1.29ms +0.23%

Copy link
Contributor

@arlyon arlyon left a comment

Choose a reason for hiding this comment

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

approving on behalf of repo

@github-actions
Copy link
Contributor

Linux Benchmark for 3faad6f

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5626.48µs ± 38.57µs 5549.25µs ± 43.00µs -1.37%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5173.96µs ± 16.65µs 5199.77µs ± 43.09µs +0.50%
bench_startup/Turbopack CSR/1000 modules 816.97ms ± 1.31ms 821.68ms ± 2.94ms +0.58%

@github-actions
Copy link
Contributor

Linux Benchmark for d717989

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5387.73µs ± 30.42µs 5372.93µs ± 46.48µs -0.27%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5036.53µs ± 21.99µs 5189.19µs ± 139.22µs +3.03%
bench_startup/Turbopack CSR/1000 modules 797.31ms ± 1.03ms 800.36ms ± 3.43ms +0.38%

@github-actions
Copy link
Contributor

MacOS Benchmark for d717989

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 29.04ms ± 0.16ms 28.29ms ± 0.18ms -2.59% -0.24%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 29.04ms ± 0.16ms 28.29ms ± 0.18ms -2.59% -0.24%
bench_hmr_to_eval/Turbopack CSR/1000 modules 28.28ms ± 0.22ms 27.56ms ± 0.18ms -2.53%
bench_startup/Turbopack CSR/1000 modules 3354.60ms ± 36.20ms 3354.94ms ± 85.07ms +0.01%

@github-actions
Copy link
Contributor

Linux Benchmark for 17be234

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5456.67µs ± 14.59µs N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 5161.98µs ± 91.61µs N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 816.56ms ± 3.46ms N/A N/A N/A
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5456.67µs ± 14.59µs N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 5161.98µs ± 91.61µs N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 816.56ms ± 3.46ms N/A N/A N/A

@github-actions
Copy link
Contributor

MacOS Benchmark for 17be234

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 28.07ms ± 0.41ms N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 27.36ms ± 0.94ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 6623.41ms ± 964.15ms N/A N/A N/A
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 28.07ms ± 0.41ms N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 27.36ms ± 0.94ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 6623.41ms ± 964.15ms N/A N/A N/A

@github-actions
Copy link
Contributor

Windows Benchmark for 17be234

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 15.48ms ± 0.05ms N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 15.48ms ± 0.02ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 2943.12ms ± 18.36ms N/A N/A N/A
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 15.48ms ± 0.05ms N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 15.48ms ± 0.02ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 2943.12ms ± 18.36ms N/A N/A N/A

@wbinnssmith wbinnssmith merged commit 046ea29 into main Jul 20, 2023
35 of 37 checks passed
@wbinnssmith wbinnssmith deleted the wbinnssmith/modularize-cli branch July 20, 2023 21:43
wbinnssmith added a commit to vercel/next.js that referenced this pull request Jul 20, 2023
Note: depends on next Turbopack publish

vercel/turborepo#5487 exports a reusable `handle_issues` function for reporting issues and erroring when failing issues are encountered.

This uses it for `next build` with a failing severity level of error.
wbinnssmith added a commit that referenced this pull request Jul 20, 2023
Depends on #5487

This implements a basic version of `turbopack build`, only targeting
browser targets. In the future, we could accept a cli or configuration
option to target Node.

Test Plan: `cargo run -p turbopack-cli build` with a `src/index.js`
present and `cargo run -p turbopack-cli build src/entry.js` with
`src/entry.js` present.
sokra added a commit to vercel/next.js that referenced this pull request Jul 21, 2023
* vercel/turborepo#5567 <!-- Alex Kirszenberg -
Remove unnecessary ValueDebugFormat item, hide Vc field -->
* vercel/turborepo#5576 <!-- Alex Kirszenberg -
Extract shared HMR utils to their own modules/crates -->
* vercel/turborepo#5503 <!-- OJ Kwon -
feat(turbopack_core): define trait for diagnostics -->
* vercel/turborepo#5487 <!-- Will Binns-Smith -
turbopack-cli: modularize code to support turbopack build -->
* vercel/turborepo#5488 <!-- Will Binns-Smith -
turbopack-cli: implement `turbopack build` -->
* vercel/turborepo#5450 <!-- Leah - feat: async
modules / top level await -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request Aug 16, 2023
Note: depends on next Turbopack publish

vercel/turborepo#5487 exports a reusable `handle_issues` function for reporting issues and erroring when failing issues are encountered.

This uses it for `next build` with a failing severity level of error.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…borepo#5487)

This work prepares for `turbopack build` by extracting code common
between dev and build, such as asset context.

This also makes the cli accept a variadic list of entries rather than an
unnamed directory parameter. The project directory is now available
under `--dir` or `-d`.

Test Plan: `cargo run -p turbopack-cli dev` with a `src/index.js`
present and `cargo run -p turbopack-cli dev src/entry.js` with
`src/entry.js` present.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
Depends on vercel/turborepo#5487

This implements a basic version of `turbopack build`, only targeting
browser targets. In the future, we could accept a cli or configuration
option to target Node.

Test Plan: `cargo run -p turbopack-cli build` with a `src/index.js`
present and `cargo run -p turbopack-cli build src/entry.js` with
`src/entry.js` present.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…borepo#5487)

This work prepares for `turbopack build` by extracting code common
between dev and build, such as asset context.

This also makes the cli accept a variadic list of entries rather than an
unnamed directory parameter. The project directory is now available
under `--dir` or `-d`.

Test Plan: `cargo run -p turbopack-cli dev` with a `src/index.js`
present and `cargo run -p turbopack-cli dev src/entry.js` with
`src/entry.js` present.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
Depends on vercel/turborepo#5487

This implements a basic version of `turbopack build`, only targeting
browser targets. In the future, we could accept a cli or configuration
option to target Node.

Test Plan: `cargo run -p turbopack-cli build` with a `src/index.js`
present and `cargo run -p turbopack-cli build src/entry.js` with
`src/entry.js` present.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…borepo#5487)

This work prepares for `turbopack build` by extracting code common
between dev and build, such as asset context.

This also makes the cli accept a variadic list of entries rather than an
unnamed directory parameter. The project directory is now available
under `--dir` or `-d`.

Test Plan: `cargo run -p turbopack-cli dev` with a `src/index.js`
present and `cargo run -p turbopack-cli dev src/entry.js` with
`src/entry.js` present.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
Depends on vercel/turborepo#5487

This implements a basic version of `turbopack build`, only targeting
browser targets. In the future, we could accept a cli or configuration
option to target Node.

Test Plan: `cargo run -p turbopack-cli build` with a `src/index.js`
present and `cargo run -p turbopack-cli build src/entry.js` with
`src/entry.js` present.
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.

4 participants