-
Notifications
You must be signed in to change notification settings - Fork 0
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 hotwired #98
add hotwired #98
Conversation
func HotwiredImportTemplateFunction() template.HTML { | ||
return template.HTML(` | ||
<script type="module"> | ||
import hotwiredTurbo from 'https://cdn.skypack.dev/@hotwired/turbo'; |
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.
I'm not a big fan of CDN hosted JS & CSS, however I'm not sure how else we should handle that.
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.
'm not a big fan of CDN hosted JS & CSS
Why exactly?
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.
Privacy, Security, depending on the CDN... also it's against the law, at least for customer facing stuff, imho all in all bad practice:
https://httptoolkit.tech/blog/public-cdn-risks/
https://shkspr.mobi/blog/2020/10/please-stop-using-cdns-for-external-javascript-libraries/
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.
We would require our own CDN then. Also our tools are not customer facing.
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.
You don't require your own CDN if you just put it in the source. But of course this would make it larger.
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.
I would not mind putting that to s3/cf. Or ship it directly. Not great, but not terrible.
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.
just put it in the source
I'd like not to have a 22.6 kB text file in SCM (for Hotwired alone, not counting other deps like Bootstrap).
I would not mind putting that to s3/cf. Or ship it directly. Not great, but not terrible.
Would work for me, but would require some access protection in case someone else uses this library.
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.
I will try Git LFS, but in another PR.
Hotwired Turbo is useful for dynamically updating websites without having to do JavaScript magic. We have a recurring use-case of status pages that could benefit of this. These status pages also have the trait that there is only one global state. Therefore I added a broadcast based on Redis with direct Hotwired integration.
A demo will follow soon.
Docs: https://turbo.hotwired.dev/handbook/introduction