perf(frontend): optimize initial bundle size with lazy-loaded dialogs and localized chart providers (#1110)

This commit is contained in:
brios
2026-05-18 23:05:10 +02:00
committed by GitHub
parent 4afc738dd4
commit c6cbdcfa11
32 changed files with 532 additions and 405 deletions
@@ -2,6 +2,7 @@ import { computed, signal, WritableSignal } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BehaviorSubject } from 'rxjs';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { MessageService } from 'primeng/api';
import { getTranslocoModule } from '../../../core/testing/transloco-testing';
import { BookDialogHelperService } from '../../../features/book/components/book-browser/book-dialog-helper.service';
@@ -104,13 +105,13 @@ describe('AppSidebarComponent', () => {
{
provide: DialogLauncherService,
useValue: {
openLibraryCreateDialog: vi.fn(),
openMagicShelfCreateDialog: vi.fn(),
openFileUploadDialog: vi.fn(),
openLibraryCreateDialog: vi.fn(() => Promise.resolve(null)),
openMagicShelfCreateDialog: vi.fn(() => Promise.resolve(null)),
openFileUploadDialog: vi.fn(() => Promise.resolve(null)),
},
},
{ provide: CommandPaletteService, useValue: commandPaletteService },
{ provide: BookDialogHelperService, useValue: { openShelfCreatorDialog: vi.fn() } },
{ provide: BookDialogHelperService, useValue: { openShelfCreatorDialog: vi.fn(() => Promise.resolve(null)) } },
{ provide: AuthService, useValue: { logout: vi.fn() } },
{ provide: MetadataProgressService, useValue: { activeTasks$, progressUpdates$ } },
{ provide: BookdropFileService, useValue: { hasPendingFiles$ } },
@@ -120,6 +121,7 @@ describe('AppSidebarComponent', () => {
{ provide: MagicShelfService, useValue: { shelves: signal([]), bookCountByMagicShelfId: signal(new Map()) } },
{ provide: SeriesDataService, useValue: { allSeries: signal([]) } },
{ provide: AuthorService, useValue: { allAuthors: signal([]) } },
{ provide: MessageService, useValue: { add: vi.fn() } },
],
});