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

feat(ecma-analyzer): support super() call in class ctor #5392

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

kwonoj
Copy link
Contributor

@kwonoj kwonoj commented Jun 27, 2023

Description

Attempt to close WEB-1089.

PR tries to support import resolustion inside of super call, if given args are referencing esm imports.

Since super() is sort of expr_call, I originally tried to reuse JsValue::Call as-is but not successfully. Still that might be a simple mistake and new addition to JsValue::Super may not be required.

@kwonoj kwonoj requested a review from a team as a code owner June 27, 2023 03:02
@vercel
Copy link

vercel bot commented Jun 27, 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 Jun 27, 2023 4:33pm
examples-designsystem-docs 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 4:33pm
examples-kitchensink-blog 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 4:33pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-cra-web ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm
examples-nonmonorepo ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm
turbo-site ⬜️ Ignored (Inspect) Visit Preview Jun 27, 2023 4:33pm

@github-actions
Copy link
Contributor

✅ This change can build next-swc

@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 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 5f6f054

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 11.18ms ± 0.12ms 11.84ms ± 0.12ms +5.86% +1.52%
bench_startup/Turbopack CSR/1000 modules 1134.69ms ± 6.46ms 1111.49ms ± 3.00ms -2.04% -0.38%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 11.18ms ± 0.12ms 11.84ms ± 0.12ms +5.86% +1.52%
bench_hmr_to_eval/Turbopack CSR/1000 modules 10.93ms ± 0.09ms 10.60ms ± 0.14ms -3.03%
bench_startup/Turbopack CSR/1000 modules 1134.69ms ± 6.46ms 1111.49ms ± 3.00ms -2.04% -0.38%

@github-actions
Copy link
Contributor

Windows Benchmark for 5f6f054

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 16.07ms ± 0.20ms 15.53ms ± 0.01ms -3.38% -0.71%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 16.07ms ± 0.20ms 15.53ms ± 0.01ms -3.38% -0.71%
bench_hmr_to_eval/Turbopack CSR/1000 modules 15.53ms ± 0.02ms 15.52ms ± 0.01ms -0.09%
bench_startup/Turbopack CSR/1000 modules 3619.25ms ± 11.12ms 3658.39ms ± 60.66ms +1.08%

@github-actions
Copy link
Contributor

MacOS Benchmark for 5f6f054

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack CSR/1000 modules 27.59ms ± 0.30ms 50.10ms ± 6.45ms +81.58% +31.89%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 28.56ms ± 0.13ms 28.38ms ± 0.15ms -0.64%
bench_hmr_to_eval/Turbopack CSR/1000 modules 27.59ms ± 0.30ms 50.10ms ± 6.45ms +81.58% +31.89%
bench_startup/Turbopack CSR/1000 modules 4978.01ms ± 818.02ms 3793.43ms ± 104.46ms -23.80%

Copy link
Member

@sokra sokra left a comment

Choose a reason for hiding this comment

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

add a test case

crates/turbopack-ecmascript/src/analyzer/mod.rs Outdated Show resolved Hide resolved
crates/turbopack-ecmascript/src/analyzer/graph.rs Outdated Show resolved Hide resolved
crates/turbopack-ecmascript/src/analyzer/mod.rs Outdated Show resolved Hide resolved
@kwonoj kwonoj force-pushed the feat-support-super-call branch from 9ccc415 to ccdfaeb Compare June 27, 2023 15:43
@github-actions
Copy link
Contributor

Linux Benchmark for f0bc234

Test Base PR % Significant %
bench_startup/Turbopack CSR/1000 modules 934.42ms ± 0.78ms 960.09ms ± 6.47ms +2.75% +1.19%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8036.17µs ± 13.69µs 7973.58µs ± 22.31µs -0.78%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7417.56µs ± 22.95µs 7436.24µs ± 33.14µs +0.25%
bench_startup/Turbopack CSR/1000 modules 934.42ms ± 0.78ms 960.09ms ± 6.47ms +2.75% +1.19%

@github-actions
Copy link
Contributor

Linux Benchmark for da4b1f3

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5936.94µs ± 26.19µs 5989.41µs ± 18.04µs +0.88%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5618.21µs ± 22.72µs 5617.66µs ± 28.17µs -0.01%
bench_startup/Turbopack CSR/1000 modules 910.53ms ± 0.84ms 911.70ms ± 0.86ms +0.13%

@github-actions
Copy link
Contributor

MacOS Benchmark for da4b1f3

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack CSR/1000 modules 49.82ms ± 2.34ms 25.33ms ± 0.13ms -49.16% -43.31%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 25.63ms ± 0.33ms 25.88ms ± 0.16ms +0.95%
bench_hmr_to_eval/Turbopack CSR/1000 modules 49.82ms ± 2.34ms 25.33ms ± 0.13ms -49.16% -43.31%
bench_startup/Turbopack CSR/1000 modules 3209.39ms ± 25.70ms 3334.03ms ± 79.75ms +3.88%

@kwonoj kwonoj merged commit 9b1fa77 into main Jun 27, 2023
@kwonoj kwonoj deleted the feat-support-super-call branch June 27, 2023 17:51
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…repo#5392)

### Description

Attempt to close WEB-1089.

PR tries to support import resolustion inside of `super` call, if given
args are referencing esm imports.

Since super() is sort of expr_call, I originally tried to reuse
JsValue::Call as-is but not successfully. Still that might be a simple
mistake and new addition to JsValue::Super may not be required.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…repo#5392)

### Description

Attempt to close WEB-1089.

PR tries to support import resolustion inside of `super` call, if given
args are referencing esm imports.

Since super() is sort of expr_call, I originally tried to reuse
JsValue::Call as-is but not successfully. Still that might be a simple
mistake and new addition to JsValue::Super may not be required.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…repo#5392)

### Description

Attempt to close WEB-1089.

PR tries to support import resolustion inside of `super` call, if given
args are referencing esm imports.

Since super() is sort of expr_call, I originally tried to reuse
JsValue::Call as-is but not successfully. Still that might be a simple
mistake and new addition to JsValue::Super may not be required.
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