You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58Lines changed: 58 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,64 @@ nestedDocsPageTreePlugin({
117
117
118
118
`labels` and `colors` are optional partial overrides. Missing entries fall back to the built-in defaults.
119
119
120
+
## Drag-And-Drop Is Triggering A Deploy?
121
+
122
+
A drag-and-drop move calls `payload.update()` on the draft only. The published version of the live site is never touched. So in most setups, dragging a page does not trigger any rebuild and you can skip this section.
123
+
124
+
### When you can skip this section
125
+
126
+
- The default Payload website template on Vercel (or any host using Next.js ISR), with drafts and autosave on. The template's `afterChange` hook only calls `revalidatePath` and `revalidateTag` from `next/cache`. Those just clear the edge cache. They do not trigger a Vercel build, do not consume build minutes, and do not change what visitors see when the published HTML hasn't changed.
127
+
- Any setup where your `afterChange` hooks only do in-process cache work (`revalidatePath`, `revalidateTag`, in-memory caches, etc.).
128
+
129
+
### When you need the one-line fix
130
+
131
+
You need the fix if **you** wrote an `afterChange` hook that calls something external or expensive on every save. Common cases:
132
+
133
+
-**Cloudflare Pages / Netlify / Vercel Deploy Hooks** (`fetch(DEPLOY_HOOK_URL)`) — these trigger full rebuilds and burn build minutes.
Why a tree move trips these: a typical deploy hook fires when `previousDoc?._status === 'published'` so that it catches unpublish events too. A tree move on a published doc matches that condition (the previous draft state was published) — but the live site hasn't actually changed. Without the fix, every drag fires your deploy.
140
+
141
+
### The fix
142
+
143
+
Add one line at the top of your hook. The plugin sets a flag on Payload's [hook context](https://payloadcms.com/docs/hooks/context) for every move, and your hook reads it to bail out early:
0 commit comments