refactor(components): split components.js into separate files and add loader; app waits for components before init

This commit is contained in:
2025-08-31 14:00:33 +02:00
parent 83d252f3cc
commit cc7fa0fa00
11 changed files with 3124 additions and 2 deletions

View File

@@ -1,13 +1,22 @@
// Main SPORE UI Application
// Initialize the application when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', async function() {
logger.debug('=== SPORE UI Application Initialization ===');
// Initialize the framework (but don't navigate yet)
logger.debug('App: Creating framework instance...');
const app = window.app;
// Wait for components to be ready (loader ensures constructors exist)
try {
if (typeof window.waitForComponentsReady === 'function') {
await window.waitForComponentsReady();
}
} catch (e) {
logger.warn('App: Components loader timeout; proceeding anyway');
}
// Create view models
logger.debug('App: Creating view models...');
const clusterViewModel = new ClusterViewModel();