Closed reid-spencer closed 8 years ago
This is an interesting idea that has not been solved but should live outside the core of Scalatags.
Scalatags Frag
s are basically arbitrary code, and you can make your frags do whatever you want. Writing a function that spits out an XHML/DOM element is trivial in both Text
and JsDom
backends.
I do not see why you would parse javascript to try and decide which tags should be XMLized, when you can just hardcode a list of them somewhere. Updating the hardcoded list can be done manually and you can enforce preciseness/accuracy of that list with runtime asserts.
I'm interested in what you come up with, but this is not an issue. Discussion should happen on gitter
This may only be a question as opposed to an issue.
I've used scalatags in some projects and am fully apprised of its benefits and would like to continue to use it. However, with web components coming down the road (or arrived depending on your point of view), I am concerned about the viability of scalatags with custom elements. I suppose that component producers could create extensions to scalatags to support their custom elements but this seems awkward and rote.
Do you think it would be possible to have scalatags automatically adapt to custom elements defined in javascript? I don't know much about scalatags internals but it seems to be a difficult problem to go from this :
to
I think the problem here is that we would need to parse the javascript (document.registerElement) as a sort of pre-compilation phase so that a scalatags declaration of "my-input" could be generated for the scala compiler.
Perhaps this is a solved problem? Perhaps I am not seeing another solution? Perhaps this is something I could contribute to scalatags if given a reasonable direction to investigate?