Skip to content
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

Register directives only when Blade is actually needed #395

Merged
merged 1 commit into from
May 24, 2022
Merged

Register directives only when Blade is actually needed #395

merged 1 commit into from
May 24, 2022

Conversation

mabdullahsari
Copy link
Contributor

Hey 👋

Thanks so much for creating Inertia. Today, I finally got the chance to try it out.
Everything went smoothly, but something caught my eye in the ServiceProvider.

According to this line in Response, Inertia is only making use of BladeCompiler for its very first render. After that, Blade is never touched.

However, due to the way things are handled in the ServiceProvider, BladeCompiler is instantiated for every request even when it's not needed. This PR fixes that by leveraging the events provided by the IoC Container. callAfterResolving is available since Laravel 6, so it's fully backwards compatible.

Thanks!

@reinink reinink merged commit 84f18f8 into inertiajs:master May 24, 2022
@reinink
Copy link
Member

reinink commented May 24, 2022

Makes sense, thanks! 👍

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.

2 participants