fix: split app into (main)/(sandbox) route groups so plugin iframe hydrates properly

This commit is contained in:
Linus Rath
2026-05-20 23:41:49 +02:00
parent d45c8ef511
commit 628966d3b5
57 changed files with 109 additions and 37 deletions
+7 -4
View File
@@ -1,9 +1,12 @@
// Shared message-protocol types for host ↔ sandbox postMessage RPC.
//
// The sandbox iframe is null-origin (`sandbox="allow-scripts"`), so postMessage
// events arrive with `event.origin === "null"`. The host pins messages by the
// iframe's `contentWindow` reference instead. All values crossing the boundary
// must be structured-cloneable: no functions, no DOM nodes, no class instances.
// In production the sandbox iframe is null-origin (`sandbox="allow-scripts"`),
// so postMessage events arrive with `event.origin === "null"`. In development
// the iframe also gets `allow-same-origin` so Next's HMR/dev runtime works;
// `event.origin` is then the host's actual origin. The host pins messages by
// the iframe's `contentWindow` reference in either case. All values crossing
// the boundary must be structured-cloneable: no functions, no DOM nodes, no
// class instances.
import type { SlotName } from '../plugin-types';