Refactor main JS #185

Closed
opened 2026-10-04 23:03:35 +02:00 by adam · 1 comment
Owner

5000 LOC

5000 LOC <!-- github-sync-id:4264313418 -->
adam closed this issue 2026-10-04 23:03:35 +02:00
Author
Owner

/plan refactoring of large files into sensible modules. a.k.a "Refactor main JS #745"
Fix https://github.com/l5yth/potato-mesh/issues/745

The first paragraph of CLAUDE.md reads "If a module grows large, split it into a submodule structure. Prefer composing small, single-purpose units over monolithic files."

However, we somewhat didn't honor this enough. Take a look at the following areas of our codebase.

Web/Frontend

  • 4778 lines of code in web/public/assets/js/app/main.js
  • 1565 lines of code in web/public/assets/js/app/node-page.js
  • 1380 lines of code in web/public/assets/js/app/node-page-charts.js

Web/Backend

  • 2371 lines of code in web/lib/potato_mesh/application/data_processing.rb
  • 1650 lines of code in web/lib/potato_mesh/application/federation.rb

Data/Ingestor

  • 1294 lines of code in data/mesh_ingestor/protocols/meshcore.py
  • 980 lines of code in data/mesh_ingestor/interfaces.py

Please come up with a sensible refactoring strategy for these 7 files across the 3 areas mentioned.

We can for now safely ignore the Rust and Dart code as these parts of the codebase are stale and need some work in future sessions in any case.

/plan refactoring of large files into sensible modules. a.k.a "Refactor main JS #745" Fix https://github.com/l5yth/potato-mesh/issues/745 The first paragraph of CLAUDE.md reads "If a module grows large, split it into a submodule structure. Prefer composing small, single-purpose units over monolithic files." However, we somewhat didn't honor this enough. Take a look at the following areas of our codebase. Web/Frontend - 4778 lines of code in web/public/assets/js/app/main.js - 1565 lines of code in web/public/assets/js/app/node-page.js - 1380 lines of code in web/public/assets/js/app/node-page-charts.js Web/Backend - 2371 lines of code in web/lib/potato_mesh/application/data_processing.rb - 1650 lines of code in web/lib/potato_mesh/application/federation.rb Data/Ingestor - 1294 lines of code in data/mesh_ingestor/protocols/meshcore.py - 980 lines of code in data/mesh_ingestor/interfaces.py Please come up with a sensible refactoring strategy for these 7 files across the 3 areas mentioned. We can for now safely ignore the Rust and Dart code as these parts of the codebase are stale and need some work in future sessions in any case. <!-- github-comment-id:4263178739 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/potato-mesh#185