Skip to content

[migrate] replace OpenNext with ViNext for Development & Production performance - #16

Merged
TechQuery merged 9 commits into
mainfrom
migrate-ViNext
Dec 3, 2026
Merged

TechQuery merged 9 commits into
mainfrom
migrate-ViNext

Conversation

@TechQuery

@TechQuery TechQuery commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

主要变更

  • 迁移至 ViNext、Vite 和 SWC,将多语言页面、活动与餐厅详情及课程详情导出为静态站点,移除 OpenNext、服务端 API 和运行时 Worker。(resolve 重构 GoodActionHub 官网为静态网站,并部署在 CloudFlare pages #17)
  • 构建时获取活动、餐厅和课程数据快照;目录页面输出可见的语义化条目,活动和餐厅使用可抓取的静态分页链接。
  • 浏览器按需加载 JSON,通过 URL 参数和 Navigation API 实现搜索、筛选与分页;数据加载中或失败时保留静态目录。
  • 餐厅推荐改为浏览器内使用 Transformers.js 与 BGE-small-zh-v1.5 推理;安装时下载并校验模型,将模型与 ONNX WASM 运行时作为静态资源部署。
  • 重构列表、推荐与倒计时组件及 MobX 模型,优化搜索输入、国际化和无障碍交互,统一使用 array-unique-proposal 进行数组去重,并更新依赖。
  • 改用 Cloudflare Pages GitHub App 自动部署,移除旧部署工作流和过时的 GitHub Pages 指南,更新部署文档与旧路径重定向。

验证

  • pnpm build:静态导出成功。
  • TypeScript 检查和本次修改文件的 ESLint 检查通过。
  • npm run test:static:6 项测试通过,覆盖模型资源与多语言静态目录、详情链接和分页链接。

部署及注意事项

  • Cloudflare Pages 构建命令为 pnpm build,输出目录为 dist/client;数据仓库更新后需重新部署以更新快照。
  • 安装环境需访问模型下载源;部署前请核验模型及转换产物的分发许可。
  • Windows 本机 PNPM 自动依赖校验时,shadcn-helper install 因 zx 的 shell 引号函数缺失报错;现有依赖下构建、类型检查和静态测试仍可运行,干净安装尚需验证。

…erformance

[optimize] upgrade to TypeScript 6, MobX 7 & other latest Upstream packages
@github-actions

Copy link
Copy Markdown

Cloudflare Preview Deployment

  • Branch: migrate-ViNext
  • Commit: 92e5a2e
  • Preview Alias: b-migrate-vinext

Wrangler Output

Uploaded 16 of 47 assets
Uploaded 31 of 47 assets
Uploaded 47 of 47 assets
✨ Success! Uploaded 47 files (36 already uploaded) (3.53 sec)
Uploaded goodaction-hub (7.99 sec)
Worker Version ID: 9c304803-6344-44dd-a40c-4cc9da452ab4
Version Preview URL: https://9c304803-goodaction-hub.shiy2008.workers.dev
Version Preview Alias URL: https://b-migrate-vinext-goodaction-hub.shiy2008.workers.dev

@TechQuery

Copy link
Copy Markdown
Member Author

@copilot 将所有分页搜索列表页的分页参数放入路径,并改为静态生成模式 ——

  1. 将每页的列表和页码以最简单的语义化标签渲染到隐藏的容器内,用于搜索引擎收录
  2. 将现有的卡片列表和页码改为客户端类组件,用户搜索时客户端更新
  3. 整个项目的构建改为导出静态 HTML

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot 将所有分页搜索列表页的分页参数放入路径,并改为静态生成模式 ——

  1. 将每页的列表和页码以最简单的语义化标签渲染到隐藏的容器内,用于...

确认分页列表可改为路径分页、隐藏静态 SEO 内容及客户端交互。需要先确认静态导出的边界:现有 /api/ai/recommend 依赖服务端密钥,STATIC_EXPORT=true 会禁用 API Routes,导致餐厅 AI 推荐功能失效。你希望将该 API 保留并独立部署(例如 Cloudflare Worker/Pages Function),还是接受静态导出版本不再提供 AI 推荐?

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Cloudflare Preview Deployment

  • Branch: migrate-ViNext
  • Commit: 8da94b2
  • Preview Alias: b-migrate-vinext

Wrangler Output

Uploaded 17 of 53 assets
Uploaded 35 of 53 assets
Uploaded 53 of 53 assets
✨ Success! Uploaded 53 files (33 already uploaded) (4.40 sec)
Uploaded goodaction-hub (8.27 sec)
Worker Version ID: 3957eeb0-0fe8-42e2-ab28-7e714b9e314f
Version Preview URL: https://3957eeb0-goodaction-hub.shiy2008.workers.dev
Version Preview Alias URL: https://b-migrate-vinext-goodaction-hub.shiy2008.workers.dev

TechQuery and others added 2 commits December 3, 2026 18:47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread components/FoodAIDialog.tsx Resolved
Comment thread components/FoodAIDialog.tsx Resolved
Comment thread components/FoodAIDialog.tsx Resolved
Comment thread lib/createFoodRecommendationWorker.ts Resolved
Comment thread lib/foodRecommendation.worker.ts Resolved
Comment thread pnpm-workspace.yaml Resolved
Comment thread public/_redirects Resolved
Comment thread scripts/copy-static-payloads.mjs Resolved
TechQuery and others added 3 commits December 3, 2026 20:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Updated AddToCalendar component to ensure consistent class usage for links.
- Refactored Aggregation component to streamline input field and button structure.
- Improved CatalogPager component by implementing observer pattern and enhancing type safety.
- Simplified CatalogView rendering logic for better readability.
- Enhanced EventCard component with consistent class usage for links and improved badge rendering.
- Refined FilterBar component layout and input handling for better user experience.
- Updated FoodAIDialog to utilize functional components for recommendation cards.
- Converted MainNav to an observer component for better state management.
- Improved SwitchLanguage component by ensuring consistent state handling.
- Enhanced TimelineItem component with observer pattern for better reactivity.
- Updated TimezoneSelector to improve input handling and button styling.
- Refined GitCodeIcon and GitHubIcon components for consistent SVG attributes.
- Improved input component styling for better user experience.
- Enhanced scroll area component for better layout handling.
- Updated localization files to reflect accurate model size information.
- Added food recommendation model JSON file for better integration.
- Improved listing filters to enhance type safety.
- Updated package.json scripts for better model handling during installation.
- Refactored scripts for downloading models and catalogs to improve reliability.
- Added tests for model asset integrity and static export validation.
- Updated Vite configuration to streamline TypeScript handling and improve build performance.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TechQuery TechQuery changed the title [migrate] replace OpenNext with ViNext for Development & Production performance 迁移至静态站点:客户端目录搜索与本地 AI 推荐 Dec 3, 2026
TechQuery and others added 2 commits December 4, 2026 00:14
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Cloudflare builds and deploys previews for this pull request. Learn more about Cloudflare previews.

Worker Status Deployment Commit
good-action-hub Failed Not deployed aa9b4f7

Updated: Dec 3, 2026, 18:31 UTC

@TechQuery TechQuery changed the title 迁移至静态站点:客户端目录搜索与本地 AI 推荐 迁移静态站点:客户端搜索分页与本地智能推荐 Dec 3, 2026
@TechQuery TechQuery added enhancement Some improvements feature New feature or request labels Dec 3, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying goodaction-hub-github-io with  Cloudflare Pages  Cloudflare Pages

Latest commit: aa9b4f7
Status: ✅  Deploy successful!
Preview URL: https://821fdc85.goodaction-hub-github-io.pages.dev

View logs

@TechQuery TechQuery changed the title 迁移静态站点:客户端搜索分页与本地智能推荐 [migrate] replace OpenNext with ViNext for Development & Production performance Dec 3, 2026
@TechQuery
TechQuery merged commit 9e00da5 into main Dec 3, 2026
3 of 4 checks passed
@TechQuery
TechQuery deleted the migrate-ViNext branch December 3, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Some improvements feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

重构 GoodActionHub 官网为静态网站,并部署在 CloudFlare pages

2 participants