tienvx/ux-collection-js
tienvx/ux-collection-js is a lightweight Laravel/PHP package for dynamic form collections. It makes it easy to add, remove, reorder, and manage repeatable fields or list items in the browser with minimal JavaScript and simple, Blade-friendly integration.
What the package actually is. tienvx/ux-collection-js is a third-party split of Symfony UX "Collection" — the Stimulus controller that powers dynamic add/remove rows in Symfony form collections. The first finding for a Laravel/PHP evaluation is a premise mismatch: this is a Symfony UX package, not a Laravel package. It inherits Symfony UX conventions (Twig helpers, Flex recipe, symfony/stimulus-bridge, bundle registration) that have no counterpart in a Laravel application. Only the JavaScript asset is potentially portable; the PHP half is effectively inert in our stack.
Architecture fit. Poor as a dependency, plausible as a reference implementation.
| Layer | Fit with Laravel stack | Notes |
|---|---|---|
| PHP/Composer package | None | Symfony Flex recipe + bundle registration; Laravel has no bundle kernel. Installing it pulls unused symfony/ux-* tree. |
| Twig integration | None | We render Blade. Any Twig helpers are dead code. |
| Stimulus controller (JS) | Conditional | Works only if we deliberately adopt Stimulus alongside Vite; not idiomatic Laravel. |
| Asset distribution | Weak | 2022-era Encore/encore_entry_* assumptions; modern Laravel uses Vite/importmap. |
Integration feasibility. Low-to-moderate. A Laravel team could consume the controller by copying or npm-vendoring the JS and wiring it to a Blade partial, but at that point we have reimplemented the integration and own it — the package adds no leverage. The Composer path is not viable.
Technical risk.
startStimulusApp, @symfony/stimulus-bridge registration, ControllerFactory) — the 2022 build is likely broken against current asset tooling.*-js splits; no evidence of a support commitment.Key questions for the maintainer / spike.
Stack fit and recommendation. Do not add this as a runtime dependency. Treat it as a design reference and, if the collection UX matches our needs, port the controller into our own first-party front-end code. Our target stack is Blade + Vite + Livewire/Alpine; Symfony UX is a foreign idiom and adopting it for one widget imports a second component model into the codebase.
Viable options, ranked.
resources/js/vendors/, pin to a commit SHA, add a provenance header and a link to the upstream repo.vendor/.Migration path. There is nothing to migrate from; this is greenfield adoption. The only migration concern is the reverse — if a team has already copied the controller, define an internal package path so it can be swapped for a first-party implementation without touching templates.
Compatibility constraints to verify in a spike.
data-collection-* names) that must be reproduced in Blade.Sequencing.
Maintenance. Ownership lands entirely with us either way. As a dependency, we would carry an unmaintained 2022 artifact with no upgrade path and no upstream to escalate to. As a port, we carry ~50 lines we control. The port is strictly cheaper over a 12-month horizon; dependency adoption here is negative-value maintenance.
Support. None commercial, single maintainer, no SLA. Internal support burden falls on whichever team owns the form layer. Because the code is client-side only, failures surface as UI breakage in forms — high-visibility, moderate-severity, easy to hotfix.
Scaling. No backend or infrastructure scaling impact — no server-side execution, no DB, no queue. The only scale dimension is form complexity (row counts, nested collections), where the original implementation's DOM cloning approach may degrade on very large collections. Validate against our worst-case form (target: 200+ rows, 2 levels of nesting) rather than assuming.
Failure modes.
| Mode | Trigger | Impact | Mitigation |
|---|---|---|---|
| Asset pipeline incompatibility | Vite/ESM vs 2022 Encore build | Widget silently dead | Spike before adoption; port avoids entirely |
| Upstream abandonment | already the case | No fixes, no security patches | Port and own the code |
| Contract drift | Blade markup diverges from expected data attributes | Add/remove no-ops | Document attribute contract; add E2E test |
| Index renumbering bugs | Nested collections, deletions | Corrupt form payloads, silent data loss | Explicit test for delete-then-submit |
| Knowledge concentration | Only the porter understands the controller | Slow incident response | Inline comments, ADR, code review |
Ramp-up. Low for JS developers: Stimulus is a small API and the controller is short. The real cost is conceptual, not technical — a Laravel team must learn Symfony UX conventions to read the upstream docs, then discard most of them. Budget half a day of orientation, and expect the port to take longer than the "copy the file" estimate once markup contracts and nested-collection behavior are covered.
Bottom line for the roadmap. Score 0.619, 13 stars, and a three-year release gap do not support a production dependency, and the Symfony-vs-Laravel mismatch makes the Composer route a non-starter. Use the repository as prior art for a first-party Livewire or Alpine implementation, record the decision in an ADR, and revisit only if the maintainer ships a 3.x release with a documented, framework-agnostic ESM entry point.
How can I help you explore Laravel packages today?