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

[WIP] feat: cloud.Check (sdk modules written in Wing) #5427

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Chriscbr
Copy link
Contributor

@Chriscbr Chriscbr commented Jan 5, 2024

WIP - type checking works, but the emitted JS code doesn't work (the compiler doesn't yet know to emit the code for cloud.Check differently than the other SDK modules)

Closes #4810

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@monadabot
Copy link
Contributor

monadabot commented Jan 5, 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 assistence, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @eladb
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @skorfmann
Wing Playground @eladcon

Comment on lines +3260 to +3272
if source_path == self.sdk_in_wing_dir {
let mut cloud_ns = self
.types
.libraries
.lookup_nested_str("@winglang/sdk.cloud", None)
.unwrap()
.0
.as_namespace_ref()
.unwrap();
for child_env in &child_envs {
cloud_ns.envs.push(*child_env);
}
}
Copy link
Contributor Author

@Chriscbr Chriscbr Jan 5, 2024

Choose a reason for hiding this comment

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

This code inside type_check_dir translates roughly to "if I'm type checking a directory, and the directory happens to be the special one bundled in the wing compiler, insert all of my types into the cloud namespace"

@monadabot
Copy link
Contributor

monadabot commented Jan 5, 2024

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

Last Updated (UTC) 2024-01-06 00:07

@monadabot
Copy link
Contributor

monadabot commented Jan 6, 2024

Benchmarks

Comparison to Baseline ⬜
Benchmark Before After Change
version 75ms±2.32 72ms±0.53 -2ms (-3.1%)⬜
jsii_big.test.w -t sim 3340ms±14.04 ... ...
jsii_big.test.w -t tf-aws 3435ms±8.48 ... ...
functions_1.test.w -t sim 614ms±5.51 ... ...
functions_1.test.w -t tf-aws 1837ms±116.31 ... ...
hello_world.test.w -t sim 621ms±5.59 ... ...
hello_world.test.w -t tf-aws 4782ms±35.26 ... ...
functions_10.test.w -t sim 683ms±4.91 ... ...
functions_10.test.w -t tf-aws 4128ms±22.63 ... ...
jsii_small.test.w -t sim 592ms±5.92 ... ...
jsii_small.test.w -t tf-aws 711ms±3.01 ... ...
empty.test.w -t sim 585ms±7.25 ... ...
empty.test.w -t tf-aws 696ms±3.07 ... ...

⬜ 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 72ms 71ms 73ms 1ms 1ms
jsii_big.test.w -t sim ... ... ... ... ...
jsii_big.test.w -t tf-aws ... ... ... ... ...
functions_1.test.w -t sim ... ... ... ... ...
functions_1.test.w -t tf-aws ... ... ... ... ...
hello_world.test.w -t sim ... ... ... ... ...
hello_world.test.w -t tf-aws ... ... ... ... ...
functions_10.test.w -t sim ... ... ... ... ...
functions_10.test.w -t tf-aws ... ... ... ... ...
jsii_small.test.w -t sim ... ... ... ... ...
jsii_small.test.w -t tf-aws ... ... ... ... ...
empty.test.w -t sim ... ... ... ... ...
empty.test.w -t tf-aws ... ... ... ... ...
Last Updated (UTC) 2024-01-06 00:12

monadabot and others added 2 commits January 6, 2024 02:03
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Jan 6, 2024
@eladb eladb removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Jan 8, 2024
(await $handler());
}
catch ($error_e) {
const e = $error_e.message;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did these snapshots have to change?

Copy link

github-actions bot commented Feb 5, 2024

Hi,

This PR has not seen activity in 20 days. Therefore, we are marking the PR as stale for now. It will be closed after 7 days.
If you need help with the PR, do not hesitate to reach out in the winglang community discord at winglang.discord.com.
Feel free to re-open this PR when it is still relevant and ready to be worked on again.
Thanks!

@github-actions github-actions bot added the Stale label Feb 5, 2024
@Chriscbr Chriscbr removed the Stale label Feb 6, 2024
@eladb
Copy link
Contributor

eladb commented Feb 12, 2024

@Chriscbr any updates on this? Would be awesome to be able to get this merged :-)

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.

Use Winglang to build Wing SDK resources
3 participants