-
Notifications
You must be signed in to change notification settings - Fork 198
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!: app.parameters
#5915
feat!: app.parameters
#5915
Conversation
Thanks for opening this pull request! 🎉
|
Console preview environment is available at https://wing-console-pr-5915.fly.dev 🚀 Last Updated (UTC) 2024-03-22 15:45 |
BenchmarksComparison to Baseline ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🟥🟥
⬜ Within 1.5 standard deviations Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI. Results
Last Updated (UTC) 2024-03-22 15:50 |
I think I could actually get struct AppParams {
someMessage: str;
someNumber: num;
}
let app = nodeof(this).app;
app.parameters.addSchema(AppParams.schema());
let appParams = AppParams.fromParameters(app.parameters);
log(appParams.someMessage); Update: I added fromParameters |
app
examples/tests/valid/apps_with_params/nested_params/parameters.test.w
Outdated
Show resolved
Hide resolved
examples/tests/valid/apps_with_params/nested_params/parameters.test.w
Outdated
Show resolved
Hide resolved
Signed-off-by: monada-bot[bot] <[email protected]>
Signed-off-by: monada-bot[bot] <[email protected]>
Signed-off-by: monada-bot[bot] <[email protected]>
Signed-off-by: monada-bot[bot] <[email protected]>
Signed-off-by: monada-bot[bot] <[email protected]>
Signed-off-by: monada-bot[bot] <[email protected]>
0f1262f
to
095265b
Compare
Signed-off-by: monada-bot[bot] <[email protected]>
Thanks for contributing, @hasanaburayyan! This PR will now be added to the merge queue, or immediately merged if |
Congrats! 🚀 This was released in Wing 0.64.0. |
## Summary BREAKING CHANGE: `app.platformParameters` has been changed to `app.parameters` This PR now allows Wing authors to access the application's parameters through `app.parameters` for example: ```js let parameters = nodeof(this).app.parameters; ``` This also means that now wing structs can easily be added to platform parameters through the use of `parameters.addSchema(Struct.schema())` as well structs can be read from the parameter list through `Struct.fromJson(parameters.read())` ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] 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](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Summary
BREAKING CHANGE:
app.platformParameters
has been changed toapp.parameters
This PR now allows Wing authors to access the application's parameters through
app.parameters
for example:This also means that now wing structs can easily be added to platform parameters through the use of
parameters.addSchema(Struct.schema())
as well structs can be read from the parameter list throughStruct.fromJson(parameters.read())
Checklist
pr/e2e-full
label if this feature requires end-to-end testingBy submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.