# Primate 0.40：路由与枚举新玩法

Original title: Primate 0.40: Route pages, store enums, async schemas and events

> Hacker News story 48899449 · language: zh · submitted 2026-07-13
> Web version: https://zeli.app/zh/story/48899449
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 15 · by [terrablue](<https://news.ycombinator.com/user?id=terrablue>) · 💬 6
[original](<https://primate.run/blog/primate-040>) · [HN discussion](<https://news.ycombinator.com/item?id=48899449>)

## Summary

Primate 0.40 预览版来了，这次更新简直是为开发者量身定制。现在你可以用 Collocated route pages 把前端组件直接放在路由文件旁边，彻底告别繁琐的视图导入。更棒的是，p.enum 终于能直接参与 Store 定义，再也不用担心枚举值和数据库字段不同步。此外，Pema 支持了异步 Schema 和派生值，让数据验证和清洗更灵活。SSE 清理机制也简化了，只需一个函数就能搞定。配合自动应用迁移和新的 @/* 路径别名，Primate 让全栈开发体验更加丝滑。

## Key quote

> 路由负责处理数据加载、验证、重定向和状态码，而页面只负责渲染。

## HN discussion (6 comments)

### [theskillwithin](<https://news.ycombinator.com/item?id=49134376>)

> 给这个项目捐了钱。但到目前为止，他们自以为是，根本听不进任何批评，所以把我给踢出去了

### [rubyfan](<https://news.ycombinator.com/item?id=48980856>)

> 我不太明白这个项目相比其他框架的主要创新点在哪里。乍一看，它就像十年前的 Express，不过可能做了一些现代化改造，并增加了灵活性，可以整合来自其他各种框架的组件。

### [happyPersonR](<https://news.ycombinator.com/item?id=48979883>)

> 笑死
>
> 我就喜欢这种东西
>
> 直接扔个随机软件框架的链接过来……连个描述都没有

---

## Cite

- Page: https://zeli.app/zh/story/48899449
- Date: 2026-07-13
- Source: primate.run (https://primate.run/blog/primate-040)
- Hacker News: https://news.ycombinator.com/item?id=48899449

## Other languages

- en: https://zeli.app/story/48899449 · markdown: https://zeli.app/story/48899449.md
- ja: https://zeli.app/ja/story/48899449 · markdown: https://zeli.app/ja/story/48899449.md
- ko: https://zeli.app/ko/story/48899449 · markdown: https://zeli.app/ko/story/48899449.md
- de: https://zeli.app/de/story/48899449 · markdown: https://zeli.app/de/story/48899449.md
- es: https://zeli.app/es/story/48899449 · markdown: https://zeli.app/es/story/48899449.md
