Skip to content

Commit 3550919

Browse files
committed
docs: add 20240612 newsletter blogs
Signed-off-by: peefy <[email protected]>
1 parent 5759de9 commit 3550919

File tree

2 files changed

+240
-0
lines changed
  • blog/2024-06-12-newsletter
  • i18n/zh-CN/docusaurus-plugin-content-blog/2024-06-12-newsletter

2 files changed

+240
-0
lines changed

blog/2024-06-12-newsletter/index.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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+
![](/img/biweekly-newsletter.png)
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` library 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/)
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
slug: 2024-06-12-newsletter
3+
title: KCL 最新动态速递 (2024.05.30 - 2024.06.12)
4+
authors:
5+
name: KCL 团队
6+
title: KCL 团队
7+
tags: [KCL, Newsletter]
8+
image: /img/biweekly-newsletter.png
9+
---
10+
11+
![](/img/biweekly-newsletter-zh.png)
12+
13+
[KCL](https://github.com/kcl-lang) 是一个 CNCF 基金会托管的基于约束的记录及函数语言,期望通过成熟的编程语言技术和实践来改进对大量繁杂配置比如云原生 Kubernetes 配置场景的编写,致力于构建围绕配置的更好的模块化、扩展性和稳定性,更简单的逻辑编写,以及更简单的自动化和生态工具集成。
14+
15+
本栏目将会双周更新 KCL 语言社区最新动态,包括功能、官网更新和最新的社区动态等,帮助大家更好地了解 KCL 社区!
16+
17+
**_KCL 官网:[https://kcl-lang.io](https://kcl-lang.io)_**
18+
19+
## 特别鸣谢
20+
21+
感谢过去两周所有的社区参与者,以下排名不分先后
22+
23+
- 感谢 @shruti2522 对 KCL IDE string union type 类型变量补全和函数符号高亮的贡献 🙌
24+
- 感谢 @ihor-hrytskiv`jsonpatch` 模块的贡献 🙌
25+
- 感谢 @selfuryon 对 KCL Nix Package 的贡献 🙌
26+
- 感谢 @nestoralonso 对 ArgoCD KCL 插件的贡献 🙌
27+
- 感谢 @Vishalk91-4 对 KCL tree-sitter-grammar 的贡献 🙌
28+
- 感谢 @Daksh-10 对 KCL tree-sitter-grammar 的贡献 🙌
29+
- 感谢 @officialasishkumar 对 kcl.mod 文件序列化/反序列化 API 的贡献 🙌
30+
- 感谢 @d4v1d03 对 KCL FAQ 文档的贡献 🙌
31+
- 感谢 @liangyuanpeng, @atelsier, @mproffitt, @steeling, @eshepelyuk, @SjuulJanssen, @riven-blade, @excalq, @Wck-iipi, @Yvan da Silva, @Hai Wu 等在近段时间使用 KCL 过程中提供的宝贵建议与反馈 🙌
32+
33+
## 内容概述
34+
35+
感谢所有贡献者过去一段时间 (2024.05.30 - 2024.06.12) 的杰出工作,以下是重点内容概述
36+
37+
**📦️ 三方库更新**
38+
39+
- jsonpatch 三方库发布 0.0.4 版本,修复 `set_obj` 函数非预期的错误
40+
41+
可以通过 `kcl mod add jsonpatch` 添加 `jsonpatch` 最新依赖。
42+
43+
使用方式如下
44+
45+
```python
46+
import jsonpatch as p
47+
48+
test_json_patch = lambda {
49+
data = {
50+
"firstName": "John",
51+
"lastName": "Doe",
52+
"age": 30,
53+
"address": {
54+
"streetAddress": "1234 Main St",
55+
"city": "New York",
56+
"state": "NY",
57+
"postalCode": "10001"
58+
},
59+
"phoneNumbers": [
60+
{
61+
"type": "home",
62+
"number": "212-555-1234"
63+
},
64+
{
65+
"type": "work",
66+
"number": "646-555-5678"
67+
}
68+
]
69+
}
70+
phoneNumbers0type: str = p.get_obj(data, "phoneNumbers/0/type")
71+
addressCity: str = p.get_obj(data, "address/city")
72+
newType = p.set_obj(data, "phoneNumbers/0/type", "school")
73+
newState = p.set_obj(data, "address/state", "WA")
74+
assert phoneNumbers0type == "home"
75+
assert addressCity == "New York"
76+
assert newType["phoneNumbers"][0]["type"] == "school"
77+
assert newState["address"]["state"] == "WA"
78+
}
79+
80+
test_json_patch()
81+
```
82+
83+
**🏄 语言更新**
84+
85+
- 修复 schema 插入属性运算符 `+=` 在配置合并时的错误
86+
- 优化多行字符串插值变量未定义错误信息
87+
88+
**💻 IDE 更新**
89+
90+
- 支持 kcl.mod 文件和 kcl.mod.lock 文件的高亮
91+
- 支持通过 VS Code Command 重启 kcl-language-server 命令
92+
- 改进了当 kcl-language-server 不存在时的提示信息
93+
- 支持字符串联合类型的成员补全
94+
- 新增函数符号的高亮,区分普通变量和函数变量
95+
96+
**📬️ 工具链更新**
97+
98+
- `kcl import` 导入工具支持从 toml 到 KCL 配置的转换
99+
- `kcl import` 导入工具支持 YAML Stream 格式输入并转换为 KCL 配置
100+
- `kcl run` 支持输出 toml 格式
101+
- `kcl run``kcl mod` 命令支持使用 `-q` 标志禁用额外消息输出
102+
- `kcl mod add` 命令优化下载过程,防止被意外中断导致无法下载包的错误
103+
- `kcl mod add` 支持从不同的 OCI 和 Git 源添加依赖
104+
105+
**⛵️ API 更新**
106+
107+
- 支持 prototext 格式和 KCL schema 输出为 KCL 配置
108+
- 支持任意 Go 类型序列化为 KCL 配置
109+
- `ListVariables` API 支持多文件输入与配置合并输出
110+
111+
**🔥 SDK 更新**
112+
113+
- 新增 KCL WASM 模块,支持在 Rust 中使用 wasmtime 或 Node.js 等运行时使用 KCL WASM 模块编译 KCL 代码,使用方式详见: [https://www.kcl-lang.io/docs/reference/xlang-api/wasm-api](https://www.kcl-lang.io/docs/reference/xlang-api/wasm-api),后续会支持 KCL 在纯浏览器环境运行。
114+
115+
## 其他资源
116+
117+
❤️ 查看 _[KCL 社区](https://github.com/kcl-lang/community)_ 加入我们。
118+
119+
更多其他资源请参考:
120+
121+
- [KCL 网站](https://kcl-lang.io/)
122+
- [KusionStack 网站](https://kusionstack.io/)

0 commit comments

Comments
 (0)