trueadm / t7

Lightweight virtual DOM templating library
900 stars 31 forks source link

Is it production ready? #12

Closed mehdi-cit closed 8 years ago

mehdi-cit commented 8 years ago

Well, it's all in the title. Can one use t7 safely for a production grade app? And here's my stupid question of the day: This t7 turns the template into some form of Virtual DOM data structure. I take it, one has to pick what particular Virtual DOM objects to output to (as of now: Inferno, React and Mithril) and from then on the chosen output's library is in charge (diffing ...etc). If one chooses React one can just use something as 'key' or 'refs' in the template and expect the library to make proper use. Are these assumptions above correct? Since trueadm is also the author of inferno I take the liberty to use this space to also ask about any roadmap/estimates for infernojs ( https://github.com/trueadm/inferno ). Cheers~

alkhe commented 8 years ago

I think we should kill React/Mithril support. It's unlikely that those will be our selling points; most people will not go through the trouble of running t7 (for a yet unproven perf gain), especially since we don't have a babel plugin.

At this time, we'd most likely want to prioritize size and perf, to make t7 and Inferno a snug little ecosystem. Getting rid of support for other things should clear our heads as well as the code.

trueadm commented 8 years ago

@edge I don't agree in killing React support, it's far too important to keep. Although I agree that we should make the t7 precompiler a Babel plugin to streamline everything and also break out t7 into modules (t7-react, t7-inferno etc).

@mehdi-cit In terms of production readiness, I feel that t7 works great with the use-cases so far outlined for React and basic virtual DOM. I'd love to hear and get feedback regarding people's usage of t7 in their applications so we can further improve performance and remove bugs.

mehdi-cit commented 8 years ago

Hello and thanks for the quick feedback. I'm not using t7 as of yet. I just came across t7 and inferno. I'm using both React (work) and Mithril (Pet project) and I might be testing with t7 for both. @edge One of the selling points of t7 (If i ever use it) is that it allows me to more easily switch from one library to the other ("feels" easier to port "templates") and let me be "close" to infernojs if/when it becomes a viable option. What I dislike about React, is that it's too heavy/bloated. Mithril is much lighter but tries to do too much (routing, ajax, automatically 'redrawing' on event listeners ...) so I end up digging into its code to switch off some "features". Could anyone please let me know if I can safely use library specific property names (such as key and refs) in the t7 template and expect them to behave as they'd in JSX ?

alkhe commented 8 years ago

@mehdi-cit We will always support JSX syntax, regardless of React support. Porting should always be fairly straightforward.

mehdi-cit commented 8 years ago

@edge Thanks for the prompt reply. I might have not been clear. Let me rephrase. If I use 'refs' inside a t7 template text (or 'key' to refer to a particular item in a list/table). Would things work exactly as when I use JSX. For instance in react I can use refs inside JSX as below:

<input ref="myInput" />

And then in my code I can use that reference such as in the code below

React.findDOMNode(this.refs.myInput)

How would you do that with t7.

Thanks in advance. I do appreciate your patience

trueadm commented 8 years ago

Should work the same as it's simply a wrapper around React.createElement, as JSX is too. Let us know if you have any issues with it.

mehdi-cit commented 8 years ago

@trueadm Thanks for the clear answer. I did not have any issue actually. But I like to ask the people in charge when I have doubts (The devil lays in the details).