Skip to content

[POC] feat(dev): rebuild the release preview on model changes and print its link - #416

Draft
jomifepe wants to merge 5 commits into
mainfrom
jp/release-types-preview
Draft

jomifepe wants to merge 5 commits into
mainfrom
jp/release-types-preview

Conversation

@jomifepe

@jomifepe jomifepe commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Part of Types on releases, Milestone 4 (DT-3645): after a type or slice write on a release, the release preview rebuilds, and prismic dev prints a link to it.

Why

A site previewing the prismic dev release only shows model changes once the release preview is rebuilt (POST /core/releases/{id}/refresh). Nothing called it.

I dropped the link earlier because the editor and toolbar open release previews. With M4, documents that use a release-only type are written through the MCP (prismicio/obelix#2132), so neither of them ever opens that preview. prismic dev has the release and the token, so it prints the link.

What

  • After each sync that pushes, pulls or deletes a model, prismic dev refreshes the release. A failed refresh stays pending and is retried on the next sync.
  • At start, it prints Preview: <url> from the repo's first preview URL. If the repo has none, it prints a hint to run prismic preview add. The open preview follows later refreshes, so the link doesn't change.

Tests

  • test/dev.test.ts: 14/14 on prismic.io.
  • Earlier, on dev-tools, against a Next.js starter: the link showed the release's types, and a pushed edit appeared in the open preview without a manual refresh.

🤖 Generated with Claude Code

jomifepe and others added 3 commits October 13, 2026 15:25
… link

A website previewing the `prismic dev` release only shows model changes
once the release preview is rebuilt, and nothing rebuilt it.

After each sync that pushes, pulls or deletes a model, the command now
calls `POST /core/releases/{id}/refresh`. That covers local edits and
Type Builder edits, which reach the command as pulls. A failed rebuild
stays pending and is retried on the next sync.

At start it prints a `Preview:` link for the release, built from the
repository's first website preview, or how to add one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rebuild ran inside `sync`, so with `--continue` a failed refresh at
start ended the session and deleted its release. The rebuild now runs
next to each loop sync and once at start, where a failure stays pending
and is retried.

Without a website preview, the hint no longer starts with `Preview:`, so
agents only hand over real preview URLs.

A new test checks that a pushed model change moves the release preview
to a new ref. It passes on hosts with prismicio/wroom#3279 and fails on
prismic.io until that ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The editor and toolbar create and refresh release previews, so prismic dev only keeps the release refreshed after each sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jomifepe jomifepe changed the title feat(dev): rebuild the release preview on model changes and print its link feat(dev): rebuild the release preview on model changes Oct 14, 2026
@jomifepe

Copy link
Copy Markdown
Contributor Author

Closing this one. It was mostly useful to test the flow while building Milestone 3, which is now merged (prismicio/obelix#2107, prismicio/apidb#89, prismicio/wroom#3279). The editor and toolbar create and refresh release previews, so prismic dev doesn't need to. To check the full flow, use the QA script on the jp/release-types-preview-qa branch of obelix.

@jomifepe jomifepe closed this Oct 15, 2026
@jomifepe jomifepe changed the title feat(dev): rebuild the release preview on model changes [POC] feat(dev): rebuild the release preview on model changes Oct 23, 2026
With types on releases, documents of a release-only type are written through the MCP, so neither the editor nor the toolbar opens their preview. prismic dev knows the release and keeps it refreshed, so it prints the link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jomifepe jomifepe reopened this Oct 23, 2026
@jomifepe jomifepe changed the title [POC] feat(dev): rebuild the release preview on model changes feat(dev): rebuild the release preview on model changes and print its link Oct 23, 2026
@jomifepe jomifepe changed the title feat(dev): rebuild the release preview on model changes and print its link [POC] feat(dev): rebuild the release preview on model changes and print its link Oct 23, 2026
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.

1 participant