Open tunnckoCore opened 9 years ago
I agree with the fact that render
is a better name for the function; but, fn
accurately distinguishes itself with the other property in the object, dependencies
. (What I'm saying is that you can totally tell dependencies
is an array, and fn
is the compiled function, since well, it came from the compile
function and is named after function.)
Another thing to keep in mind is that even though jstransformer is still @<1 (albeit for quite some time), a few people have started using it so it wouldn't be nice to just break it without a technical reason for such.
Another thing to keep in mind is that even though jstransformer is still @<1
exactly, because of that, this change shouldn't be a problem.
Actually, I think this change would be a really good idea. We could have it return both render
and renderAsync
(which we would polyfill for synchronous FNs). We could also add the fn
property for backwards compatibility, but deprecate it.
We could have it return both render and renderAsync (which we would polyfill for synchronous FNs)
:+1:
We could also add the fn property for backwards compatibility, but deprecate it.
we can just bump major. JSTransformer is baby, it's normal to have changes and dont have notices as per 0.0.x. There's would have too much things in the returned object and may goes more complicated.
Sounds good. If we were to do this, I'd just remove fn
as @tunnckoCore said.
It's more natural and logical for me. Talking about
.fn
which is (in object) returned fromcompile
method.