Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In Marko 3,
w-id
was used as both akey
and set a scopedid
. Theid
was primarily an implementation detail, but it could also be used withw-for
to associate DOM elements.Marko 3:
Marko 4 equivalent:
However Marko 4's
:scoped
modifier does not support repeated values. This is because it's difficult to reason about association of repeated values (the primary use-case fore:scoped
). However, this causes the same ids to appear on the page because:scoped
doesn't have special behavior forrepeated[]
values.In Marko 3, this association doesn't actually work between repeated
w-id
andw-for
attributes:Input template:
Output HTML:
Because of this, it should be safe to assume that a repeated
w-id
is only being used to reference the elements, not associate them with other elements. This PR modifies the migration ofw-id
so that repeated ids do not add anid:scoped
attribute.Checklist:
I have updated/added documentation affected by my changes.