tickety-tick icon indicating copy to clipboard operation
tickety-tick copied to clipboard

New template engine

Open pmeinhardt opened this issue 2 years ago • 1 comments

Description

This integrates LiquidJS for rendering branch, commit and command templates in Tickety-Tick. This adds the following features:

  • Additional filters, see: https://liquidjs.com/filters/overview.html
  • Conditionals, loops etc.: https://liquidjs.com/tags/overview.html

to use inside templates.

The syntax is similar to, but not the same as the template syntax previously used by Tickety-Tick.

Most importantly, LiquidJS does not use eval() or new Function():

When released, we should publish an announcement and migration guide, possibly find a way of showing a notification in the browser/extension popup to notify users about the breaking changes and the need to update custom templates in the extension settings.

State

This still needs further testing to verify it provides the desired functionality for all supported browsers. So far I've tested in Firefox which seems to work well.

TODO:

  • [ ] Check browser-support more thoroughly:
    • [ ] Firefox
    • [ ] Chrome
    • [ ] …
  • [ ] Update settings page
    • [ ] Simplify state handling, async preview updates etc.
    • [ ] Improve layout for the longer list of template filters at the bottom
    • [ ] Update tests
  • [ ] Check whether we want to notify users about the changed template syntax in the extension popup and/or options page (for those who use customized templates)
  • [ ] Create template migration guide?
    • [ ] lowercase => downcase
    • [ ] …
    • [ ] changed syntax for passing filter params

Relates to #372.

pmeinhardt avatar Apr 02 '23 10:04 pmeinhardt

Some ideas 🧠

  • Link the filter names on the setting screen to their documentation (e.g https://liquidjs.com/filters/escape.html)
  • For the breaking changes (break existing custom templates):
    • store Tickety-Tick version with customizations
    • if a person has a customization without version, show them a migration hint in the popup window (link to a MIGRATION.md in the repo or the release notes)

klappradla avatar Apr 04 '23 21:04 klappradla

Hey @pmeinhardt 👋

As this topic did not come up again for more than a year now, I'd vote to close this and stick to the templates as they are for now. I would want to avoid introducing more complexity if not absolutely necessary. And as it seems right now, only a fraction of users even makes use of the template customizations 😉

Feel free to reopen whenever you want and be sure to have me on board for it 💚

klappradla avatar Jun 28 '24 11:06 klappradla