sveltejs / svelte · Issue No. 18599
Found while reviewing compile-time complexity in packages/svelte/src alongside https://github.com/sveltejs/svelte/pull/18602.
packages/svelte/src/compiler/phases/3-transform/utils.js:92{@const} tags in a fragment{@const} declarations in one fragment (can grow in complex templates)function add(tag) {
if (sorted.includes(tag.node)) {
return;
}
// ...
sorted.push(tag.node);
}
That PR fixed a related Map-misuse on legacy $: statements. This is the same pattern class on a different surface ({@const}).
Track visited const tags with a Set (or Map) of nodes; O(1) membership. Preserve topological order and cycle detection.
{@const} ordering samples (const-tag-ordering, const-tag-depends-on-const-tag)Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.