Commit 900ec95
authored
fix: Correct virtual SSR module invalidation and import side-effect logic (#587)
Follow-up to previous PR (#586) - there were some issues in it for establishing proper module graph linkage for virtual SSR modules.
Fixes:
* Corrected environment scope for invalidation: Virtual SSR modules must be invalidated in the worker environment, not client, to ensure proper propagation without triggering full reloads.
* Handled modules without code (e.g. CSS): CSS and other plugin-handled modules can return undefined from fetchModule(). We now avoid skipping these entirely and still extract specifiers to maintain accurate graph linkage.
* Replaced the switch-wrapped `ssrImport()` + return logic with direct inline injection of `import()` side effects. This change restores correct behaviour for some module types (notably CSS), though the exact cause of breakage in the previous version is not yet fully understood.1 parent 1766a8f commit 900ec95
File tree
3 files changed
+5
-19
lines changed- sdk/src/vite
3 files changed
+5
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
93 | | - | |
94 | 91 | | |
95 | 92 | | |
96 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 154 | | |
163 | 155 | | |
164 | | - | |
| 156 | + | |
165 | 157 | | |
166 | 158 | | |
167 | 159 | | |
| |||
176 | 168 | | |
177 | 169 | | |
178 | 170 | | |
179 | | - | |
180 | | - | |
| 171 | + | |
| 172 | + | |
181 | 173 | | |
182 | 174 | | |
183 | | - | |
| 175 | + | |
184 | 176 | | |
185 | 177 | | |
186 | 178 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | 179 | | |
191 | 180 | | |
192 | 181 | | |
| |||
0 commit comments