Releases: starfederation/datastar
v1.0.0-beta.7
v1.0.0-beta.6
Changed
- The
data-on-loadcallback is now delayed to the next microtask, making it possible to place thedata-indicatorattribute later on the same element.
Fixed
- Fixed a bug in which the
data-on-signals-changeattribute expression was not being executed when signal values changed (#641). - Fixed a bug in which the signal created by
data-refwas being removed during the cleanup process (#642). - Fixed a bug in which errors were being caught in preact core, which was obfuscating the original error (#643).
- Fixed a bug in which morphed DOM elements could lose their focus, due to a change of behavior in Idiomorph (#645).
v1.0.0-beta.5
Fixed
- Fixed a bug in the morph merge mode (that raised its fists in rebellion) when merging multiple top-level fragments.
v1.0.0-beta.4
In this release we tuned the engine, added the ability to react to specific signal changes, and added some new modifiers. Idiomorph got an upgrade, and a few bugs were squashed.
The most exciting part of this beta release is that it marks the final round of planned changes before we move to a stable v1 release 🚀
Added
- Added the ability to add a signal path to the
data-on-signals-change-*attribute (#587). - Added a
__viewtransitionmodifier to thedata-on-*attribute that wraps the expression indocument.startViewTransition()when the View Transition API is available (#627). - Added a
__casemodifier to thedata-signals-*,data-computed-*,data-ref-*,data-indicator-*,data-persist-*,data-bind-*,data-class-*, anddata-on-*attributes, allowing you to modify the casing of the key by adding.kebab,.snakeor.pascal. - Added a
retryingevent type that is dispatched when the SSE plugin is trying to reconnect (#583).
Changed
- Idiomorph was updated to version 0.5.0 (pre-release) and is now imported as a module, making it easier to import future versions (#608, #633).
- Class names are no longer converted to kebab case when used in the
data-class-*attribute (#610). - Event names are no longer converted to kebab case when used in the
data-on-*attribute.
Fixed
v1.0.0-beta.3
This release adds the ability to use an alias prefix when using the bundler, making it possible to use your own custom data-*-* attributes. It also changes how plugins are applied and cleaned up to use MutationObserver, which is more efficient and allowed us to solve some timing issues with debouncing and intervals.
We had uptick in community PRs for this release, and a big push in terms of SDKs, so a big thank you to everyone who contributed 🚀
Added
- Added the ability to use an alias prefix when using the bundler. This makes it possible to use
data-customPrefix-*attributes instead ofdata-*.
Changed
- Changed the
data-on-intervalattribute to accept a__durationmodifier instead of a__delaymodifier (#513). - The
data-custom-validityattribute can now be used onselectandtextareaelements, in addition toinputelements (534). - Changed how plugins are applied and cleaned up to use
MutationObserver(#528). - Changed the parsing of Datastar expressions so that only semicolons can be used to explicitly indicate a statement delimiter (#525).
Fixed
- Fixed a bug when using the
__delaymodifier on thedata-on-loadattribute (#511). - Fixed how Datastar expressions are evaluated to allow regular expressions and strings that contain semicolons and new lines (#508).
- Fixed a bug with the
innermerge mode that was causing only the inner HTML of a fragment to be merged (#524). - Fixed a bug in which signal values could get out of sync when populated by an input element by Chrome’s back/forward cache (#530).
- Fixed a bug when generating IDs for elements that could result in duplicate IDs (#533).
Removed
v1.0.0-beta.2
This release adds some quality-of-life improvements. The main things to write home about are that error handling has been significantly improved, and the order in which plugins are applied to elements is now more deterministic and transparent (depth-first per element, then per data attribute).
Enjoy 🚀
Added
- Added the
data-on-intervalattribute. - Added the
__delaymodifier todata-on-*attributes. - Added the
__selfmodifier to thedata-star-ignoreattribute. - Added the entire context to error messages output in the browser console.
- Added the ability to use an empty value when using the
data-signals-*syntax, which sets the value to an empty string.
Changed
- Changed the order in which plugins are applied to elements to be depth-first per element, then per
dataattribute (#495). - Improved the handling of invalid expressions and signals, and made error handling generally more granular (#452).
- The
data-star-ignoreattribute now ignores descendant elements by default.
Fixed
- Fixed dashes not being trimmed from keys when double dashes were used (#450).
Removed
- Removed the now redundant
methodoption from backend plugin actions (#443). - Removed the concept of macro plugins.
v1.0.0-beta.1
Happy new 2025! We’ve tied up loose ends, made all final breaking changes to the API and, after a grueling couple of months, we’re delighted to finally release Datastar v1.0.0-beta.1 🚀
After stabilising how nested signals work and living with the signal suffix .value for a while, we realised that it wasn’t as ergonomic as we wanted. So, honing our regex fu, we managed to switch (back) to a $ prefix for signals and a @ prefix for actions.
These symbols act as Datastar-specific namespacing – $ for a signal, @ for an action – so it’s immediately obvious what you’re working with, and you end up with much fewer characters to read and write!!
Added
- Added the
@get(),@post(),@put(),@patch()and@delete()actions, which replace the@sse()action. - Added the
data-custom-validityattribute (#410).
Changed
- Signals now have a
$prefix (again) instead of a.valuesuffix (the regex search and replace from(\w+(\.\w+)*)\.valueto\$$1may be helpful when updating your code). - Actions now have a
@prefix (again) instead of no suffix. - Changed the
data-attributesattribute todata-attr(#422). - Changed TypeScript import paths back to relative paths, so that no config is required in the build step.
- Removed the
@sse()action. Use@get(),@post(),@put(),@patch()and@delete()instead.
Fixed
- Fixed the
__outsidemodifier so that elements contained within it are ignored (#425).
0.21.4
Added
- Added a
contentTypeoption to thesse()action that, when set toform, submits the closest form element, or one specified using theselectoroption (#400). - Added a
retryIntervaloption to thesse()action, defaulting to 1 second (#393). - Added the version number in a comment at the top of bundled files (#401).
Changed
- The
data-on-submitevent listener now prevents the default submission behavior of forms.
Fixed
v0.21.3
Added
- Added the ability to tell Datastar to ignore an element if
data-star-ignoreexists on it. Useful for preventing naming conflicts with third-party libraries.
Changed
- The Datastar module is now exported, exposing public methods and properties (#358).