trueadm / t7

Lightweight virtual DOM templating library
900 stars 31 forks source link

Why this is better than jsx #17

Closed stevemao closed 8 years ago

stevemao commented 8 years ago

on jsx website it explicitly indicates why jsx is better than Template strings. https://facebook.github.io/jsx/#why-not-template-literals

I believe people are used to write jsx in their code.

Unlike JSX, t7 relies exclusively on ES 2015 features, so you can use any ES 2015 compliant build tools, linters, IDEs or syntax highlighting schemes, without worrying about transpiling JSX.

I don't think this is enough to convince people to use this. It would be better if you could include more details on this.

trueadm commented 8 years ago

If you look at the rewrite branch, you'll see there's a new syntax for pulling in components – which was their biggest gripe with template strings. End of the day, what I said is completely 100% true: t7 formally covers ECMA2015 spec without any alterations.

On the other hand, JSX has a hard dependency on requiring Babel. There's nothing wrong with Babel, I use it within the new t7 branch, but t7 can simply run in your browser without any magic or transpilation.

To put that in context of the real-world, this is a massive problem for my line of work – the finance world. Banks and investment companies don't use Node and won't be touching Node for many many years to come. Not only is NPM is a security nightmare but Node 5.0 recently failed a security audit a very large bank, forcing them to scrap the project completely. So there there's simply no way they'd move away from their Java/.NET cores for their build pipelines. So that makes t7 a very attractive proposition for people who "cannot" use JSX.

There is nothing wrong with JSX though. To point this out: my other project, Inferno, also makes heavy usage of JSX too (again in the new-build branch rather than maser). JSX is very cool, very easily to optimise and very "on-trend". However, in some very constrained parts of the development world, usage of Babel simply would never fly.