Client: Rename a collection's "row" to an "item" and fold content anchor - #2278
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 2200b03
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
🌿 Interactive Playground and Documentation PreviewA preview deployment has been built for this pull request. Try out the changes live in the interactive playground: 🌱 Grown from commit ✅ Preview deployment has been cleaned up. |
commit: |
The operation an event carries named what kind of thing changed, except for items, where it named what happened to one. Rewriting an item's markup fell through to `markup` with a key set, so a listener had to read "markup plus a key" as "an item was replaced", while the item appearing or leaving said so outright. `item-updated` says it. `markup` keeps its meaning for a whole slot rewritten at once, which is the case that carries no key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request settles the vocabulary of the slot marker format on one set of words, and reduces the two attributes that anchor a slot to an element down to one.
Nothing outside this stack reads the format yet, which is the only reason this is cheap. Every one of these changes is breaking, and each gets more expensive the longer it waits.
rowis table vocabulary, and a collection repeats<li>, cards and<option>as readily as it repeats<tr>. The slot type beside it is alreadycollection, and a collection has items, which is also what Rails calls them whenrender collection:renders one partial per item.Also, an element's content slot had an attribute of its own while every other slot on that element was in
data-herb-slot, and the index called what the first one produced acontentanchor, so the format and the index disagreed about its name.The anchor kind is a property of the slot's type and does not need an attribute to carry it.
childmeans the value goes inside the element, and every other type on that attribute means the element itself:The list is space-separated now, which is what HTML uses for token lists, and it means a slot can be found with a selector instead of by parsing the attribute:
~=matches one token of a whitespace-separated list, so the comma form could not be queried this way. A content-only element grows three characters, an element carrying both roles shrinks by a whole attribute.Some values of
SlotOperationnamed what kind of thing changed and two named what happened to one item, and rewriting an item's markup fell through tomarkupwith a key set:markupkeeps its meaning for a whole slot rewritten at once, which is the case that carries no key. Nothing read the operation except the Dev Tools flash, which looks it up in a colour map, so this costs one entry there. No test covered that path before, and one does now.Slots are experimental and the marker format is not stable yet.