Skip to content

Fix filesystem aliases in vendor and Blade discovery - #369

Merged
AJenbo merged 1 commit into
PHPantom-dev:mainfrom
shuvroroy:fix/vendor-path-aliases
Aug 17, 2026
Merged

Fix filesystem aliases in vendor and Blade discovery#369
AJenbo merged 1 commit into
PHPantom-dev:mainfrom
shuvroroy:fix/vendor-path-aliases

Conversation

@shuvroroy

Copy link
Copy Markdown
Contributor

Summary

  • Normalize registered vendor roots once before analyzer walks compare canonical paths.
  • Retain both raw and canonical vendor spellings, including after a late Composer install.
  • Normalize Blade template paths against canonical view roots, with a parent fallback for deleted files.
  • Add deterministic Unix regressions for analyzer vendor pruning and Blade view-name resolution through symlinks.

Why this is separate

This filesystem behavior was discovered while working on #368, but it is independent of Laravel named-resource strings. Splitting it out keeps both changes focused and reviewable.

Verification

  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check
  • PHP playground syntax checks
  • PHP playground runtime assertions
  • Laravel demo syntax check
  • Laravel analyzer reports exactly the three intentional errors

Checklist

  • I have updated CHANGELOG.md
  • I have updated the documentation where applicable
  • I have added tests to cover my changes
  • I fully understand the code that I am submitting, including code drafted with an LLM
  • I have proof-read and copy-edited generated prose

🤖 Generated with Codex

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shuvroroy

Copy link
Copy Markdown
Contributor Author

CI note: the benchmark job reported a broad 31–76% slowdown across unrelated completion, hover, parsing, and diagnostics suites, then failed while trying to post its alert review because the fork token received a 403. The same filesystem-alias commit is included in #371 and #372, where both CPU and memory comparison jobs passed.

This looks like runner variance rather than a path-normalization regression. I cannot rerun an upstream workflow from the fork without repository admin permission; please rerun the failed benchmark job when convenient.

🤖 Generated with Codex

@AJenbo
AJenbo force-pushed the fix/vendor-path-aliases branch from fcfcd0e to 3f9d21a Compare August 17, 2026 01:36
@AJenbo

AJenbo commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

I'm on Linux so things might be a bit different, but I made some small corrections after testing:

The regression I fixed

view_names_for_blade_uri canonicalized the template path instead of trying it raw. A template that is itself a symlink into a shared directory then resolves out of its view root and gets no view name at all, so its callers' variables stop being typed. I added view_name_resolution_keeps_symlinked_templates, confirmed it fails on the commit as written (left: [], right: ["shop"]), and restructured the matching to try raw first and fall back to canonical only when the spellings don't line up.

That reordering is also a performance win over main: the old code canonicalized every view root on every call, and blade_render_order calls this once per Blade URI. The common case now costs zero syscalls, and the template path is canonicalized lazily through a OnceCell so it happens at most once even with several roots.

@AJenbo
AJenbo merged commit ec47f80 into PHPantom-dev:main Aug 17, 2026
7 of 8 checks passed
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.

3 participants