-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolves view factory only at services' construction time #773
Conversation
Signed-off-by: Matteo Orefice <[email protected]>
0178e6c
to
1235572
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR makes sense to me, also tested it locally.
However the change in createLocalViewFactory
looks like a micro-optimization .. I suggest to leave the method as is.
Further, I think this can be removed from the boot()
method:
if ($this->app->has('view')) {
$viewPath = __DIR__ . '/../resources/views';
$this->loadViewsFrom($viewPath, 'ide-helper');
}
When this code was rewritten to use a standalone view, it wasn't removed but the package also isn't referencing it 🤷♀️
Do we even need to explicitly list the factories? We can just use DI now right? |
Probably not because of #475
People use dedicated view factories not supporting php views, thus packages assuming php templates work (like this) break, thus a custom view is necessary. |
@MatteoOreficeIT do you still need the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo of createLocalViewFactory optimization that is not strictly required
Yes, this code break the Laravel register/boot event sequence, my only remark is about the time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests are failing however
Hi, I will try to fix in next days |
Closing due to inactivity |
Signed-off-by: Matteo Orefice [email protected]
This change allows to register
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider
in any order inapp.php
, I discovered it cannot be registered beforeIlluminate\Filesystem\FilesystemServiceProvider
so the documentation is not really in sync because it throws an error if we putBarryvdh\LaravelIdeHelper\IdeHelperServiceProvider
at the topBased on my actual knowledge trying to resolve object via the container is not allowed before every provider's register() method has been completed