hec-franco/twig-inspector
Twig Inspector adds debugging tools for Twig templates, letting you trace which template rendered each part of a page and inspect variables, includes, and blocks directly from the browser. A practical helper for faster template debugging and clearer view-layer insight.
Architecture fit
hec-franco/twig-inspector is a development-time instrumentation layer for the Twig rendering pipeline: it annotates rendered markup with markers (HTML comments or attributes) identifying which template, block, or file:line produced a fragment. That is a diagnosis aid, not infrastructure — it changes nothing about user-facing behavior, so it belongs in the developer-experience bucket rather than the product roadmap. The architectural catch is stack fit: Twig is not Laravel's native engine, so the package has no insertion point in a standard Blade application. It only becomes relevant where Twig is actually rendering (a Symfony service, or a Laravel app running rcrowe/twigbridge). Worse, it hooks the templating layer itself — the exact layer you least want a small, unmaintained third-party dependency inside.
Integration feasibility
Low-to-moderate, and the deliverable is a fork rather than a dependency. There is no documented Laravel support, no extra.laravel.providers auto-discovery evidence, and no obvious config surface; integration into a Laravel/TwigBridge app means writing and owning an adapter that grabs the shared Twig Environment, registers the extension, and hard-gates enablement on APP_DEBUG or an explicit env flag. Realistic spike: 1–3 engineer-days plus a test pass. For a standard Blade codebase the functional need is already served by Telescope, Debugbar, and Blade directives, so feasibility is moot.
Technical risk High relative to value delivered:
NOASSERTION means the license could not be identified. That is a hard legal gate before any code — even require-dev — enters a commercial repo.Extension, NodeVisitor, compiled-template cache); Twig 2→3 and Symfony major bumps are routine breakage points with nobody upstream to fix them.The decision this actually supports is build-vs-adopt on a very small capability: an afternoon spiking this versus ~50–100 lines of internal debug middleware you own and can license cleanly.
Key questions
data-* attributes, or both), and is each toggleable?Environment, or require bundle-level boot? This determines whether a TwigBridge adapter is even possible.Stack fit Conditional and narrow. Viable for Symfony/Twig services or Laravel services genuinely rendering through TwigBridge. For a Laravel + Blade codebase this is a no-go — the premise does not apply, and the legal/ownership overhead buys nothing.
Migration path Treat it as a vendored dev tool, never a runtime dependency:
require-dev only, pinned to a commit SHA — no floating constraints on a package with no release history.TwigInspectorServiceProvider) that no-ops outside local/dev.Compatibility
Unverified on our side. Must confirm PHP ceiling, Twig 2 vs 3, bundle version, and — critically — TwigBridge's Environment lifecycle, since the tool is useless unless it decorates the same environment the app renders through. A CI matrix across our supported PHP/Twig versions is required before we can call it "supported internally."
Sequencing
{{ dump() }} + Xdebug.Maintenance We inherit it permanently. The code surface is small so the ongoing burden is modest, but it is ours: no expectation of upstream fixes, Twig-version support, or security patches. Budget a recurring compatibility line item at every Twig/Symfony/PHP upgrade.
Support No vendor, no SLA, one maintainer, no dependents to lean on for community answers. Support is internal by definition, and any incident involving the tool routes to the adopting team.
Scaling Irrelevant in the intended dev-only mode. The scaling risk is accidental exposure: enabled in a shared environment, overhead scales with request volume × template nesting depth, and injected markup inflates response size and breaks caching/compression assumptions. The real scaling concern is organizational — one mis-set env var replicated across many services.
Failure modes
Ramp-up Low for engineers fluent in Twig and Symfony bundle mechanics; moderate for a Laravel team, who must first understand TwigBridge's environment wiring before the tool does anything at all. Documentation is thin, so expect source-reading rather than docs-reading — roughly a day of onboarding per engineer, amortized only if the team is genuinely Twig-centric.
TPM recommendation Do not adopt for a Laravel/Blade stack. Hold for a TwigBridge-based service only after license clarification, and only as a forked, dev-gated, internally-owned tool with a timeboxed spike and a CI guard against production inclusion. Given zero ecosystem validation and unresolved licensing, expected value is low and ownership cost non-trivial: a half-day evaluation and, if the capability is genuinely needed, a ~50-line internal injector we own outright. No budget impact, no product risk, no user-facing change — this is an engineering-enablement line item, not roadmap.
How can I help you explore Laravel packages today?