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

Ts Bundle Laravel Package

yabx/ts-bundle

yabx/ts-bundle is a PHP package for bundling and managing TypeScript assets in your application. It streamlines TypeScript build integration with straightforward configuration, helping keep frontend assets organized, maintainable, and easier to manage within your development workflow.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What the package is. yabx/ts-bundle is a Symfony bundle (not Laravel) that generates TypeScript type definitions from PHP-side contracts — entities, DTOs, enums, and likely controller signatures — so the frontend consumes compiler-checked types rather than hand-maintained .d.ts files. This is a well-understood category (comparable in intent to symfony/ux type generation, typescript-transformer, and OpenAPI→TS pipelines), but this specific implementation is unproven: 2 stars, 0 dependents, and an opportunity score of 0.01 indicate effectively zero ecosystem validation.

Architecture fit — poor as a direct dependency. Three structural mismatches:

  1. Framework mismatch. Our stack is Laravel. Symfony bundles register via Bundle classes, Extension/Configuration DI semantics, and bundle auto-discovery — none of which Laravel's service container consumes. There is no install path short of forking.
  2. Version coupling. The package targets Symfony 8, which requires PHP 8.4 and ships the newest component major line. Laravel 12 pins Symfony components to 7.x, so a coexistence install will almost certainly fail dependency resolution. This is a hard blocker today and a moving target even after Laravel's next major.
  3. Semantic mismatch. Type mapping is driven by Doctrine entity metadata and Symfony serializer/validator conventions. Laravel's Eloquent models, casts, API Resources, and Form Requests encode types differently; the introspection layer would produce incomplete or incorrect output without substantial rework.

Integration feasibility. Direct composer require into a Laravel app: not feasible. Fork-and-port into a Laravel service provider: feasible but a genuine engineering project, not a package adoption — you would be reimplementing the introspection layer against Eloquent/Resources while keeping the emitter. Value of the fork depends entirely on the emitter's quality, which is precisely the part we cannot assess from 2 stars and no dependents.

Technical risk — high. Single-vendor, single-maintainer project with no release history to speak of. No test matrix visibility, no security disclosure process, no backward-compatibility track record. Symfony 8 targeting means the maintainer is building forward-looking, which is fine for a hobby project and dangerous for a production contract surface. Critically, this package's failure mode is silent contract drift — emitted types diverge from runtime behavior and the frontend compiles cleanly against a lie.

Key questions before any further spend:

  • What is the actual type-coverage surface — scalars only, or unions, nullability, generics, enums, discriminated unions, readonly?
  • How are breaking changes signaled? Does it emit a schema hash or diff for CI gating?
  • Is output deterministic and stable across runs (ordering, naming collisions, nested DTOs)?
  • Does it integrate with an existing contract source (OpenAPI/JSON Schema) or is it a closed introspection loop?
  • License and maintenance intent — is this a published internal tool or a supported library?

Integration Approach

Stack fit: none. Treat this as a reference implementation for a pattern, not a component to install. The problem it addresses — keeping TypeScript types synchronized with backend contracts — is real and worth solving; the artifact is not the solution for us.

Recommended path: contract-first via OpenAPI. We already have a viable Laravel-native route to the same outcome:

  • dedoc/scramble or knuckleswtf/scribe → OpenAPI 3.1 spec generated from routes, Form Requests, and API Resources, checked into the repo.
  • openapi-typescript (or orval) → TypeScript types and typed fetch clients in the frontend.
  • CI gate: regenerate spec, fail the build on uncommitted diff.

This gives deterministic output, an explicit contract artifact, language-agnostic consumers (mobile, partner integrations), and a large maintained ecosystem — all the things this bundle cannot offer at 2 stars.

Migration path (if we deliberately choose to evaluate the bundle's approach):

  1. Time-boxed spike, 2–3 days. Clone, run against a synthetic Symfony 8 + PHP 8.4 scratch app (Docker), and inspect emitted output for a representative model set: nullable relations, enums, nested DTOs, collections. Deliverable: sample .d.ts plus a coverage verdict.
  2. Gap analysis. Diff its output against what our OpenAPI-based pipeline already produces. The only justification to continue is a materially better result on a case OpenAPI cannot express.
  3. Port decision gate. If and only if the spike shows clear superiority, scope a fork as an internal package (internal/laravel-ts-types) behind a service provider. Estimate 3–4 weeks of engineering plus ongoing maintenance — weigh against the near-zero cost of the OpenAPI path.
  4. Default decision: do not proceed past step 2. Document the outcome in the architecture decision record so this is not re-litigated.

Compatibility. If a fork is ever built, pin it to a specific Laravel/Symfony component line, lock PHP minor version in CI, and run generation against the same runtime version as production. Never allow the generator to float across majors independently of the framework.

Sequencing. Contract-generation hygiene (OpenAPI + CI gate) first — it delivers most of the value and de-risks everything downstream. TypeScript client generation second. Only then revisit bespoke PHP introspection.

Operational Impact

Maintenance. As a dependency: unquantifiable, which for a contract-bearing tool means unacceptable — a stalled upstream leaves us pinned to a dead framework major. As a fork: we own it outright, roughly 0.25–0.5 FTE ongoing to track Laravel releases, plus a recurring tax every framework upgrade. Neither is attractive relative to a maintained OpenAPI toolchain.

Support. None meaningful. Two stars and zero dependents means no issue-tracker history to mine, no Stack Overflow corpus, no third-party writeups, and no peer to ask. Every problem becomes first-principles debugging against a codebase we did not write.

Scaling. Generation is a build-time batch job; scaling is a non-issue technically. The real scaling concern is organizational: as the number of models and consuming clients grows, an undocumented bespoke type mapper becomes a single point of contract failure across every frontend surface, and its quirks become folklore held by one or two engineers.

Failure modes, ranked:

  1. Silent contract drift — emitted types diverge from runtime (wrong nullability on an optional relation, a cast Eloquent applies at runtime but not in metadata). TypeScript compiles; production returns null; runtime error in the browser. Highest severity, lowest detectability.
  2. Upstream abandonment — maintainer stops, we are frozen on Laravel N with no upgrade path.
  3. Dependency deadlock — Symfony 8 components block Laravel upgrades or vice versa, forcing a rush fork.
  4. Non-deterministic output — ordering or naming churn creates permanent merge noise and erodes trust in the diff-based CI gate, which is the control that makes the whole scheme safe.
  5. Coverage gaps — unsupported constructs fall back to any, quietly disabling type safety exactly where the domain is most complex.

Mitigation for all of the above is identical: an explicit, checked-in contract artifact with CI diff enforcement. That is the OpenAPI path.

Ramp-up. Near zero for the OpenAPI route — both tools are widely documented and any mid-level engineer can extend the pipeline. For a fork of this bundle: 2–3 weeks for one engineer to reach competence on the introspection and emission layers, with bus factor 1 unless a second engineer is deliberately trained.

Bottom line. Do not adopt. Log it as a pattern reference, run the 2–3 day spike only if a specific introspection gap in our OpenAPI pipeline is identified, and default to the contract-first route.

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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route