Repository navigation
fix: expose clearAssetsCache on framework wrappers - #1113
Merged
yiludege merged 2 commits intoNov 13, 2026
Merged
Conversation
yiludege
previously requested changes
Nov 13, 2026
Closed
Co-authored-by: Cursor <cursoragent@cursor.com>
yiludege
approved these changes
Nov 13, 2026
yiludege
left a comment
Collaborator
There was a problem hiding this comment.
docs/pack/index.md、docs/pack/react.md 写的是从封装组件上解构 clearAssetsCache,但 wujie-vue2 / wujie-vue3 / wujie-react 没有导出它,照文档调用会得到 undefined。三个封装补上透传即可修复。
为保持改动最小,维护者追加了一个提交,移除了回归测试、babel-jest 依赖和 Jest preset 的调整。PR 现在只改三个封装的 index.js / index.d.ts,共 6 个文件。
在最新 master 上验证:
- 用仓库原有锁文件
--frozen-lockfile安装,core 与三个封装的 lib / esm 构建通过。 - 把三个封装的 esm 产物与 core 一起打包后运行:封装上的
clearAssetsCache与 core 导出是同一个函数;按单个前缀、前缀数组清理时只清掉匹配条目,不传参时三类缓存全部清空;bus、setupApp、preloadApp、destroyApp、refreshApp不受影响。 - 类型:按文档写法解构调用,三个封装均通过
tsc --strict,传入非法参数会报错。
感谢 @dvd233 的修复和完整的验证说明。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
详细描述
文档要求从
wujie-vue2/wujie-vue3/wujie-react默认导出上解构clearAssetsCache,但三个封装目前都没有暴露该方法,调用会报clearAssetsCache is not a function。此改动直接透传已有 core API,并用
typeof clearAssetsCache补齐三个封装的声明。保持无参数、单 URL 前缀及多个 URL 前缀的原有行为,不修改缓存实现。Related to #1107:仅处理其中的
clearAssetsCache问题,不声称解决refreshApp部分。新增 12 项回归使用真实封装和真实 core,验证导出函数、三类缓存清理及无关缓存保留。Jest 配置增加 JS/Babel 接入,显式声明
babel-jest开发依赖;锁文件由 pnpm 10.33.0 生成,无包版本升级,含现有 peer 上下文去重及元数据更新。验证
pnpm exec lerna run prepack --concurrency 1:四包通过;重建后的 lib/ESM API 调用通过,ESM 实际缓存行为通过。Windows 验证使用原 Jest 配置及完整测试集合,以
--testMatch '**/unit/*.test.ts'/--testMatch '**/integration/*.test.ts'适配本地路径,并逐一比对测试文件清单。集成使用 checkout 外的 Puppeteer 配置指定 D 盘浏览器,将端口冲突设为报错并将服务启动等待改为 180 秒;测试断言和 30 秒用例超时均未修改。未声称直接执行原 POSIXnpm run test命令。