Skip to content

Fix TIA for Livewire component views - #1812

Closed
lucasromanojf wants to merge 2 commits into
pestphp:5.xfrom
lucasromanojf:codex/fix-tia-livewire-sfc-edges
Closed

Fix TIA for Livewire component views#1812
lucasromanojf wants to merge 2 commits into
pestphp:5.xfrom
lucasromanojf:codex/fix-tia-livewire-sfc-edges

Conversation

@lucasromanojf

Copy link
Copy Markdown

Summary

  • map changed Livewire single-file and multi-file component sources to the generated view hashes already recorded by TIA
  • preserve direct Blade edges and the existing broad watch-pattern fallback when no safe generated-view match exists
  • cover the documented Livewire 4 component locations and formats, including optional emoji filenames, and update the visual test snapshots

Root cause

Livewire renders single-file and multi-file components through generated views under storage/framework/views/*/livewire/views/<hash>.blade.php. TIA recorded those generated paths, but a Git change is reported using the original component path, so the graph could not connect the changed component to its tests.

The graph now derives the same platform-specific source-path hash without requiring Livewire as a dependency and reuses matching generated-view edges. If no matching edge exists, the existing watch-pattern fallback remains unchanged.

Validation

  • composer test
  • fresh TIA baseline in an integration Laravel application: 1,259 tests passed with 2,820 assertions
  • four real Livewire SFC changes across resources/views/components/** and resources/views/pages/**: exactly 7 related test files selected, with 167 tests and 340 assertions passing
  • final integration application gate with --parallel --tia: 1,259 tests passed with 2,820 assertions

Fixes #1808

@lucasromanojf
lucasromanojf force-pushed the codex/fix-tia-livewire-sfc-edges branch from afd2672 to df7bbe3 Compare August 1, 2026 19:54
@lucasromanojf
lucasromanojf force-pushed the codex/fix-tia-livewire-sfc-edges branch from df7bbe3 to 333aaa8 Compare August 3, 2026 19:11
@lucasromanojf
lucasromanojf force-pushed the codex/fix-tia-livewire-sfc-edges branch from 333aaa8 to 0030e83 Compare August 4, 2026 19:52
…re-sfc-edges

# Conflicts:
#	src/Plugins/Tia/Graph.php
#	tests/.snapshots/success.txt
#	tests/Unit/Plugins/Tia/Graph.php
#	tests/Visual/Parallel.php
@lucasromanojf

Copy link
Copy Markdown
Author

Fechando: o mesmo fix já foi aplicado diretamente no branch 5.x no commit eb88513 ("fix: livewire", por nuno maduro). O código em 5.x é idêntico ao deste PR (Graph.php e testes). Correção ainda sem tag/release — deve sair na próxima versão.

@lucasromanojf
lucasromanojf deleted the codex/fix-tia-livewire-sfc-edges branch August 7, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TIA invalidates almost the entire suite for Livewire 4 single-file component views

1 participant