Commit 2b0906d
committed
Fix dual-module bug in playground dev rewrite
The playground's dev-mode rewrite sent 'squint-cljs/core.js' through
/js/squint-local/core.js (the 38-byte root shim that re-exports from
./src/squint/core.js). Vite transformed that shim's relative import
into a /@fs/.../src/squint/core.js URL.
Meanwhile the same import inside already-served runtime files
(test.js, multi.js, etc.) was left as a bare specifier and resolved by
the browser via the importmap to /src/squint/core.js. Two URLs, same
file — and ES-module caching treats them as two separate modules.
Each gets its own _metaSym; with-meta written through the user side
becomes invisible to meta reads inside the runtime, which is why
deftest'd tests surfaced as 'anonymous' in :begin-test-var events.
Rewrite 'squint-cljs/{,src/squint/}X' straight to /src/squint/X so
user code and importmap-resolved imports converge on one URL, one
module instance. Confirmed against a live Vite+Playwright repro:
before, sameModule=false; after, sameModule=true and deftest names
surface correctly end-to-end.1 parent df5a87e commit 2b0906d
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
113 | 123 | | |
114 | 124 | | |
115 | 125 | | |
| |||
0 commit comments