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

Require Js Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Is there an inherited Symfony2 + RequireJS application in the estate, or is this being evaluated for a greenfield Laravel app? The answer flips the recommendation entirely.
  • What is the actual job: (a) bundle AMD modules today, (b) understand an existing AMD graph during a migration, or (c) satisfy a compliance/inventory requirement for a known dependency? Only (b) and (c) justify spending time here.
  • Does the estate contain multiple RequireJS-based apps, or one? One app is a migration ticket; several is a program with a shared ES-module target.
  • Who owns the fork-and-maintain decision if we do touch the code? Archived packages require a named owner and a documented exit plan before the first commit.
  • Can we standardize on Vite + ES modules (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.
  • Are there runtime behaviors (shim handling, path mapping, build ordering) in the legacy config that we cannot reproduce trivially? This determines whether the reference read is a two-hour task or a two-week spike.

Integration Approach

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.

  1. Legacy Symfony2 app in maintenance mode — pin the version, do not upgrade, do not extend. Record it in the dependency inventory with an EOL flag and a scheduled removal. The bundle's Twig helper stays as-is; no new modules are added to it.
  2. Laravel target state — do not port the bundle. Instead: lift the config schema into 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:

  1. Classify the need as legacy support vs. modern asset delivery before any code is written; the two produce opposite plans.
  2. Inventory RequireJS usage — module IDs, paths, shim/deps, page entry points — and treat that inventory as the migration backlog.
  3. Time-box a spike only if a legacy Symfony2/RequireJS dependency actually exists; cap it explicitly and define the exit criteria up front.
  4. Stand up the target pipeline (Vite, or Vite plus a transitional r.js build) on a single low-traffic page behind a feature flag.
  5. Convert modules in dependency order — leaves first, entry points last — validating asset resolution in staging at each step.
  6. Decommission the bundle and the r.js step, then remove the config file so the pattern does not get reused by default.

Operational Impact

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:

  • Composer dependency conflicts on symfony/* or PHP constraints when added to a modern Laravel app — usually surfaces at install time and blocks the approach outright.
  • Missing service provider / no auto-discovery — silent no-op in Laravel; the package installs and does nothing, which reads as "broken" rather than "unsupported."
  • Asset path mismatches (web/ vs public/, base URL assumptions) producing 404s that only appear in staging.
  • Config drift between PHP-declared bundles and the build.js/r.js declaration, causing bundles to be stale or incomplete without any build error.
  • Abandoned-code exposure — an unpatched transitive dependency flagged in a security scan with no upstream remediation path, forcing either a fork or a rushed removal.
  • Key-person concentration — the one engineer who understands the AMD graph leaves, and the build becomes effectively unmaintainable.

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.

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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package