jms/google-closure-bundle
JMS Google Closure Bundle integrates Google Closure Compiler with Symfony, providing services and console commands to compile, optimize, and minify JavaScript assets. It helps streamline frontend asset builds and reduce script size using Closure’s optimizations.
Architecture fit — this is not a Laravel package. jms/google-closure-bundle is a Symfony2 bundle (2011–2013 era). It registers via Symfony's Bundle class, ships DI Extension/CompilerPass classes, wires services through the Symfony container, and plugs into Assetic filters and Symfony console commands. Laravel has no bundles.php, no Extension lifecycle, no Assetic pipeline, and no service provider or facade here. It cannot be composer required into a Laravel app and "turned on" — it would have to be forked and re-implemented against Laravel's container.
Integration feasibility — low, and the residual value is thin. What is portable is the idea: shelling out to the Closure Compiler JAR (and optionally the Soy/Closure Templates compiler) during a build step. That is roughly a process-invocation wrapper. Everything else — DI wiring, Assetic filters, console commands, config tree — is dead weight in a Laravel context. Realistically this is a rewrite, not an integration, and the rewrite target already exists in better-maintained form (google-closure-compiler on npm, driven by Vite or a Mix plugin).
Technical risk — high on every axis.
symfony/* 2.x components collide with modern Laravel's Symfony 6/7 components. Composer resolution will fail or force a downgrade cascade. Do not attempt --ignore-platform-reqs to "make it work."compiler.jar on every dev machine and CI runner.TPM angle — treat it as a diagnostic, not a dependency. The most reliable way a TPM "leverages" this package is as a signal: its presence in a codebase reliably indicates a Symfony2-era application with a legacy asset pipeline. That should trigger a tech-debt inventory item ("which apps depend on Closure Tooling, and what is the migration cost?"), feed build-vs-buy analysis, and inform platform-modernization and Symfony-upgrade roadmaps.
Key questions for the team
Stack fit — none as-is; partial as a pattern. A modern Laravel stack (PHP 8.2+, Laravel 10/11) has zero overlap with a Symfony 2.3-era bundle. The functional slot it once filled — "compile and minify assets during the app build" — is now owned by Vite (laravel-vite-plugin) or, on older Laravel apps, Laravel Mix.
Recommended path: do not integrate the bundle. Re-implement the capability.
| Need | Recommended approach |
|---|---|
| Minify / bundle JS | Vite + esbuild (default) or terser |
| Closure Compiler specifically (ADVANCED mode) | google-closure-compiler npm package as a Vite/Rollup plugin, or a standalone build script |
| Soy / Closure Templates | Separate soy npm toolchain in the build pipeline, not in PHP |
| PHP-side invocation (only if unavoidable) | Thin Process-based wrapper service behind an interface, pinned JAR, no Assetic |
Migration path, if the team is currently on an Assetic/JMS-style pipeline:
goog.exportSymbol/@export usage — a strong tell).Compatibility: assume none with current Laravel/Symfony. Treat any attempt to install the bundle as a research spike with a hard time-box, not a delivery task. The Composer constraints alone are likely to block the install, and forcing them past that point produces an unsupported hybrid stack.
Sequencing: requirement validation → tool choice → parallel build → behavior diff → cutover. Do not sequence the fork first; the fork only makes sense if step 1 proves ADVANCED-mode Closure is non-negotiable and npm tooling is blocked by some constraint.
Maintenance — you would own it outright. Zero dependents means zero community maintenance. A fork becomes an internal, undocumented PHP package that must track Closure Compiler JAR releases, PHP version bumps, and Laravel container changes. Budget ongoing engineering time, not a one-off integration.
Support — no upstream. No issue triage, no CVE remediation path, no Stack Overflow corpus for the Symfony2-era API. Onboarding a new engineer to a bespoke JAR-invoker plus Assetic-era config is a real cost with little transferable knowledge.
Scaling — build-time, not runtime. The compiler generates build artifacts, so production scaling is unaffected. Build scaling is the concern: JVM startup plus ADVANCED-mode compilation on a large bundle is slow and memory-hungry, and it serializes CI. Cache compiler output keyed on source hash, or CI times will regress.
Failure modes to plan for
composer update months later, when the constraint conflict surfaces unexpectedly.Ramp-up — steep and low-yield. The team must learn (a) a dead framework's bundle conventions, (b) Assetic-era asset config, (c) Closure Compiler's ADVANCED-mode annotation contract, and (d) JVM/JAR operations. Three of those four are pure legacy tax.
TPM recommendation: Decline integration. Record the package as evaluated-and-rejected on framework mismatch and abandonment, and use it as a tech-debt marker in the modernization backlog. If Closure Compiler's ADVANCED optimizations are a genuine requirement, sponsor a small time-boxed spike against google-closure-compiler on npm driven from the existing frontend build — that delivers the capability with a maintainable owner, no JVM-in-PHP coupling, and no fork. If the requirement is only minification, close the ticket and confirm Vite/esbuild is already doing the job.
How can I help you explore Laravel packages today?