Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds options.handlebarsNamespace #96

Closed
wants to merge 1 commit into from
Closed

Adds options.handlebarsNamespace #96

wants to merge 1 commit into from

Conversation

jamesplease
Copy link
Member

Fixes #69 if we want to add it.

@Kerrick, wanna take a look at this and see if it suits your needs? @trojjer as well. I wouldn't use it myself, so I'd like your thoughts.

// cc @tkellen; do you think this is a worthwhile option?

@tkellen
Copy link
Member

tkellen commented Feb 21, 2014

I'm not thrilled about adding yet another option to this task, but if we do, maybe rename the option to something like handlebarsVariable and force the user to provide the full path? e.g. MyApp.Handlebars. That way if some weird person wants to run Handlebars under a totally different name they can do that too.

@jamesplease
Copy link
Member Author

I'm not thrilled about adding yet another option to this task

Yeah, same. There were (at least) two issues made about it, though, so I'm sure there are even more people who are looking for the functionality.

maybe rename the option to something like handlebarsVariable and force the user to provide the full path?

Agreed on both counts.

@Kerrick / @trojjer, I'd like to hear your thoughts.

@lazd
Copy link
Contributor

lazd commented Aug 3, 2014

I don't think this is the right way to go about this. Instead of taking handlebarsNamespace and passing the template to handlebarsNamespace.Handlebars.template(), the entire path should be customizable.

For instance, if you wanted templates to be passed to MyNS.doHandlebarsReg(), you should be able to do so. An appropriate name for this would be wrapper.

@jd327
Copy link

jd327 commented Dec 5, 2014

+1

Edit: Any ETA on this?

@lazd
Copy link
Contributor

lazd commented Dec 5, 2014

@jmeas any thoughts on my comment above?

@jd327
Copy link

jd327 commented Dec 5, 2014

Honestly, any solution to wrap Handlebars would be better than nothing. In the meantime, for anyone else having the same issues, I've "glued it together" in my own project by using https://github.com/outaTiME/grunt-replace immediately after grunt-contrib-handlebars task:

replace: {
    example: {
        options: {
            usePrefix: false,
            patterns: [{
                match: /Handlebars\./g,
                replacement: 'MyApp.Handlebars.'
            }]
        },
        files: [
            {
                expand: true,
                flatten: true,
                src: 'build/templates.js',
                dest: 'build/'
            }
        ]
    }
}

...which feels like a crime doing this, but it works. Until this issue is fixed anyway.

@sindresorhus
Copy link
Member

Closing for lack of activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handlebars Namespace config
5 participants