Closed kodeFant closed 2 days ago
I like the idea 👍
one alternative could also be adding an [uncheckedHsx||] quasi quoter. Like hsx but without any checking of the attributes or tag names.
Your approach feels more in line with type safety, so likely we should go with makeCustomHsx :)
Great! If it doesn't prove to be extremely difficult, I could try to add uncheckedHsx
too. Would be nice for shipping XML for example if you don't want to declare every allowed tag and attribute
Great, let's try that :+1:
The custom thing was far too complex for me to deal with right now, so I went with uncheckedHsx
#2010
Hi!
Sometimes, I would like to avoid using
{...[("non-standard-attribute", "value" :: Text)]}
in hsx and rather be able to extend it with my own whitelist of attributes I commonly use.When using custom elements or js libraries with non-standard attributes, it would be nice to just have a custom HSX that just adds a whitelist.
I guess we could have it as a low level function that also hsx could use.
And with something like this, one can enjoy compile-time type-safety with custom attributes:
And then we could do this:
I haven't actually tested it, so it's just pseudo for now.
If interesting, I could attempt a pull request.