hearsay/require-js-bundle
HearsayRequireJsBundle integrates RequireJS with Symfony applications, offering configuration for module paths, shims, and dependencies plus Twig helpers to load scripts. It simplifies managing JavaScript modules and optimized RequireJS builds.
Framing note for the reader: the package metadata describes a Laravel integration, but the repository is a Symfony2 bundle with Twig helpers, DI extension classes, and AppKernel registration. That discrepancy is itself the most important TPM finding: the advertised value proposition (drop-in Laravel asset bundling) does not match the shipped artifact, so any adoption decision must be made against the code, not the summary.
Architecture fit: Low for a Laravel product. The bundle's value is concentrated in two places — a declarative RequireJS configuration schema (baseUrl, paths, shim, deps, map, waitSeconds) and an optimizer wrapper class that shells out to r.js. Neither is coupled to Symfony in a way that is useful to Laravel; the Symfony-coupled parts (DI extension, Twig extension, kernel wiring) are precisely the parts that do not transfer. Architecturally this is a configuration pattern, not an integration layer we can consume.
Integration feasibility: Low as a dependency, moderate as a blueprint. composer require into a Laravel app is not viable: no service provider, no package discovery, no config/ publish tag, and a PHP/Symfony version surface from the Symfony 2 era that will collide with a modern Laravel runtime's Symfony components. The realistic integration is to copy the schema shape into config/requirejs.php and reproduce the Twig helper's output with a Blade directive or a small view component.
Technical risk: High, and mostly organizational rather than runtime. Archived status means no security responsiveness and no PHP-version compatibility work; 0 dependents means no field evidence that the optimizer wrapper behaves correctly across edge cases; RequireJS/AMD is a superseded module format, so any investment compounds against the direction of the ecosystem. The one genuinely reusable asset — the config schema — is also the cheapest thing to reimplement, which weakens the case for taking on the rest.
Key questions:
laravel-vite-plugin) for the target state, with r.js retained only as a transitional build step? If yes, this package has no role beyond reference material.Stack fit: Poor as a dependency, adequate as a pattern source. Laravel's supported path is Vite for bundling and native ES modules for JavaScript; AMD is not a first-class citizen and forcing it in means owning a parallel front-end toolchain indefinitely. Where the bundle's schema is genuinely useful, it is because RequireJS config is data — and data ports cleanly even when code does not.
Migration path: Two distinct paths, and the TPM's job is to keep them from being conflated.
config/requirejs.php, reproduce config rendering via a Blade directive (or @json(config('requirejs')) inline in the layout), keep page entry points in @push('requirejs-modules'), and drive r.js from a standalone npm script or Composer script in CI — never through Mix or Vite. Then plan the AMD → ES module conversion as a separate, sequenced workstream.Compatibility: Assume incompatible until a spike proves otherwise. Specific risks: Symfony 2 interfaces that no longer exist in the Symfony versions Laravel pulls in, PHP constraint conflicts, Composer solver failures on symfony/* transitive requirements, and document-root assumptions (web/ versus Laravel's public/) baked into asset path resolution. There is no Blade parity for the Twig extension — output must be reproduced manually. The optimizer's r.js invocation is the most portable piece and the least valuable to inherit.
Sequencing:
paths, shim/deps, page entry points — and treat that inventory as the migration backlog.r.js build) on a single low-traffic page behind a feature flag.r.js step, then remove the config file so the pattern does not get reused by default.Maintenance: The dominant cost, and it is entirely ours. Archived means zero upstream patches: no PHP 8.x compatibility work, no security fixes, no dependency updates. Any use beyond read-only reference implies a fork, an owner, a CVE-watch obligation, and a documented exit plan. Because the package's only durable asset is a config schema, forking it is almost always a worse trade than reimplementing the ~50 lines of config plumbing it actually provides.
Support: Effectively none. 129 stars and 0 dependents means no community fix pipeline, no Stack Overflow corpus, no vendor relationship, and no Laravel-ecosystem documentation. Internal engineers debugging a build failure have the source and nothing else — which raises mean time to resolution on exactly the kind of front-end build issue that already has poor tooling ergonomics.
Scaling: Static bundled assets scale fine at the CDN/edge layer; the integration layer does not scale organizationally. Every engineer who touches the front end must learn Symfony2 bundle conventions and RequireJS and the team's bespoke hybrid pipeline. That is a tax on onboarding and a recurring source of drift between the PHP config and the build.js config — two sources of truth that must be kept in sync by hand.
Failure modes, in rough order of likelihood:
symfony/* or PHP constraints when added to a modern Laravel app — usually surfaces at install time and blocks the approach outright.web/ vs public/, base URL assumptions) producing 404s that only appear in staging.build.js/r.js declaration, causing bundles to be stale or incomplete without any build error.The realistic worst case is not a runtime outage; it is quiet, prolonged ownership of a pipeline nobody wants to touch, blocking the eventual framework upgrade.
Ramp-up: Moderate to high, and largely non-transferable. Symfony2 bundle conventions plus RequireJS plus r.js optimization is a three-layer stack of legacy knowledge that pays off only if the goal is explicitly legacy migration. For a Laravel team, the ramp-up should be scoped to reading the config during an inventory pass — hours, not weeks — and the engineering time is better spent on Vite and ES modules, which are transferable and actively maintained.
TPM recommendation: Treat this as a migration input, not a dependency. Leverage it in exactly two ways: (1) as the schema reference when authoring config/requirejs.php and the Blade rendering path for any transitional AMD work, and (2) as an inventory line item driving a scheduled removal of the Symfony2/RequireJS surface. Do not add it to composer.json, do not fork it without a named owner and an exit plan, and do not let the "Laravel bundle" description in the package metadata create the impression of a supported path. Frame the decision to stakeholders as "migrate away", with the opportunity score treated as a signal of unresolved legacy surface area rather than of adoption value.
How can I help you explore Laravel packages today?