mirror of https://github.com/ColorlibHQ/gentelella
168 lines
5.9 KiB
Markdown
168 lines
5.9 KiB
Markdown
# Bootstrap 5 Modernization Plan đ
|
|
|
|
## Project Overview
|
|
Upgrade Gentelella Admin Template from Bootstrap 4.6.2 to Bootstrap 5.3.6 with modern dependencies while maintaining functionality and layout.
|
|
|
|
## Phase 1: Dependency Analysis & Planning â
COMPLETE
|
|
|
|
### Current Dependencies Status
|
|
| Package | Current | Target | Breaking Changes |
|
|
|---------|---------|--------|------------------|
|
|
| bootstrap | 4.6.2 | 5.3.6 | MAJOR - jQuery removal, class renames |
|
|
| chart.js | 2.9.4 | 4.4.2 | MAJOR - API changes, new options structure |
|
|
| jquery | 3.6.1 | REMOVE | Bootstrap 5 no longer needs jQuery |
|
|
| font-awesome | 4.7.0 | 6.6.0 | MINOR - new icons, class structure |
|
|
| jquery-ui | 1.14.1 | KEEP | Still needed for some widgets |
|
|
| datatables.net | 2.3.2 | 2.x.x | Update to latest |
|
|
| moment | 2.30.1 | dayjs | Replace with modern alternative |
|
|
|
|
## Phase 2: Bootstrap 5 Core Migration
|
|
|
|
### 2.1 Bootstrap Installation & Configuration
|
|
- [ ] Update Bootstrap to 5.3.6
|
|
- [ ] Remove jQuery dependency from Bootstrap components
|
|
- [ ] Update Popper.js to v2.x (required by Bootstrap 5)
|
|
- [ ] Configure Bootstrap 5 with custom Sass variables
|
|
|
|
### 2.2 CSS Class Migration
|
|
Bootstrap 5 class changes to apply:
|
|
- [ ] `.ml-*`, `.mr-*` â `.ms-*`, `.me-*` (margin start/end)
|
|
- [ ] `.pl-*`, `.pr-*` â `.ps-*`, `.pe-*` (padding start/end)
|
|
- [ ] `.text-left`, `.text-right` â `.text-start`, `.text-end`
|
|
- [ ] `.float-left`, `.float-right` â `.float-start`, `.float-end`
|
|
- [ ] `.badge-*` â `.bg-*` for background colors
|
|
- [ ] `.btn-block` â `.d-grid` wrapper
|
|
- [ ] `.form-group` â remove (use margins/utilities)
|
|
- [ ] `.form-control-file` â `.form-control`
|
|
- [ ] `.custom-select` â `.form-select`
|
|
- [ ] `.no-gutters` â `.g-0`
|
|
|
|
### 2.3 Component Updates
|
|
- [ ] **Cards**: Update `.card-deck` â CSS Grid layout
|
|
- [ ] **Forms**: Migrate to new form structure
|
|
- [ ] **Navbars**: Add required container structure
|
|
- [ ] **Dropdowns**: Update data attributes `data-toggle` â `data-bs-toggle`
|
|
- [ ] **Modals**: Update data attributes and remove jQuery dependency
|
|
- [ ] **Tooltips/Popovers**: Update to Bootstrap 5 JS API
|
|
|
|
### 2.4 Data Attribute Migration
|
|
- [ ] `data-toggle` â `data-bs-toggle`
|
|
- [ ] `data-target` â `data-bs-target`
|
|
- [ ] `data-dismiss` â `data-bs-dismiss`
|
|
- [ ] `data-slide` â `data-bs-slide`
|
|
- [ ] `data-parent` â `data-bs-parent`
|
|
|
|
## Phase 3: JavaScript Modernization
|
|
|
|
### 3.1 Bootstrap JS Migration
|
|
- [ ] Remove jQuery dependencies from Bootstrap components
|
|
- [ ] Update Bootstrap component initialization
|
|
- [ ] Migrate event listeners to vanilla JS
|
|
- [ ] Update component APIs (Modal, Dropdown, etc.)
|
|
|
|
### 3.2 Chart.js v4 Migration
|
|
- [ ] Update Chart.js to 4.4.2
|
|
- [ ] Migrate chart configurations:
|
|
- `scales.yAxes` â `scales.y`
|
|
- `scales.xAxes` â `scales.x`
|
|
- Update responsive options
|
|
- Update legend configuration
|
|
- Update tooltip configuration
|
|
|
|
### 3.3 Widget Library Updates
|
|
- [ ] **jQuery UI**: Keep for progressbar, maintain compatibility
|
|
- [ ] **DataTables**: Update to latest compatible version
|
|
- [ ] **Gauge.js**: Fix loading issues, ensure compatibility
|
|
- [ ] **jqVMap**: Test compatibility or find alternative
|
|
- [ ] **Bootstrap-progressbar**: Find Bootstrap 5 compatible version
|
|
|
|
### 3.4 Custom JavaScript Refactoring
|
|
- [ ] Update `src/js/sidebar.js` for Bootstrap 5 navbar
|
|
- [ ] Update `src/js/init.js` for new component initialization
|
|
- [ ] Replace jQuery utilities with vanilla JS where possible
|
|
- [ ] Maintain jQuery for specific widgets that require it
|
|
|
|
## Phase 4: Modern Dependencies
|
|
|
|
### 4.1 Package Updates
|
|
- [ ] Font Awesome 4.7.0 â 6.6.0
|
|
- [ ] Moment.js â Day.js (smaller, modern)
|
|
- [ ] Update all vendor CSS/JS to latest versions
|
|
- [ ] Remove deprecated packages
|
|
|
|
### 4.2 Build System Optimization
|
|
- [ ] Optimize Vite configuration for Bootstrap 5
|
|
- [ ] Update CSS preprocessing for Bootstrap 5 Sass structure
|
|
- [ ] Configure proper tree-shaking for reduced bundle size
|
|
- [ ] Add CSS/JS minification for production
|
|
|
|
## Phase 5: Testing & Quality Assurance
|
|
|
|
### 5.1 Visual Testing
|
|
- [ ] Dashboard layout consistency
|
|
- [ ] All widget functionality
|
|
- [ ] Responsive design across breakpoints
|
|
- [ ] Dark mode compatibility (if implementing)
|
|
|
|
### 5.2 Functionality Testing
|
|
- [ ] All charts rendering correctly
|
|
- [ ] Forms validation working
|
|
- [ ] Modal/dropdown interactions
|
|
- [ ] Data table operations
|
|
- [ ] Navigation and sidebar
|
|
|
|
### 5.3 Performance Testing
|
|
- [ ] Bundle size optimization
|
|
- [ ] Loading speed improvements
|
|
- [ ] Memory usage validation
|
|
|
|
## Phase 6: Outstanding Issues Resolution
|
|
|
|
### 6.1 Current TODOs
|
|
- [x] ~~Fix gauge.js loading~~ â
**COMPLETED**
|
|
- [ ] Investigate broken map.html page
|
|
- [ ] Add proper error handling for widget failures
|
|
- [ ] Implement fallbacks for failed library loads
|
|
|
|
### 6.2 New Modern Features
|
|
- [ ] Add CSS custom properties for easy theming
|
|
- [ ] Implement CSS Grid layouts where appropriate
|
|
- [ ] Add accessibility improvements (ARIA labels, focus management)
|
|
- [ ] Consider adding dark mode support
|
|
- [ ] Add PWA capabilities (optional)
|
|
|
|
## Implementation Timeline
|
|
|
|
### Week 1: Core Bootstrap Migration
|
|
- Days 1-2: Install Bootstrap 5, update basic layouts
|
|
- Days 3-4: CSS class migration across all HTML files
|
|
- Days 5-7: Component structure updates
|
|
|
|
### Week 2: JavaScript & Charts
|
|
- Days 1-3: Bootstrap JS component migration
|
|
- Days 4-5: Chart.js v4 migration
|
|
- Days 6-7: Widget library updates
|
|
|
|
### Week 3: Testing & Polish
|
|
- Days 1-3: Comprehensive testing
|
|
- Days 4-5: Bug fixes and optimizations
|
|
- Days 6-7: Documentation and cleanup
|
|
|
|
## Success Metrics
|
|
- â
Zero console errors
|
|
- â
All widgets functional
|
|
- â
Responsive design maintained
|
|
- â
Loading speed improved by 20%+
|
|
- â
Bundle size optimized
|
|
- â
Future-proof dependencies
|
|
|
|
## Risk Mitigation
|
|
- Create feature branch for each phase
|
|
- Maintain backup of working version
|
|
- Test individual components before integration
|
|
- Document all custom modifications
|
|
- Plan rollback strategy for critical issues
|
|
|
|
---
|
|
|
|
**Next Steps**: Begin Phase 2 with Bootstrap 5 installation and basic CSS migration. |