refactor(sandbox): remove preview-fetch proxy#4171
Open
guitavano wants to merge 1 commit into
Open
Conversation
…/.decofile directly The preview-fetch CORS proxy route was unnecessary — the client can fetch /live/_meta and /.decofile directly from the preview URL. This removes the server-side proxy, the buildPreviewFetchUrl helper, and threads previewUrl through all useLiveMeta/useDecofile call sites. Also reduces the file-changed debounce from 2s to 1s and adds cache: "no-store" to bypass browser HTTP caching on direct fetches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
preview-fetchCORS proxy route from sandbox-proxy —useLiveMetaanduseDecofilenow fetch/live/_metaand/.decofiledirectly from the preview URLpreview-fetch-url.ts(URL builder with proxy fallback) and its testspreviewUrlthrough all call sites (preview.tsx,sections-editor.tsx,content-browser.tsx,use-main-panel-tabs.ts)cache: "no-store"to bypass browser HTTP caching on direct fetchesTest plan
/live/_metareflects the change within ~1s🤖 Generated with Claude Code
Summary by cubic
Removed the preview-fetch CORS proxy and now fetch
/.decofileand/live/_metadirectly from the sandbox preview URL for simpler, faster metadata loads. Also addedcache: "no-store"and reduced file-change debounce to 1s for quicker updates.sandbox-proxy.ts.preview-fetch-url.tsand its tests.useLiveMetaanduseDecofileto direct fetches withcache: "no-store".previewUrlthroughpreview.tsx,sections-editor.tsx,content-browser.tsx, anduse-main-panel-tabs.ts.sandbox-events-context.tsx.Written for commit c510503. Summary will update on new commits.