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

Misc fixes to starting dev server #3121

Merged
merged 5 commits into from Dec 22, 2022
Merged

Misc fixes to starting dev server #3121

merged 5 commits into from Dec 22, 2022

Conversation

jridgewell
Copy link
Contributor

  • The 10th attempt used to day "trying again" and then didn't try again because the iterator ended…
  • Swaps a nested .map() == Some(bool) for a and_then
  • Extracts into a helper function so code can early return without an Option<Result> wrapper.

@jridgewell jridgewell requested a review from a team as a code owner December 22, 2022 02:13
@vercel
Copy link

vercel bot commented Dec 22, 2022

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

Name Status Preview Comments Updated
examples-cra-web 🔄 Building (Inspect) Dec 22, 2022 at 4:30AM (UTC)
examples-designsystem-docs 🔄 Building (Inspect) Dec 22, 2022 at 4:30AM (UTC)
examples-kitchensink-blog 🔄 Building (Inspect) Dec 22, 2022 at 4:30AM (UTC)
5 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Dec 22, 2022 at 4:30AM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Dec 22, 2022 at 4:30AM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Dec 22, 2022 at 4:30AM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Dec 22, 2022 at 4:30AM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Dec 22, 2022 at 4:30AM (UTC)

- The 10th attempt used to day "trying again" and then didn't try again because the iterator ended…
- Swaps a nested `.map() == Some(bool)` for a `and_then`
- Extracts into a helper function so code can early return without an Option<Result> wrapper.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2022

🟢 CI successful 🟢

Thanks

@github-actions
Copy link
Contributor

Benchmark for 5f2629f

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8551.54µs ± 63.90µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RCC/1000 modules 8834.63µs ± 75.97µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RSC/1000 modules 467.20ms ± 3.00ms N/A N/A N/A
bench_hmr_to_commit/Turbopack SSR/1000 modules 8617.87µs ± 69.68µs N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 7503.03µs ± 37.33µs N/A N/A N/A
bench_hmr_to_eval/Turbopack RCC/1000 modules 7672.28µs ± 61.95µs N/A N/A N/A
bench_hmr_to_eval/Turbopack SSR/1000 modules 7573.75µs ± 39.82µs N/A N/A N/A
bench_hydration/Turbopack RCC/1000 modules 3312.08ms ± 8.66ms N/A N/A N/A
bench_hydration/Turbopack RSC/1000 modules 2775.17ms ± 6.17ms N/A N/A N/A
bench_hydration/Turbopack SSR/1000 modules 2638.44ms ± 4.43ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 1657.29ms ± 5.27ms N/A N/A N/A
bench_startup/Turbopack RCC/1000 modules 2492.55ms ± 7.21ms N/A N/A N/A
bench_startup/Turbopack RSC/1000 modules 2375.18ms ± 14.54ms N/A N/A N/A
bench_startup/Turbopack SSR/1000 modules 2020.85ms ± 3.18ms N/A N/A N/A
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8551.54µs ± 63.90µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RCC/1000 modules 8834.63µs ± 75.97µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RSC/1000 modules 467.20ms ± 3.00ms N/A N/A N/A
bench_hmr_to_commit/Turbopack SSR/1000 modules 8617.87µs ± 69.68µs N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 7503.03µs ± 37.33µs N/A N/A N/A
bench_hmr_to_eval/Turbopack RCC/1000 modules 7672.28µs ± 61.95µs N/A N/A N/A
bench_hmr_to_eval/Turbopack SSR/1000 modules 7573.75µs ± 39.82µs N/A N/A N/A
bench_hydration/Turbopack RCC/1000 modules 3312.08ms ± 8.66ms N/A N/A N/A
bench_hydration/Turbopack RSC/1000 modules 2775.17ms ± 6.17ms N/A N/A N/A
bench_hydration/Turbopack SSR/1000 modules 2638.44ms ± 4.43ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 1657.29ms ± 5.27ms N/A N/A N/A
bench_startup/Turbopack RCC/1000 modules 2492.55ms ± 7.21ms N/A N/A N/A
bench_startup/Turbopack RSC/1000 modules 2375.18ms ± 14.54ms N/A N/A N/A
bench_startup/Turbopack SSR/1000 modules 2020.85ms ± 3.18ms N/A N/A N/A

@jridgewell jridgewell added the pr: automerge Kodiak will merge these automatically after checks pass label Dec 22, 2022
@github-actions
Copy link
Contributor

Benchmark for 7925de8

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8024.53µs ± 112.43µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RCC/1000 modules 8347.65µs ± 77.67µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RSC/1000 modules 459.10ms ± 1.16ms N/A N/A N/A
bench_hmr_to_commit/Turbopack SSR/1000 modules 8011.37µs ± 91.01µs N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 7136.91µs ± 36.29µs N/A N/A N/A
bench_hmr_to_eval/Turbopack RCC/1000 modules 7222.25µs ± 70.88µs N/A N/A N/A
bench_hmr_to_eval/Turbopack SSR/1000 modules 7123.04µs ± 51.07µs N/A N/A N/A
bench_hydration/Turbopack RCC/1000 modules 3231.48ms ± 8.64ms N/A N/A N/A
bench_hydration/Turbopack RSC/1000 modules 2724.38ms ± 10.45ms N/A N/A N/A
bench_hydration/Turbopack SSR/1000 modules 2581.27ms ± 11.27ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 1621.18ms ± 12.29ms N/A N/A N/A
bench_startup/Turbopack RCC/1000 modules 2423.71ms ± 7.17ms N/A N/A N/A
bench_startup/Turbopack RSC/1000 modules 2319.99ms ± 6.22ms N/A N/A N/A
bench_startup/Turbopack SSR/1000 modules 1981.41ms ± 5.34ms N/A N/A N/A
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8024.53µs ± 112.43µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RCC/1000 modules 8347.65µs ± 77.67µs N/A N/A N/A
bench_hmr_to_commit/Turbopack RSC/1000 modules 459.10ms ± 1.16ms N/A N/A N/A
bench_hmr_to_commit/Turbopack SSR/1000 modules 8011.37µs ± 91.01µs N/A N/A N/A
bench_hmr_to_eval/Turbopack CSR/1000 modules 7136.91µs ± 36.29µs N/A N/A N/A
bench_hmr_to_eval/Turbopack RCC/1000 modules 7222.25µs ± 70.88µs N/A N/A N/A
bench_hmr_to_eval/Turbopack SSR/1000 modules 7123.04µs ± 51.07µs N/A N/A N/A
bench_hydration/Turbopack RCC/1000 modules 3231.48ms ± 8.64ms N/A N/A N/A
bench_hydration/Turbopack RSC/1000 modules 2724.38ms ± 10.45ms N/A N/A N/A
bench_hydration/Turbopack SSR/1000 modules 2581.27ms ± 11.27ms N/A N/A N/A
bench_startup/Turbopack CSR/1000 modules 1621.18ms ± 12.29ms N/A N/A N/A
bench_startup/Turbopack RCC/1000 modules 2423.71ms ± 7.17ms N/A N/A N/A
bench_startup/Turbopack RSC/1000 modules 2319.99ms ± 6.22ms N/A N/A N/A
bench_startup/Turbopack SSR/1000 modules 1981.41ms ± 5.34ms N/A N/A N/A

@github-actions
Copy link
Contributor

Benchmark for 7b42a5b

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 7319.24µs ± 39.51µs 7517.18µs ± 42.80µs +2.70% +0.45%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 7319.24µs ± 39.51µs 7517.18µs ± 42.80µs +2.70% +0.45%
bench_hmr_to_commit/Turbopack RCC/1000 modules 7918.21µs ± 53.79µs 7739.52µs ± 103.05µs -2.26%
bench_hmr_to_commit/Turbopack RSC/1000 modules 451.52ms ± 2.01ms 453.40ms ± 1.24ms +0.42%
bench_hmr_to_commit/Turbopack SSR/1000 modules 7511.06µs ± 83.12µs 7539.49µs ± 43.00µs +0.38%
bench_hmr_to_eval/Turbopack CSR/1000 modules 6437.42µs ± 56.99µs 6407.11µs ± 49.70µs -0.47%
bench_hmr_to_eval/Turbopack RCC/1000 modules 6681.91µs ± 51.40µs 6702.55µs ± 89.70µs +0.31%
bench_hmr_to_eval/Turbopack SSR/1000 modules 6540.28µs ± 24.39µs 6624.31µs ± 52.78µs +1.28%
bench_hydration/Turbopack RCC/1000 modules 3254.02ms ± 11.26ms 3226.02ms ± 18.26ms -0.86%
bench_hydration/Turbopack RSC/1000 modules 2709.98ms ± 9.30ms 2715.81ms ± 6.33ms +0.22%
bench_hydration/Turbopack SSR/1000 modules 2554.45ms ± 8.08ms 2530.66ms ± 11.70ms -0.93%
bench_startup/Turbopack CSR/1000 modules 1589.54ms ± 4.85ms 1589.18ms ± 6.08ms -0.02%
bench_startup/Turbopack RCC/1000 modules 2425.32ms ± 7.38ms 2437.59ms ± 6.73ms +0.51%
bench_startup/Turbopack RSC/1000 modules 2323.99ms ± 6.26ms 2322.27ms ± 7.60ms -0.07%
bench_startup/Turbopack SSR/1000 modules 1985.04ms ± 4.88ms 1998.10ms ± 5.59ms +0.66%

/// Attempts to find an open port to bind.
fn find_port(&self, host: IpAddr, port: u16, max_attempts: u16) -> Result<DevServerBuilder> {
// max_attempts of 1 means we loop 0 times.
let max_attempts = max_attempts - 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this argument be "retry" instead? That way we avoid integer underflow altogether. In any case, the semantics of max_attempts = 0 are not very clear. You could also use https://doc.rust-lang.org/beta/std/num/struct.NonZeroU16.html.

@kodiakhq kodiakhq bot merged commit 912a354 into main Dec 22, 2022
@kodiakhq kodiakhq bot deleted the jrl-dev_server-fixes branch December 22, 2022 10:50
jridgewell added a commit to vercel/next.js that referenced this pull request Mar 10, 2023
- The 10th attempt used to day "trying again" and then didn't try again because the iterator ended…
- Swaps a nested `.map() == Some(bool)` for a `and_then`
- Extracts into a helper function so code can early return without an `Option<Result>` wrapper.
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
- The 10th attempt used to day "trying again" and then didn't try again because the iterator ended…
- Swaps a nested `.map() == Some(bool)` for a `and_then`
- Extracts into a helper function so code can early return without an `Option<Result>` wrapper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants