trueadm / t7

Lightweight virtual DOM templating library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any way using this without tagged templates?

linus-amg opened this issue · comments

I think i have a difficulty using that with CoffeeScript instead of JS directly, since afaik tagged templates are not supported by cs. Any advice?

Your best bet would be to add a feature request for the CoffeeScript team to add ES6 tagged template support (I believe they are lacking other ES6 features currently, not only tagged templates). This is one of the main reasons I moved back to vanilla JS from CS, too many of these problems started happening when new features were added to JS. :/

yeah, they will include useful ES6 features when they are stable and supported by default, i think thats alright, well thanks though. :)

so there is no way to use t7 without es6 (or transpilers/compileres/converters etc.), right?

t7 is supported natively in Chrome, Chrome for Android and Firefox (has done for a while now). It's also supported in the new Safari for Mac and OS X (tried it yesterday with iOS9 Beta). Microsoft Edge also supports t7 just fine, that will be out at the end of this month. It's actually quite exciting to see t7 working so well in all these browsers, it's definitely a good sign of things to come for the library.

I'll work on getting the t7 precompiler fixed and working again in the coming weeks (it's a lot of work) and that should give a huge performance boost and will give support to all browsers IE7+ (without needing Babel). I'll probably get it working as a Browserify and Webpack plugin first then attempt to get support for it in Babel (if they're willing to accept t7 for it's value to people using Virtual DOM frameworks).

Your message was removed? I'd like to expand on test coverage where possible. I've almost got the t7 precompiler into a state that I'm happy with :)

i'll add another vote here for a more concise, js-only syntax. i'm quite partial to Mithril's m() [1].

I think it's much easier to grok without angle brackets, closing tags, getting any syntax errors in js, and having css syntax likediv#foo.bar is hard to beat.

In addition, multiplexing of modes within Javascript tagged template strings is not yet widely supported in editors; Codemirror still lacks a multiplexed javascript mode to allow this - there's a closed issue for it [2] that I hope will be re-opened.

EDIT: on the other hand, m-style definitions would make it harder to determine what constitute dynamic parts to avoid full re-compilation.

[1] https://lhorie.github.io/mithril/mithril.html
[2] codemirror/codemirror5#3026

@leeoniya I completely agree with you there.

Although, we're definitely the minority here. The vast majority of developers/designers I work with love HTML and only really understand HTML. That's one of the core reasons behind t7 working like JSX with HTML angle brackets.

I feel that the hardened JavaScript developers who see value in writing concise js-only syntax will have an uphill task trying to convert the others to our ways (especially so in large companies).

Saying that, t7 also leverages pulling out static content. By doing this, it can easily optimise HTML templates into precompiled fragments for Inferno (which is why it gets the performance it does). I can't see any easy way to provide this power to js-only syntax.