orhun / git-cliff

A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️
https://git-cliff.org
Apache License 2.0
9.3k stars 199 forks source link

Change to MiniJinja #791

Open pando85 opened 3 months ago

pando85 commented 3 months ago

Is there an existing issue or pull request for this?

Feature description

I think that changing the template engine to MiniJinja will be a notable improvement in templates.

Desired solution

Replace Tera with MiniJinja

Alternatives considered

Keep using Tera.

Additional context

No response

welcome[bot] commented 3 months ago

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

alerque commented 3 months ago

Why? Personally the use of Tera was one of the things that stood out in git cliff's favor when I was first considering using it. What is the perceived problem with Tera and why would Minijinja be better?

pando85 commented 3 months ago

There are multiple points about user experience which I think are the most important.

MiniJinja works better in a sense that overpass all the limitations that Tera V2 is trying to fix. For example, Tera doesn't support parenthesis for operations priority. These limitations are recognized by his own author.

Also, MiniJinja syntax is widely known because it is compatible with Jinja2.

I'm not saying that Tera is not a good software. I've loved and used it for a long time. But I think that MiniJinja is better and it can be a personal opinion but I wanted to bring the discussion here.

Furthermore, this is not an easy change because it implies a breaking change but probably Tera V2 is going to have similar problems.

Cyclonit commented 3 months ago

Can you provide a couple of examples of syntax that is supported by MiniJinja but not Tera? A list of breaking changes would be nice too.

pando85 commented 3 months ago

The things from this list: https://github.com/Keats/tera/issues/637

Plus the syntax is fully compatible with Jinja2.

orhun commented 3 months ago

I think this will be a significant breaking change. However, I'm curious about the possibility of supporting MiniJinja with a feature flag for users who might prefer it over Tera (e.g. --features minijinja-templates).

But I'm not still sure if it is worth it. @pando85 what was the feature you needed the most in MiniJinja which Tera does not have?

pando85 commented 3 months ago

I don't have anything special. I want to bring here the discussion. From my perspective it can be a better solution for the future. Probably it could be better just to wait to see what happen with https://github.com/Keats/tera2 which seems that it is already in beta.

Which seems clear to me is that Tera (v1) is going to be deprecated soon.

orhun commented 3 months ago

Ooh, I didn't know about the existence of that repository. Thanks for sharing!

Which seems clear to me is that Tera (v1) is going to be deprecated soon.

It's definitely exciting :)