Skip to content

Remove htmx#37224

Merged
wxiaoguang merged 2 commits intogo-gitea:mainfrom
wxiaoguang:remove-htmx
Apr 15, 2026
Merged

Remove htmx#37224
wxiaoguang merged 2 commits intogo-gitea:mainfrom
wxiaoguang:remove-htmx

Conversation

@wxiaoguang
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang commented Apr 14, 2026

Close #35059

Slightly improved the "fetch action" framework and started adding tests for it.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 14, 2026
@wxiaoguang wxiaoguang force-pushed the remove-htmx branch 4 times, most recently from 480ddf0 to fe13e95 Compare April 15, 2026 03:59
@wxiaoguang wxiaoguang requested a review from Copilot April 15, 2026 04:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the htmx dependency from the web frontend and migrates remaining dynamic behaviors to the in-house “fetch-action” framework, including editor preview/diff loading and related initialization.

Changes:

  • Remove htmx imports/globals/config, related event handlers, and dependency entries.
  • Expand “fetch-action” capabilities (pseudo-selector command execution, loading indicator targeting, redirect behavior) and start unit test coverage.
  • Replace htmx-driven editor diff/preview and some dynamic diff behaviors with fetch-action/explicit fetch calls; adjust templates and E2E selectors accordingly.

Reviewed changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
web_src/js/vitest.setup.ts Removes htmx-related polyfill and switches setup to a simple globals import.
web_src/js/index.ts Drops htmx error event listeners and related imports.
web_src/js/globals.ts Removes global window.htmx wiring/config; keeps jQuery global.
web_src/js/globals.d.ts Removes window.htmx type declaration.
web_src/js/features/repo-issue-sidebar-combolist.ts Removes htmx.process calls after DOM replacements.
web_src/js/features/repo-editor.ts Replaces htmx-driven diff/preview with explicit POST requests; adds diff tab support.
web_src/js/features/repo-diff.ts Removes htmx.process calls and replaces “sleep for htmx” with fetch-action trigger.
web_src/js/features/notification.ts Removes htmx.process after notification DOM replacement.
web_src/js/features/common-fetch-action.ts Enhances fetch-action: indicator selection via pseudo-commands, exported trigger, stricter sync targeting, prod redirect optimization.
web_src/js/features/common-fetch-action.test.ts Adds initial unit test coverage for pseudo-selector command execution.
web_src/css/repo.css Removes repo editor menu min-height override.
vite.config.ts Removes rolldown eval check override previously needed by htmx.
types.d.ts Removes htmx ESM shim module declaration.
tests/e2e/codeeditor.test.ts Narrows .editor-loading selector to the write tab to avoid new preview/diff loaders.
templates/repo/view_list.tmpl Updates fetch-action loading indicator selector to match new “relative” indicator targeting.
templates/repo/editor/patch.tmpl Adjusts editor menu classes to match updated layout expectations.
templates/repo/editor/edit.tmpl Removes htmx attributes; adds data attributes required by new JS-driven preview/diff loading; adds preview/diff loading placeholders.
templates/repo/actions/workflow_dispatch_inputs.tmpl Removes comments that referenced htmx limitations.
pnpm-lock.yaml Removes htmx.org dependency entries.
package.json Removes htmx.org dependency.
eslint.config.ts Removes htmx import restriction and htmx global declaration.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web_src/js/features/repo-editor.ts
Comment thread web_src/js/features/repo-editor.ts
Comment thread web_src/js/features/common-fetch-action.ts Outdated
Comment thread web_src/js/features/common-fetch-action.test.ts Outdated

This comment was marked as resolved.

This comment was marked as resolved.

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

Should be good enough.

Not too many changes when diff with ignoring spaces https://github.com/go-gitea/gitea/pull/37224/changes?w=1

Comment thread web_src/js/features/common-fetch-action.ts Outdated
Signed-off-by: silverwind <me@silverwind.io>
@GiteaBot GiteaBot removed the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 15, 2026
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Apr 15, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 15, 2026
@wxiaoguang wxiaoguang enabled auto-merge (squash) April 15, 2026 17:01
@wxiaoguang wxiaoguang merged commit 2644bb8 into go-gitea:main Apr 15, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.27.0 milestone Apr 15, 2026
@wxiaoguang wxiaoguang deleted the remove-htmx branch April 15, 2026 17:29
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 17, 2026
* main:
  Replace `dropzone` with `@deltablot/dropzone` (go-gitea#37237)
  Add `ExternalIDClaim` option for OAuth2 OIDC auth source (go-gitea#37229)
  Remove error returns from crypto random helpers and callers (go-gitea#37240)
  Use Content-Security-Policy: script nonce (go-gitea#37232)
  Remove htmx (go-gitea#37224)
  Refactor "htmx" to "fetch action" (go-gitea#37208)
  Fix UI regression (go-gitea#37218)
  Fix corrupted JSON caused by goccy library (go-gitea#37214)
  Add test for "fetch redirect", add CSS value validation for external render (go-gitea#37207)
  Fix incorrect concurrency check (go-gitea#37205)
  refactor: simplify ParseCatFileTreeLine and catBatchParseTreeEntries (go-gitea#37210)
  Update go js py dependencies (go-gitea#37204)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/code-linting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: drop htmx

5 participants