Skip to content

Commit c9fb02b

Browse files
authored
Merge pull request #380 from zong-zhe/blog-20240529-newsletter
docs: add 2024-05-29 newsletter blogs
2 parents 1143ffd + 92d2240 commit c9fb02b

File tree

4 files changed

+320
-0
lines changed

4 files changed

+320
-0
lines changed

blog/2024-05-29-newsletter/index.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
---
2+
slug: 2024-05-29-newsletter
3+
title: KCL Newsletter (2024.05.01 - 2024.05.29)
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+
- Congratulations to @AkashKumar7902 for completing the LFX 1 task, successfully merging the mvp version of the kpm version management module into the main branch 🙌
24+
- Thanks to @shashank-iitbhu for his continued contributions to the IDE Quick Fix feature 🙌
25+
- Thanks to @Wck-iipi for his continued contributions to the IDE hover feature 🙌
26+
- Thanks to @warjiang for his contributions to the devcontainer 🙌
27+
- Thanks to @shruti2522 for her continued contributions to the IDE hover feature 🙌
28+
- Thanks to @XiaoK29 for his continued contributions to the KCL go SDK code optimization 🙌
29+
- Thanks to @d4v1d03 for his continued contributions to the KCL documentation 🙌
30+
- Thanks to @officialasishkumar for his contributions to the package management tool third-party dependency renaming feature 🙌
31+
- Thanks to @Vishalk91-4, @Daksh-10 for their contributions to the KCL tree sitter syntax and parser generator 🙌
32+
- Thanks to @SamirMarin for his contributions to the Crossplane KCL function 🙌
33+
- Thanks to @officialasishkumar, @d4v1d03, @karlhepler, @Hai Wu, @ron18219, @olinux, @Alexander Fuchs, @Emmanuel Alap, @excalq, @leon-andria, @taylormonacelli, @dennybaa, @zhuxw, @aleeriz, @steeling, and others for their valuable feedback and suggestions while using KCL recently 🙌
34+
35+
## Overview
36+
37+
Thanks to all contributors for their outstanding work over the past two weeks (2024.05.15 - 2024.05.29). Here is an overview of the key content:
38+
39+
**📦️ Modules Updates**
40+
41+
- New module `difflib` added to support configuration comparison.
42+
43+
Add `difflib` as a dependency by `kcl mod add difflib`.
44+
45+
Through the `diff` method provided by the `difflib`, the configuration difference is output.
46+
47+
```python
48+
import difflib
49+
import yaml
50+
51+
data1 = {
52+
"Name": "John",
53+
"age": 30,
54+
}
55+
data2 = {
56+
"Name": "John",
57+
"age": 20,
58+
}
59+
diff = difflib.diff(yaml.encode(data1), yaml.encode(data2))
60+
```
61+
62+
The expected output is the diff as below:
63+
64+
```
65+
data1:
66+
Name: John
67+
age: 30
68+
data2:
69+
Name: John
70+
age: 20
71+
diff: |2
72+
Name: John
73+
+ age: 20
74+
- age: 30
75+
```
76+
77+
**🏄 Language Updates**
78+
79+
- KCL 0.9.0-beta.1 released.
80+
- Enhanced the check process for non-empty attributes in the schema, optimized the diagnostic information when the check statement is invalid due to empty attributes.
81+
- Fixed the issue of doc parse parsing string literals as doc.
82+
- Fixed the issue of the resolver node type missing during the compilation process.
83+
- Added syntax error types to support quick recovery of IDE syntax errors.
84+
- Fixed the memory leak issue in the KCL runtime.
85+
86+
**💻 IDE Updates**
87+
88+
- Added support for quick fix of some compilation errors in the IDE.
89+
- Added support for some syntax IDE hover highlights.
90+
91+
IDE hover highlights for some syntax.
92+
93+
![hover](/img/blog/2024-05-29-biweekly-newsletter/hover.png)
94+
95+
For string literals, added hover highlights.
96+
97+
![hoverstrlit](/img/blog/2024-05-29-biweekly-newsletter/hoverstrlit.png)
98+
99+
- Added vscode extension to the devcontainer configuration.
100+
- Added config expression hover tips corresponding to the schema fields in the IDE.
101+
- Added support for identifying compilation units through the kcl.mod file in the IDE.
102+
- Fixed the document hover format error in the IDE.
103+
- Fixed the compilation error caused by the LSP panic in the IDE.
104+
- Optimized the log content of LSP input.
105+
106+
**📬️ Toolchain Updates**
107+
108+
- KCL testing tool supports fast eval mode.
109+
- Added `kcl clean` to support cleaning module caches.
110+
- Fixed the unexpected error in the YAML Stream format import process of the KCL import tool.
111+
112+
- Package management tool updates.
113+
- Added support for renaming dependencies to prevent name conflicts through the `mod add --rename` parameter and the `kcl.mod` file.
114+
- Fixed the issue of missing dependencies in the `kcl.mod` file when adding a local file directory as a dependency.
115+
- Added support for adding git third-party dependencies through branch names.
116+
- Removed the invalid log output when updating dependencies.
117+
- Added API support for writing `kcl.mod` and `kcl.mod.lock` files.
118+
- Removed the process of requesting metadata when loading third-party dependencies.
119+
- When packaging and uploading KCL, diagnostic information is output for the case of local dependencies in the KCL package.
120+
- LFX term 1 task completed, the version management module mvp version merged into the main branch.
121+
- Supported specifying files to be packaged and skipped through the `include` and `exclude` fields in the `kcl.mod` file.
122+
- Removed the calculation checksum process of dependencies.
123+
124+
**⛵️ API Updates**
125+
126+
- Added `UpdateDependencies` API to support updating KCL third-party libraries.
127+
- Added API support for writing `kcl.mod` and `kcl.mod.lock` files.
128+
- OverrideFile API returns compilation error information.
129+
- OverrideFile API supports inserting configurations through operators ":" and "+=".
130+
- ListVariable API return values support parsing List and Dict structures.
131+
- Fixed the issue of configuration format error caused by the insertion of import statements in the OverrideFile API.
132+
- Refactored the API for obtaining schema types.
133+
- Fixed the issue of panic caused by the LSP handle_semantic_tokens_full and handle_document_symbol methods.
134+
135+
**🔥 SDK Updates**
136+
137+
- KCL SDK v0.9.0-beta.1 released, synchronously supporting API updates.
138+
- KCL go SDK supports importing KCL Schema through proto.
139+
140+
**📂️ Documentation Updates**
141+
142+
- Fixed typos in the development guide documentation and some environment configuration descriptions.
143+
- Added documentation for the `file.read_env` function.
144+
- The language document has been updated to include information about the "-" and "." symbols in schema property names.
145+
- Added some Q&A.
146+
147+
**📺️ Ecosystem Integration**
148+
149+
- Fixed the memory leak issue in the crossplane kcl function.
150+
- Added support for the KCL tree sitter schema, mixin, rule, and other syntax support and corresponding tests.
151+
152+
## Resources
153+
154+
❤️ See [here](https://github.com/kcl-lang/community) to join us!
155+
156+
For more resources, please refer to
157+
158+
- [KCL Website](https://kcl-lang.io/)
159+
- [KusionStack Website](https://kusionstack.io/)
160+
- [KCL v0.9.0 Milestone](https://github.com/kcl-lang/kcl/milestone/9)
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
---
2+
slug: 2024-05-29-newsletter
3+
title: KCL 最新动态速递 (2024.05.15 - 2024.05.29)
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+
- 恭喜 @AkashKumar7902 完成 LFX 1 期任务,kpm 版本管理模块的 mvp 版本成功合并入 main 分支 🙌
24+
- 感谢 @shashank-iitbhu 在 IDE Quick Fix 功能上做的持续贡献 🙌
25+
- 感谢 @Wck-iipi 在 IDE 悬停功能上做的持续贡献 🙌
26+
- 感谢 @warjiang 为 devcontainer 作出的贡献 🙌
27+
- 感谢 @shruti2522 为 IDE 悬停效果的优化作出的持续贡献 🙌
28+
- 感谢 @XiaoK29 为 KCL go SDK 的代码优化作出的持续贡献 🙌
29+
- 感谢 @d4v1d03 为 KCL 文档作出的持续贡献 🙌
30+
- 感谢 @officialasishkumar 在包管理工具三方依赖重命名功能的贡献 🙌
31+
- 感谢 @Vishalk91-4, @Daksh-10 对 KCL tree sitter 语法和解析器生成器的贡献 🙌
32+
- 感谢 @SamirMarin 对 Crossplane KCL 函数的贡献 🙌
33+
- 感谢 @officialasishkumar, @d4v1d03, @karlhepler, @Hai Wu, @ron18219, @olinux, @Alexander Fuchs, @Emmanuel Alap, @excalq, @leon-andria, @taylormonacelli, @dennybaa, @zhuxw, @aleeriz, @steeling 等在近段时间使用 KCL 过程中提供的宝贵建议与反馈 🙌
34+
35+
## 内容概述
36+
37+
感谢所有贡献者过去一段时间 (2024.05.15 - 2024.05.29) 的杰出工作,以下是重点内容概述
38+
39+
**📦️ 三方库更新**
40+
41+
- 新增 difflib 三方库,支持比较配置差异。
42+
43+
通过 `kcl mod add difflib` 添加 `difflib` 依赖。
44+
45+
通过 `difflib` 三方库提供的 `diff` 方法,输出配置差异。
46+
47+
```python
48+
import difflib
49+
import yaml
50+
51+
data1 = {
52+
"Name": "John",
53+
"age": 30,
54+
}
55+
data2 = {
56+
"Name": "John",
57+
"age": 20,
58+
}
59+
diff = difflib.diff(yaml.encode(data1), yaml.encode(data2))
60+
```
61+
62+
然后,对应配置的 diff 如下:
63+
64+
```
65+
data1:
66+
Name: John
67+
age: 30
68+
data2:
69+
Name: John
70+
age: 20
71+
diff: |2
72+
Name: John
73+
+ age: 20
74+
- age: 30
75+
```
76+
77+
**🏄 语言更新**
78+
79+
- kcl 0.9.0-beta.1 新版本发布。
80+
- 强化了 schema 结构中属性非空的检查过程,优化了在空属性导致的 check 语句失效时的诊断信息。
81+
- 修复了 doc parse 将字符串字面值解析成 doc 的问题。
82+
- 修复了编译过程中 resolver 节点类型丢失的问题。
83+
- 新增语法错误类型以支持 IDE 语法错误的快速恢复。
84+
- 修复了 KCL 运行时内存泄漏的问题。
85+
86+
**💻 IDE 更新**
87+
88+
- IDE 增加对于部分编译错误的快速恢复。
89+
- 新增了部分语法 IDE 悬停高亮。
90+
91+
IDE 支持部分语法悬停高亮。
92+
93+
![hover](/img/blog/2024-05-29-biweekly-newsletter/hover.png)
94+
95+
对于字符串字面值,新增悬停高亮
96+
97+
![hoverstrlit](/img/blog/2024-05-29-biweekly-newsletter/hoverstrlit.png)
98+
99+
- Devcontainer 配置新增 vscode 扩展。
100+
- IDE 新增 config 表达式悬停提示对应 schema 字段。
101+
- IDE 支持通过 kcl.mod 文件识别编译单元。
102+
- IDE 修复了文档悬停格式错误。
103+
- IDE 修复了由于 LSP 的 panic 导致的编译错误。
104+
- 优化了 LSP 输入的日志内容。
105+
106+
**📬️ 工具链更新**
107+
108+
- KCL 测试工具支持 fast eval 模式。
109+
- 新增 `kcl clean` 支持清理 module 缓存。
110+
- KCL Import 工具修复 YAML Stream 格式导入过程非预期的错误
111+
112+
- 包管理工具更新
113+
- kcl 支持通过 mod add --rename 参数和 kcl.mod 文件中重命名依赖防止名称冲突。
114+
- 修复了添加本地文件目录作为依赖时,kcl.mod 文件依赖丢失的问题。
115+
- 支持通过分支名称添加 git 三方库。
116+
- 移除了在更新依赖时输出的无效日志。
117+
- 新增 API 支持写入 kcl.mod 和 kcl.mod.lock 文件。
118+
- 移除了加载三方库过程中请求 metadata 过程。
119+
- 在打包和上传 KCL 三方库时,针对 KCL 包中存在本地依赖的情况,输出诊断信息。
120+
- LFX 1 期题目完成,版本管理模块 mvp 版本合并入 main 分支。
121+
- 支持 kcl.mod 文件中通过 include 和 exclude 字段指定需要打包和跳过的文件。
122+
- 移除本地计算三方库 checksum 过程。
123+
124+
**⛵️ API 更新**
125+
126+
- 新增 UpdateDependencies API 支持更新 KCL 三方库。
127+
- 新增 API 支持写入 kcl.mod 和 kcl.mod.lock 文件。
128+
- OverrideFile API 返回值中新增编译错误信息。
129+
- OverrideFile API 支持通过运算符 ":" 和 "+=" 插入配置。
130+
- ListVariable API 返回值支持解析 List 和 Dict 结构。
131+
- 修复了 OverrideFile API 在插入 import 语句时导致的配置格式错乱的问题。
132+
- 重构了获取 schema type 相关的 API。
133+
- 修复了 LSP handle_semantic_tokens_full 和 handle_document_symbol 方法导致的 panic 问题。
134+
135+
**🔥 SDK 更新**
136+
137+
- KCL SDK v0.9.0-beta.1 版本发布, 同步支持 API 更新。
138+
- KCL go SDK 支持通过 proto 导入 KCL Schema。
139+
140+
**📂 文档更新**
141+
142+
- 修复了开发向导文档中的错误拼写与一些环境配置描述。
143+
- 新增关于 file.read_env 库函数的文档说明。
144+
- 语言文档中补充了关于 schema 属性名称中“-”,“.”等符号的说明。
145+
- 新增了一些 Q&A。
146+
147+
**📺 生态集成**
148+
149+
- 修复了 crossplane kcl function 导致的 pod 内存泄漏问题。
150+
- KCL tree sitter 新增 schema, mixin, rule 等语法支持和对应测试。
151+
152+
## 其他资源
153+
154+
❤️ 查看 _[KCL 社区](https://github.com/kcl-lang/community)_ 加入我们。
155+
156+
更多其他资源请参考:
157+
158+
- [KCL 网站](https://kcl-lang.io/)
159+
- [KusionStack 网站](https://kusionstack.io/)
160+
- [KCL v0.9.0 Milestone](https://github.com/kcl-lang/kcl/milestone/9)
Loading
Loading

0 commit comments

Comments
 (0)