2.7.0
{warning} The htmx script is now automatically injected into the end of the page whenever a Sprig component is created. If you have any JavaScript code in your layouts that rely on htmx being loaded, you will need to wrap them in
{% js %}tags as per the docs.
Added
- Added the Sprig component generator that scaffolds PHP components via a console command (
php craft make sprig-component --path sprig/components). - Added the s-cache attribute that allows you to specify if and for how long a request should be cached locally in the browser.
- Added the s-on:* attribute that allows you to respond to events directly on an element.
- Added the s-disabled-elt attribute that allows you to specify elements that will have the disabled attribute added to them for the duration of the request.
- Added the
sprig.htmxVersiontag. - Added the
sprig.setAddScript()tag. - Added friendly invalid variable exceptions that are shown when the Canary plugin is installed.
Changed
- The htmx script is now automatically injected into the end of the page whenever a Sprig component is created, meaning that the
sprig.scripttag is no longer required and can be safely removed. - Updated htmx to version 1.9.6 (changelog).
- Simplified and improved invalid variable error messages.
- Invalid variable error messages are now only shown when
devModeis turned on.
Fixed
- Fixed the response status code that is sent when required request parameters are not supplied (#325).
- Fixed a potential security issue.
Deprecated
- Deprecated the
sprig.scripttag. It is no longer required and can be safely removed. - Deprecated the
s-onattribute. Use thes-on:*attribute instead.