Skip to content

2.7.0

Choose a tag to compare

@github-actions github-actions released this 11 Nov 09:05
· 49 commits to develop since this release
2.7.0
ea36ce1

{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.htmxVersion tag.
  • 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.script tag 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 devMode is 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.script tag. It is no longer required and can be safely removed.
  • Deprecated the s-on attribute. Use the s-on:* attribute instead.