Skip to content

Latest commit

 

History

History
55 lines (33 loc) · 2.3 KB

v0.3.4.md

File metadata and controls

55 lines (33 loc) · 2.3 KB

v0.3.4 — 2026-05-13

插件类型边界收口与联调验证补强

概述

本版本围绕 plugin lifecycle 的公开类型边界做一次收口:新增 VextPluginContext,把插件生命周期真正需要的能力从完整 VextApp 中分离出来,避免 linked workspace / 本地 file 依赖联调时把路由注册相关的递归类型链一并带入比较,导致跨仓库重复类型冲突。同时补齐 setThrow 的公开类型、修正 typegen 增强声明的模块边界,并把 app.setFetch() 的 API 文档口径纠回到当前真实实现。


Added

  • 新增公开类型 VextPluginContext,用于 setup/onReady/onClose 插件生命周期入参。
  • VextApp 公开类型新增 setThrow(),与运行时已有能力保持一致。

Changed

  • VextPlugin 生命周期签名改为接收 VextPluginContext,不再暴露 app.get/post/... 等路由注册方法。
  • 内置 monsqlize 插件辅助函数统一改为接收 VextPluginContext,与新的插件边界保持一致。
  • typegen 生成的 services.generated.d.ts 与 app-extensions.generated.d.ts 现在会先注入 import "vextjs";,避免 bare ambient module 遮蔽包根导出。

Fixed

  • 修复 linked workspace 下 vext-test + vextjs-nacos 等本地 file 依赖场景中的重复 VextApp 类型冲突。
  • 修复公开类型与运行时能力漂移:setThrow() 现在在类型层可见。
  • 修复 fetch 相关文档仍声称存在 app.setFetch() 公共 API 的错误描述。

Documentation

  • README.md、CLI 文档与站点导航版本标识同步更新到 v0.3.4。
  • website/docs/api/fetch.md 与 website/docs/guide/fetch.md 明确说明:当前版本不支持通过 app.setFetch() 直接替换内置客户端,推荐使用 app.fetch.create() 或 app.extend() 挂载自定义客户端。

Tests

已验证:

  • npm run build
  • website: npm run build
  • vextjs-nacos: npm run build
  • vext-test: npx tsc -p tsconfig.json --noEmit
  • vext-test: npm run verify:permission:http — 25/25 passed

Known Notes

  • VextPluginContext 刻意保留插件协作所需的字符串索引签名,但不再承诺插件生命周期中可直接注册 HTTP 路由;如需注册路由,应继续通过 defineRoutes() 与路由文件体系完成。