プロジェクト

全般

プロフィール

Vote #79795

未完了

Convert all jQuery to ECMA Script

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
0
issue_org_id:
30486
author_id:
4
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

I am going to just create this ticket, it's sounds quite general, but I would like to see how many will agree with me here, so in the future, it could be branched up into separate issues.

  1. I think java script in Redmine is inconsistent, many things are written in bare JS and many other things are written in bare jQuery.
  2. ECMA Script brings new functions for easy DOM manipulation, please see You Dont Need jQuery by nefe[[[https://github.com/nefe/You-Dont-Need-jQuery]]]
  3. I think the set of front end functions deserves a good rethinking, in order to redesign most of them with re usability in mind as much is possible, so plugins developers could reuse them when necessary, the set of functions will however need to be documented.

For example, quite a versatile HTTP request function I made for my WebGL plugin:

function httpRequest(method, url, body, callback) {
  let request = new XMLHttpRequest();
  request.open(method, url, true);
  request.setRequestHeader('Content-type','application/json');
    request.onload = function () {
      if (request.status < 200 || request.status > 299) callback("Error: Status " + request.status + " on resource " + url);
      else callback(null, request.responseText);
    }
  request.send(body);
}

etc etc :)


journals

In the future, I think Redmine need convert to API only at the backend and React/Vue/Angular in the frontend.
Rails 6 use webpacker and it does not support assets pipeline.
--------------------------------------------------------------------------------
Wouldn't make a lot of sense to just swap a library with a framework, or would it?
I think, judging by the pattern the vanilla JS has been evolving in recent years, it's safe to say that it will continue to get influenced by React, Vue and Angular, meaning things will get easier even in vanilla JS. IMHO, Redmine should not use front-end frameworks or libraries at all and encourage new contributors and developers to instead think for themselves more than just use some lame solutions premade for them. I believe a zillion of front-end JS frameworks today is the reason why many till this day thinks of a front-end engineer in JS as of someone who is a noob exactly for that reason. XD

I actually share a lot with what Adrian Holovaty had to say on the situation: https://youtu.be/k7n2xnOiWI8.

If front-end frameworks and libs are absolutely needed by someone, then they can include it with their plugin and write an appropriate code which will use their desirable framework or a lib, but for the core, encouraging vanilla seems like the best longer term solution since now.
And besides, things are already in there written in a bare vanilla JS, e.g. *jstoolbar.js*
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0