Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Google Closure Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Abandonment: Symfony2 is EOL; the package has 21 stars and 0 dependents — no user base to surface bugs, no maintainer, no security response path.
  • Dependency graph conflict: transitive constraints on 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."
  • Runtime dependency: requires a JVM and a pinned compiler.jar on every dev machine and CI runner.
  • Upstream drift: Google Closure Tools has de-emphasized this integration surface; the compiler now ships primarily through npm, and Closure Templates was renamed/split (Soy).
  • Scoring signal: a 0.225 composite is consistent with "archived curiosity," not a build dependency.

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

  1. What is the actual requirement — ADVANCED-mode dead-code elimination and renaming, or ordinary minification? If the latter, esbuild/terser via Vite covers it with zero new infrastructure.
  2. Is Closure Templates (Soy) in use anywhere? That's a separate decision from JS minification and should be scoped separately.
  3. Who owns a forked JAR-invoker long-term? Name the owner before proceeding.
  4. Is a JVM acceptable in the CI image and in developer onboarding?

Integration Approach

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:

  1. Inventory which templates and bundles depend on the Closure pass, and whether ADVANCED mode is genuinely load-bearing (check for goog.exportSymbol/@export usage — a strong tell).
  2. Stand up the new build (Vite or a script) in parallel and produce both artifacts.
  3. Diff output behavior in staging. ADVANCED mode is the risk surface — property renaming and dead-code elimination break reflection, string-keyed access, and dynamic imports.
  4. Cut over per-bundle, then delete the old filter config.

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.

Operational Impact

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

  • Missing/mismatched JAR in CI → build fails with an opaque Java error, not a PHP stack trace.
  • JVM OOM on large inputs → intermittent, hard to reproduce locally.
  • ADVANCED mode silently breaking dynamic property access → passes build, fails at runtime in production.
  • Source map drift between compiled artifact and original source → near-useless stack traces.
  • Composer resolution failure on a composer update months later, when the constraint conflict surfaces unexpectedly.
  • Abandoned-package audit flag blocking a security review with no remediation available.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource