Skip to content

Conversation

@HecFranco
Copy link
Contributor

@HecFranco HecFranco commented Jan 24, 2026

🎯 Purpose

This PR replaces the legacy Js Vanilla frontend with a modern TypeScript + Vite build system, improving maintainability, type safety, and developer experience.

🔧 Changes

Build System

  • Added Vite build system with TypeScript support
    • package.json: Configured for pnpm with Vite, TypeScript, and Stimulus
    • vite.config.ts: Build configuration with HMR support
    • tsconfig.json: TypeScript compiler settings
    • .npmrc: pnpm configuration
  • Build outputs to Resources/public/dist/ with hashed filenames

TypeScript Migration

  • Migrated translation.js (Vanilla JS) to TypeScript
    • assets/translation.ts: Main entry point
    • assets/types/config.ts: Type definitions for configuration
    • assets/utils/api.ts: API client with fetch
    • assets/utils/message.ts: Message display utilities
    • assets/utils/html.ts: HTML manipulation utilities
    • assets/utils/grid.ts: Grid-specific utilities
  • Modular architecture with clear separation of concerns
  • Full type safety with TypeScript checking

Twig Templates

  • Updated templates to load Vite assets
    • grid.html.twig: Loads Vite dev server or built assets
    • _grid.html.twig: Updated for new frontend
    • overview.html.twig: Updated asset loading
  • Supports both development (HMR) and production builds
  • Configuration passed via window.lexikTranslationConfig

Legacy Code Removal

  • Removed Vanilla JS translation.js (replaced by TypeScript)
  • All functionality maintained with modern codebase

✅ Testing

  • Frontend builds successfully
  • TypeScript type checking passes
  • Development server works (HMR)
  • Production build works
  • All UI functionality works as before
  • Browser compatibility verified

📝 Breaking Changes

BREAKING CHANGE: Frontend assets now require a build step:

pnpm install
pnpm run build

Development requires either:

  • Vite dev server running (pnpm run dev)
  • Or built assets (pnpm run build)

🔗 Related Issues

Replaces legacy VAnilla JS with modern TypeScript + Vite.

📚 Documentation

  • Added assets/README.md with setup instructions
  • Updated .gitignore for frontend build artifacts
  • Development workflow documented

- Add Vite build system with TypeScript support
  * package.json with pnpm
  * vite.config.ts for build configuration
  * tsconfig.json for TypeScript settings
- Migrate translation.js from AngularJS to TypeScript
  * Modular architecture: types, utils, API client
  * Type-safe codebase with full TypeScript checking
- Update Twig templates to load Vite assets
  * Support for dev server (HMR) and production builds
- Remove legacy AngularJS code

This modernization improves maintainability, type safety, and developer
experience while maintaining all existing functionality.

BREAKING CHANGE: Frontend assets now require build step:
  pnpm install && pnpm run build

Refs: #XXX
@bartmcleod
Copy link
Collaborator

@HecFranco We don't have Angular in master anymore, we have the pure JS implementation, or did I miss something?

@HecFranco
Copy link
Contributor Author

That’s right, it’s vanilla JavaScript.

…ate composer.lock

- Added "symfony/var-exporter" with version constraints "^6.4|^7.0" to the require section of composer.json.
- Generated composer.lock file to lock dependencies and ensure consistent installations.

This update ensures compatibility with the new Symfony components while maintaining existing functionality.
- Updated the content-hash to reflect changes in dependencies.
- This ensures the lock file is in sync with the current state of the project.
- Added an empty "platform" section in composer.json.
- Updated various Symfony package versions in composer.lock to 7.4.4, ensuring compatibility with PHP 8.2.
- Adjusted dependency requirements for several packages to align with the new Symfony versioning.

This update enhances compatibility with Symfony 7.x while maintaining support for existing functionality.
- Removed the empty "platform" section from composer.json to streamline configuration.
- Maintained existing "sort-packages" setting for dependency management.

This change simplifies the composer.json file without affecting functionality.
…bility

- Added an empty "platform" section in composer.json to support PHP 8.4.
- Updated various Symfony package versions in composer.lock to 8.0.4, ensuring compatibility with PHP 8.4.
- Adjusted dependency requirements for several packages to align with the new Symfony versioning.

This update enhances compatibility with Symfony 8.x while maintaining support for existing functionality.
@HecFranco HecFranco closed this Jan 25, 2026
@HecFranco HecFranco reopened this Jan 25, 2026
@HecFranco HecFranco changed the title feat: Replace AngularJS with TypeScript + Vite feat: Replace Vanilla JS with TypeScript + Vite Jan 26, 2026
@HecFranco HecFranco closed this Jan 26, 2026
@bartmcleod
Copy link
Collaborator

@HecFranco Would you like to share the reason you closed it?

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.

2 participants