trueadm / t7

Lightweight virtual DOM templating library
900 stars 31 forks source link

Clarify differences with JSX #13

Closed gaearon closed 8 years ago

gaearon commented 8 years ago

I understand you might not want to take this, but I wanted to clarify something that seemed off to me.

resulting in templates that can easily be linted

For any practical purposes, JSX has been possible to lint for a few years now, first with JSXHint, and now with ESLint that supports JSX out of the box. The claim is also a bit misleading because “linting t7” won't lint the string contents—just the interpolated expressions. Whereas with JSX linting as implemented in JSXHint or ESLint, you get parse errors if your tree is malformed.

there isn't a need to setup in-browser transformers or NodeJS transpilers to start developing.

I removed this sentence too. First, nobody in the real world sets up in-browser transformers to develop with JSX. I'm sure you know that—it just feels misleading to even mention that in the comparison. Secondly, this sentence makes it sound like you don't need any transpilers to use t7 today in the browsers. (Is anybody writing virtual DOM server-only apps?) But this isn't the case. Since t7 requires ES 2015, it actually needs a transpiler like Babel today. And Babel supports JSX. So it's unfair to say JSX requires transpilers but t7 lets you start developing without them—at least not until most browsers support template strings.

I think t7 is a fine library and I mean well. Some of my arguments may be invalid in a year or two, but I think they are valid as of today. Please feel free to close if you consider this inaccurate or inappropriate. Keep up the good work!

gaearon commented 8 years ago

Thank you!

trueadm commented 8 years ago

No, I completely agree with those statements too. They were definitely somewhat misleading when I look back on them retrospectively (although innocently so).

In regards to using t7 without a transpiler, this was intended for companies that couldn't use Babel in their workflow (or any other transpiler). I've been involved in some large projects for large businesses lately where they fully support only evergreen browsers (no IE support etc) and thus have no issues with supporting template strings, but simply couldn't adopt Node/Babel into their testing/build pipeline. That was really where t7 was built from.

I definitely see plenty of value from JSX when using precompilers and given now most of the IDEs have picked up on supporting the syntax (which wasn't the case end of last year) it's looking healthy there!

Thanks for the feedback regardless.

gaearon commented 8 years ago

large businesses lately where they fully support only evergreen browsers (no IE support etc) and thus have no issues with supporting template strings, but simply couldn't adopt Node/Babel into their testing/build pipeline

Interesting, thanks for sharing the context. The biggest blocker for using them directly is iOS <9, but I can see this not being an issue for desktop-only apps.