페이로드 v4: 모든 블록은 고유한 TypeScript 인터페이스를 얻습니다 (충돌 시 해시됨).

작성자

카테고리:

← 피드로
DEV Community · Kacper Zawojski · 2026-06-22 개발(SW)

Kacper Zawojski

A nice quality-of-life change in Payload v4’s type generation.

Previously, a block only got its own TypeScript interface if you set interfaceName. In v4 the name is derived automatically from the slug (PascalCased), and when two different blocks would collide on a name, the second one gets a stable suffix from a content hash — so types never silently overwrite each other:

// slug 'content-block'  -> interface ContentBlock
// a colliding block of a different shape -> Hero_3F2A1B0C  (deterministic hash)

Enter fullscreen mode Exit fullscreen mode

The key word is deterministic: the hash is derived from the block’s shape, so regenerating payload-types.ts doesn’t churn your diffs. No more “why did half my types get renamed” after a codegen run.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다