Enable multizone embedding via prefixed asset URLs#96
Open
SakshiKekre wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Beta preview is ready.
|
The chat is being embedded on policyengine.org/uk/chat as a multizone child (see policyengine-app-v2 PR #1036). Vercel rewrites are the mechanism; cross-origin iframes blank out for Next.js apps per CLAUDE.md. For the rewrites to work end-to-end, the chat's static asset URLs need to live under a prefixed path so the website can proxy them back through policyengine.org. Matches the household-api-docs zone pattern (which uses the same /_zones/<name> convention). Two coordinated files: - frontend/next.config.js: assetPrefix '/_zones/uk-chat' in production builds. Dev server stays unprefixed for local development. - frontend/vercel.json: rewrite /_zones/uk-chat/_next/:path* back to /_next/:path* so the chat host serves the prefixed URLs that the generated HTML references, without needing basePath (which would break the standalone preview URL). Pages still live at "/" on the chat host, so direct previews (policyengine-uk-chat.vercel.app) keep working unchanged.
1432dfc to
41a5ed5
Compare
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.
What
Makes the chat embeddable as a multizone child on `policyengine.org/uk/chat` (see policyengine-app-v2 PR #1036). Matches the household-api-docs zone pattern.
How
Two files:
End-to-end flow once both this and PR #1036 merge
The website (policyengine.org) rewrites:
```
/uk/chat → chat-host/
/_zones/uk-chat/_next/:path* → chat-host/_zones/uk-chat/_next/:path*
```
What stays the same
Test plan