Skip to content
This repository was archived by the owner on Dec 23, 2020. It is now read-only.
This repository was archived by the owner on Dec 23, 2020. It is now read-only.

Support for Handlebars 3.x #1

@SteveCostello

Description

@SteveCostello

This is a great piece of work. I'm pretty surprised that this has not received more visibility. It's a complete lifesaver for our situation, where we do not want to have to install Grunt and whatnot to our VisualStudio developer's machines. So, thank you for that.

That said, is there any way to support the latest Handlebars release in this? I see that Handlebars 1.3 is used as the initial source. If someone used Handlebars 3.x (and specifically, the runtime) in their project, Templar no longer works.

I found a quick-ish sort of way around this. I replaced the handlebars.js in the Templar project with the latest version of Handlebars. It builds, and the website that depends on the Templar.dll builds, however, the site returns a YSOD on the first page, saying that "window is not defined." After poking around, I see these lines in two places (starting around lines 708 and 3280 or so) in the new version of Handlebars:

        /*jshint -W040 */
        /* istanbul ignore next */
        var root = typeof global !== 'undefined' ? global : window,
            $Handlebars = root.Handlebars;
        /* istanbul ignore next */
        Handlebars.noConflict = function () {
            if (root.Handlebars === Handlebars) {
                root.Handlebars = $Handlebars;
            }
        };

Removing these lines of code seems to fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions