gruntjs/grunt-contrib-handlebars

Partial registration happening before namespace defined

Closed this issue · 14 comments

Since 0.9x partials are registering before their namespace is defined.

Problem is same as described in #122. Though I don't feel like the solution provided is correct.

@vladikoff What is the process to get this PR reviewed and merged? It was opened in October.
Thanks!

It appears to be a bit less straight forward than just a flag not being respected. Digging in some more.

OK, the problems occurs when you have partials namespaces and you have multiple templates, with at least one of them ordered before the partials in the configuration.

Example below:

      partials_use_namespace_multiple_templates: {
        options: {
          partialsUseNamespace: true
        },
        files: {
          'tmp/partials_use_namespace_multiple_templates.js': ['test/fixtures/has-spaces.hbs',
            'test/fixtures/_partial.hbs', 'test/fixtures/one.hbs']
        }
      },

Will result in the follow generation:

  1. partial registration
  2. namespace declaration
  3. helper registration

@lazd This issue relates to work done in commit 373d402

A stop-gap for anyone running into this is to pre-order your partials in-front of your templates in your configuration.

Going through CLA right now and will have a PR shortly.

lazd commented

Fixed and released as grunt-contrib-handlebars@0.9.3.

@pivotal-vanguard This should be solved at 0.9.3

This is still causing me problems as of 0.9.3. I am running Handelbars 2.0.0 with grunt-contrib-handlebars 0.9.3

lazd commented

@dylanrhysscott can you put together a small test case and provide the output you're getting so we can troubleshoot it?

Also, please triple check your installed version. Thanks!