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

Refactoring module references #5572

Merged
merged 18 commits into from
Jul 21, 2023
Merged

Refactoring module references #5572

merged 18 commits into from
Jul 21, 2023

Conversation

sokra
Copy link
Member

@sokra sokra commented Jul 20, 2023

Description

Split AssetReference ResolveResult into Module and Source variants
simplify ResolveResult
get rid of some temporary type fixup methods

graph references are now typed either Source, Module or OutputAsset instead of only Asset in general

next.js PR: vercel/next.js#52930

@vercel
Copy link

vercel bot commented Jul 20, 2023

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 20, 2023

⚠️ This change may fail to build next-swc.

Logs

error: failed to select a version for `testing`.
    ... required by package `turbopack-binding v0.1.0 (https://github.com/vercel/turbo?rev=558489a935cceba1f73b6258be0d4c79851d7bd3#1a950b08)`
    ... which satisfies git dependency `turbopack-binding` (locked to 0.1.0) of package `next-api v0.1.0 (/home/runner/work/turbo/turbo/packages/next-swc/crates/next-api)`
    ... which satisfies path dependency `next-api` (locked to 0.1.0) of package `next-swc-napi v0.0.0 (/home/runner/work/turbo/turbo/packages/next-swc/crates/napi)`
versions that meet the requirements `^0.33.21` are: 0.33.21

all possible versions conflict with previously selected packages.

  previously selected package `testing v0.33.20`
    ... which satisfies dependency `testing = "^0.33.20"` (locked to 0.33.20) of package `next-dev-tests v0.1.0 (/home/runner/work/turbo/turbo/packages/next-swc/crates/next-dev-tests)`

failed to select a version for `testing` which could resolve this conflict

See job summary for details

@github-actions
Copy link
Contributor

github-actions bot commented Jul 20, 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

Linux Benchmark for 97b5dff

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5473.50µs ± 16.20µs 5528.26µs ± 19.43µs +1.00%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5208.73µs ± 48.61µs 5647.61µs ± 468.86µs +8.43%
bench_startup/Turbopack CSR/1000 modules 803.12ms ± 1.16ms 809.65ms ± 3.63ms +0.81%

@github-actions
Copy link
Contributor

Linux Benchmark for 3d1c823

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 7409.92µs ± 27.79µs 7433.11µs ± 39.10µs +0.31%
bench_hmr_to_eval/Turbopack CSR/1000 modules 6647.74µs ± 131.37µs 6953.81µs ± 268.58µs +4.60%
bench_startup/Turbopack CSR/1000 modules 827.05ms ± 3.13ms 817.95ms ± 5.50ms -1.10%

@github-actions
Copy link
Contributor

Linux Benchmark for 1e91e03

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack CSR/1000 modules 6086.06µs ± 51.97µs 6421.32µs ± 106.48µs +5.51% +0.30%
bench_startup/Turbopack CSR/1000 modules 830.63ms ± 4.43ms 853.91ms ± 5.16ms +2.80% +0.49%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 6640.54µs ± 39.90µs 6622.85µs ± 34.24µs -0.27%
bench_hmr_to_eval/Turbopack CSR/1000 modules 6086.06µs ± 51.97µs 6421.32µs ± 106.48µs +5.51% +0.30%
bench_startup/Turbopack CSR/1000 modules 830.63ms ± 4.43ms 853.91ms ± 5.16ms +2.80% +0.49%

@github-actions
Copy link
Contributor

MacOS Benchmark for 1e91e03

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 27.92ms ± 0.12ms 27.46ms ± 0.11ms -1.65% -0.05%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 27.92ms ± 0.12ms 27.46ms ± 0.11ms -1.65% -0.05%
bench_hmr_to_eval/Turbopack CSR/1000 modules 26.51ms ± 0.14ms 26.93ms ± 0.17ms +1.59%
bench_startup/Turbopack CSR/1000 modules 3025.62ms ± 11.69ms 3139.69ms ± 73.85ms +3.77%

@sokra sokra marked this pull request as ready for review July 20, 2023 14:55
@sokra sokra requested a review from a team as a code owner July 20, 2023 14:55
@github-actions
Copy link
Contributor

Linux Benchmark for eaa2e91

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 6386.03µs ± 30.15µs 6268.91µs ± 22.50µs -1.83% -0.19%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 6386.03µs ± 30.15µs 6268.91µs ± 22.50µs -1.83% -0.19%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5780.09µs ± 41.70µs 6063.95µs ± 221.56µs +4.91%
bench_startup/Turbopack CSR/1000 modules 816.21ms ± 1.65ms 815.91ms ± 1.50ms -0.04%

@github-actions
Copy link
Contributor

MacOS Benchmark for eaa2e91

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack CSR/1000 modules 26.22ms ± 0.23ms 57.33ms ± 2.27ms +118.66% +97.83%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 27.88ms ± 0.05ms 28.15ms ± 0.10ms +0.96%
bench_hmr_to_eval/Turbopack CSR/1000 modules 26.22ms ± 0.23ms 57.33ms ± 2.27ms +118.66% +97.83%
bench_startup/Turbopack CSR/1000 modules 3969.78ms ± 480.44ms 3108.49ms ± 61.50ms -21.70%

@sokra sokra requested a review from alexkirsz July 20, 2023 16:13
Copy link
Contributor

@alexkirsz alexkirsz left a comment

Choose a reason for hiding this comment

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

There's a bunch of places where we should rename asset -> module, and a bunch of unnecessary Vc functions to clean up, but otherwise LGTM.

crates/turbopack-core/src/chunk/mod.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/chunk/mod.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/chunk/mod.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/chunk/mod.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/chunk/mod.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/introspect/module.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/introspect/output_asset.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/introspect/source.rs Outdated Show resolved Hide resolved
crates/turbopack-core/src/introspect/utils.rs Show resolved Hide resolved
crates/turbopack-css/src/chunk/mod.rs Outdated Show resolved Hide resolved
# Conflicts:
#	crates/turbopack-core/src/reference/mod.rs
@github-actions
Copy link
Contributor

Linux Benchmark for 913d518

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5809.62µs ± 80.79µs 5695.47µs ± 12.35µs -1.96%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5594.60µs ± 114.66µs 5514.32µs ± 131.79µs -1.43%
bench_startup/Turbopack CSR/1000 modules 1027.03ms ± 1.66ms 1019.70ms ± 4.18ms -0.71%

@github-actions
Copy link
Contributor

MacOS Benchmark for 913d518

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack CSR/1000 modules 23.66ms ± 0.63ms 57.95ms ± 5.09ms +144.96% +91.71%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 27.30ms ± 0.11ms 27.56ms ± 0.18ms +0.95%
bench_hmr_to_eval/Turbopack CSR/1000 modules 23.66ms ± 0.63ms 57.95ms ± 5.09ms +144.96% +91.71%
bench_startup/Turbopack CSR/1000 modules 3436.37ms ± 59.43ms 3301.74ms ± 72.70ms -3.92%

@github-actions
Copy link
Contributor

Linux Benchmark for 558489a

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 6999.29µs ± 68.84µs 6918.88µs ± 28.17µs -1.15%
bench_hmr_to_eval/Turbopack CSR/1000 modules 6365.75µs ± 36.41µs 6392.30µs ± 65.20µs +0.42%
bench_startup/Turbopack CSR/1000 modules 1055.02ms ± 4.79ms 1046.84ms ± 5.52ms -0.78%

@github-actions
Copy link
Contributor

MacOS Benchmark for 558489a

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 26.92ms ± 0.19ms 27.55ms ± 0.06ms +2.31% +0.40%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 26.92ms ± 0.19ms 27.55ms ± 0.06ms +2.31% +0.40%
bench_hmr_to_eval/Turbopack CSR/1000 modules 27.14ms ± 0.33ms 27.11ms ± 0.13ms -0.13%
bench_startup/Turbopack CSR/1000 modules 3404.62ms ± 9.53ms 3547.14ms ± 103.47ms +4.19%

@sokra sokra merged commit c4d1d31 into main Jul 21, 2023
45 of 48 checks passed
@sokra sokra deleted the sokra/module-references branch July 21, 2023 10:04
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request Jul 21, 2023
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