Commit 95ec71c
committed
Script Loader: Walk deps of empty-scoped queued entry points.
A module registered with `scopes => array()` and enqueued is an entry point: it is
emitted as a `<script type="module">` and its imports must resolve in the browser
even though its own bare specifier resolves nowhere. The dependency walk in
`get_import_map()` previously stopped at every empty-scoped node, including the
starting node, leaving the entry's deps absent from the import map.
Stop traversal at *transitive* empty-scoped nodes only. Starting nodes (queue
items and classic-script `module_dependencies`) are now exempt. The leak
prevention for empty-scoped modules reached only via dep edges is preserved.1 parent 602daa6 commit 95ec71c
2 files changed
Lines changed: 75 additions & 7 deletions
File tree
- src/wp-includes
- tests/phpunit/tests/script-modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | | - | |
816 | | - | |
817 | | - | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
818 | 822 | | |
819 | 823 | | |
820 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
821 | 828 | | |
822 | | - | |
| 829 | + | |
823 | 830 | | |
824 | 831 | | |
825 | 832 | | |
826 | 833 | | |
827 | | - | |
| 834 | + | |
828 | 835 | | |
| 836 | + | |
829 | 837 | | |
830 | 838 | | |
831 | 839 | | |
| |||
838 | 846 | | |
839 | 847 | | |
840 | 848 | | |
841 | | - | |
| 849 | + | |
842 | 850 | | |
843 | 851 | | |
844 | 852 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3418 | 3418 | | |
3419 | 3419 | | |
3420 | 3420 | | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
3421 | 3481 | | |
3422 | 3482 | | |
3423 | 3483 | | |
| |||
0 commit comments