Hatch v0.2.0 — Hatch Blocks foundation (alpha)
Pre-release
Pre-release
Hatch Blocks foundation — alpha. The block system is no longer dormant. Eight Hatch-native blocks ship, register on init, appear in the Gutenberg inserter under a "Hatch" category, save semantic HTML with Tailwind utility classes, and render passthrough on the Astro frontend (no custom Astro components required — the HTML they save IS the renderable output).
What's in this release
8 Hatch blocks (registered + working)
hatch/section— full-width row wrapper with bg color / image / gradient + responsive paddinghatch/container— max-width wrapper with flex / grid + alignmenthatch/heading— H1–H6 with responsive sizes + gradient texthatch/paragraph— body text with typography controls + prose widthshatch/button— variants with size + radius from design tokenshatch/image— Astro Image-friendly (<img>with class hooks)hatch/hero— composed hero patternhatch/custom-code— sandboxed HTML/CSS/JS (admin-only capability gate)
Tier 1 still owes: Spacer, Divider, Group, Columns, List, Quote. Tier 2 (Media: YouTube/Video/Gallery/Cover/Embed), Tier 3 (Interactive: Tabs/Accordion/Table/Form/Search), Tier 4 (Posts), Tier 5 (Smart AI) — roadmap for v0.2.1 through v0.5.
Admin
- New tab: Blocks — between Content and Performance.
- "Hatch Blocks Only" toggle — restricts the editor inserter to
hatch/*blocks. Authors see only the Hatch vocabulary. Default OFF so existing content keeps working. - Master switch — disable all Hatch blocks at once without uninstalling.
- Per-block enable/disable list — flip individual blocks off; saved instances become invalid-block placeholders for the recovery flow.
Fixed
hatch_blocks_statelegacy reset migration — earlier installs ended up with every block explicitly disabled in the option store, causing the inserter to silently show zero Hatch blocks. Newmigrate_legacy_state()hook onplugins_loadeddetects the all-false state and resets to default-enabled. Marker stored inhatch_blocks_migrationso the migration only runs once per upgrade.blocks-src/now ships in the release zip. Previous v0.1.x zips excluded it; the per-block registration silently no-op'd.
Architecture
- Block registration uses
Hatch_Blocks_Registry::register_all()with a per-block fallback that readsblock.jsonfromblocks-src/blocks/<name>/when nobuild/blocks/exists. Single-bundle build (build/index.js) provides the editor script shared by all blocks. - Frontend rendering is passthrough — Hatch blocks save plain HTML with Tailwind utility classes, so
<Fragment set:html={post.content}>in the Astro starter renders them correctly with no per-block Astro component needed. hatch_blocks_hatch_onlyoption filtersallowed_block_types_allto whitelist onlyhatch/*when on.
Verified end-to-end
- 8 blocks register on container init (
WP_Block_Type_Registry::get_all_registered()reports them). - Block content saved to a real post via
wp_update_postrenders onlocalhost:4321/blog/<slug>with correct classes (<section class="hatch-section"><h2 class="hatch-heading">…</h2></section>).
Coming next
The remaining 16 blocks ship across v0.2.1 → v0.4. Smart Block (AI generation) targets v0.5 — needs BYOK API key plumbing + prompt engineering.