PlutoHTMLElement and PlutoHTMLElementList #1687
Draft
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.
What
This replaces
PlutoRunner.DivElement
with two new primitives:PlutoHTMLElement
andPlutoHTMLElementList
.Why
The problem with
DivElement
areHow
I try to fix that by
PlutoHTMLElement
very generic.It basically takes all the same arguments as a
Preact.createElement
call and passes these on directly.It does some special handling for children, more on that later.
PlutoHTMLElementList
.PlutoHTMLElementList
takes aDict{String,Any}
(!!) where every key is the key prop the child will get on the Preact side.This allows for creating changing lists that preserve identity.
It does contain a polyfill for
DivElement
based onPlutoHTMLElement
, so it doesn't break currentPlutoUI.Experimental.Layout
uses.Todo
(I don't really get yet what parts we want and can make reactive)
children
prop, which we wrap in Pluto-show-thingies. One problem is, (p)react components often use different props for renderable stuff (title
,body
,icon
). Is there a way we can figure out what props we should wrap in Pluto-show-thingies?