This document tracks planned improvements, technical debt, and future features for the Module Federation Explorer.
- Make Webview Offline Ready: Bundle
D3.jsinside the extensionmedia/folder and update CSP. Loading from CDN will fail for offline users or those behind corporate proxies. - Sync View IDs: Fixed mismatched view ID references in
src/index.ts(was 'moduleFederationExplorer', should be 'moduleFederation'). - Complete Activation Support: Add
.tsconfig files (vite.config.ts, etc.) toactivationEventsinpackage.jsonto ensure the extension auto-activates in TypeScript projects. - Rspack Performance: Switch from
ts-loaderto build-inbuiltin:swc-loaderinrspack.config.jsto significantly speed up builds. - Redundant Dependency Audit: Moved bundled dependencies (
d3,estraverse, etc.) todevDependenciesto clarify the extension is standalone. - Robust Config Fallback: Refactor
rootConfigManager.tsto avoid fragile key-scanning that can cause false positives when configuration is corrupted.
- Decompose
UnifiedModuleFederationProvider.ts: The file is currently ~2500 lines long.- Move Tree Item logic to a dedicated Factory/Provider.
- Extract terminal management logic into a
TerminalManagerservice. - Separate configuration persistence logic into a dedicated module.
- Refactor
dependencyGraph.ts: The file is ~1700 lines long and contains complex graph generation logic and a large embedded webview.- Extract the
generateDependencyGraphmulti-pass logic into smaller, testable methods or aGraphBuilderclass. - Move the massive Webview HTML/CSS/JS string to a separate template file or dedicated generator.
- Improve the robustness of
findAppIdByNameto handle more edge cases in remote naming.
- Extract the
- Modularize
src/index.ts: The main entry point is overgrown (~770 lines) and mixes numerous concerns.- Extract the massive inline HTML string
getWelcomePageHtmlinto a dedicated template file (e.g.,src/webviews/welcome.ts). - Extract inline command implementations (especially
startRemotewith its complex prompting logic) into dedicated modules (e.g.,src/commands/). - Move file watchers and terminal lifecycle hooks into a separate
LifecycleManagerorWatcherService.
- Extract the massive inline HTML string
- Improve Config Extraction:
- Add support for asynchronous configuration files (
export default async () => ...). - Refactor
configExtractors.tsinto smaller, bundler-specific modules (Webpack, Vite, etc.).
- Add support for asynchronous configuration files (
- Error Handling:
- Implement a more robust error reporting system to the user (instead of primarily logging to
outputChannel). - Add explicit validation for user-provided start/build commands.
- Implement a more robust error reporting system to the user (instead of primarily logging to
- Lazy Loading configurations: For large mono-repos, scan folders only when expanded in the tree view.
- Cache Extraction Results: Persist the AST extraction results to avoid re-parsing unchanged config files on every startup.
- Debounce File Watchers: Ensure multiple rapid file changes don't trigger simultaneous expensive re-scans.
- Enhanced Dependency Graph:
- Add search/filter capabilities to the graph view.
- Visualize "shared" dependencies between modules.
- Add "Focus" mode to view only immediate up/downstream connections of a specific node.
- Better Remote Management:
- Automatically detect port conflicts when starting multiple remotes.
- Provide "Restart" button for running terminals.
- Manifest Support: Support
manifest.jsonbased discovery for Module Federation 2.0.
- Unit Tests:
- Add tests for
configExtractorsusing various config file samples. - Test the
rootConfigManagerpersistence logic.
- Add tests for
- E2E Tests: Implement Playwright/VS Code extension tests for core user journeys (Add root -> see remotes -> start remote).