Skip to content

refactor(sandbox): remove preview-fetch proxy#4171

Open
guitavano wants to merge 1 commit into
mainfrom
guilherme/remove-preview-fetch-proxy
Open

refactor(sandbox): remove preview-fetch proxy#4171
guitavano wants to merge 1 commit into
mainfrom
guilherme/remove-preview-fetch-proxy

Conversation

@guitavano

@guitavano guitavano commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the preview-fetch CORS proxy route from sandbox-proxy — useLiveMeta and useDecofile now fetch /live/_meta and /.decofile directly from the preview URL
  • Delete preview-fetch-url.ts (URL builder with proxy fallback) and its tests
  • Thread previewUrl through all call sites (preview.tsx, sections-editor.tsx, content-browser.tsx, use-main-panel-tabs.ts)
  • Add cache: "no-store" to bypass browser HTTP caching on direct fetches
  • Reduce file-changed debounce from 2s to 1s

Test plan

  • Save a file in the sandbox editor and verify /live/_meta reflects the change within ~1s
  • Verify sections editor, content browser, and preview all load metadata correctly
  • Confirm no regressions in the CMS visual editor flow

🤖 Generated with Claude Code


Summary by cubic

Removed the preview-fetch CORS proxy and now fetch /.decofile and /live/_meta directly from the sandbox preview URL for simpler, faster metadata loads. Also added cache: "no-store" and reduced file-change debounce to 1s for quicker updates.

  • Refactors
    • Removed proxy route from sandbox-proxy.ts.
    • Deleted preview-fetch-url.ts and its tests.
    • Switched useLiveMeta and useDecofile to direct fetches with cache: "no-store".
    • Threaded previewUrl through preview.tsx, sections-editor.tsx, content-browser.tsx, and use-main-panel-tabs.ts.
    • Shortened live meta debounce from 2s to 1s in sandbox-events-context.tsx.

Written for commit c510503. Summary will update on new commits.

Review in cubic

…/.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>
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