[PR #6206] [MERGED] refactor(frontend): remove unused legacy utilities #6168

Closed
opened 2026-11-02 04:06:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6206
Author: @n0ctal
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/13/2026
Merged by: @MHSanaei

Base: main ← Head: codex/upstream-remove-unused-legacy-utils


📝 Commits (2)

  • 894464b refactor(frontend): remove unused legacy utilities
  • 2f9daab Merge branch 'main' into codex/upstream-remove-unused-legacy-utils

📊 Changes

1 file changed (+0 additions, -42 deletions)

View changed files

📝 frontend/src/utils/index.ts (+0 -42)

📄 Description

Summary

Utils, ArrayUtils, URLBuilder and BuildURLOptions in frontend/src/utils/index.ts have no callers. This removes them, 42 lines out of the 974-line module.

Why

These are leftovers rather than a public surface: Utils holds a single debounce, ArrayUtils a single doAllItemsExist, and URLBuilder.buildURL builds panel URLs from window.location. The frontend is a bundled application, not a published library, so an export with no importer has no external consumer to protect.

URLBuilder.buildURL in particular is the kind of helper someone reaches for when adding a new absolute-URL feature, and it encodes assumptions (implicit window.location fallbacks, port elision) that are no longer exercised or tested by anything.

Scope

  • frontend/src/utils/index.ts: remove Utils, ArrayUtils, URLBuilder, BuildURLOptions.

Everything else in the module is untouched, including Msg, HttpUtil, SizeFormatter, NumberFormatter, ColorUtils and LanguageManager.

Validation

  • Repository-wide search for Utils (whole word), ArrayUtils, URLBuilder, BuildURLOptions, doAllItemsExist, buildURL and debounce: zero matches outside the removed block.
  • knip no longer reports the symbols.
  • tsc --noEmit, eslint src, vitest run (1065 tests in 112 files), production vite build: all pass.
  • make gen-check clean.

Risk

Low. If a future feature wants debouncing or URL building, it should get a helper with tests rather than inherit these; nothing in the current tree depends on them.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6206 **Author:** [@n0ctal](https://github.com/n0ctal) **Created:** 8/12/2026 **Status:** ✅ Merged **Merged:** 8/13/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `codex/upstream-remove-unused-legacy-utils` --- ### 📝 Commits (2) - [`894464b`](https://github.com/MHSanaei/3x-ui/commit/894464b6d2b297d82088fc05493a356e7aaa163f) refactor(frontend): remove unused legacy utilities - [`2f9daab`](https://github.com/MHSanaei/3x-ui/commit/2f9daab596ad31651201be2002d74451114472f7) Merge branch 'main' into codex/upstream-remove-unused-legacy-utils ### 📊 Changes **1 file changed** (+0 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/utils/index.ts` (+0 -42) </details> ### 📄 Description ## Summary `Utils`, `ArrayUtils`, `URLBuilder` and `BuildURLOptions` in `frontend/src/utils/index.ts` have no callers. This removes them, 42 lines out of the 974-line module. ## Why These are leftovers rather than a public surface: `Utils` holds a single `debounce`, `ArrayUtils` a single `doAllItemsExist`, and `URLBuilder.buildURL` builds panel URLs from `window.location`. The frontend is a bundled application, not a published library, so an export with no importer has no external consumer to protect. `URLBuilder.buildURL` in particular is the kind of helper someone reaches for when adding a new absolute-URL feature, and it encodes assumptions (implicit `window.location` fallbacks, port elision) that are no longer exercised or tested by anything. ## Scope - `frontend/src/utils/index.ts`: remove `Utils`, `ArrayUtils`, `URLBuilder`, `BuildURLOptions`. Everything else in the module is untouched, including `Msg`, `HttpUtil`, `SizeFormatter`, `NumberFormatter`, `ColorUtils` and `LanguageManager`. ## Validation - Repository-wide search for `Utils` (whole word), `ArrayUtils`, `URLBuilder`, `BuildURLOptions`, `doAllItemsExist`, `buildURL` and `debounce`: zero matches outside the removed block. - `knip` no longer reports the symbols. - `tsc --noEmit`, `eslint src`, `vitest run` (1065 tests in 112 files), production `vite build`: all pass. - `make gen-check` clean. ## Risk Low. If a future feature wants debouncing or URL building, it should get a helper with tests rather than inherit these; nothing in the current tree depends on them. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6168
No description provided.