Skip to content

chore: Remove backend-ai-dialog and unused MWC dependencies after full migration #5376

@inureyes

Description

@inureyes

⚠️ Before implementing, read and follow the Implementation Rules in the epic issue #5364. These rules cover mandatory patterns for React component structure, BAI component usage, reactToWebComponent bridge, state management, i18n, error handling, styling, and code quality. The reference implementation is react/src/components/SignupModal.tsx.

Goal: Complete Lit file removal. Each migration must fully replace the Lit source file with React — not just the dialog parts. The migrated Lit .ts file and its type declarations must be deleted. This epic is a critical step toward removing all Lit/MWC/Vaadin dependencies from the codebase.

Description

After all Lit-Element dialog components have been migrated to React (per epic #5364), remove backend-ai-dialog and all related Lit files. This is also the checkpoint for evaluating full Lit/MWC/Vaadin dependency removal from the project.

Part of epic #5364 — Phase 5 (Cleanup)
Blocked by: All other sub-issues in epic #5364

Scope

Part A: Remove Dialog-Related Lit Files

Files that should already be removed by individual sub-issues. Verify and clean up any remnants:

Part B: Remove Type Definitions and Declarations

  • src/types/backend-ai-console.d.ts — Remove BackendAIDialog and all migrated component type references
  • d/components/backend-ai-dialog.d.ts — Remove declaration file
  • d/components/backend-ai-dialog.d.ts.map — Remove source map
  • All d/components/backend-ai-*.d.ts files corresponding to removed Lit components

Part C: Remove Style References

  • src/components/backend-ai-general-styles.ts — Remove backend-ai-dialog style rules
  • CSS custom properties specific to backend-ai-dialog (--component-width, --component-height, etc.)
  • Evaluate if backend-ai-general-styles.ts and backend-ai-webui-styles.ts can be fully removed

Part D: Evaluate Full MWC Dependency Removal

After all dialog-using components are migrated, audit remaining MWC usage and remove packages where possible.

All 24 MWC packages currently in package.json:

Package Used by (after this epic) Removable?
@material/mwc-dialog None ✅ Yes
@material/mwc-button Remaining Lit components Evaluate
@material/mwc-textfield None (all migrated) ✅ Yes
@material/mwc-select None (all migrated) ✅ Yes
@material/mwc-checkbox None (all migrated) ✅ Yes
@material/mwc-icon-button backend-ai-edu-applauncher.ts After edu-launcher migration
@material/mwc-icon-button-toggle None (all migrated) ✅ Yes
@material/mwc-menu None (all migrated) ✅ Yes
@material/mwc-list None (all migrated) ✅ Yes
@material/mwc-linear-progress backend-ai-indicator.ts After indicator migration
@material/mwc-circular-progress Evaluate Evaluate
@material/mwc-snackbar lablup-notification.ts After notification migration
@material/mwc-drawer backend-ai-webui.ts After app shell migration
@material/mwc-top-app-bar-fixed backend-ai-webui.ts After app shell migration
@material/mwc-icon Evaluate Evaluate
@material/mwc-radio Evaluate Evaluate
@material/mwc-slider Evaluate Evaluate
@material/mwc-switch Evaluate Evaluate
@material/mwc-tab Evaluate Evaluate
@material/mwc-tab-bar Evaluate Evaluate
@material/mwc-textarea Evaluate Evaluate
@material/mwc-formfield Evaluate Evaluate
@material/mwc-line-ripple Evaluate Evaluate
@material/mwc-ripple Evaluate Evaluate

Part E: Evaluate Vaadin Dependency Removal

9 Vaadin packages currently in package.json:

  • @vaadin/combo-box, @vaadin/date-time-picker, @vaadin/grid, @vaadin/icons, @vaadin/item, @vaadin/progress-bar, @vaadin/select, @vaadin/text-field, @vaadin/tooltip
  • Currently used by: backend-ai-project-switcher.ts (1 file)
  • Can be removed after project-switcher is migrated to React (separate issue)

Part F: Evaluate Lit Core Dependency Removal

Lit core packages:

  • lit (v3.3.2)
  • @lit/reactive-element (v2.1.2)
  • lit-translate (v2.0.1)

Remaining Lit components after this epic (20 files):

Category Components Priority for Future Migration
App Shell backend-ai-webui.ts, backend-ai-page.ts Last (depends on all others)
Views backend-ai-edu-applauncher.ts, backend-ai-serving-view.ts, backend-ai-error-view.ts Medium
Widgets backend-ai-project-switcher.ts, lablup-notification.ts, lablup-codemirror.ts, lablup-expansion.ts, lablup-loading-dots.ts Medium
Indicators backend-ai-indicator.ts, backend-ai-indicator-pool.ts Medium
State/Utils backend-ai-tasker.ts, backend-ai-metadata-store.ts, backend-ai-settings-store.ts, backend-ai-common-utils.ts, backend-ai-painkiller.ts High (can be replaced with React hooks/context)
Styles backend-ai-general-styles.ts, backend-ai-webui-styles.ts, paper-color.ts High (can be replaced with Ant Design theme tokens)

Lit core can only be removed after ALL 20 remaining components are migrated. This issue should produce a report documenting which components still depend on Lit and a recommended migration order for subsequent epics.

Cleanup Checklist

  • Verify all dialog migrations are complete and working
  • Remove backend-ai-dialog.ts and related type definitions
  • Remove all migrated Lit component files and their type declarations in d/components/
  • Remove unused MWC package imports from remaining components
  • Run grep -r "backend-ai-dialog" to find any remaining references
  • Run grep -r "mwc-dialog" to verify no direct mwc-dialog usage remains
  • Evaluate and remove unused @material/mwc-* packages from package.json
  • Evaluate removability of @vaadin/* packages
  • Document remaining Lit dependencies and recommended migration order
  • Run pnpm install to verify dependency tree is clean
  • Run pnpm run build to verify no build errors
  • Run pnpm run lint to check for any issues
  • Run pnpm run test to verify no test regressions
  • Update E2E tests if they reference removed elements
  • Measure and report bundle size reduction

Acceptance Criteria

  • Lit file removed: src/components/backend-ai-dialog.ts, src/components/backend-ai-app-launcher.ts, and all related type declarations deleted from codebase
  • All 8 dialog-related Lit files confirmed removed
  • All removable MWC packages removed from package.json
  • Build, lint, and tests pass
  • Bundle size reduction measured and documented
  • Remaining Lit dependency report produced: list of 20 remaining Lit components with recommended migration order for future epics

Expected Impact

  • Reduced bundle size (MWC packages removed, fewer Lit runtime dependencies)
  • Simplified component architecture (single UI framework for dialogs)
  • Removal of Shadow DOM / z-index conflict issues between Lit and React modals
  • Cleaner dependency tree
  • Clear roadmap for subsequent Lit removal epics

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxUI / UX issue.effort:normalNeed to understand a few modules / some extent of contextual or historical information.platform:webWeb-specific issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions