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

improve handling of syntax errors in HMR #4129

Merged

Conversation

sokra
Copy link
Member

@sokra sokra commented Mar 8, 2023

Description

It's a bit ugly and I dislike the way it's implemented, but this will help for now.

  • When using HMR and introducing an parse error to a module, this keeps the previous references and exports type to keep the environment intact and avoid unloading a bunch of modules

depends on #3975 to work correctly

@vercel
Copy link

vercel bot commented Mar 8, 2023

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

Name Status Preview Comments Updated
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 9, 2023 at 11:53AM (UTC)
9 Ignored Deployments
Name Status Preview Comments Updated
examples-basic-web ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-cra-web ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-tailwind-web ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)
examples-vite-web ⬜️ Ignored (Inspect) Mar 9, 2023 at 11:53AM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 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 Mar 8, 2023

Benchmark for 03ab43e

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9312.68µs ± 24.38µs 9378.20µs ± 49.38µs +0.70%
bench_hmr_to_commit/Turbopack RCC/1000 modules 11.52ms ± 0.15ms 12.01ms ± 0.20ms +4.31%
bench_hmr_to_commit/Turbopack RSC/1000 modules 513.09ms ± 1.94ms 510.47ms ± 0.95ms -0.51%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9566.63µs ± 57.97µs 9583.54µs ± 51.71µs +0.18%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8469.25µs ± 52.19µs 8418.90µs ± 108.45µs -0.59%
bench_hmr_to_eval/Turbopack RCC/1000 modules 11.10ms ± 0.93ms 10.38ms ± 0.12ms -6.49%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8670.58µs ± 37.61µs 8570.94µs ± 36.72µs -1.15%
bench_hydration/Turbopack RCC/1000 modules 3475.84ms ± 14.13ms 3506.66ms ± 10.79ms +0.89%
bench_hydration/Turbopack RSC/1000 modules 3177.49ms ± 11.87ms 3181.05ms ± 11.47ms +0.11%
bench_hydration/Turbopack SSR/1000 modules 3285.92ms ± 3.46ms 3301.16ms ± 7.72ms +0.46%
bench_startup/Turbopack CSR/1000 modules 2577.52ms ± 8.99ms 2561.96ms ± 8.22ms -0.60%
bench_startup/Turbopack RCC/1000 modules 1978.53ms ± 3.90ms 1984.36ms ± 4.44ms +0.29%
bench_startup/Turbopack RSC/1000 modules 1957.76ms ± 5.01ms 1957.73ms ± 4.26ms -0.00%
bench_startup/Turbopack SSR/1000 modules 2019.21ms ± 2.84ms 2017.64ms ± 2.03ms -0.08%

crates/turbopack-ecmascript/src/lib.rs Outdated Show resolved Hide resolved
crates/turbopack-ecmascript/src/lib.rs Outdated Show resolved Hide resolved
crates/turbopack-ecmascript/src/lib.rs Outdated Show resolved Hide resolved
crates/turbopack-ecmascript/src/lib.rs Outdated Show resolved Hide resolved
@sokra sokra force-pushed the sokra/web-626-hmr-a-syntax-error-will-take-forever-and branch from 6e3683a to 18585eb Compare March 9, 2023 11:52
@sokra sokra marked this pull request as ready for review March 9, 2023 11:52
@sokra sokra requested a review from a team as a code owner March 9, 2023 11:52
@sokra sokra added the pr: automerge Kodiak will merge these automatically after checks pass label Mar 9, 2023
@sokra sokra requested a review from alexkirsz March 9, 2023 12:22
@kodiakhq kodiakhq bot merged commit 82924b5 into main Mar 9, 2023
@kodiakhq kodiakhq bot deleted the sokra/web-626-hmr-a-syntax-error-will-take-forever-and branch March 9, 2023 12:53
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2023

Benchmark for da8a1ba

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack SSR/1000 modules 9090.33µs ± 22.01µs 9304.20µs ± 66.22µs +2.35% +0.41%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 10.03ms ± 0.03ms 9981.59µs ± 38.81µs -0.44%
bench_hmr_to_commit/Turbopack RCC/1000 modules 11.70ms ± 0.10ms 11.66ms ± 0.14ms -0.34%
bench_hmr_to_commit/Turbopack RSC/1000 modules 518.50ms ± 2.52ms 515.25ms ± 3.47ms -0.63%
bench_hmr_to_commit/Turbopack SSR/1000 modules 10.07ms ± 0.05ms 10.16ms ± 0.06ms +0.86%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8915.74µs ± 42.58µs 8761.01µs ± 48.03µs -1.74%
bench_hmr_to_eval/Turbopack RCC/1000 modules 10.45ms ± 0.14ms 10.43ms ± 0.16ms -0.19%
bench_hmr_to_eval/Turbopack SSR/1000 modules 9090.33µs ± 22.01µs 9304.20µs ± 66.22µs +2.35% +0.41%
bench_hydration/Turbopack RCC/1000 modules 3469.50ms ± 10.03ms 3464.84ms ± 8.02ms -0.13%
bench_hydration/Turbopack RSC/1000 modules 3171.11ms ± 13.52ms 3141.83ms ± 6.12ms -0.92%
bench_hydration/Turbopack SSR/1000 modules 3263.46ms ± 4.25ms 3269.83ms ± 5.54ms +0.20%
bench_startup/Turbopack CSR/1000 modules 2593.67ms ± 4.95ms 2600.04ms ± 5.79ms +0.25%
bench_startup/Turbopack RCC/1000 modules 1987.95ms ± 6.42ms 1989.20ms ± 4.79ms +0.06%
bench_startup/Turbopack RSC/1000 modules 1978.74ms ± 5.69ms 1994.54ms ± 6.72ms +0.80%
bench_startup/Turbopack SSR/1000 modules 2037.18ms ± 4.28ms 2033.98ms ± 5.34ms -0.16%

ijjk pushed a commit to vercel/next.js that referenced this pull request Mar 9, 2023
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
### Description

It's a bit ugly and I dislike the way it's implemented, but this will
help for now.

* When using HMR and introducing an parse error to a module, this keeps
the previous references and exports type to keep the environment intact
and avoid unloading a bunch of modules

depends on vercel/turborepo#3975 to work correctly
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
### Description

It's a bit ugly and I dislike the way it's implemented, but this will
help for now.

* When using HMR and introducing an parse error to a module, this keeps
the previous references and exports type to keep the environment intact
and avoid unloading a bunch of modules

depends on vercel/turborepo#3975 to work correctly
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
### Description

It's a bit ugly and I dislike the way it's implemented, but this will
help for now.

* When using HMR and introducing an parse error to a module, this keeps
the previous references and exports type to keep the environment intact
and avoid unloading a bunch of modules

depends on vercel/turborepo#3975 to work correctly
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.

2 participants