mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-07 23:04:14 +00:00
Refactored app.js boot sequence to follow Ember conventions:
1. Created app/initializers/load-runtime-config.js
- Loads fleetbase.config.json before application boots
- Uses deferReadiness/advanceReadiness pattern
- Runs before all other initializers
- Added performance timing with debug logging
2. Created app/instance-initializers/apply-router-fix.js
- Applies router refresh bug fix patch
- Runs as instance-initializer (needs app instance)
- Runs before extension loading
- Added performance timing with debug logging
3. Refactored app/app.js
- Removed custom ready() hook
- Removed document.addEventListener('DOMContentLoaded')
- Removed manual deferReadiness/boot calls
- Now uses standard Ember boot sequence
- Clean, minimal implementation
Benefits:
- Follows Ember conventions and best practices
- Proper initialization order guaranteed
- Performance monitoring for boot phases
- Easier to debug and maintain
- No custom boot logic needed
Boot sequence:
1. load-runtime-config initializer (runs first)
2. Other initializers (socketcluster, etc.)
3. apply-router-fix instance-initializer
4. load-extensions instance-initializer
5. Other instance-initializers
6. Application ready