Phase 8: Split Global JavaScript Into Extension AssetsURL copied
- Global JS stops being the feature junk drawer.
- Tasks: lines around task constants through
openTasksFullscreen.
- D2: D2 import and D2 functions.
- Mermaid: Mermaid import and Mermaid functions.
- Tabs:
switchTab, initTabPanelHeights.
- Themes: theme debug functions.
- Sidebar/layout: sidebar reveal, mobile menus, keyboard shortcuts.
- Search: search persistence, command palette if search-owned.
- Documents: code copy, heading permalink, PDF focus, iframe fullscreen,
JSON focus.
Use marker extraction. Example:
awk '/^const vyasaBookmarks/{flag=1} /^function loadSidebarFolderBranch/{flag=0} flag' vyasa/static/scripts.js > vyasa/extensions_builtin/bookmarks/static/bookmarks.js
- Request the bundle from renderer/route/layout.
- Remove the copied section from
scripts.js.
- Run browser smoke test if UI changed.
vyasa/static/scripts.js is under 500 lines or deleted.
- No extension-specific selectors remain in global JS.