You can see from the workaround above that it could be possible to allow users to take IpyReact component code and almost copy paste it into a ReactiveHTML component with a utility function like _esm.
One question I have is whether we want to support the component signature
And somehow the code needs to add functionality to rerender when data parameter values changes. Should that user specify which parameters trigger a rerender? Or can that be automatically determined?
Another question I have is how to inject Panel components from _scripts instead of via template variables ${...} in the _template. See #5551
I'm working on the
ReactiveHTML
docs. When comparing to AnyWidget and Ipyreact I can see that they support modern browser features likeimport
statementsimport
mapswhile
ReactiveHTML
does not or does not easily.The consequences are
ReactiveHTML
componentAnywidget
orIpyreact
examples or code intoReactiveHTML
Please either add these features to
ReactiveHTML
or document how to add them.Workaround
In the below example I show how to work around some of the missing features. This example is based on the
IpyReact
getting started example.<script type="module"></script>
tagimport
statements:import(...).then
syntax.import
maps: no workaround yet.then
syntaxDiscussion
You can see from the workaround above that it could be possible to allow users to take IpyReact component code and almost copy paste it into a
ReactiveHTML
component with a utility function like_esm
.One question I have is whether we want to support the component signature
or
And somehow the code needs to add functionality to rerender when
data
parameter values changes. Should that user specify which parameters trigger a rerender? Or can that be automatically determined?Another question I have is how to inject Panel components from
_scripts
instead of via template variables${...}
in the_template
. See #5551