Version 2.8.1
April 21, 2024
Fixed
- Fixed a bug in which some
sprig
variables were incorrectly persisting across requests (#363).
Version 2.8.0
March 26, 2024
Added
- Added the
sprig.isSuccess
variable. - Added the
sprig.isError
variable. - Added the
sprig.message
variable. - Added the
sprig.modelId
variable.
Deprecated
- Deprecated the
success
variable. Usesprig.isSuccess
orsprig.isError
instead. - Deprecated the
flashes
variable. Usesprig.message
instead. - Deprecated the
id
variable. Usesprig.modelId
instead.
Version 2.7.2
September 29, 2023
Added
- Added the
sprig.registerScript()
function (#329).
Changed
- Renamed the
sprig.setAddScript()
function tosprig.setRegisterScript()
.
Version 2.7.1
September 27, 2023
Fixed
- Fixed a deprecated tag in the Sprig playground.
Version 2.7.0
September 26, 2023
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
function. - Added the
sprig.setAddScript()
function. - 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
function 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
function. It is no longer required and can be safely removed. - Deprecated the
s-on
attribute. Use thes-on:*
attribute instead.
Version 2.6.2
May 1, 2023
Changed
- Updated htmx to version 1.9.2 (changelog).
- Improved autocomplete documentation in the playground.
Version 2.6.1
April 25, 2023
Fixed
- Fixed a bug in which the htmx file was not being published even if it did not already exist locally (#305).
Version 2.6.0
April 23, 2023
Added
- Added the sprig.setConfig template variable that allows you to set configuration options for htmx (via a meta tag).
- Added the s-on attribute that allows you to respond to events directly on an element.
Changed
- Updated htmx to version 1.9.0 (release notes).
- The htmx file is now loaded locally rather than from a CDN, to reduce dependency on third-party sites (#303).
Version 2.5.1
January 31, 2023
Fixed
- Fixed rendered markup not being escaped in the Sprig playground.
Version 2.5.0
January 18, 2023
Added
- Added the s-history attribute that prevents sensitive data being saved to the history cache.
Changed
- Updated htmx to version 1.8.5 (release notes).
Version 2.4.0
December 8, 2022
Added
- Added the sprig.triggerRefreshOnLoad template variable that triggers a refresh event on all components on page load (#279).
Version 2.3.0
November 7, 2022
Added
- Added the s-validate attribute that forces an element to validate itself before it submits a request.
- Added the sprig.isHistoryRestoreRequest template variable that returns whether the request is for history restoration after a miss in the local history cache a client-side redirect without reloading the page.
Changed
Version 2.2.1
October 8, 2022
Fixed
- Fixed a bug in which Sprig requests were failing in live preview requests (#269).
Version 2.2.0
October 5, 2022
Added
- Added the s-replace-url attribute that allows you to replace the current url of the browser location history.
- Added the s-select-oob attribute that selects one or more elements from a server response to swap in via an out-of-band swap.
- Added the sprig.location(url) template variable that triggers a client-side redirect without reloading the page.
- Added the sprig.replaceUrl(url) template variable that replaces the current URL in the location bar.
- Added the sprig.reswap(value) template variable that allows you to change the swap behaviour.
Changed
- Updated htmx to version 1.8.0 (release notes).
Version 2.1.0
June 22, 2022
Added
- Added the Twigfield package that adds full autocomplete to the code editor in the playground (#235 ❤️@nystudio107).
Changed
- Improved attribute autocomplete in the playground.
Version 2.0.1
May 12, 2022
Changed
- Improved the styling of variables panes in the playground.
Version 2.0.0
May 4, 2022
Added
- Added compatibility with Craft 4.
Changed
- Restyled invalid variable error messages.
Removed
- Removed the deprecated
sprig.element
,sprig.elementName
,sprig.elementValue
andsprig.eventTarget
tags. - Removed the deprecated
s-vars
attribute.