Closed foxyblocks closed 11 years ago
Are you getting any errors in JS inspector in the browser?
No. I have a demo on a branch for a brunch skeleton I've been working on. https://github.com/wordofchristian/brunch-with-hampsters/tree/emblem
Steps:
> git clone https://github.com/wordofchristian/brunch-with-hampsters
> cd brunch-with-hampsters
> git checkout emblem
> npm install && brunch watch --server
It's possible that the outlet
helper isn't functioning and that's why the index isn't being rendered.
I tried adding a linkTo helper to application.emblem:
li
linkTo "index"
and I got Uncaught Error: Could not find property 'linkTo'
Could you paste the JS inspector output of Ember.TEMPLATES["application"].toString() and Ember.TEMPLATES["index"].toString() ? My hunch is that vanilla handlebars is being used, not emberized handlebars
On Wed, Feb 20, 2013 at 2:51 PM, Christian Schlensker < notifications@github.com> wrote:
It's possible that the outlet helper isn't functioning and that's why the index isn't being rendered.
I tried adding a linkTo helper to application.emblem:
li linkTo "index"
and I got Uncaught Error: Could not find property 'linkTo'
— Reply to this email directly or view it on GitHubhttps://github.com/machty/emblem-brunch/issues/1#issuecomment-13852559.
Alex Matchneer Co-Founder and Lead Dev Useful Robot LLC http://usefulrobot.io (614) 395-8832
That's what I was thinking too.
Also here's what's getting compiled and joinedTo app.js
window.require.register("templates/application", function(exports, require, module) {
module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
this.compiledVersion = '1.0.rc.2';
helpers = helpers || Handlebars.helpers; data = data || {};
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
buffer += "<div class=\"container-fluid\"><div class=\"navbar\"><div class=\"navbar-inner\"><a class=\"brand\">Hampsters</a><ul class=\"nav\"><li class=\"active\"><a>Home</a></li><li></li><li><a>Link</a></li></ul></div></div><p>Find me in <code>app/templates/application.emblem</code>";
if (stack1 = helpers.outlet) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.outlet; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</p></div>";
return buffer;
});
});
window.require.register("templates/index", function(exports, require, module) {
module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
this.compiledVersion = '1.0.rc.2';
helpers = helpers || Handlebars.helpers; data = data || {};
return "<h1>this is my index</h1>";
});
});
Ok, stay tuned, we're currently taming dependency hell between ember-handlebars, and new releases, and handlebars runtime mismatches. I'll be taking care of this shortly. Sorry for the holdup in the meantime
On Wed, Feb 20, 2013 at 3:26 PM, Christian Schlensker < notifications@github.com> wrote:
That's what I was thinking too. [image: Screen Shot 2013-02-20 at 12 23 26 PM]https://f.cloud.github.com/assets/555044/177613/b010cbfa-7b9b-11e2-8128-227d2fa6f0ff.png
Also here's what's getting compiled and joinedTo app.js
window.require.register("templates/application", function(exports, require, module) { module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { this.compiledVersion = '1.0.rc.2'; helpers = helpers || Handlebars.helpers; data = data || {}; var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
buffer += "<div class=\"container-fluid\"><div class=\"navbar\"><div class=\"navbar-inner\"><a class=\"brand\">Hampsters</a><ul class=\"nav\"><li class=\"active\"><a>Home</a></li><li></li><li><a>Link</a></li></ul></div></div><p>Find me in <code>app/templates/application.emblem</code>"; if (stack1 = helpers.outlet) { stack1 = stack1.call(depth0, {hash:{},data:data}); } else { stack1 = depth0.outlet; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } buffer += escapeExpression(stack1) + "</p></div>"; return buffer; });});window.require.register("templates/index", function(exports, require, module) {
module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { this.compiledVersion = '1.0.rc.2'; helpers = helpers || Handlebars.helpers; data = data || {};
return "<h1>this is my index</h1>"; });});
— Reply to this email directly or view it on GitHubhttps://github.com/machty/emblem-brunch/issues/1#issuecomment-13854400.
Alex Matchneer Co-Founder and Lead Dev Useful Robot LLC http://usefulrobot.io (614) 395-8832
Perhaps you could help me out though: one of the major refactors to emblem was to split out Handlebars from it, so that when you compile, you need to provide it the handlebars variant that you're using, either Handlebars or Ember.Handlebars. I'm not certain how to handle these two different cases in a brunch setting; in ember-rails, it assumes Ember.Handlebars, unless the template has .raw.emblem in the name. Would this be consistent with a brunch pattern?
On Wed, Feb 20, 2013 at 3:35 PM, Alex Matchneer machty@gmail.com wrote:
Ok, stay tuned, we're currently taming dependency hell between ember-handlebars, and new releases, and handlebars runtime mismatches. I'll be taking care of this shortly. Sorry for the holdup in the meantime
On Wed, Feb 20, 2013 at 3:26 PM, Christian Schlensker < notifications@github.com> wrote:
That's what I was thinking too. [image: Screen Shot 2013-02-20 at 12 23 26 PM]https://f.cloud.github.com/assets/555044/177613/b010cbfa-7b9b-11e2-8128-227d2fa6f0ff.png
Also here's what's getting compiled and joinedTo app.js
window.require.register("templates/application", function(exports, require, module) { module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { this.compiledVersion = '1.0.rc.2'; helpers = helpers || Handlebars.helpers; data = data || {}; var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
buffer += "<div class=\"container-fluid\"><div class=\"navbar\"><div class=\"navbar-inner\"><a class=\"brand\">Hampsters</a><ul class=\"nav\"><li class=\"active\"><a>Home</a></li><li></li><li><a>Link</a></li></ul></div></div><p>Find me in <code>app/templates/application.emblem</code>"; if (stack1 = helpers.outlet) { stack1 = stack1.call(depth0, {hash:{},data:data}); } else { stack1 = depth0.outlet; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } buffer += escapeExpression(stack1) + "</p></div>"; return buffer; });});window.require.register("templates/index", function(exports, require, module) {
module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { this.compiledVersion = '1.0.rc.2'; helpers = helpers || Handlebars.helpers; data = data || {};
return "<h1>this is my index</h1>"; });});
— Reply to this email directly or view it on GitHubhttps://github.com/machty/emblem-brunch/issues/1#issuecomment-13854400.
Alex Matchneer Co-Founder and Lead Dev Useful Robot LLC http://usefulrobot.io (614) 395-8832
Alex Matchneer Co-Founder and Lead Dev Useful Robot LLC http://usefulrobot.io (614) 395-8832
Check out https://github.com/chrixian/ember-precompiler-brunch
It has you specify the path to ember, handlebars, and jquery so it doesn't have to worry about conflicting dependencies.
I'm currently using it in my master branch https://github.com/wordofchristian/brunch-with-hampsters
You could maybe make the ember dependency optional and only use ember-handlebars when it's provided.
Here's a gist comparing the output of emblem-brunch and ember-precompiler-brunch: https://gist.github.com/wordofchristian/4998646
+1 for specifying paths
fixed by #2 when that's merged.
Just merged #2, can I close this? just need you to run through and see if it's fixed.
Yeah. Looks good now.
What's the recommended way to make ember aware of the templates when using this plugin?
For instance if I have
app/templates/application.emblem
which contains:{{outlet}}
As well as
app/templates/index.emblem
which contains some other html.I would expect that if I require both of those files and do a simple
window.App = Em.Application.create();
. Then visiting the homepage would render the application template with index template inside of it.So far I've been able to get application template rendering automatically by using:
but I haven't been able to get it to also include the
index
.Using
Ember.TEMPLATES['index'] = require('templates/index');
doesn't seem to do anything.