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: @target intrinsic #7161

Merged
merged 5 commits into from
Sep 24, 2024
Merged

feat: @target intrinsic #7161

merged 5 commits into from
Sep 24, 2024

Conversation

Chriscbr
Copy link
Contributor

As a more convenient alternative to importing the util module and using util.env("WING_TARGET") to obtain the current cloud target, this PR adds a dedicated intrinsic function @target which does the same thing.

In terms of design, the motivation of the new syntax is to make it clear that this kind of pattern (where you alter application logic or configuration based on the compilation target string) is an intended pattern in Wing and something handy for building abstractions around, not a hacky workaround.

Existing code that uses the WING_TARGET environment variable will continue to work (no current plans to deprecate it).

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.

@Chriscbr Chriscbr requested a review from a team as a code owner September 24, 2024 04:24
Copy link

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

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

Last Updated (UTC) 2024-09-24 04:32

Copy link
Contributor

mergify bot commented Sep 24, 2024

Thanks for contributing, @Chriscbr! This PR will now be added to the merge queue, or immediately merged if rybickic/target-intrinsic is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit 62d0fab into main Sep 24, 2024
26 checks passed
@mergify mergify bot deleted the rybickic/target-intrinsic branch September 24, 2024 07:02
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.85.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants