Unit 15: JS modernization (var→const, lazy fetch, event-driven init) + dead file cleanup#17
Open
stradichenko wants to merge 1 commit intomainfrom
Open
Unit 15: JS modernization (var→const, lazy fetch, event-driven init) + dead file cleanup#17stradichenko wants to merge 1 commit intomainfrom
stradichenko wants to merge 1 commit intomainfrom
Conversation
- fuzzy-search.js: replace var with const/let (71+ sites). Lazy-load /index.json on first focus (cache for the session) instead of eager fetch on load. Strip 6 console.info debug stubs. - sidenotes.js: replace == / != with strict equality. Replace the setTimeout(350) race with a MutationObserver / custom event. Remove 6 console.log calls. - references.js: replace setTimeout(1500/800) chains with event-driven init (listens for the sidenotes-ready custom event). Remove 12 console.log calls. - table-wrapper.js: remove trailing console.log per table. - theme-toggle.js: cache SVG nodes once (clone) instead of re-innerHTML on every toggle. - main.js: rely on Unit 5/6 -- the file is now included exactly once. - partials/comments/remark42.html: remove 3 console.log debug calls. - Production js.Build opts now include drop = ["console", "debugger"], so console.* survives in dev only. - DELETE assets/js/kokoro-tts.js (599 LOC, no callers). - DELETE assets/css/debug.css and assets/css/shortcodes.css (empty). - Verified contribution-calendar.js is referenced (Unit 12 wires it).
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.
Summary
fuzzy-search.js: replacevarwithconst/let(71+ sites). Lazy-load/index.jsonon first focus (cache for the session) instead of eager fetch on load. Strip 6console.infodebug stubs.sidenotes.js: replace==/!=with strict equality. Replace thesetTimeout(350)race with aMutationObserver/ custom event. Remove 6console.logcalls.references.js: replacesetTimeout(1500/800)chains with event-driven init (listens for thesidenotes-readycustom event). Remove 12console.logcalls.table-wrapper.js: remove trailingconsole.logper table.theme-toggle.js: cache SVG nodes once (clone) instead of re-innerHTMLon every toggle.main.js: rely on Unit 5/6 — the file is now included exactly once.partials/comments/remark42.html: remove 3console.logdebug calls.js.Buildopts now includedrop = ["console", "debugger"], soconsole.*survives in dev only.assets/js/kokoro-tts.js(599 LOC, no callers).assets/css/debug.cssandassets/css/shortcodes.css(empty).Notes for reviewer
assets/js/contribution-calendar.jsbecause the audit showed it as effectively dead, but Unit 12 wires it back. Resolve by keeping the file (Unit 12 wins) and dropping the deletion from this PR.Test plan
npm run lintpasses (warnings allowed).exampleSitehas noconsole.login minified output (grep "console" exampleSite/public/<bundle>.jsreturns nothing for prod).Part of the PKB-theme modernization batch (15 units).