Skip to content

Add episode 68: 前端代码也能「预制」了#71

Merged
AnnatarHe merged 1 commit into
masterfrom
claude/modest-hamilton-wti0dx
Jun 18, 2026
Merged

Add episode 68: 前端代码也能「预制」了#71
AnnatarHe merged 1 commit into
masterfrom
claude/modest-hamilton-wti0dx

Conversation

@AnnatarHe

Copy link
Copy Markdown
Member

概述

新增播客单集 EP68 前端代码也能「预制」了,副标题为「Swagger + Hey API 自动生成请求代码,告别手写 interface」。

本期介绍一种渐进式的前后端协作方案:由后端提供规范的 swagger.json,前端借助 Hey API 根据契约自动生成请求代码(含 response body 校验、react-query 查询代码与 key),并在编译期完成类型检查,从而尽早暴露问题、清晰划分前后端责任边界,同时对 AI 与 CI 更友好。

改动内容

仅新增一个文件 src/content/posts/ep68.mdx,沿用 ep67 的既有结构。站点为内容驱动,列表页、动态路由、RSS、WebMCP 等均自动从内容集合读取并按 publicationDate 排序,无需手动维护索引。

字段取值来源:

  • youtubeId: _VmBKj9Da40(取自 https://youtu.be/_VmBKj9Da40
  • biliUrlxyzLink/url 按提供的平台链接填入;同时存在 youtubeIdbiliUrl,单集页面会渲染视频嵌入块
  • categories 映射为站点既有的小写连字符约定:swagger / openapi / hey-api / typescript / react-query / restful / frontend / ai
  • publicationDate: 2026-06-18 14:00:00(沿用每周 14:00 发布的节奏)
  • status: published

验证

  • pnpm astro check — 0 errors(校验 ep68 frontmatter 是否符合 schema 并编译 MDX)
  • ✅ 内容集合同步成功,静态路由正常生成

⚠️ 说明:pnpm build 会在 Open Graph 图片生成阶段报错(/posts/ep0-og.png),原因是当前远程执行环境的网络策略屏蔽了 imagekit.io(远程 logo 返回 HTTP 403),Satori 无法获取图片尺寸。该问题对所有单集一致存在(首先在 ep0 失败),与本次新增 ep68 无关,属于环境网络限制。

🤖 Generated with Claude Code

https://claude.ai/code/session_01R6NAVxeeK4EZWTQeHTuD2G


Generated by Claude Code

新增 EP68,介绍使用 Swagger + Hey API 根据后端 swagger.json
契约自动生成前端请求代码,告别手写 interface。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R6NAVxeeK4EZWTQeHTuD2G
@AnnatarHe AnnatarHe temporarily deployed to claude/modest-hamilton-wti0dx - asynctalk-website PR #71 June 18, 2026 16:48 — with Render Destroyed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown

Code Review: EP68 前端代码也能「预制」了

Overall: ✅ Looks good — ready to merge with one minor note.


Overview

Single-file content PR adding src/content/posts/ep68.mdx. The episode covers using Swagger + Hey API for type-safe frontend code generation, a well-scoped topic for the audience.


Frontmatter Compliance

All required schema fields from src/content.config.ts are correctly filled:

Field Status
title
author
publicationDate
categories ✅ (8 relevant tags)
status: published
xyzLink
youtubeId
biliUrl

Extra frontmatter fields (guid, slug, subtitle, episodeNumber, etc.) are consistent with ep67 and all prior episodes — no issues.


Observations

size: 0 / duration: 0

Both are placeholder values, same as ep67 and earlier episodes. duration in particular is surfaced in the RSS enclosure and iTunes feed — podcast apps use it to display episode length and some clients pre-buffer based on it. This is a pre-existing pattern across the repo, not specific to this PR, but it's worth tracking as a follow-up to populate real values post-recording.

Content quality

Shownotes are clear and well-structured in Chinese. The progression from problem (手写 interface 痛点) → existing alternatives (GraphQL/tRPC 改造成本高) → proposed solution (Hey API + swagger.json) → trade-offs (后端 swagger 必须准确) is logical and readable.

biliUrl protocol-relative URL

//player.bilibili.com/... is consistent with ep67's format. No issue here, but this is only safe when the site itself is served over HTTPS (which it is).

excerpt mirrors title

title: "EP68 前端代码也能「预制」了"
excerpt: "EP68 前端代码也能「预制」了:Swagger + Hey API 自动生成请求代码,告别手写 interface"

The excerpt is a superset of the title. For SEO/OG meta this is fine. Consistent with prior episodes.


No Issues Found

  • No TypeScript/schema errors (confirmed by pnpm astro check passing)
  • No routing or content collection changes needed
  • No security concerns (static content only)
  • Follows all conventions established in ep67

The pnpm build failure noted in the PR description is a pre-existing environment issue (imagekit.io blocked) unrelated to this change.

🤖 Reviewed with Claude Code

@AnnatarHe AnnatarHe merged commit 9b1c182 into master Jun 18, 2026
1 check passed
@AnnatarHe AnnatarHe deleted the claude/modest-hamilton-wti0dx branch June 18, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants