Giter VIP home page Giter VIP logo

browserify-hogan's People

Contributors

acroyear2 avatar bobthecow avatar callumlocke avatar simenbrekken avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

browserify-hogan's Issues

git push --tags

Hi - would you mind pushing the tags to this repository so that it can be pulled in by package management systems other than npm (eg. bower)?

Export the whole template object?

@sbrekken do you mind if I make the following change to this transform: I want to change it so the compiled module exports the whole Hogan template object, not just the render function. So usage would change to:

var myTemplate = require('./my-template.mustache');
$('body').append( myTemplate.render({foo: 'bar'} );
                             ^^^^^^

reasons:

  • it's more in line with Hogan's docs (they describe a "compiled template" as being an object with a render method, not just a function)
  • it would make it easier to inspect compiled template code (for debugging purposes)... Currently if you console.log the template, you just get function (data) {return template.render(data)}, so you have to go looking in the bundled code.

I just wanted to check if you had any objection before I go ahead and do this, as it's effectively an API change (so I would bump the version to 0.1.0).

Add me as NPM maintainer?

Hey @sbrekken, could you add me as a maintainer on NPM too, so I can publish my update?

npm owner add callumlocke browserify-hogan

Option to include whole Hogan.js library in templates

Comment from @jkrems on issue #2:

Would you be open to making this optional? Not including Hogan quietly disables support for lamdas (e.g. {{#myLamda}}text{{/myLamda}}) which checks for template.c - and since the template itself is not exposed, it's currently impossible to fix from the outside.

gulp-browserify

I use gulp-browserify in my build process and I seem to be getting errors when using this.

I require my template like so:

template: require('../Templates/invoiceDetail.ms'),

but when running gulp I get the following error:

/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/public/app/js/Templates/invoiceDetail.ms:1
<p>Hello</p>
^
ParseError: Unexpected token <
    at wrapWithPluginError (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/index.js:44:10)
    at Stream.<anonymous> (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/index.js:103:28)
    at Stream.<anonymous> (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/index.js:299:22)
    at Stream.EventEmitter.emit (events.js:117:20)
    at Stream.onerror (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/node_modules/stream-combiner/index.js:29:18)
    at Stream.EventEmitter.emit (events.js:117:20)
    at Stream.<anonymous> (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/index.js:527:30)
    at Stream.stream.write (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/node_modules/through/index.js:26:11)
    at Stream.ondata (stream.js:51:26)
    at Stream.EventEmitter.emit (events.js:95:17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.