Skip to content

Remove unused frontend and backend code - #1040

Open
Irozuku wants to merge 19 commits into
refactor/remove-pipelinesfrom
refactor/dead-code
Open

Irozuku wants to merge 19 commits into
refactor/remove-pipelinesfrom
refactor/dead-code

Conversation

@Irozuku

@Irozuku Irozuku commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes code that nothing in the application reaches, in the frontend and in the backend. No behaviour change is intended: every removed file, function or method was proven unreferenced before it was deleted.

How the dead code was found:

  • Frontend files: the list of modules Vite actually bundles was compared with the tracked files under src. A file that is not bundled and is not imported, even as a type, by a bundled file was removed.
  • Backend modules: an import graph was built from the entry points (DashAI/__main__.py, back/app.py, webview.py, the alembic scripts, the PyInstaller spec and hooks), including modules named in strings. Modules outside the graph were removed.
  • Backend functions and methods: vulture candidates were kept only when the name appears exactly once in the whole repository, tests and frontend included, and the definition has no decorator.

Lazy imports were taken into account:

  • Imports written inside functions and methods, and imports under TYPE_CHECKING, count as edges of the graph. Every import statement of every file was walked, not only the ones at module level.
  • Module paths written as strings ("DashAI.back.x.y") count as references, in Python files and in pyproject.toml, dashai.spec and the PyInstaller hooks.
  • The backend has four dynamic loaders. model_package/load.py imports the module named inside a saved model package; models/lazy_llm.py is a __getattr__ proxy over a loaded model, not a module loader; the ones in unstructured_document_dataloader.py and hyperopt_optimizer.py load third party modules. None scans a directory or builds DashAI module names from short strings.
  • As a last check, the tree before the deletions was searched for every removed module name and class name as a plain word, in Python, TOML, spec, JSON and YAML files. There are no matches outside the removed files.
  • Saved artifacts cannot point at the removed components: none of those classes was ever registered, so the application could not have produced a model package or a pickled model that names them.

Type of Change

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

Frontend, 145 files under DashAI/front/src:

  • components/explorations/ and its API client and types: the legacy explorations UI, replaced by the notebook explorers.
  • pages/results/ and components/results/: the legacy results page.
  • components/datasets/: dataset modals and converter tables no page opens.
  • components/models/, components/predictions/, components/explainers/: session, prediction and explainer dialogs no page opens.
  • components/configurableObject/, part of components/shared/: the form renderer that FormSchema* replaced.
  • Unused API clients (dataloader, task, values, oldEndpoints), types, hooks, helpers, example data and the schema fixtures the removed jest tests used.
  • styles/fonts/Quicksand-*: font files no stylesheet references.

Backend:

  • api/api_v1/schemas/: six request schema modules and two schema classes no endpoint uses.
  • converters/scikit_learn/cca.py, sklearn_like_converter.py, dataloaders/classes/audio_dataloader.py, tabular_dataloader.py, models/dummy_text_classification_model.py: components that were never registered.
  • models/RAG/retrievers/dense/_hf_language_utils.py, _hf_metadata_utils.py: helpers with no caller.
  • core/enums/squema_types.py, PipelineRunStatus, and the empty packages core/exceptions and models/remote_models.
  • Unused functions in types/utils.py, types/type_validation.py, tasks/utils.py and dataloaders/classes/dashai_dataset_utils.py.
  • Methods nothing calls in services/RAG/retriever_db_service.py, services/RAG/embedding_storage_service.py, models/RAG/RAG_models_factory.py and models/RAG/prompts/base_prompt.py.

Repository:

  • DashAI/back.rar and DashAI/front/src.rar: old source archives.

Testing (optional)

  • yarn build in DashAI/front. The set of bundled modules is identical before and after (657).
  • pytest tests/back/types tests/back/tasks tests/back/dataloaders tests/back/RAG tests/back/services tests/back/api/test_components_api.py: 2205 passed.
  • The component registry still loads 422 components.

Notes (optional)

  • metrics/forecasting/mase.py: not registered, but left to be added later.
  • credentials/github_credential.py and models/pymc/bart_regression.py: not registered, but both have tests.
  • components/datasets/SelectDataloaderStep.jsx and the two selectors it imports: unreachable, kept as legacy.
  • Frontend fixture JSON files under __fixtures__ and utils/ruleConformance.fixture.json: not bundled, but backend tests read them.

@Irozuku
Irozuku added this pull request to stack #1039 November 24, 2026 14:54
@Irozuku Irozuku added front Frontend work back Backend work refactor Prune and embelish code labels Nov 24, 2026
@Irozuku
Irozuku marked this pull request as draft November 25, 2026 21:53
@Irozuku
Irozuku marked this pull request as ready for review November 27, 2026 14:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back Backend work front Frontend work refactor Prune and embelish code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant