Skip to content

Hogan.js is unmaintained #435

Open
Open

Description

@SydneyUni-Jim

twitter/hogan.js#272 (2 May 2021)

It's been ~8 years since I seriously worked on this project […] After this work is done, I'll add a note to the README that makes it clear the project is not adding new features, and is in maintenance mode. Serious bugs, such as security issues, will be addressed. New features and performance work can be done in a fork.

The last time a pull request was closed was 8 Jun 2019. The dependencies in hogan.js are becoming deprecated (twitter/hogan.js#270) and security vulnerabilities are being exposed (twitter/hogan.js#276).

Activity

  1. rtfpessoa commented on May 7, 2022

    @rtfpessoa
    Owner

    👋 I understand that it is not being maintained anymore but it has been very stable and fits very well the use case.

    Do you have any alternatives we can use?

    Also AFAIK we have no active vulns http://github.com/rtfpessoa/diff2html/security/dependabot

  2. jgonggrijp commented on Aug 12, 2022

    @jgonggrijp

    @rtfpessoa I'm currently developing Wontache, which can be thought of as a successor of hogan.js (although the code bases are not actually related). I haven't reached the 1.0.0 release yet, but it's fully tested, passes all the official Mustache specs (including the newest) and is even more accurate at whitespace handling than hogan.js. In my own testing, it also seems to be at least as fast as hogan.js, but you might want to try that for yourself on a feature branch.

    The API is slightly different, the compiler returns a function that you can then call with the data:

    import mustache from 'wontache';
    
    const templateText = 'Interpolate {{variable}} here.';
    const compiledTemplate = mustache(templateText);
    const renderedOutput = compiledTemplate({variable: 'foo'});
    // 'Interpolate foo here.'

    While I'm not proud enough yet to draw a lot of attention to Wontache, I would definitely welcome diff2html as a first serious outside user.

  3. rtfpessoa commented on Aug 12, 2022

    @rtfpessoa
    Owner

    👋 @jgonggrijp did a quick test and seems like it works.

    For me the most important things missing are:

    • Typescript types support
    • Seems like codegen is not optimal since some functions have unused parameters, for example
    • Would be great to have a script to pre-compile templates into a file that you can bundle in your app like hulk.js did and similar to what I did in this PR

    Do you think these are things you will be interested in doing?

  4. jgonggrijp commented on Aug 13, 2022

    @jgonggrijp

    @rtfpessoa Yes, the first and the last point are planned. Please clarify the middle point!

  5. jgonggrijp commented on Aug 13, 2022

    @jgonggrijp

    Potentially relevant issue tickets, in case you want to track them:

  6. rtfpessoa commented on Sep 2, 2022

    @rtfpessoa
    Owner

    Do you have any ideas for timelines here?

  7. jgonggrijp commented on Sep 3, 2022

    @jgonggrijp

    As far as order is concerned, the development board conveys best how I prioritize the issues. I want to finish the evaluation release milestone this year if I can help it, and the official launch milestone as soon as possible after that.

    As far as calendar time is concerned, unfortunately I can spend at most two days a week on my open source libraries and I have to divide my attention between Wontache, Backbone and Underscore (I took over maintainance of the latter two from the original author). I get to it whenever I get to it, so I cannot promise any particular date.

    If you are seriously considering to use Wontache, please let me know which issues are the most important to you. The priorities are somewhat flexible; in fact, I already moved the WebPack plugin up because it seemed relevant to diff2html and I expect it to be quick to implement.

    (Also, please consider donating to my Patreon and recruiting other people to do so. Given substantial sponsorship, I might be able to increase my time investment in open source libraries such as Wontache.)

    By the way, you mentioned this earlier:

    • Seems like codegen is not optimal since some functions have unused parameters, for example

    Please clarify.

  8. t1m0thyj commented on Sep 13, 2022

    @t1m0thyj

    @rtfpessoa Would it be possible to publish the 3.0.0-beta.1 tag in the "use-wontache" branch to NPM, since all tests are passing? My team would like to use diff2html but we are not allowed to use deprecated/unmaintained packages. Thanks! 🙏

  9. rtfpessoa commented on Sep 14, 2022

    @rtfpessoa
    Owner

    @t1m0thyj I just released version 3.4.20-usewontache.1.60e7a2e with the initial wontache implementation.

  10. t1m0thyj commented on Sep 16, 2022

    @t1m0thyj

    Thanks for the quick response! So far the beta version seems to be working well for us.

    In case anyone else wants to try it out in a TypeScript project, here's what I did to work around wontache not having type definitions yet. I created a file __types__/wontache.d.ts:

    // Remove this file once wontache adds type definitions
    declare module 'wontache' {
        type CompiledTemplate = any;
        type Partials = any;
    }

    and added this to tsconfig.json:

      "files": [
        "./__types__/wontache.d.ts"
      ]
  11. rtfpessoa commented on Sep 16, 2022

    @rtfpessoa
    Owner
  12. jgonggrijp commented on Oct 16, 2022

    @jgonggrijp

    @rtfpessoa I just released Wontache version 0.2.0, which has a couple of new features and bugfixes, as well as a breaking change in the way precompiled templates are represented.

    Along with this new version, I released the new packages rollup-plugin-wontache and wontache-loader. You can use the latter for bundling your templates with your code directly with webpack, so you (hopefully) don't need the custom logic in scripts/hulk.ts anymore. I also published a new playground where you can try all wontache features from your browser (including partials and parents).

    Update: added more links for convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions