DEV Community

Discussion on: SolidJS Official Release: The long road to 1.0

Collapse
 
ryansolid profile image
Ryan Carniato

It was easier. Seriously.

I had done Templates before that and it just allowed me to keep JavaScript scope and you eventually pull in JavaScript parsers anyway. The truth is no one wants just HTML they want something with JavaScript in there. I knew that as one developer leveraging an existing toolset would be infinitely easier than creating my own almost HTML thing. Like good TypeScript support, Syntax Highlighting, Code formatting. Like Solid code snippets look good on every platform. And no need to maintain my own Parser or Transformer. I literally picked up Babel and was good to go. Everything just works.

Then there are the other aspects. I wrote an article about this but Single File Components I'm not the biggest fan of. You get this sort of overhead of forcing separate files to break things up. There mechanisms to do this. Like Marko has a <macro> tag but frameworks like Vue and Svelte don't.

Also ease of composition patterns of components. I've always like React for that. Things like Render Props. Being able to have a syntax to describe things like For loops without it being a specialized syntax makes it extensible. Like if you've ever tried to use "scoped slots" or "slot props" and equivalent in Vue or Svelte you will sort of see what I mean. It's where the ugliness of these templates come out as there is no syntax for passing variables out and you need to disambiguate like variable scope things like refs and nested scope things like slots. With simply attributes you are forced into series of namespaced keywords that hold special meaning but provide not syntaxtual indicator of their purpose. Like the subtle difference between this:variable and let:variable.

I think it can be done with an HTML language. Marko is probably the closest to having the full capability. But for a developer working by themselves on a new project. It was a no brainer.