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

1.9.0-alpha has a breaking change from 1.7.0 #24

Open jaswilli opened 9 years ago

jaswilli commented 9 years ago

1.9.0-alpha has a breaking change. You can produce it running the example code that's in README.md:

var fs = require('fs');
var compiler = require('ember-template-compiler');

var template = fs.readFileSync('foo.handlebars').toString();
var input = compiler.precompile(template).toString();
var output = "Ember.TEMPLATES['foo'] = Ember.Handlebars.template(" + input + ");";

console.log(output);

Output with ember-template-compiler@1.9.0-alpha: Ember.TEMPLATES['foo'] = Ember.Handlebars.template([object Object]);

Output with ember-template-compiler@1.7.0:

Ember.TEMPLATES['foo'] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};

  data.buffer.push("<div>something</div>\n\n");

});
rwjblue commented 9 years ago

I will update the README, but the second param to compile was previously defaulted to false and now it is defaulted to true. I believe that we can mitigate this in Ember. Stay tuned....

jaswilli commented 9 years ago

Any chance of publishing a 1.9.1 that uses Handlebars ~1 and then making the version that uses Handlebars 2 2.0.0-alpha so that things using this with semver ranges won't be broken?

rwjblue commented 9 years ago

Ember 1.9.0 will require Handlebars 2.0, and this library is in lock-step with the Ember version. See http://emberjs.com/blog/2014/10/16/handlebars-update.html for details.

jaswilli commented 9 years ago

Got it. It's a bummer for packages depending on this (that aren't Ember) but I get the rationale.

rwjblue commented 9 years ago

Yes, I agree, and we are definitely still iterating and trying to make this as straight forward as possible for folks once 1.9.0 enters beta.

parkr commented 9 years ago

I looked high and low and couldn't find Ember's (or this project's) versioning scheme. If not SemVer, how is Ember being versioned?

parkr commented 9 years ago

Given that other libraries are depending upon this module (even if that was not the intention, it is the truth) without using it via Ember, it would be phenomenal if you can revert the breaking change until Ember hits 2.0.

TylerNHansen commented 9 years ago

Ember uses SemVer: http://emberjs.com/blog/2013/09/06/new-ember-release-process.html#comment-1037826164

mhenley-uk commented 9 years ago

+1