iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
15.61k stars 1.71k forks source link

[Enhancement] Migrate from ECR to another templating language #4483

Open syeopite opened 4 months ago

syeopite commented 4 months ago

Is your enhancement request related to a problem? Please describe.

ECR files are loaded at compile time. This causes two problems:

  1. A lengthily compilation time
  2. A requirement to recompile Invidious each time the templates are updated contributing to a bad developer experience.

Describe the solution you'd like

Invidious should migrate to a runtime based templating engine such as https://github.com/straight-shoota/crinja

Describe alternatives you've considered

Keep it as-is

Additional context

SamantazFox commented 2 months ago

I wasn't aware that straight-shoota ported Jinja templates to Crystal, that's great :D While that's low priority, moving to Jinja templates might be a good step towards community-made themes! (See https://github.com/iv-org/invidious/issues/4113#issuecomment-1732572843)

ChunkyProgrammer commented 2 months ago

Is there still a way to validate that the templates don't have runtime errors at compile time? I imagine not, but I'm asking because these errors likely wouldnt be caught by the CI workflow

SamantazFox commented 1 month ago

@ChunkyProgrammer I don't think so. I'm pretty sure we'll need to mock some responses and curl/wget some pages in the CI (so to speak, I think there are some proper test frameworks for web apps in crystal).