Skip to content

Frontend: fix RxJS subscription leaks and add lazy loading #115

Description

@pcastelo

Problem

  1. No subscription cleanup: Zero uses of ngOnDestroy, DestroyRef, or takeUntilDestroyed(). All components use bare .subscribe() without teardown. Repeated navigation accumulates handlers and causes memory leaks.

  2. No lazy loading: All feature routes eagerly import components at the top of app.routes.ts. No loadComponent / loadChildren. Increases initial bundle size unnecessarily.

Acceptance criteria

Subscription management

  • Add DestroyRef + takeUntilDestroyed() to all component subscriptions (Angular 16+ pattern)
  • Or use async pipe in templates where possible (preferred)
  • Verify no leaked subscriptions with a test

Lazy loading

  • Convert feature routes to use loadComponent:
    { path: 'migrate', loadComponent: () => import('./features/migration/migration-wizard.component').then(m => m.MigrationWizardComponent) }
  • Verify lazy chunks are generated in ng build output
  • Measure bundle size reduction

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions