Web Interface Stack Upgrade #2777
Replies: 2 comments 27 replies
-
Good analysis and I'd like to jump in straight away on your suggestions for potential migrations:
What do you think? |
Beta Was this translation helpful? Give feedback.
-
Hey all, checking in with a hefty update. Following up from last week, I figured out translation with LinguiJS and now translation in the UI is as simple as using the <Trans>SABnzbd Quick-Start Wizard</Trans> <input title={t`Select only if your provider allows SSL connections.`}
... other attributes ...
/> I spent this week migrating There are a few improvements to make regarding routing and data fetching on each page load due to my inexperience with the libraries and patterns, but overall I think this is a good foundation for how most functionality can be migrated. However, now that I have a better idea of what the migration will look like, and before I go much farther, I want to raise some concerns about the decision to introduce a node-based frontend framework to the project. I recently reread https://grugbrain.dev/ (among other essays) and its warnings of the dreaded complexity demon. The section on front-end development struck a chord:
The existing UI is kinda fragmented with different outdated libraries, but the stack is super simple with Python serving the Cheetah templates. With React introduced, there are already a lot of moving pieces:
Even though I haven’t yet explored the requirements of Glitter and the Config, I don’t anticipate too many more big libs for the frontend, but the point stands. After some research, it seems like Cheetah, Knockout.js and jQuery can be replaced with more modern alternatives without devoting ourselves to the heaviness of a JavaScript frontend framework. For example:
While this is a less conventional stack given the state of frontend today, it is simple (and I mean htmx was 2nd in the 2023 JavaScript Rising Stars "Front-end Frameworks" category, #10 overall). You get to keep the benefits and speed of SSR, have relatively few dependencies, and keep everything within the Python backend instead of splitting the frontend. I get the draw to use a JavaScript SPA framework because they are the predominant solution today and there are plenty of resources, but that decision adds a lot of complexity to a previously Python-exclusive project. As we have established that there are few contributors to SABnzbd, so the most important thing is that the stack is easy to digest for existing maintainers. Making the UI in React is doable, but maybe more complicated than SABnzbd really requires. Let me know your thoughts. I would be willing to start a new branch to see what the Jinja/htmx/alpine stack might look like. |
Beta Was this translation helpful? Give feedback.
-
Following up from the beginning of this discussion. I am new to SABnzbd and open source contributing but I saw a need here and feel motivated to make some contributions.
The technologies behind SABnzbd’s UI haven't been updated in some years, with some being leftover from even earlier refactors. Many of the libraries used are old and/or unmaintained, and some obsolete. This discussion is to analyze and understand how the current stack is used and form a plan to migrate to more modern and maintainable alternatives.
The goal is for the change to be transparent to the end-user. Changing the look and feel of the UI is not part of this upgrade plan, but could be a separately-planned project.
I started writing a section on potential UI frameworks but there is a lot to unpack, so I thought it would be wise to split that into a separate discussion after establishing a high-level plan.
Current Stack
These are the libraries involved in the UI from what I've seen poking around the project.
Potential Migrations
Beta Was this translation helpful? Give feedback.
All reactions