DEV Community

Discussion on: I made DEV.to widget for websites/blogs

Collapse
 
artis3n profile image
Ari Kalfus • Edited

This is great. Nit: Promote healthy web practices and add sub-resource integrity (SRI) via the integrity attribute on your example.

developer.mozilla.org/en-US/docs/W...

You can grab your hash from unpkg via the meta query parameter:

https://unpkg.com/dev-widget@1.0.1/dist/card.component.mjs?meta

<script src="https://unpkg.com/dev-widget@1.0.1/dist/card.component.mjs" type="module" integrity="sha384-755Jblzb17ugkA3KRCLz4XS8CPb3xEwBdBMk8ZBw51agtKmppILXMJrKvuTRkUhy"></script>
Collapse
 
loujaybee profile image
Lou (🚀 Open Up The Cloud ☁️)

Came here to say that too — bravo!

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

Oh thank you! I've added integity hash to my codepen demo. Not really sure how I can get that hash before publishing so that I can set in readme (Apparently that hash changed from 1.0.1 to 1.0.2)

Thread Thread
 
artis3n profile image
Ari Kalfus • Edited

Yup, the hash will change for each version of the script pushed to the CDN.

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

Oh I didn't know about this thank you so much! I'll check it out