hotwired-laravel / turbo-laravel

This package gives you a set of conventions to make the most out of Hotwire in Laravel.
https://turbo-laravel.com
MIT License
793 stars 48 forks source link

Add Turbo Drive Components #133

Closed tonysm closed 8 months ago

tonysm commented 9 months ago

There are several Turbo Drive tag helpers in turbo-rails. I think it would be cool to add them here as well, something like:

<x-turbo-exempts-page-from-cache />
<x-turbo-exempts-page-from-preview />
<x-turbo-page-requires-reload />

Which would render the following meta tags, respectively:

<meta name="turbo-cache-control" content="no-cache">
<meta name="turbo-cache-control" content="no-preview">
<meta name="turbo-visit-control" content="reload">
tonysm commented 9 months ago

Perhaps we could use namespaced page components, something like Pulse does: <x-turbo::frame>, <x-turbo::stream>, and <x-turbo::exempts-page-from-cache />... if that's the case, we'd have to adapt the existing components, as well as provide the deprecated ones as well and update the docs.