feat(rebuild): rebuild pages on pubish action#787
Merged
Conversation
…on and page regeneration
…emove `onPublish` prop
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
sdk-nextjs | f2320e3 | Mar 02 2026, 11:52 AM |
Deploying sdk with
|
| Latest commit: |
f2320e3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://148e1b1d.sdk-8n4.pages.dev |
| Branch Preview URL: | https://revert-revalidate-pr.sdk-8n4.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the publish-changes flow to support path-based revalidation in the Next.js framework integration, alongside a couple of small cleanup/UI tweaks.
Changes:
- Extend
PublishChangesActionto return bothtagsandpathsso consumers can trigger more targeted cache/path revalidation. - Add a Next.js-specific publish action wrapper that revalidates returned tags/paths, and switch the builder API route to use this handler.
- Minor tweaks: simplify publish error logging in the builder UI and adjust the public page HTML class name.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/hooks/pages/mutations.ts | Simplifies publish error logging output. |
| src/actions/export.ts | Re-exports PublishChangesAction for external consumers (e.g., framework adapters). |
| src/actions/builder/publish-changes.ts | Returns { tags, paths } from publish operations and collects both across ids. |
| frameworks/nextjs/package/actions.ts | Adds Next.js wrapper action to revalidate by tag/path and provides a Next.js-specific action handler init. |
| frameworks/nextjs/app/(public)/[[...slug]]/page.tsx | Updates the <html> class name for smooth scrolling styling. |
| frameworks/nextjs/app/(builder)/api/route.ts | Routes builder POST handling through the new Next.js action handler initializer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
surajair
approved these changes
Mar 2, 2026
Collaborator
There was a problem hiding this comment.
Looks like prettify is not ran here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #773
This pull request introduces a new Next.js-specific action handler for publishing changes, enhances the publishing logic to support both tags and paths for cache revalidation, and refactors the API route to use the new handler. Additionally, it includes a minor class name fix for HTML and a small logging improvement.
Next.js Integration and Action Handling:
Added a new
NextJsPublishChangesActioninframeworks/nextjs/package/actions.tsthat extends the base publishing action to support Next.js cache revalidation using both tags and paths, and introducedinitChaiBuilderNextJSActionHandlerto handle streaming and JSON responses in a Next.js-friendly way.Updated the API route in
frameworks/nextjs/app/(builder)/api/route.tsto use the new Next.js-specific action handler, simplifying the response logic and ensuring compatibility with streaming and cache revalidation. [1] [2]Publishing Logic Enhancements:
Refactored
PublishChangesActioninsrc/actions/builder/publish-changes.tsto return bothtagsandpathsfor published changes, and updated internal methods (publishTheme,publishDesignToken,publishPage) to support this dual return type for more granular cache invalidation. [1] [2] [3] [4] [5] [6]Exported
PublishChangesActionfrom the main actions entry point for broader accessibility.UI and Logging Improvements:
Fixed a typo in the HTML class name from
smooth-scrollto the correctscroll-smoothin the public page template. (frameworks/nextjs/app/(public)/[[...slug]]/page.tsxL48-R48)Improved error logging in the page publishing mutation hook for better debugging.