Baroshem / nuxt-security

🛡 Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware
https://nuxt-security.vercel.app/
MIT License
738 stars 56 forks source link

update(doc): recommend useScript for Nuxt 3.11+ #403

Closed vejja closed 2 months ago

vejja commented 3 months ago

Modify notes to recommend useScript

Types of changes

Description

For Nuxt version 3.11 and above, useScript allows to insert any external script in a CSP-compatible way. Update documentation to recommend useScript.

Checklist:

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuxt-security ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2024 5:51am
vejja commented 3 months ago

@Baroshem I'm thinking maybe I should remove all references to useHead and push them back at the end of the document, because now the text is very long and it doesn't help with clarity What's your opinion ?

Baroshem commented 3 months ago

Hey @vejja .

Thanks for this note! It is much cleaner now!

Regardinng getting rid of useHead. Yes please do so! Lets keep one format that we want to recommend users to follow. UseScript should be recommended approach from now on :)

vejja commented 3 months ago

@Baroshem please don't merge this yet, I'm reverting to draft Reason is, @harlan-zw released the stable version of useScript yesterday, so I want to update usage notes first

harlan-zw commented 3 months ago

Hi @vejja, I've sent you access to Nuxt Scripts, maybe it will help with this PR.

vejja commented 3 months ago

Hi @vejja, I've sent you access to Nuxt Scripts, maybe it will help with this PR.

Indeed, thanks !

Baroshem commented 3 months ago

Hey @vejja

Should this pull request be still draft? Not sure what is the actual state of it :)

Also, could you contact me in any channels like Discord, X, Linkedin? I would love to get more contact with you so that we could discuss certain things more easily :)

vejja commented 3 months ago

Hey @vejja

Should this pull request be still draft? Not sure what is the actual state of it :)

Also, could you contact me in any channels like Discord, X, Linkedin? I would love to get more contact with you so that we could discuss certain things more easily :)

Yes it is still draft, I need to update for idle status removal Will contact you separately

vejja commented 2 months ago

@Baroshem The docs are now updated for useScript v1.9.4 (released yesterday) which is even simpler because we can skip using trigger 🚀 But I'm still keeping this as draft because Nuxt 3.11.1 still pins unhead to v1.8.20 (which has the old syntax). I will mark it as ready in the next release of Nuxt.

vejja commented 2 months ago

@Baroshem this is good to go ! Nuxt 3.11.2 now includes unhead 1.9.4 with its wonderful useScript magic 🚀

Many many thanks to @harlan-zw for ensuring useScript is CSP-compatible, mostly

Baroshem commented 2 months ago

Awesome @vejja 💚

Thanks for this great write up! I will merge it and publish quite soon!