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

Js Assets Helper Bundle Laravel Package

jmikola/js-assets-helper-bundle

A Symfony bundle that integrates the JavaScript assets helper, providing convenient service and template support for managing and rendering JavaScript asset references in your application.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature scoping — dynamic, client-side asset URL resolution. The bundle's single job is to make Symfony's templating AssetsHelper reachable from JavaScript so front-end code can build relative or absolute asset URIs (respecting the configured base path, CDN prefix, and version/package resolution) at runtime rather than hardcoding paths. This matters for features where the asset is chosen after page render: lazy-loaded images, sprite/icon selection driven by state, video/audio source swapping, JS-side template or partial loading, and any widget that constructs URLs from user interaction.
  • Roadmap: CDN and asset-versioning migrations. If the roadmap includes moving static assets to a CDN or enabling cache-busting versioning, this is the piece that prevents "the JS still points at /images/foo.png" regressions. It makes the asset base URL and version string a server-owned configuration instead of a duplicated constant that drifts between Twig and JS.
  • Build vs. buy vs. wire-up-yourself. The genuine alternative is not a competing library — it's two lines of glue: serialize the asset base path/version into a <meta> tag or data- attribute and read it in JS. Treat "adopt" as a decision to keep one source of truth for asset URLs, not a decision to add a dependency. This package only wins if you want that logic to stay inside Symfony's asset configuration rather than reimplementing it.
  • Platform-fit check (critical). Despite being framed as a Laravel/PHP package, this is a Symfony 2 bundle, not a Laravel package. For a Laravel roadmap the equivalent decision is exposing asset()/mix()/vite() output to the front end via a manifest endpoint or inline config. The product need is real and recurring; this specific artifact does not satisfy it on Laravel.

When to Consider This Package

Consider it only when all of the following hold:

  • The application is a Symfony 2.x full-stack app (or a fork still on the 2.x templating component) that already configures assets through the templating AssetsHelper.
  • You have JavaScript that must generate asset URLs dynamically and you want those URLs to stay consistent with server-side asset configuration.
  • Your dependency bar tolerates a single-maintainer, ~19-star, 0-dependent, legacy-era bundle — i.e., you're comfortable vendoring or forking a small piece of glue code.
  • The alternative (dumping config into a meta tag) would introduce real duplication or maintenance risk in your specific setup.

Look elsewhere when:

  • Laravel is the target. There is no adapter here; you'd be writing the glue anyway, so write it against asset()/Vite manifest and skip the dependency.
  • You're on Symfony 3/4/5/6+ or have migrated off Symfony 2. Symfony 2 reached end of life in 2018; the bundle targets a templating component that has since moved on. This is a migration blocker, not an adoption candidate.
  • Your front end already has a build pipeline (Webpack Encore, Vite, Rollup). Those emit a manifest.json and import.meta.url-style resolution; adding a server-side helper to JS duplicates a problem the bundler already solved.
  • You need active maintenance, security responsiveness, or a support contract. Zero dependents and no recent activity mean no ecosystem pressure to keep it patched.
  • Hot-path performance or CSP-sensitive contexts — any inline-script/config-injection approach should be reviewed against your CSP posture regardless of which tool provides it.

How to Pitch It (Stakeholders)

To executives: This is a small, MIT-licensed utility that closes a specific gap — keeping JavaScript-generated asset URLs in sync with server-side asset configuration (CDN prefixes, cache-busting versions) so a CDN or versioning migration doesn't quietly break images and media loaded by the front end. It is low-cost and low-risk to adopt, but it is legacy-scoped: it serves a Symfony 2 estate only. Do not treat it as a foundation for new work, and do not expect vendor support. Recommended framing: a tactical fix for an existing Symfony 2 application, with roughly one day of in-house glue as the fallback if we'd rather not carry a stale dependency.

To engineering: It's a thin bundle that exposes the templating AssetsHelper to client-side JS. Costs: one dependency, one config block, and accepting a single-maintainer bundle last touched in the Symfony 2 era. The honest comparison is our own two-line config dump (<meta name="asset-base"> + version string) — which we'd need anyway on Laravel, where this package does not apply. Pick this if we want asset package/version resolution to remain server-authoritative and are willing to fork it if it breaks; pick the meta-tag approach if we want zero dependency risk. On a Laravel stack the answer is the Laravel-native path: Vite manifest for build-time hashed paths, an optional cached manifest/base-URL endpoint for runtime resolution, and a small owned asset() module. Either way, the architectural decision is the same: one source of truth for asset URLs across server and client.

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.
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
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console