Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nowo-tech/TwigInspectorBundle/llms.txt

Use this file to discover all available pages before exploring further.

All notable changes are documented here. The format follows Keep a Changelog and this project adheres to Semantic Versioning.

[Unreleased]

No unreleased changes at this time.

1.0.25 — 2026-02-18

Added

  • Compiler pass: TwigPathsPass registers the bundle’s Twig views path with the native Twig loader so that application overrides in templates/bundles/NowoTwigInspectorBundle/ are consulted first.
  • Documentation: New USAGE.md covering overview, step-by-step usage, filter, shortcuts, full panel, overriding bundle templates, and troubleshooting.
  • Tests: Unit tests for TwigPathsPass (loader resolution and path registration).

Changed

  • Dependencies and demo app Composer locks updated; PHP CS Fixer applied.
  • Bundle template and service wiring minor updates.

1.0.24 — 2026-02-18

Fixed

  • CI: Pin symfony/console to the same major version as the Symfony matrix in the workflow to avoid pulling Console 7.x when testing PHP 8.4 with Symfony 6.4 (caused a fatal error due to DebugCommand::configure() signature mismatch).
  • Tests: Integration test testInstallCommandRunsAndCreatesConfigAndRoutes now uses Application::addCommand() on Symfony Console 7.0+ and falls back to Application::add() on 6.4.

1.0.23 — 2026-03-14

Added

  • TypeScript tests: Full coverage for the frontend entry point and types. New index.test.ts tests toolbar presence, DOM setup, checkbox and icon click, filter input, keyboard shortcuts (Ctrl+Shift+T, Ctrl+Shift+R, Escape), and both DOMContentLoaded and readyState paths.
  • BlockStorage tests: Sort order when a block has Twig then controller template; controller range with a text node before the element.
  • Overlay tests: updateFilterHighlights when some blocks do not match the filter; handleBlockClick early return when templateIndex is not set.

Changed

  • Coverage: Vitest thresholds set to 100% for lines, statements, and functions; 99.5% for branches.
  • Overlay: Click handler logic extracted to handleBlockClick(event) for testability.
  • BlockStorage: c8 ignore comments added where v8 underreports branches in jsdom.

1.0.22 — 2026-03-13

Fixed

  • InstallCommand tests: Normalize console output in tests so assertions pass when SymfonyStyle wraps lines with block borders. Fixes five failing unit tests in environments where the console formats warning/note blocks with line breaks.

1.0.21 — 2025-02-19

Fixed

  • InstallCommand: Moved help text from #[AsCommand(help: ...)] to setHelp() in configure(). Symfony Console 6.x does not accept the help named parameter in Command::__construct(), which caused “Unknown named parameter $help” on PHP 8.1 with Symfony 6.4.

1.0.20 — 2025-02-18

Fixed

  • DataCollector / services.yaml: Corrected TwigInspectorCollector constructor arguments — removed incorrect @request_stack; the second argument is ?Twig\Environment (@twig). Fixes TypeError when loading the bundle on Symfony 8.

Changed

  • Tests: Added testOnKernelResponseSkipsWhenResponseContentIsFalse to improve PHP test coverage (methods 95.06%, lines 97.84%).

1.0.19 — 2026-03-02

Fixed

  • DataCollector: Serialization for web profiler — $enableMetrics is restored in __unserialize() and lateCollect() guards with isset() so the collector does not throw “Typed property $enableMetrics must not be accessed before initialization” on PHP 8.5.

Changed

  • Demos: Symfony 6 demo uses FrankenPHP without worker mode for reliable startup in CI.
  • Dependencies: Composer lock and Symfony 7.4.6 in demos; PHP-CS-Fixer 3.94.2.

1.0.18 — 2026-03-02

Changed

  • CI: Simplified GitHub Actions workflow; testing integrated into main docker-compose.yml.
  • Docker: Root Dockerfile updated to PHP 8.2 with Node.js for asset management.
  • PHP-CS-Fixer: Configuration updated for improved code style consistency.
  • Demos (Symfony 6, 7, 8): Added README per demo; Makefile and docker-compose adjustments.

Removed

  • docker-compose.test.yml: Removed; tests now run via the main docker-compose setup.

1.0.17 — 2026-02-18

Fixed

  • OpenTemplateController: Skip non-string namespaces in collectFilesystemPaths() to avoid TypeError when FilesystemLoader::getNamespaces() returns integer keys.

Changed

  • Demos: Custom Caddyfile serves HTTP on port 80 (no HTTPS). Access at http://localhost:8001.
  • Root Makefile: Asset targets (assets, assets-dev, assets-watch, assets-clean) now run inside the Docker container.

1.0.16 — 2026-02-18

Changed

  • DependencyInjection: Removed redundant setArgument() calls in NowoTwigInspectorExtension. Configuration is now passed solely via parameters. Internal refactor — no user-facing changes.
  • Makefile: Asset targets renamed for clarity — build-assetsassets, build-assets-devassets-dev, watch-assetsassets-watch, clean-assetsassets-clean.

1.0.15 — 2026-02-18

Added

  • Security — prod restriction: The “open in IDE” controller returns 404 in prod even if routes were accidentally enabled.
  • ChainLoader support: Template path validation now works when using ChainLoader with multiple Twig template directories.

Changed

  • Routes: Recipe and InstallCommand now import routes with when@dev: and when@test: only.

1.0.14 — 2026-02-18

Changed

  • Dependencies: Updated composer.lock.
  • Services: Internal services now use FQCN as service IDs. The controller service nowo_twig_inspector.controller.open_template is unchanged for route compatibility.
  • Configuration: Added commented placeholder for future optimize_output_buffering option in the config template.

1.0.13 — 2026-02-18

Fixed

  • .gitattributes: Fixed malformed line (missing newline before comment) that could cause “not a valid attribute name” errors.

Changed

  • Documentation: Clarified asset pipeline (TypeScript → JavaScript) in DEVELOPMENT.md and CONTRIBUTING.md.

1.0.12 — 2026-02-11

Added

  • Configuration: New option inject_on_sub_requests (bool, default false). Set to true when your main HTML is rendered during a sub-request and all templates show “sub-request” in the panel.

Changed

  • Overlay default: When the inspector is enabled, the overlay is off by default. Click the </> toolbar icon to turn it on (green); click again to turn it off (yellow).
  • Toolbar dropdown: Filter input and Rescan button are now initialized after DOMContentLoaded so they reliably appear in all environments.

1.0.11 — 2026-02-10

Added

  • Web Profiler — Controllers tab: Lists every controller invoked in the request (main controller + sub-requests). Each row shows controller name, role (Main / Fragment), and render count.
  • Controller HTML comments: When the inspector is enabled, HTML comments are injected for controllers using box-drawing characters, wrapping each fragment’s output.
  • Overlay — controller recognition: Hovering over an element inside a controller range shows the controller (and template) in the tooltip.
  • Panel — Renders column: Templates and Blocks tables now show how many times each template/block was rendered.

Changed

  • TwigInspectorCollector: Now receives ControllerRenderSubscriber as its first constructor argument. No user-facing breaking change.

1.0.10 — 2025-02-10

Added

  • Screenshots: Three screenshots added to the README (overlay tooltip, toolbar dropdown, DevTools HTML comments).
  • Panel: New “How to use” tab in the collector panel (first tab by default).
  • Filter: Filter by template path as well as name; comma-separated terms (OR logic); persistent highlight frames when filter is active.
  • Tests: Vitest + jsdom for frontend; blockMatchesFilter() unit tests.

Fixed

  • Template timing: Collector now detects Symfony\Bridge\Twig\Extension\ProfilerExtension so timing data appears when the Twig profiler is enabled.

Changed

  • Toolbar dropdown: Simplified; long “How to use” block moved to the panel tab.

1.0.9 — 2025-01-26

Fixed

  • Twig 4.0+ compatibility: Added #[\Twig\Attribute\YieldReady] attribute to the NodeStart class to resolve deprecation warnings in Twig 4.0+. NodeEnd already had this attribute; both node classes are now consistent.

1.0.8 — 2024-12-15

Changed

  • Packagist: Improved package discoverability — enhanced description and expanded keywords in composer.json.

1.0.7 — 2024-12-15

Changed

  • Documentation: Moved all documentation files into the docs/ directory.

Fixed

  • Twig 3.15+ compatibility: Replaced direct Node instantiation with BodyNode in DebugInfoNodeVisitor to resolve deprecation warnings introduced in Twig 3.15.

1.0.0 — 2024-12-11

Initial stable release.

Compatibility

DependencySupported versions
PHP>= 8.1, < 8.6
Symfony>= 6.0, >= 7.0, >= 8.0
Twig>= 3.8, >= 4.0
Symfony Web Profiler>= 6.0, >= 7.0, >= 8.0

Added

  • Twig template inspection with visual overlay — hover over HTML elements to see which template rendered them, click to open in IDE.
  • HTML comments injected before and after Twig blocks using box-drawing characters.
  • Symfony Web Profiler integration — toolbar toggle, enable/disable checkbox, and JavaScript overlay.
  • OpenTemplateController for opening templates directly in the IDE.
  • TwigInspectorCollector DataCollector for Web Profiler.
  • Twig extensions and node visitors for comment injection.
  • PHPUnit test suite, PHP-CS-Fixer configuration, Docker development environment, and Makefile.

Build docs developers (and LLMs) love