While updating the bindigs to v12, I ran into another complication.
SolidJS uses slightly different DOM attributes. For example in SolidJS class is allowed, and there are also special ones like classList that exist only in SolidJS.
With v11 I was using the generic JSX transform feature to modify the domProps type by providing my own definition of the Elements module (as described in the docs):
module Elements = {
type props = {
...JsxDOM.domProps,
class?: string /* Solid also allows class */,
classList?: classList,
textContent?: string,
}
}
With v12 it seems generic JSX transform and preserve mode are mutually exclusive. (At least in my tests I could not get them to work together). Which seems intuitive at first glance, since defining your own function names is not necessary if those functions are never created.
But now I can no longer use it to modify domProps.
I found a solution that works, by simply providing my own JsxDOM module:
module JsxDOM = {
type style = JsxDOMStyle.t
type domRef
type popover = | @as("auto") Auto | @as("manual") Manual | @as("hint") Hint
type popoverTargetAction = | @as("toggle") Toggle | @as("show") Show | @as("hide") Hide
type domProps = {
...JsxDOM.domProps,
class?: string /* Solid also allows class */,
classList?: string,
textContent?: string
}
}
But this seems much less elegant than the previous solution.
Would it be possible to have JSX transform and preserve mode active at the same time (with preserve mode taking precedence)?
Or do you have another idea on how to solve this in a cleaner way than just overriding JsxDOM?