This repository has been archived on 2026-10-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
NeteaseUrl/frontend/package.json
T
snowy-yang 3a089caff2 feat: 前端迁移 React 18 + Vite 5 脚手架与保真移植的控制器
为什么:index.html 单体 4600 行 ES5 已到维护极限,迁移到 Vite 工程
获得热更新、类型检查与模块化能力。迁移策略是保真优先——业务逻辑
不重写为 React 组件(行为漂移风险),而是逐字移植为
legacy.ts/auth.ts 两个 @ts-nocheck 控制器模块;React 只接管静态
骨架与响应式显隐(tab/modal/drawer/toast),动态列表/播放器/歌词
仍走 id + innerHTML 命令式更新。

关键决策:
- boot 包装:旧脚本原在 body 末尾可直取 DOM,模块化后顶层事件
  绑定会在 import 求值时打在 null 上,全部副作用包进
  __legacyBoot()/__authBoot() 由 App useEffect 骨架落盘后调用
- 轻量 store:单一可变 AppState + notify() + useSyncExternalStore,
  沿用旧版"改 state 后手动通知"心智模型
- modalBus:弹窗栈 + useSyncExternalStore,Escape 走 closeTopmost,
  stats/cookie 弹窗经 __legacyApi 调 legacy 内部专用关闭(清定时器/
  复位视图)
- vite 固定产物文件名(无内容 hash),保证 index.html 字节级稳定,
  golden sha256 契约才跨构建成立
2026-09-27 18:34:49 +08:00

24 lines
486 B
JSON

{
"name": "yunvillage-frontend",
"private": true,
"version": "2.3.21",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"typecheck": "tsc --noEmit",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "~5.6.3",
"vite": "^5.4.11"
}
}