Major simplifications achieved:
- Enhanced http-utils.ts with getJSON/getText/postJSONAndParseResponse utilities
- Added executeHttpRequest and handleResponseError for common patterns
- Simplified getTemplates() in site-templates-widget.ts (15→8 lines)
- Removed async IIFE complexity in main.ts (34→24 lines for both patterns)
- Streamlined error handling in editor.ts formatting (46→32 lines)
- Simplified all compiler-service.ts HTTP methods (75→60 lines total)
- Cleaned up sharing.ts getShortLink method (17→12 lines)
Total reduction: ~150+ lines of code eliminated while maintaining all functionality
- Standardized error handling patterns
- Eliminated duplicate error message extraction logic
- Removed complex try-catch nesting
- Simplified async patterns from IIFEs to direct function calls
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>