No-Javascript support for Forgejo #239

Open
opened 2024-11-18 00:26:25 +01:00 by fnetX · 2 comments
Owner

Repeatedly, we get requests from users who ask for supporting browsers without Javascript for various reasons. Sometimes they come as "bug reports", sometimes as "feature requests", but it doesn't really matter.

Many in the Forgejo community would like to rely less on Javascript, not only for "idelogical" reasons (i.e. not wanting to run Javascript), but for reasons such as performance and accessibility, too.

I propose the following to classify requests by users:

  • Forgejo should work for "guests" without Javascript: Users who visit Forgejo repositories and have Javascript disabled should not require enabling Javascript in order to get a read-only view of Forgejo. Something which does not work properly can be reported as a bug or feature request.
  • Forgejo requires Javascript in order to interact with the site. Behaviour for logged-in users requires Javascript and we will not actively consider changing this until we know that the first point was addressed.
  • We do not encourage anyone to work on the "no JavaScript" goal. We focus on fixing bugs and improving both accessibility and performance. And we might prefer no-JS solutions to achieve that goal. But we will happily review and accept contributions to allow working without Javascript.

The latter means that we might, some day, allow navigation without or with less Javascript. But it's not an active issue.

Some related issues (there are a lot more, but you can get an idea):

Repeatedly, we get requests from users who ask for supporting browsers without Javascript for various reasons. Sometimes they come as "bug reports", sometimes as "feature requests", but it doesn't really matter. Many in the Forgejo community would like to rely less on Javascript, not only for "idelogical" reasons (i.e. not wanting to run Javascript), but for reasons such as performance and accessibility, too. I propose the following to classify requests by users: - Forgejo should work for "guests" without Javascript: Users who visit Forgejo repositories and have Javascript disabled should not require enabling Javascript in order to get a read-only view of Forgejo. Something which does not work properly can be reported as a bug or feature request. - Forgejo requires Javascript in order to interact with the site. Behaviour for logged-in users requires Javascript and we will not actively consider changing this until we know that the first point was addressed. - We do not encourage anyone to work on the "no JavaScript" goal. We focus on fixing bugs and improving both accessibility and performance. And we might prefer no-JS solutions to achieve that goal. But we will happily review and accept contributions to allow working without Javascript. The latter means that we might, some day, allow navigation without or with less Javascript. But it's not an active issue. Some related issues (there are a lot more, but you can get an idea): - https://codeberg.org/forgejo/forgejo/issues/1634 - https://codeberg.org/forgejo/forgejo/issues/5839 - https://codeberg.org/forgejo/forgejo/issues/1632 - https://codeberg.org/forgejo/forgejo/issues/1633

I can outline some concrete goals for moving towards no-JavaScript support:

  • Use CSS instead of JS for UI whenever possible (e.g. forgejo/design#23)
  • Use native HTML elements instead of JS (e.g. replace divs with data-url to anchor tags with href)

A lot of this can be accomplished simply by editing the template files and some CSS. I would say this already fixes 90% of the functionality. Honestly Forgejo already works quite well without JavaScript, so it shouldn't be too much work. I'm not too familiar with the internals of Fomantic-UI, so maybe I'm missing something.

I can outline some concrete goals for moving towards no-JavaScript support: - Use CSS instead of JS for UI whenever possible (e.g. https://codeberg.org/forgejo/design/issues/23) - Use native HTML elements instead of JS (e.g. replace divs with data-url to anchor tags with href) A lot of this can be accomplished simply by editing the template files and some CSS. I would say this already fixes 90% of the functionality. Honestly Forgejo already works quite well without JavaScript, so it shouldn't be too much work. I'm not too familiar with the internals of Fomantic-UI, so maybe I'm missing something.
Author
Owner

It is a lot of work, but you are invited to contribute.

You can take a look at some related work in forgejo/forgejo#4995 and forgejo/forgejo#5031 which took about one week to complete. It's manageable to contribute one-time, but focusing on this effort will take a lot of weeks to convert UI elements and menus into semantic HTML one-by-one.

forgejo/forgejo#5346 could be a good issue as a starter. It still requires writing some Javascript to ensure the existing links work (ideally including the GitHub compatibility in the linked PR), but it's probably a manageable task.

But it is only one, among many.

It is a lot of work, but you are invited to contribute. You can take a look at some related work in https://codeberg.org/forgejo/forgejo/pulls/4995 and https://codeberg.org/forgejo/forgejo/pulls/5031 which took about one week to complete. It's manageable to contribute one-time, but focusing on this effort will take a lot of weeks to convert UI elements and menus into semantic HTML one-by-one. https://codeberg.org/forgejo/forgejo/issues/5346 could be a good issue as a starter. It still requires writing some Javascript to ensure the existing links work (ideally including the GitHub compatibility in the linked PR), but it's probably a manageable task. But it is only one, among many.
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#239
No description provided.