toranb / ember-template-compiler

An npm module for the ember-template-compiler.js file that ships with ember.js
MIT License
30 stars 23 forks source link

Expose asObject parameter to precompile function #11

Closed kingpin2k closed 10 years ago

kingpin2k commented 10 years ago

Allow precompilation to return a string instead of an object

rwjblue commented 10 years ago

:+1: from me.

@toranb - any objections?

toranb commented 10 years ago

How will this effect a library in use today? I assume this would be 100% backward compatible :)

rwjblue commented 10 years ago

@toranb - Correct. There is a test showing the results of simply not specifying the param (like current users), specifying a true value, and specifying false. No param, and true result in the same thing (the current output).

kingpin2k commented 10 years ago

Wonderful assumption, as @rjackson pointed out it behaves the same for current users.

toranb commented 10 years ago

sounds legit to me -could you update the README also to show why/how this might be used by another library?

kingpin2k commented 10 years ago

Done and done (and to back the perf claim http://jsperf.com/obj-vs-string)

toranb commented 10 years ago

Can we just include this officially in the 1.3 build (stable) as it should be out in the next week?

rwjblue commented 10 years ago

@toranb - Seems good to me. We are planning on 1.3.0 to come out early in the week anyways.

rwjblue commented 10 years ago

I can't believe that I didn't realize what was happening in this PR. We need to make this change upstream (in Ember itself), as the vendor/ember-template-compiler.js file is overridden upon each published version (to correspond directly to the ember-template-compiler.js that is generated by Ember).

@kingpin2k - I'm very sorry about this. Could you submit a PR to Ember to fix this upstream?

kingpin2k commented 10 years ago

lol, I can't believed I missed that, the vendor folder should have been an instant give away

kingpin2k commented 10 years ago

https://github.com/emberjs/ember.js/pull/4097

rwjblue commented 10 years ago

@kingpin2k - Thank you, and sorry again for the run around.