-
Notifications
You must be signed in to change notification settings - Fork 75
Remove legacy Jinja2 frontend and associated dead code #904
Description
The project has been migrating from a legacy Jinja2 template-based frontend to a modern React PWA (frontend/).
The legacy frontend is still present in the codebase and has been causing confusion; contributors have been submitting patches against dead or soon-to-be-removed code instead of focusing on the React frontend.
This umbrella issue tracks the removal of all legacy frontend code and associated infrastructure. Please create one pull request per functionality listed below so that each removal can be reviewed and merged independently.
Each of the following is a self-contained removal/cleanup activity. Please pick one, create a branch, remove the code, verify nothing in the React frontend or API endpoints breaks, and open a PR referencing this issue.
-
Remove legacy Jinja2 templates
- Directory:
tahrir/templates/ - All
.htmltemplate files (index.html,user.html,badge.html,badge_full.html,leaderboard.html,explore.html,explore_badges.html,report.html,about.html,diff.html,admin.html,builder.html,thingiview.html,assertion_widget.html,tags.html,error.html,_base.html,_badge-base.html,_functions.html) - Includes the dead
test.htmltemplate that is not referenced by any view
- Directory:
-
Remove legacy view functions that render Jinja2 templates
- Directory:
tahrir/views/ - Views that render legacy templates:
index,about,user,diff,badge,badge_full,leaderboard,report,explore,explore_badges,admin,builder,thingiview,assertion_widget,tags - Do not remove the API endpoint functions in
tahrir/endpoints/— those serve the React frontend
- Directory:
-
Remove legacy static assets (CSS)
- Directory:
tahrir/static/css/ - Files:
unsemantic-grid-mobile.css,unsemantic-grid-responsive.css,unsemantic-grid-responsive-tablet.css,tahrir.css,monokai.css - These serve the old Jinja2-based HTML frontend only
- Directory:
-
Remove legacy static assets (JavaScript)
- Directory:
tahrir/static/js/ - Files:
jquery-3.3.1.min.js,social.js,favico-0.3.4.min.js,builder.js - These are used exclusively by the legacy Jinja2 templates
- Directory:
-
Remove the 3D STL badge viewer
- Directory:
tahrir/static/js/thingiview/ - Files:
thingiview.js,Three.js,plane.js,binaryReader.js,thingiloader.js,stats.js - Also remove the
/badge/<badge_id>/stlroute andthingiview.htmltemplate (if not already removed in task 1/2)
- Directory:
-
Clean up dead code in
tahrir/utils/avatar.py- File:
tahrir/utils/avatar.py - Lines 41–50 are unreachable due to an early return on line 39
- Remove the dead code and the associated TODO comment on lines 36–37
- File:
As the mentors have a limited amount of time and effort that they can spend on a single applicant, please ensure that you are following these guidelines while submitting your pull request in a ready state.
- One PR per task: do not bundle multiple tasks into a single PR
- Reference this issue in your PR description (e.g. "Part of #NNN")
- Verify before submitting: ensure the React frontend (
frontend/) and the API endpoints (tahrir/endpoints/) still work after your removal. Run the test suite - Do not remove code in
tahrir/endpoints/: those API routes serve the React frontend - Do not remove JSON-serving routes under
/json/without first confirming that the React frontend does not depend on them - Check
frontend/src/features/call.jsto see which backend routes the React frontend actually calls