Closed juliomotol closed 4 years ago
I just saw PR https://github.com/Elhebert/laravel-sri/pull/37 and I think this is a cleaner solution since $attributes
is more general than $execute
but the idea is pretty much the same.
Nice PR, I'll have a deeper look later this week.
I think that I might remove the Blade directive soon to use Blade component that will provide a far better DX 🤔
Interesting! On v3 maybe?
I also noticed that you're setting an alias for Sri::class
with sri
in lowercase. Normally, aliases are pointed to the facade and is CamelCased.
$this->app->alias(SriFacade::class, 'Sri');
I think I will first do a new minor with the components, then remove them in a major version (so yeah 3.0). It's a bit hard for me to work on this package as I'm currently not working with Laravel anymore. But I do intent to do a full rewrite for a v3 at some point.
For the Alias I think we can remove the one in the service provider because I set one in the composer.json:
https://github.com/Elhebert/laravel-sri/blob/master/composer.json#L42-L44
I see. I also have a few concerns that could be implemented in v3 if you are open for an RFC.
I'll create an issue for v3 improvements.
See #57.
This PR aims to improve the current blade directives available with the following notable changes:
@mixSri
and@assetSri
blade directives.@mixSri('app.css', true)
doesn't work since the directive because when extending the directive, it only allows 1 parameter.script
andlink
tags attributes.@assetSri(string $path, bool $useCredentials, string $attributes)
.Sri
class.This PR also adds tests for the blade directives which there wasn't any before.