forgejo/discussions
49
43

Direction of the frontend #338

Open
opened 2025年04月27日 16:45:51 +02:00 by moonglum · 10 comments

I'm an experienced frontend dev, and would love to help in the frontend part of Forgejo. I'm also happy and experienced to do modernization efforts in this area. But right now, I'm not sure what the target setup for the frontend is. I found the discussion #73, but it has not been active in a while. But I get the impression that you want to reduce the usage of JS in general. Am I right in that?

Looking through the dependencies and code, I see:

  • Vue.js
  • jQuery
  • htmx (with idiomorph)
  • If I'm not mistaken, bootstrap is in this project, but only the JS part and not CSS.

Which of those frameworks/libraries do you want to keep in the project? Do you want to go Vanilla.js? Which ones would you like to see removed?

PS: This is not in any way a critique, I understand that this project went through many transitions. But to contribute to it, I want to understand where you intend to move to.

I'm an experienced frontend dev, and would love to help in the frontend part of Forgejo. I'm also happy and experienced to do modernization efforts in this area. But right now, I'm not sure what the target setup for the frontend is. I found the discussion #73, but it has not been active in a while. But I get the impression that you want to reduce the usage of JS in general. Am I right in that? Looking through the dependencies and code, I see: * Vue.js * jQuery * htmx (with idiomorph) * If I'm not mistaken, bootstrap is in this project, but only the JS part and not CSS. Which of those frameworks/libraries do you want to keep in the project? Do you want to go Vanilla.js? Which ones would you like to see removed? PS: This is not in any way a critique, I understand that this project went through many transitions. But to contribute to it, I want to understand where you intend to move to.

@jak2k is looking at removing some jQuery code, so he is interested in this question as well.

@jak2k is looking at removing some jQuery code, so he is interested in this question as well.
Member
Copy link

But I get the impression that you want to reduce the usage of JS in general. Am I right in that?

Yes

Which of those frameworks/libraries do you want to keep in the project? Do you want to go Vanilla.js? Which ones would you like to see removed?

From what I remember/know, this the current plan is:

We want to get rid of jQuery over time and probably Vue as well. Htmx should just be an add-on (prevent complete page reloads when js is available). If js is needed vanilla js is the preferred way. 🤔

Multiple people working on the UI side are also available at https://matrix.to/#/#forgejo-ui:matrix.org 😃

> But I get the impression that you want to reduce the usage of JS in general. Am I right in that? Yes > Which of those frameworks/libraries do you want to keep in the project? Do you want to go Vanilla.js? Which ones would you like to see removed? From what I remember/know, this the current plan is: We want to get rid of jQuery over time and probably Vue as well. Htmx should just be an add-on (prevent complete page reloads when js is available). If js is needed vanilla js is the preferred way. 🤔 Multiple people working on the UI side are also available at https://matrix.to/#/#forgejo-ui:matrix.org 😃

Thanks, @Beowulf ! That helps 🙇 I'm happy to start working on removing jQuery step by step. Then we can continue with Vue after that 😉

I will set up a Matrix account, and join sometime in the next days 😄

Thanks, @Beowulf ! That helps 🙇 I'm happy to start working on removing jQuery step by step. Then we can continue with Vue after that 😉 I will set up a Matrix account, and join sometime in the next days 😄
Member
Copy link

@jak2k got a bit far with figuring out why it's difficult to remove the jQuery code and seemed to know his stuff, perhaps it might make sense to include him if he feels like participating further. :)

@jak2k got a bit far with figuring out why it's difficult to remove the jQuery code and seemed to know his stuff, perhaps it might make sense to include him if he feels like participating further. :)

Of course, happy to work with @jak2k <3 Let me know which parts you are working on right now, so we don't work on the same thing. Also happy to provide feedback if you want any!

Of course, happy to work with @jak2k <3 Let me know which parts you are working on right now, so we don't work on the same thing. Also happy to provide feedback if you want any!

I was also thinking about starting a similar discussion, not necessarily only regarding the JS dependencies but also the CSS ones, since I asked myself multiple times whether I should use things like Fomantic, or Tailwinds of rather try to implement new features without using these frameworks.

From my point of view a great first step would be if a consensus can be reached amoung the core contributors regarding what frameworks are still considered for the long run and which should be avoided; and the conclusions should be communicated at least as recommendations for new contributions.

I was also thinking about starting a similar discussion, not necessarily only regarding the JS dependencies but also the CSS ones, since I asked myself multiple times whether I should use things like Fomantic, or Tailwinds of rather try to implement new features without using these frameworks. From my point of view a great first step would be if a consensus can be reached amoung the core contributors regarding what frameworks are still considered for the long run and which should be avoided; and the conclusions should be communicated at least as recommendations for new contributions.

whether I should use things like Fomantic, or Tailwinds

Fomantic seems to provide things like dropdowns and dialogs and is the reason jQuery is still needed. Moving away from it, at least on the JS side, is probably a good thing.

Tailwind just moves the styles into the HTML, which means a lot of templating would be required to achieve a proper design system. I think vanilla CSS with some variables is a much better solution.

> whether I should use things like Fomantic, or Tailwinds Fomantic seems to provide things like dropdowns and dialogs and is the reason jQuery is still needed. Moving away from it, at least on the JS side, is probably a good thing. Tailwind just moves the styles into the HTML, which means a lot of templating would be required to achieve a proper design system. I think vanilla CSS with some variables is a much better solution.

I agree with jak2k on the direction of CSS 👍

For JS, I think we should step by step move to vanilla JS with custom elements. There might be some complex components for which Vue is a good fit, but I think we should discuss them on a case by case basis.

I agree with jak2k on the direction of CSS 👍 For JS, I think we should step by step move to vanilla JS with custom elements. There might be some complex components for which Vue is a good fit, but I think we should discuss them on a case by case basis.

For JS, I think we should step by step move to vanilla JS with custom elements.

I think we don't even need custom elements for many simple things. Confirmation dialogs could be a simple as a global confirm function that uses the native element. (Browser support is at 96.31%). Dropdowns can use the native elements too with some progressive enhancement (JS for autocomplete; CSS with the new picker selector, which is only at 58.53%).

I don't think keeping Vue for the more complex ones would hurt anyone, as JS is required for them anyway.

> For JS, I think we should step by step move to vanilla JS with custom elements. I think we don't even need custom elements for many simple things. Confirmation dialogs could be a simple as a global confirm function that uses the native element. (Browser support is at 96.31%). Dropdowns can use the native elements too with some progressive enhancement (JS for autocomplete; CSS with the new picker selector, which is only at 58.53%). I don't think keeping Vue for the more complex ones would hurt anyone, as JS is required for them anyway.

Concerning my own question:

I asked myself multiple times whether I should use things like Fomantic, or Tailwinds of rather try to implement new features without using these frameworks.

@Gusted wrote in forgejo/forgejo#8694 (comment):

It's possible to migrate to tailwind v4... but time is better spent to just move away from tailwind. Their new usage is incompatible with the current layout Forgejo uses for CSS.

Concerning my own question: > I asked myself multiple times whether I should use things like Fomantic, or Tailwinds of rather try to implement new features without using these frameworks. @Gusted wrote in https://codeberg.org/forgejo/forgejo/pulls/8694#issuecomment-6014062: > It's possible to migrate to tailwind v4... but time is better spent to just move away from tailwind. Their new usage is incompatible with the current layout Forgejo uses for CSS.
Sign in to join this conversation.
No Branch/Tag specified
No results found.
No results found.
Labels
Clear labels
User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
forgejo/discussions#338
Reference in a new issue
forgejo/discussions
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?