Pros:
illuminate/view overrides or facade wrappers).Cons:
TwigBridge or FrameworkBundle patterns, which may not map cleanly to Laravel’s View or Service Provider systems.Core Challenges:
View facade is tightly coupled to Blade. Replacing it would require:
Illuminate\View\Engines\EngineResolver to include HAML.FileViewFinder or CompiledViewFinder to parse .haml files.bootstrap/cache/), which would need regeneration.= stylesheet_link_tag). Laravel’s mix or Vite would need configuration to handle HAML-specific asset tags.@stack, @component) have no HAML equivalents, requiring custom JavaScript or PHP workarounds.Workarounds:
High:
Mitigations:
Why HAML?
Scope of Adoption
@auth, @foreach) translate to HAML?Team Alignment
Long-Term Viability
Compatible Layers:
View system, but requires custom glue code.Incompatible/Challenging Layers:
@stack, @push, or @component have no HAML equivalents.laravel-breeze, filament) would need updates.Phase 1: Hybrid Integration (Low Risk)
symfony/twig-bridge)..haml files in resources/views/ via a custom ViewServiceProvider:
public function boot(): void {
$this->app['view']->addExtension('haml', function ($view) {
return new HamlEngine(); // Hypothetical wrapper
});
}
Phase 2: Partial Adoption (Medium Risk)
Phase 3: Full Replacement (High Risk)
config/view.php:
'engines' => [
'haml' => DigitalNoLimit\MtHamlBundle\HamlEngine::class,
],
@if → %- if).Dependencies:
symfony/dependency-injection), which could conflict with Laravel’s container.Conflict Risks:
Bundle class may not integrate cleanly with Laravel’s ServiceProvider lifecycle.| Step | Task | Dependencies | Risk Level |
|---|---|---|---|
| 1 | Install bundle + Symfony dependencies | Composer, PHP 8.0+ | Low |
| 2 | Configure custom ViewServiceProvider |
Laravel view facade |
Medium |
| 3 | Test static HAML templates | Basic .haml files |
Low |
| 4 | Preprocess HAML to Blade (if needed) | Build tool (Vite/Webpack) | Medium |
| 5 | Migrate non-critical templates | Existing Blade templates | Medium |
| 6 | Update frontend workflows | Asset pipeline config | Medium |
| 7 | Override default view engine | config/view.php |
High |
| 8 | Full template migration | All Blade templates | High |
Pros:
Cons:
Challenges:
Mitigations:
How can I help you explore Laravel packages today?