Background
During v12.1.0 development, we deleted src/code/LivePreview.mjs#beforeSetWindowUrl. This manual path calculation was originally added in #8074 to solve Windows OS path separator issues and nested "recursive" popouts. However, mapping the SharedWorker's basePath upward directly to the repo root fundamentally stripped out environment prefixes like dist/development/.
Current State
The system now relies entirely on the Main thread's native browser relative URL resolution (e.g., evaluating ./childapps/preview/index.html strictly against location.href). Initial macOS testing confirms that this successfully resolves for popouts executed from both the Portal Home route and the Learn route, preventing environment-jumping bugs.
Risk & Verification Plan
We must perform a matrix validation to ensure the native Main thread resolution handles all historical edge cases:
- OS Matrix Verification: Ensure the Windows OS path separator (
\) bug (#9365) does not regress without the manual split/join logic.
- App Depth Verification: Test popping out
LivePreview components located in apps with varying structural depths (e.g., apps/portal vs examples/component/button).
- Environment Matrix Verification: Test popouts across all environments:
development (raw), dist/development (bundled), and dist/production.
- Recursive Popout Verification: Verify that popping out a component from inside an already-popped-out childapp (Window 2 -> Window 3) evaluates the deep relative path correctly without generating 404 URL loops (e.g.,
childapps/preview/childapps/preview/).
Background
During v12.1.0 development, we deleted
src/code/LivePreview.mjs#beforeSetWindowUrl. This manual path calculation was originally added in #8074 to solve Windows OS path separator issues and nested "recursive" popouts. However, mapping the SharedWorker'sbasePathupward directly to the repo root fundamentally stripped out environment prefixes likedist/development/.Current State
The system now relies entirely on the Main thread's native browser relative URL resolution (e.g., evaluating
./childapps/preview/index.htmlstrictly againstlocation.href). Initial macOS testing confirms that this successfully resolves for popouts executed from both the Portal Home route and the Learn route, preventing environment-jumping bugs.Risk & Verification Plan
We must perform a matrix validation to ensure the native Main thread resolution handles all historical edge cases:
\) bug (#9365) does not regress without the manual split/join logic.LivePreviewcomponents located in apps with varying structural depths (e.g.,apps/portalvsexamples/component/button).development(raw),dist/development(bundled), anddist/production.childapps/preview/childapps/preview/).