Claude/optimize main file size 1ak4o - #111
Merged
Merged
Conversation
…S modules The main file was a single 4,411-line file containing all frontend logic. This splits it into focused modules under frontend/js/modules/: - state.js (70 lines) — shared mutable state - helpers.js (98 lines) — utility functions (rtgColor, escapeHTML, debounce, etc.) - validation.js (238 lines) — security/input validation, URL sanitization - analytics.js (65 lines) — click and search tracking - tooltips.js (287 lines) — info tooltips and modal system - search.js (604 lines) — smart search index, fuzzy matching, suggestions - ratings.js (787 lines) — star ratings, review modal, reviews drawer, toasts - cards.js (521 lines) — tire card rendering and lazy image loading - favorites.js (108 lines) — user favorites system - filters.js (1,005 lines) — filtering, sorting, pagination, URL state - compare.js (71 lines) — compare bar logic - server.js (210 lines) — server-side pagination mode - image-modal.js (52 lines) — full-screen image preview The main entry point (rivian-tires.js) is now ~408 lines, handling only imports, event delegation wiring, and initialization. esbuild bundles all modules into a single IIFE output — no changes to how WordPress loads the script. All 83 existing tests continue to pass. https://claude.ai/code/session_017rXHMqjGbMFnzGqRxxGszL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.