Commit adeaa9b
Recompile cljs.loader in REPL
The cljs.loader namespace has to be compiled last, because all inputs
need to be known to populate the `MODULE_INFOS` and `MODULE_URIS`
vars.
Loading a file or evaluating a form in the REPL could trigger another
compilation of the cljs.loader namespace, without the information for
the `MODULE_INFOS` and `MODULE_URIS` available. This compilation
erased the previously populated `MODULE_INFOS` and `MODULE_URIS` vars
and corrupted the module loader.
This patch modifies the loader compilation pass to swap and merge the
`MODULE_INFOS` and `MODULE_URIS` into the compiler state, to make this
information available to compilation stages happening later.
The patch also changes the REPL to recompile and load the cljs.loader
namespace when a file gets loaded, or a namespace form gets
evaluated. A new module graph will be calculated and merged into the
previously calculated one. Recompilation of the cljs.loader namespace
will only happen if the file or form require the cljs.loader
namespace.
Since the :aot-cache is populated at a point where the information for
the `MODULE_INFOS` and `MODULE_URIS` is not yet available, this patch
also makes sure the cljs.loader namespace is never cached.1 parent fb312cd commit adeaa9b
3 files changed
Lines changed: 77 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
637 | 641 | | |
638 | 642 | | |
639 | 643 | | |
| |||
1140 | 1144 | | |
1141 | 1145 | | |
1142 | 1146 | | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1143 | 1152 | | |
1144 | 1153 | | |
1145 | 1154 | | |
| |||
1153 | 1162 | | |
1154 | 1163 | | |
1155 | 1164 | | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1164 | 1174 | | |
1165 | 1175 | | |
1166 | 1176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
1499 | 1501 | | |
1500 | 1502 | | |
1501 | 1503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
209 | 233 | | |
210 | 234 | | |
211 | | - | |
212 | | - | |
| 235 | + | |
| 236 | + | |
213 | 237 | | |
214 | 238 | | |
215 | 239 | | |
| |||
221 | 245 | | |
222 | 246 | | |
223 | 247 | | |
224 | | - | |
| 248 | + | |
225 | 249 | | |
226 | 250 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 251 | + | |
| 252 | + | |
241 | 253 | | |
242 | 254 | | |
243 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
244 | 258 | | |
245 | | - | |
246 | | - | |
| 259 | + | |
247 | 260 | | |
248 | 261 | | |
249 | 262 | | |
| |||
544 | 557 | | |
545 | 558 | | |
546 | 559 | | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
552 | 566 | | |
553 | 567 | | |
554 | 568 | | |
| |||
596 | 610 | | |
597 | 611 | | |
598 | 612 | | |
599 | | - | |
| 613 | + | |
| 614 | + | |
600 | 615 | | |
601 | 616 | | |
602 | 617 | | |
| |||
0 commit comments