-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add support for static caching #61
Add support for static caching #61
Conversation
Thinking about this a little more, it might be a bit overkill to have an array of An array of But if we just deal with one replacer, it's maybe sufficient to just have a |
Thanks for this PR, which does look really good. Are there any side effects we should be aware of might it even be a breaking change somehow?
Does it work without any conflicts, in case I update the Livewire addon, but still include my Livewire assets manually? |
Yes, it all works without conflicts. If you manually include the Livewire assets, the assets won't be injected a second time. See here: statamic-livewire/src/Replacers/AssetsReplacer.php Lines 34 to 46 in aab2b6a
|
Thanks. I just wanted to be sure. |
This PR adds a new
AssetsReplacer
class to make Livewire compatible with Statamic's static caching. The replacer is merged with existing replacers and loaded automatically. Users may swap the replacer class with their own implementation or add additional replacers in the config.The
AssetsReplacer
adds support …@assets
Blade directive. Without this PR, the assets wouldn't be pushed to the head at all.