gruntjs / grunt-contrib-handlebars

Precompile Handlebars templates to JST file.
http://gruntjs.com/
MIT License
282 stars 126 forks source link

Fix #108 side effect #131

Open stephanebachelier opened 9 years ago

stephanebachelier commented 9 years ago

See https://github.com/gruntjs/grunt-contrib-handlebars/issues/108#issuecomment-68934254 about #108 being backward incompatible with AMD namespace with dots.

lostthetrail commented 9 years ago

Cloned from comment in: https://github.com/gruntjs/grunt-contrib-handlebars/issues/108

@stephanebachelier Ah drat. I noticed something that might still be problematic.

If you have a function that returns a dot based namespace, you will still have the issue.

var myVar = 'FooVar';

namespace: function() {
    return 'Foo.Templates.' + myVar;
}
lostthetrail commented 9 years ago

@stephanebachelier No updates?

stephanebachelier commented 9 years ago

@lostthetrail sorry did not had the time before to complete my patch. Will push an update tomorrow.

lostthetrail commented 9 years ago

@stephanebachelier Any updates?

stephanebachelier commented 9 years ago

@lostthetrail I had issue to rebase my work on master. Regarding a function which return dots, is the namespace function always returning the same value ?

Are you using the filename variable like this:

          namespace: function(filename) {
            return 'JST.templates.' + filename;
          }
lostthetrail commented 9 years ago

Not exactly your example.

grunt.config(['handlebars', namespace], {
   options: {
       namespace: function() {
           return 'MyBiz.template.' + namespace
       }
   },
   files: [...]
});
stephanebachelier commented 9 years ago

@lostthetrail thank for you answer, I will add a test with your example.

lostthetrail commented 9 years ago

@stephanebachelier Did this ever happen?