Releases: starfederation/datastar
v0.21.1
v0.21.0
We’ve overhauled Datastar in v0.21.0, doubling down on making nestable signals declarative. To that end, we’ve removed special characters, made the API more explicit and consistent, and fixed restrictions to nested signals that we discovered. Signal values are now accessed in expressions using the syntax signalName.value, actions no longer have a prefix, and attribute keys support nested signals using dot-delimited paths.
The new Datastar VSCode extension and IntelliJ plugin have autocomplete for all v0.21.0 attributes, and we’ve painstakingly added error pages for every error that can be thrown.
Added
- Added the ability to merge one-off signals using the syntax
data-signals-foo="value". - Added the ability to use dot-delimited paths to denote nested signals in applicable attribute keys (
data-signals-foo.bar="value"). - Added the ability to use multiple attributes using the syntax
data-attributes="{attrName1: value1, attrName2: value2}". - Added the ability to use a single classes using the syntax
data-class-hidden="foo.value". - Added the ability to use a key instead of a value to denote a signal name in the
data-bind,data-indicatoranddata-refattributes (data-bind-foo,data-indicator-foo,data-ref-foo). - Added error codes and links to descriptions in the console for every error thrown.
- Retries and backoff are now configurable for SSE connections.
Changed
- Signals no longer have the
$prefix and must be acessed using a.valuesuffix (signalName.value). - Action plugins no longer have the
$prefix. - Renamed the
data-storeattribute todata-signals. - Renamed the
data-bindattribute todata-attributes. - Renamed the
data-modelattribute todata-bind. - Changed the
data-*attribute modifier delimiter from.to__for modifiers and from_to.for arguments. This is to be spec compliant while still parseable with new nested signal syntax (data-on-keydown__debounce.100ms__throttle.noLead="value"). - The the
get(),post(),put(),patch()anddelete()plugins have been replaced by a singlesse()plugin that accepts a method as an option (sse(url, {method: 'post'})), defaulting toget. - The
setAll()andtoggleAllplugins now accept a path prefix, instead of a regular expression. - Nested signals no longer allow
__in the key, which causes a conflict with modifiers.
Fixed
- Fixed headers not merging correctly.
- Fixed new lines in the SDK protocol for paths.
v0.20.1
Release Notes for Datastar
0.20.1 - 2024-11-25
VersionClientByteSize = 35970->35789
VersionClientByteSizeGzip = 12647->12568
Added
- SDKs
- .NET
- Initial SDK release! #231
- PHP
- Allow KV pairs
- Author
- .NET
- DevOps
- added
make test&make cleanto development Dockerfile
- added
Changed
- Client
- SDKs
- updated README for clarity around contributing
- Go
- Fix inverted logic for ViewTransitions #238
- PHP
- tagged SDK 1.0.0-alpha.1
- fixed retry duration
- general cleanup
- Website
- Devops
- fix
make devto work cross-platform - moved development Dockerfile from Alpine to Ubuntu
- fix
Removed
- DevOps
- Removed broken Github Actions
Full Changelog: v0.20.0...v0.20.1
v0.20.0
Warning
This update contains breaking changes to attributes, actions and SSE events.
Added
- Added a custom bundle bundler.
- Added SDKs for Go, PHP and .NET.
- Added the
data-persistattribute. - Added the
data-replace-urlattribute. - Added the
data-indicatorattribute. - Added the
datastar-remove-fragmentsSSE event. - Added the
datastar-remove-signalsSSE event. - Added the
datastar-execute-scriptSSE event.
Changed
- Changed the
$$prefix to$for action plugins. - The
data-modelattribute now upserts signals into the store. - The
data-refattribute now upserts a signal into the store. - The
data-showattribute now shows/hides an element using thestyleattribute only. Modifiers have been removed. For anything custom, usedata-classinstead. - Renamed the
datastar-fragmentSSE event todatastar-merge-fragments. - Renamed the
datastar-signalSSE event todatastar-merge-signals. - Renamed the
fragmentdataline literal for SSE events tofragments. - Renamed the
storedataline literal for SSE events tosignals. - Renamed the
upsert_attributesmerge mode toupsertAttributesin the fragment event. - Renamed the
settleoption tosettleDurationin the fragment event and changed the default value to300. - Renamed the
vtoption touseViewTransitionin the fragment event and changed the default value tofalse. - Changed the second argument of SSE actions from
onlyRemoteSignalsto an optional object withheadersandonlyRemoteSignalskeys, defaulting to{}andtruerespectively. - Error codes that roughly match HTTP status codes are now used.
Removed
- Removed the
~refsyntax. Use the signal created bydata-refdirectly instead. - Removed the
localandsessionmodifiers fromdata-store. Use the newdata-persistattribute instead. - Removed the
data-teleportattribute. - Removed the
data-headerattribute. Use theheadersoption in SSE actions instead. - Removed the
$$isFetchingaction and thedata-fetch-indicatorattribute. Usedata-indicatorinstead. - Removed the
$$remoteaction. - Removed the
datastar-deleteSSE event. Use the newdatastar-remove-fragmentsanddatastar-remove-signalsSSE events instead. - Removed the
datastar-redirectanddatastar-consoleSSE events. Use the newdatastar-execute-scriptSSE event instead. - Removed
sendDatastarEventfrom ctx. We have to rethink how to expose events for a better try at the inspector. - Removed the concept of
_dsPlugins, made unnecessary by a more consistent architecture.
v0.19.9
What's Changed
- Fix
data-refprocessing by @bencroker in #172 - Improve wording in routes_home.templ opening paragraph. by @human154 in #180
- Improve wording of getting_started.md "copy locally" section by @human154 in #181
New Contributors
Full Changelog: v0.19.8...v0.19.9
v0.19.8
Added
data-headers-*data-computed-*data-class
What's Changed
- Update README.md by @githubUser982 in #177
- Cleanup docs and update discord links
New Contributors
- @githubUser982 made their first contribution in #177
Full Changelog: v0.19.7...v0.19.8
v0.19.7
Full Changelog: v0.19.6...v0.19.7
v0.19.6
v0.19.3
Added
- The Getting Started page now has URLs for downloading module + source maps.
- The
datastar-consoleevent now haserrormode.
Changed
- The
datastar-modelattribute now handles web components!
Fixed
- Fixed the docs around
datastar-signalsyntax. - Fixed a bad handler in
datastar-signal. - Fixed a bad handler in
datastar-console.
v0.19.0
Warning
This update contains breaking changes to the Datastar SSE events.
Added
- Added the ability to send multiple top-level elements in a single fragment. Datastar will handle each one as its own HTML fragment.
- Added the
datastar-deleteevent that deletes all elements matching the provided selector. - Added the
datastar-redirectevent that redirects the page to the provided URI. - Added the
datastar-consoleevent that outputs a message to the browser console.
Changed
- The
datastar-signalevent now acceptsdata: ifmissing trueto update the store with new values only if the key does not exist.
Removed
- Removed the
datastar-signal-ifmissingevent. Use thedatastar-signalevent instead, passing indata: ifmissing true. - Removed the restriction on
data-modelallowed elements. Should now work with any web component that implements avalueprop and anoninputevent