(Typescript) Expose classList type
Currently exposing classList as a prop requires a custom type. It would be better to create a "ClassList" type definition, use that everywhere and expose it. PR following shortly.
We are in the process of meditating if classList should be deprecated, replaced by something else (such a super powered class[class behaving as classlist]/clsx equivalent) or just plainly suggest to use clsx instead, or maybe even leave it as is.
It has issues like defining both class and classList overwrites each other in un/predictable ways when stuff is dynamic. Specially when used in spreads(spreading before or after setting class as attribute?), when effects run out of the expected order(there are no expectation on the order effects run), and it has issues with SSR too.
I am probably missing some other situation. I meant to investigate this. While I somewhat understand the issue, I am not confident enough about its problems (it only happens in some circumstances and most of the time is not an issue or a big deal), and I am also not authoritative enough to decide over its future.
btw, the typings are in https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/jsx.d.ts
I mentioned all of the above because we do not seem to be sure about its future, so you can consider
I think deprecating or removing classList is irrelevant. It will stay in 1.x anyway (removing it would be a breaking change), so exposing its type makes sense I think.
I'm just not sure what package should export the type. I'm thinking solid/web? If so, then: https://github.com/solidjs/solid/pull/2401
If classList ends up being deprecated, it should be easy to write a Lint rule for Biome (and probably eslint too, but I'm not involved in that) to recommend using clsx or similar over it.