Skip to content

refactor: remove jQuery, SweetAlert, Bootstrap; extract tags data#172

Merged
yltx merged 1 commit into
masterfrom
refactor-deep-cleanup
May 31, 2026
Merged

refactor: remove jQuery, SweetAlert, Bootstrap; extract tags data#172
yltx merged 1 commit into
masterfrom
refactor-deep-cleanup

Conversation

@yltx

@yltx yltx commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

Continuation of PR #171 — deep cleanup of deprecated libraries and legacy code.

Removed libraries

Library Version Usage Replacement
jQuery 3.7.1 traininglist, traindetails, paintboard DOM manipulation Native DOM API
jQuery UI (CDN) paintboard drag Native mouse events
SweetAlert v1 (2014) traininglist pagination error dialogs vscode.postMessage → showErrorMessage
Bootstrap 3.3.7 (CDN) paintboard layout Native CSS
@types/jquery 3.5.25 TypeScript defs for jQuery Removed
@types/dateformat 5.0.2 TypeScript defs for dateformat Removed

Deleted resource files

  • resources/jquery.min.js (69KB)
  • resources/sweetalert-dev.js (50KB)
  • resources/sweetalert.css (17KB)
  • resources/bootstrap.min.js (37KB)
  • resources/bootstrap.min.css (119KB)

Total: ~292KB of bundled resources removed.

Tags data extraction

  • Extracted 2688-line inline tag data from src/utils/shared.ts to src/data/tags.json
  • shared.ts reduced from 3160 lines to 472 lines

Code modernization

  • Removed href=javascript:void(0) anti-pattern
  • Replaced deprecated HTML attributes (nowrap, align, border) with CSS
  • Replaced inline onmouseout/onmouseover handlers with CSS :hover
  • Replaced jQuery UI .draggable() with native mousedown/mousemove/mouseup
  • Replaced alert() with vscode.postMessage for proper VSCode notification handling

Test results

Test Files  5 passed (5)
     Tests  52 passed (52)
  Typecheck  passed

- Remove jQuery from traininglist, traindetails, paintboard (native DOM)
- Remove SweetAlert from traininglist (use vscode notification via postMessage)
- Remove Bootstrap 3.3.7 CSS/JS from paintboard
- Remove CDN dependencies from paintboard (inline all resources)
- Replace jQuery UI draggable with native mouse drag implementation
- Replace alert() with vscode.postMessage in paintboard
- Extract 2688-line tags data from shared.ts to src/data/tags.json
- Remove jquery, @types/jquery, @types/dateformat from package.json
- Delete unused resource files: jquery.min.js, sweetalert-dev.js, sweetalert.css, bootstrap.min.js, bootstrap.min.css
- Remove href='javascript:void(0)' anti-pattern
- Replace deprecated HTML attributes (nowrap, align, border) with CSS
Copilot AI review requested due to automatic review settings May 31, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@yltx
yltx merged commit d69e15c into master May 31, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants