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

[v1] allow dev to specify extra attributes on the HTML element #7

Closed
tabacitu opened this issue Nov 24, 2021 · 1 comment
Closed

[v1] allow dev to specify extra attributes on the HTML element #7

tabacitu opened this issue Nov 24, 2021 · 1 comment

Comments

@tabacitu
Copy link
Member

If loading something from a CDN, the dev might want to pass integrity and crossorigin. Or hell, maybe even something for lazy-loading. Currently we have no way of doing that. So after #6 I think we should add a second parameter, so that you can do:

@loadOnce('http://domain.com/some.js', [
    'integrity' => 'sha256-0YPKAwZP7Mp3ALMRVB2i8GXeEndvCq3eSl/WsAl1Ryk=',
    'crossorigin' => 'anonymous',
])

It's not pretty, but... it should be useful. The implementation isn't difficult at all, it's basically the same thing we do in the script widget in Backpack. And this parameter would be optional, so it'd be a non-breaking change.

Just writing it out so we don't forget about it.

@promatik
Copy link
Collaborator

We can close this one since bassets allows to set tag attributes 🎉

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

No branches or pull requests

2 participants