Hacker News new | ask | show | jobs
by torb-xyz 2208 days ago
Is it possible to use Solid with just plain JavaScript/TypeScript (like using createElement with React)?

I generally find those far more readable than JSX (and is one of the reasons I think SwiftUI and Flutter code looks nicer than React).

2 comments

You can use HyperScript(createElement) version. You just forgo the advantages of compilation - better dx(less need for explicit wrapping), better performance(optimized code path), and smaller bundle size (more directed code).

Solid's JSX does not compile to HyperScript like React. HyperScript is a different slightly de-optimized experience.

It sounds to me that you are looking for Webscript: https://mudgen.github.io/webscript/docs/

Webscript does work with SolidJS nicely.

Probably should have specified, but a big ting I'm looking for is sull TypeScript support in this regard.

Webscript looks really cool, but it doesn't look very TypeScript-friendly.