主要更新内容
- 重构 JavaScript 运行时:新增
pkg/jsruntime包替代旧的消息发送脚本实现,内置 Fetch API、XMLHttpRequest、console、定时器及queueMicrotask等 Web API,并完成内置模块的模块化拆分。 - 新增 Node.js 兼容模块:
events、path、os、process、fs、child_process、net、http,支持通过AllowExec、AllowListen、AllowAllFileAccess等选项控制子进程执行、端口监听与文件访问权限。 - 新增
pkg/jsruntime/README.mdAPI 与兼容性文档,明确各接口支持状态;未支持的方法会抛错而非静默无操作。 - 将 metric store 从
database/metricstore迁移至internal/metricstore,并按职责拆分为配置、压缩、删除、ping 记录、报告映射等模块。
Bug修复
- 修复 JavaScript 运行时将
process.exit(0)误判为异常的问题,现按正常终止处理,并改进错误上报。
其他
- 移除未使用的数据库辅助函数:
GetAllMessageSenderConfigs、GetAllOidcConfigs、SaveLoadNotification、GetEnabledTrafficReportByType。 - 移除
pkg/metric中未使用的 API:DeleteMetricData、DeleteBeforeTx、scanRollupRowsContained及各数据库方言的nowExpr。 - 依赖调整:
golang.org/x/sys转为直接依赖,新增github.com/dop251/base64dec间接依赖。
Commits
- style: 移除没有使用的旧版本兼容代码,移动 database/metricstore 到 internal/metricstore 并拆分组件 (4077201) @Akizon77
- refactor: javascript runtime (df6ffba) @Akizon77
- refactor(jsruntime): modularize built-ins (3c58382) @Akizon77
- docs(jsruntime): add API and compatibility documentation (54851bd) @Akizon77
- docs(jsruntime): clarify unsupported methods throw instead of no-op (91ae9ed) @Akizon77
- fix(jsruntime): treat process.exit(0) as normal termination and improve error reporting (91cbeb3) @Akizon77
Full Changelog: 1.3.2...Snapshot-2607311655