Skip to content

Typescript UI update #1578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

Conversation

DGarbs51
Copy link
Contributor

@DGarbs51 DGarbs51 commented Aug 5, 2025

Convert Horizon UI to TypeScript

This PR modernizes the Laravel Horizon frontend by converting all Vue components from
JavaScript to TypeScript, improving type safety and developer experience.

Changes Made

TypeScript Migration

  • Converted all Vue components from Options API to Composition API with <script setup lang="ts">
  • Added proper TypeScript interfaces for all data structures
  • Configured TypeScript build pipeline with strict type checking
  • Added type declarations for external dependencies

Components Converted

  • Core Components: Alert, LineChart, Poll, SchemeToggler, Stacktrace
  • Feature Screens: Dashboard, Batches, Failed Jobs, Metrics, Monitoring, Recent Jobs
  • Routing: Converted Vue Router configuration to TypeScript
  • Base Files: app.js, base.js, routes.js → TypeScript equivalents

Testing Infrastructure

  • Added Playwright for visual regression testing
  • Created comprehensive test suite covering all screens
  • Added GitHub Actions for automated visual testing
  • Included baseline snapshots to ensure UI consistency

Technical Details

  • Vue 3 Composition API with TypeScript
  • Proper type safety for API responses
  • Maintained full compatibility with existing backend
  • No visual changes to the UI (verified by visual regression tests)

Testing

Visual regression tests ensure pixel-perfect compatibility with the original UI:

  • ✅ All main screens tested
  • ✅ Dark/light theme switching
  • ✅ Interactive features (search, sorting)
  • ✅ GitHub Actions CI integration

To run tests locally:
npm run test:visual

Breaking Changes

None. This is a pure frontend refactor with no changes to:

  • Backend API
  • Vue component behavior
  • UI appearance
  • Configuration

Future Improvements

This TypeScript foundation enables:

  • Better IDE support and autocomplete
  • Catch type errors at compile time
  • Easier refactoring and maintenance
  • Improved developer onboarding

- Migrate all Vue components from Options API to Composition API with TypeScript
- Add TypeScript configuration files (tsconfig.json, tsconfig.node.json)
- Convert JavaScript files to TypeScript (.js to .ts)
- Add type definitions for all data structures
- Update build configuration to support TypeScript
- Add type checking to build process
- Suppress Sass deprecation warnings from Bootstrap
- Update package.json with TypeScript dependencies
- Set up Playwright for visual regression testing
- Add comprehensive tests covering all main screens
- Create GitHub Actions for automated testing
- Add workflow for updating snapshots via PR comments
- Fix primary color to match original (#7746ec)
- Update Chart.js configuration for v2 compatibility
- Add TypeScript declarations for Chart.js v2
- Include baseline snapshots for all screens
- Add documentation for visual testing workflow

This ensures the TypeScript conversion maintains pixel-perfect
compatibility with the original JavaScript version.
- Update upload-artifact from v3 to v4
- Update cache action from v3 to v4

This fixes the deprecation warnings from GitHub Actions.
Copy link

github-actions bot commented Aug 5, 2025

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@DGarbs51 DGarbs51 closed this Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant