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

fix(console)!: not all diagnostics are errors #6975

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

Chriscbr
Copy link
Contributor

@Chriscbr Chriscbr commented Aug 1, 2024

The compile function from the @winglang/compiler package throws even if the compilation was successful (e.g. the compiler emitted a warning). As result of that behavior, the console shows a blue screen of death when the compiler emits a warning.

This changeset refactors compile so it doesn't throw anymore, but returns the output directory (if possible) along with the diagnostics and any preflight errors.

Copy link

github-actions bot commented Aug 1, 2024

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and standard library @chriscbr
Wing Console @skyrpex
Wing compiler and language design @chriscbr
VSCode extension and language server @chriscbr
Wing CLI @chriscbr
Documentation @boyney123
Examples @boyney123
Wing Playground @skyrpex

@monadabot
Copy link
Contributor

monadabot commented Aug 1, 2024

Console preview environment is available at https://wing-console-pr-6975.fly.dev 🚀

Last Updated (UTC) 2024-08-02 07:56

@monadabot
Copy link
Contributor

monadabot commented Aug 1, 2024

Benchmarks

Comparison to Baseline ⬜🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 58ms±0.76 58ms±0.62 +0ms (+0.43%)⬜
empty.test.w -t sim 370ms±4.97 386ms±15.36 +16ms (+4.3%)🟥
empty.test.w -t tf-aws 620ms±3.79 614ms±4.33 -6ms (-0.92%)⬜
hello_world.test.w -t sim 415ms±9.93 406ms±3.2 -9ms (-2.13%)⬜
hello_world.test.w -t tf-aws 1524ms±16.95 1499ms±12.23 -25ms (-1.66%)⬜
jsii_big.test.w -t sim 2987ms±15.08 2963ms±8.14 -24ms (-0.8%)⬜
jsii_big.test.w -t tf-aws 3176ms±17.56 3171ms±18.93 -6ms (-0.18%)⬜
functions_1.test.w -t sim 406ms±5.45 399ms±3.38 -7ms (-1.7%)⬜
functions_1.test.w -t tf-aws 856ms±4.67 852ms±3.6 -4ms (-0.5%)⬜
functions_10.test.w -t sim 501ms±12.95 469ms±17.74 -32ms (-6.37%)⬜
functions_10.test.w -t tf-aws 2181ms±13.09 2172ms±7.98 -8ms (-0.39%)⬜
jsii_small.test.w -t sim 376ms±5.6 377ms±3.24 +0ms (+0.12%)⬜
jsii_small.test.w -t tf-aws 622ms±4.71 619ms±2.33 -2ms (-0.39%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 58ms 56ms 59ms 1ms 1ms
empty.test.w -t sim 386ms 370ms 437ms 15ms 21ms
empty.test.w -t tf-aws 614ms 607ms 626ms 4ms 6ms
hello_world.test.w -t sim 406ms 401ms 413ms 3ms 4ms
hello_world.test.w -t tf-aws 1499ms 1476ms 1535ms 12ms 17ms
jsii_big.test.w -t sim 2963ms 2945ms 2985ms 8ms 11ms
jsii_big.test.w -t tf-aws 3171ms 3127ms 3214ms 19ms 26ms
functions_1.test.w -t sim 399ms 390ms 406ms 3ms 5ms
functions_1.test.w -t tf-aws 852ms 844ms 861ms 4ms 5ms
functions_10.test.w -t sim 469ms 433ms 503ms 18ms 25ms
functions_10.test.w -t tf-aws 2172ms 2154ms 2191ms 8ms 11ms
jsii_small.test.w -t sim 377ms 371ms 384ms 3ms 5ms
jsii_small.test.w -t tf-aws 619ms 614ms 623ms 2ms 3ms
Last Updated (UTC) 2024-08-02 08:02

@skyrpex
Copy link
Contributor

skyrpex commented Aug 1, 2024

Looks good, although I'd like to change the console part a bit. We only want to log/report errors if shouldCompileAgain is false, and I believe a specific code path is broken.

@skyrpex skyrpex changed the title fix(console): not all diagnostics are errors fix(console)!: not all diagnostics are errors Aug 2, 2024
@skyrpex skyrpex marked this pull request as ready for review August 2, 2024 08:06
@skyrpex skyrpex requested review from skyrpex and a team as code owners August 2, 2024 08:06
@skyrpex skyrpex merged commit a8d5057 into main Aug 2, 2024
16 checks passed
@skyrpex skyrpex deleted the rybickic/fix-console-warning branch August 2, 2024 08:07
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.80.0.

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.

3 participants