Repository navigation
[13.x] Resolve view namespace hints like view locations - #62005
Merged
Merged
Conversation
|
Thanks for submitting a PR! Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
This was referenced Oct 13, 2026
view:cache compiles every view at its real path, and Blade names a compiled view after the path the finder returns. Locations are already resolved with realpath(), but namespace hints are kept as given, so a package that registers its views through a path with ".." gets none of them precompiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013KFfWQLT7PsmH3zswyjmqv
realpath() returns a Windows path with backslashes, while the view finder joins a view name with a forward slash, so view:cache never compiles a view at the path it renders from on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013KFfWQLT7PsmH3zswyjmqv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013KFfWQLT7PsmH3zswyjmqv
fgilio
force-pushed
the
resolve-view-namespace-hints
branch
from
October 20, 2026 10:19
cd758ca to
838a057
Compare
fgilio
marked this pull request as ready for review
October 20, 2026 10:47
Contributor
Author
|
Please let me know if something should be different, I'm happy to iterate as needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a package registers its views through a path with
..in it,view:cachedoesn't help. Each of its views compiles again on the first request that renders it.Blade names a compiled view after the path the finder returns, and
view:cachecompiles each file at its real path. For a hint like__DIR__.'/../resources/views', those paths differ, and so do the compiled files.I ran into this with Flux, which registers its components from
src/../stubs/resources/views/flux. On a fresh app, afterview:cache, rendering five Flux components still compiled 8 Flux views at runtime. On a read-only filesystem (#26357), those requests fail.#26395 fixed this for view locations by running them through
realpath()inFileViewFinder::resolvePath(). This PR does the same for namespace hints, inaddNamespace(),prependNamespace()andreplaceNamespace(). With it, the same app compiles no Flux view at runtime.Backwards compatibility
resolvePath()keeps the path as given whenrealpath()fails, like it does for locations.view:cachealready compares paths byrealpath()when it skips nested ones ([12.x] Deduplicate paths in view:cache #59145), so now the finder and the command agree.Tests
ViewFileViewFinderTest: all three methods resolve hints, and a missing path stays as given.BladeTest:view:cachecompiles a view under a..hint at the path it renders from. It fails without the change. It's skipped on Windows, whererealpath()returns backslashes and the finder joins view names with/, so the two paths never match there, with or without this PR.ExceptionReportingTest: the expected compiled path now comes from the resolved hint. It only differs on Windows.livewire/flux#2856 makes the same fix inside Flux, for apps on Laravel 10, 11 and 12.
🤖 Generated with Claude Code
https://claude.ai/code/session_013KFfWQLT7PsmH3zswyjmqv