forgejo/web_src/js/features
Beowulf 28e0af23fa
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
feat(ui): replace Monaco with CodeMirror (#10559)
- Replace the [Monaco Editor](https://microsoft.github.io/monaco-editor/)
with [CodeMirror 6](https://codemirror.net/). This editor is used to
facilitate the 'Add file' and 'Edit file' functionality.
- Rationale:
  - Monaco editor is a great and powerful editor, however for Forgejo's
  purpose it acts more like a small IDE than a code editor and is doing
  too much. In my limited user research the usage of editing files via
  the web UI is largely for small changes that does not need the
  features that Monaco editor provides.
  - Monaco editor has no mobile support, Codemirror is very usable on mobile.
  - Monaco editor pulls in large dependencies (for language support) and
  by replacing it with Codemirror the amount of time that webpack needs
  to build the frontend is reduced by 50% (~30s -> ~15s).
  - The binary of Forgejo (build with `bindata` tag) is reduced by 2MiB.
  - Codemirror is much more lightweight and should be more usable on
  less powerful hardware, most notably the lazy loading is much faster
  as codemirror uses less javascript.
  - Because Codemirror is modular it is much easier to change the
  behavior of the code editor if we wish to.
- Drawbacks:
  - Codemirror is quite modular and as seen in `package.json` and in
  `codeeditor.ts` we have to supply a lot more of its features to have
  feature parity with Monaco editor.
  - Monaco editor has great integrated language support (features that
  an lsp would provide), Codemirror only has such language support to an
  extend.
  - Monaco editor has its famous command palette (known by many as its
  also available in VSCode), this is not available in code mirror.
- Good to note:
  - All features that was added on top of the monaco editor (such as
  dynamically changing language  support depending on the filename)
  still works and the theme is based on the VSCode colors which largely
  resembles the monaco editor.
  - The code editor is still lazy-loaded (this is painfully clear by
  reading how imports are passed around in `codeeditor.ts`).
  - This change was privately tested by a few people, a few bugs were
  found (and fixed) but no major drawbacks were noted for their usage of
  the web editor.
  - There's a "search" button in the top bar, so that search can be used
  on mobile. It is otherwise only accessible via
  <kbd>Ctrl</kbd>+<kbd>f</kbd>.

Co-authored-by: Beowulf <beowulf@beocode.eu>

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10559
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2026-01-04 23:52:33 +01:00
..
admin feat: move more modals to native dialogs (#9636) 2025-10-13 17:48:49 +02:00
comp fix(ui): add dynamic aria-label to monospace button in markdown editor (#8244) 2025-12-22 13:59:50 +01:00
autofocus-end.js When the title in the issue has a value, set the text cursor at the end of the text. (#30090) 2024-03-30 07:17:31 +01:00
captcha.js Enforce trailing comma in JS on multiline (#30002) 2024-03-26 19:04:27 +01:00
clipboard.js Fix Citation modal responsiveness and clipboard copy (#29799) 2024-03-20 08:46:29 +01:00
code-frequency.js Enforce trailing comma in JS on multiline (#30002) 2024-03-26 19:04:27 +01:00
codeeditor.ts feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
codemirror-lang.ts feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
codemirror-search.ts feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
codemirror.ts feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
colorpicker.js Replace coloris with vanilla-colorful (#30201) 2024-04-07 15:40:31 +02:00
common-global.js feat: replace cross origin protection (#9830) 2025-10-29 22:43:22 +01:00
common-issue-list.js Remove jQuery from the issue "go to" button (#30028) 2024-03-26 19:04:27 +01:00
common-issue-list.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
common-organization.js Fix initCompLabelEdit not being called (#29198) 2024-02-17 23:24:31 +01:00
contextpopup.js feat(ui): lazy-load all Vue components (#9444) 2025-09-28 05:40:40 +02:00
contributors.js Add "n commits" link to contributors in contributors graph page (#32799) 2024-12-15 13:21:02 +01:00
copycontent.js Remove fomantic input module (#30194) 2024-04-07 15:40:31 +02:00
dashboard-repo-list.ts feat(ui): lazy-load all Vue components (#9444) 2025-09-28 05:40:40 +02:00
dropzone.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
emoji.js feat: make text expander aware of custom emojis 2025-08-10 23:11:41 +02:00
eventsource.sharedworker.js chore: add new lint rules 2024-10-23 08:10:18 +02:00
file-fold.js Update JS dependencies (#27922) 2023-11-06 21:14:32 +00:00
heatmap.js feat(ui): lazy-load all Vue components (#9444) 2025-09-28 05:40:40 +02:00
imagediff.js Refactor imagediff and fix regression bug (#30694) 2024-04-28 15:39:01 +02:00
install.js [CHORE] Remove Microsoft SQL Server Support 2024-04-05 23:37:36 +02:00
notification.js Remove jQuery class from the notification count (#30172) 2024-04-07 15:40:31 +02:00
org-team.js chore: enable no-jquery/no-each-util 2025-04-01 03:59:12 +02:00
pull-view-file.js Fix counter display number incorrectly displayed on the page (#29448) 2024-03-06 12:10:44 +08:00
recent-commits.js Enforce trailing comma in JS on multiline (#30002) 2024-03-26 19:04:27 +01:00
repo-action-view.ts display pre-execution errors in action view UI 2025-10-04 19:56:38 -06:00
repo-activity-top-authors.ts fix: add vue data to createApp instead mount (#9467) 2025-09-29 15:44:01 +02:00
repo-branch-tag-selector.js feat: replace cross origin protection (#9830) 2025-10-29 22:43:22 +01:00
repo-branch.ts feat: convert create/rename branch and create tag to native dialog (#9760) 2025-10-30 21:06:14 +01:00
repo-code.test.ts chore(ui): replace repo-code jQuery use, convert file to typescript (#9337) 2025-09-21 08:08:47 +02:00
repo-code.ts chore(ui): replace repo-code jQuery use, convert file to typescript (#9337) 2025-09-21 08:08:47 +02:00
repo-commit.js feat: show CI status on force-pushes (#8655) 2025-08-13 03:29:36 +02:00
repo-common.js fix(ui): make tag dropdown clickable again (#7558) 2025-04-16 12:28:39 +00:00
repo-diff-commit.js Migrate margin and padding helpers to tailwind (#30043) 2024-03-30 07:17:29 +01:00
repo-diff-commitselect.js feat(ui): lazy-load all Vue components (#9444) 2025-09-28 05:40:40 +02:00
repo-diff-filetree.js feat(ui): lazy-load all Vue components (#9444) 2025-09-28 05:40:40 +02:00
repo-diff.js fix: process dynamically added content via htmx (#10572) 2025-12-29 20:54:49 +01:00
repo-editor.js feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
repo-findfile.js Refactor all .length === 0 patterns in JS (#30045) 2024-03-30 07:17:30 +01:00
repo-findfile.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
repo-graph.js fix branch selector in commit graph 2024-07-07 20:26:30 +02:00
repo-home.js Add null check for responseData.invalidTopics (#32212) 2024-10-13 08:06:49 +03:00
repo-issue-content.js feat: show spinner when loading content history menu (#9874) 2025-10-27 22:04:04 +01:00
repo-issue-list.js Make a distinction between active and selected in the issue author dropdown (#30207) 2024-04-07 15:40:31 +02:00
repo-issue-pr-form.js feat(ui): lazy-load all Vue components (#9444) 2025-09-28 05:40:40 +02:00
repo-issue-pr-status.js Fix the overflow style for "Hide all checks" (#27932) 2023-11-07 18:53:35 +00:00
repo-issue.js fix(ui): prevent JS from removing icon from close/reopen button (#9959) 2025-11-05 05:02:52 +01:00
repo-issue.test.js feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
repo-legacy.js feat(ui): add switch between formats when previewing CITATION.{cff,bib} files (#9103) 2025-11-14 14:39:20 +01:00
repo-migrate.js fix(ui): prevent exceptions on other users' repo migration pages 2024-08-21 19:57:08 +00:00
repo-migration.js Add support for migrating from Pagure (#8513) 2025-08-11 16:56:26 +02:00
repo-milestone.js feat: use combo markdown editor for milestone description 2024-10-22 19:58:44 +02:00
repo-projects.js Fix various problems around projects board view (#30696) 2024-05-12 20:03:10 +02:00
repo-release.js fix(ui): release: set default release title to tag name (#6883) 2025-02-23 08:30:39 +00:00
repo-search.js Filter Repositories by type (#29231) 2024-03-06 12:10:46 +08:00
repo-settings.js feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
repo-template.js chore: enable no-jquery/no-each-util 2025-04-01 03:59:12 +02:00
repo-unicode-escape.js fix(ui): make unicode escape work in wiki (#8923) 2025-09-10 08:10:23 +02:00
repo-wiki.js Enforce trailing comma in JS on multiline (#30002) 2024-03-26 19:04:27 +01:00
scoped-access-token-selector.ts feat(ui): lazy-load all Vue components (#9444) 2025-09-28 05:40:40 +02:00
sshkey-helper.js feat(ui): clear panel form inputs when closed 2025-09-16 15:49:02 -07:00
stopwatch.js Remove jQuery from the stopwatch (#29351) 2024-02-26 22:30:26 +01:00
tablesort.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
tribute.js Migrate margin and padding helpers to tailwind (#30043) 2024-03-30 07:17:29 +01:00
user-auth-webauthn.js Enforce trailing comma in JS on multiline (#30002) 2024-03-26 19:04:27 +01:00
user-auth.js feat: improve incorrect ROOT_URL warning (#7103) 2025-03-03 18:05:01 +00:00