|
| 1 | +--- |
| 2 | +slug: 2024-06-12-newsletter |
| 3 | +title: KCL Newsletter (2024.05.30 - 2024.06.12) |
| 4 | +authors: |
| 5 | + name: KCL Team |
| 6 | + title: KCL Team |
| 7 | +tags: [KCL, Newsletter] |
| 8 | +image: /img/biweekly-newsletter.png |
| 9 | +--- |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +[KCL](https://github.com/kcl-lang/kcl) is an open-source configuration and policy language hosted by the Cloud Native Computing Foundation (CNCF) as a Sandbox Project. Built on a foundation of constraints and functional programming principles, KCL enhances the process of writing complex configurations, particularly in cloud-native environments. By leveraging advanced programming language techniques, KCL promotes improved modularity, scalability, and stability in configuration management. It simplifies logic writing, offers easy-to-use automation APIs, and seamlessly integrates with existing systems. |
| 14 | + |
| 15 | +This section will update the KCL language community's latest news, including features, website updates, and the latest community news, helping everyone better understand the KCL community! |
| 16 | + |
| 17 | +**_KCL Website: [https://kcl-lang.io](https://kcl-lang.io)_** |
| 18 | + |
| 19 | +## Special Thanks |
| 20 | + |
| 21 | +Special thanks to all community contributors over the past two weeks. The following list is in no particular order: |
| 22 | + |
| 23 | +- Thanks to @shruti2522 for contributions to the KCL IDE string union type variable completion and function symbol highlighting 🙌 |
| 24 | +- Thanks to @ihor-hrytskiv for contributions to the jsonpatch module 🙌 |
| 25 | +- Thanks to @selfuryon for contributions to the KCL Nix Package 🙌 |
| 26 | +- Thanks to @nestoralonso for contributions to the ArgoCD KCL plugin 🙌 |
| 27 | +- Thanks to @Vishalk91-4 for contributions to the KCL tree-sitter-grammar 🙌 |
| 28 | +- Thanks to @Daksh-10 for contributions to the KCL tree-sitter-grammar 🙌 |
| 29 | +- Thanks to @officialasishkumar for contributions to the kcl.mod file serialization/deserialization API 🙌 |
| 30 | +- Thanks to @d4v1d03 for contributions to the KCL FAQ documentation 🙌 |
| 31 | +- Thanks to @liangyuanpeng, @atelsier, @mproffitt, @steeling, @eshepelyuk, @SjuulJanssen, @riven-blade, @excalq, @Wck-iipi, @Yvan da Silva, @Hai Wu, and others for their invaluable suggestions and feedback during the recent period of using KCL 🙌 |
| 32 | + |
| 33 | +## Overview |
| 34 | + |
| 35 | +Thanks to all contributors for their outstanding work over the past two weeks (2024.05.30 - 2024.06.12). Here is an overview of the key content: |
| 36 | + |
| 37 | +**📦️ Modules Updates** |
| 38 | + |
| 39 | +The `jsonpatch` ibrary released version 0.0.4, fixing unexpected errors in the set_obj function. You can add the latest jsonpatch dependency using `kcl mod add jsonpatch`. Usage example: |
| 40 | + |
| 41 | +```python |
| 42 | +import jsonpatch as p |
| 43 | + |
| 44 | +test_json_patch = lambda { |
| 45 | + data = { |
| 46 | + "firstName": "John", |
| 47 | + "lastName": "Doe", |
| 48 | + "age": 30, |
| 49 | + "address": { |
| 50 | + "streetAddress": "1234 Main St", |
| 51 | + "city": "New York", |
| 52 | + "state": "NY", |
| 53 | + "postalCode": "10001" |
| 54 | + }, |
| 55 | + "phoneNumbers": [ |
| 56 | + { |
| 57 | + "type": "home", |
| 58 | + "number": "212-555-1234" |
| 59 | + }, |
| 60 | + { |
| 61 | + "type": "work", |
| 62 | + "number": "646-555-5678" |
| 63 | + } |
| 64 | + ] |
| 65 | + } |
| 66 | + phoneNumbers0type: str = p.get_obj(data, "phoneNumbers/0/type") |
| 67 | + addressCity: str = p.get_obj(data, "address/city") |
| 68 | + newType = p.set_obj(data, "phoneNumbers/0/type", "school") |
| 69 | + newState = p.set_obj(data, "address/state", "WA") |
| 70 | + assert phoneNumbers0type == "home" |
| 71 | + assert addressCity == "New York" |
| 72 | + assert newType["phoneNumbers"][0]["type"] == "school" |
| 73 | + assert newState["address"]["state"] == "WA" |
| 74 | +} |
| 75 | + |
| 76 | +test_json_patch() |
| 77 | +``` |
| 78 | + |
| 79 | +**🏄 Language Updates** |
| 80 | + |
| 81 | +- Fixed an error with the schema insertion operator += during configuration merging. |
| 82 | +- Improved error messages for undefined variables in multi-line string interpolation. |
| 83 | + |
| 84 | +**💻 IDE Updates** |
| 85 | + |
| 86 | +- Added highlighting support for kcl.mod and kcl.mod.lock files. |
| 87 | +- Added support for restarting the kcl-language-server via VS Code Command. |
| 88 | +- Improved messaging when the kcl-language-server is not found. |
| 89 | +- Added member completion for string union types. |
| 90 | +- Added function symbol highlighting to differentiate between normal variables and function variables. |
| 91 | + |
| 92 | +**📬️ Toolchain Updates** |
| 93 | + |
| 94 | +- `kcl import` tool now supports conversion from toml to KCL configuration. |
| 95 | +- `kcl import` tool now supports YAML Stream format input and conversion to KCL configuration. |
| 96 | +- `kcl run` now supports toml format output. |
| 97 | +- `kcl run` and `kcl mod` commands now support the -q flag to disable extra message output. |
| 98 | +- `kcl mod add` command improves the downloading process to prevent errors caused by unexpected interruptions. |
| 99 | +- `kcl mod add` command supports adding dependencies from various OCI and Git sources. |
| 100 | + |
| 101 | +**⛵️ API Updates** |
| 102 | + |
| 103 | +- Added support for prototext format and KCL schema output to KCL configuration. |
| 104 | +- Added support for serializing arbitrary Go types to KCL configuration. |
| 105 | +- `ListVariables` API now supports multiple file input and configuration merge output. |
| 106 | + |
| 107 | +**🔥 SDK Updates** |
| 108 | + |
| 109 | +- Added KCL WASM module, supporting the compilation of KCL code in Rust using wasmtime or Node.js and other runtimes. For more details, see: [https://www.kcl-lang.io/docs/reference/xlang-api/wasm-api](https://www.kcl-lang.io/docs/reference/xlang-api/wasm-api). Future support for running KCL in a pure browser environment is planned. |
| 110 | + |
| 111 | +## Resources |
| 112 | + |
| 113 | +❤️ See [here](https://github.com/kcl-lang/community) to join us! |
| 114 | + |
| 115 | +For more resources, please refer to |
| 116 | + |
| 117 | +- [KCL Website](https://kcl-lang.io/) |
| 118 | +- [KusionStack Website](https://kusionstack.io/) |
0 commit comments