Skip to content

Releases: starfederation/datastar

v0.21.1

11 Dec 17:34
418cc3a

Choose a tag to compare

Fixed

  • Fixed the Attributes plugin being loaded too early.
  • Fixed the path prefix tests in the setAll() and toggleAll() actions.
  • Fixed error message links.

v0.21.0

11 Dec 05:58

Choose a tag to compare

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-indicator and data-ref attributes (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 .value suffix (signalName.value).
  • Action plugins no longer have the $ prefix.
  • Renamed the data-store attribute to data-signals.
  • Renamed the data-bind attribute to data-attributes.
  • Renamed the data-model attribute to data-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() and delete() plugins have been replaced by a single sse() plugin that accepts a method as an option (sse(url, {method: 'post'})), defaulting to get.
  • The setAll() and toggleAll plugins 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

26 Nov 01:33
207f120

Choose a tag to compare

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
  • DevOps
    • added make test & make clean to development Dockerfile

Changed

  • Client
    • Function expression optimizations #234
    • Truthy Attributes were not getting set correctly #234
    • Fix invalid headers sent via SSE #241
    • Added hooks so NPM will package the correct files
  • 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
    • Bundler getting create valid zip for Windows #228
    • General site improvements
    • Actions section in getting started
    • Fixed broken links for SDKs and CDN #225
    • Try to fix Safari bug around caching SSE connections #239
  • Devops
    • fix make dev to work cross-platform
    • moved development Dockerfile from Alpine to Ubuntu

Removed

  • DevOps
    • Removed broken Github Actions

Full Changelog: v0.20.0...v0.20.1

v0.20.0

22 Nov 09:14

Choose a tag to compare

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-persist attribute.
  • Added the data-replace-url attribute.
  • Added the data-indicator attribute.
  • Added the datastar-remove-fragments SSE event.
  • Added the datastar-remove-signals SSE event.
  • Added the datastar-execute-script SSE event.

Changed

  • Changed the $$ prefix to $ for action plugins.
  • The data-model attribute now upserts signals into the store.
  • The data-ref attribute now upserts a signal into the store.
  • The data-show attribute now shows/hides an element using the style attribute only. Modifiers have been removed. For anything custom, use data-class instead.
  • Renamed the datastar-fragment SSE event to datastar-merge-fragments.
  • Renamed the datastar-signal SSE event to datastar-merge-signals.
  • Renamed the fragment dataline literal for SSE events to fragments.
  • Renamed the store dataline literal for SSE events to signals.
  • Renamed the upsert_attributes merge mode to upsertAttributes in the fragment event.
  • Renamed the settle option to settleDuration in the fragment event and changed the default value to 300.
  • Renamed the vt option to useViewTransition in the fragment event and changed the default value to false.
  • Changed the second argument of SSE actions from onlyRemoteSignals to an optional object with headers and onlyRemoteSignals keys, defaulting to {} and true respectively.
  • Error codes that roughly match HTTP status codes are now used.

Removed

  • Removed the ~ref syntax. Use the signal created by data-ref directly instead.
  • Removed the local and session modifiers from data-store. Use the new data-persist attribute instead.
  • Removed the data-teleport attribute.
  • Removed the data-header attribute. Use the headers option in SSE actions instead.
  • Removed the $$isFetching action and the data-fetch-indicator attribute. Use data-indicator instead.
  • Removed the $$remote action.
  • Removed the datastar-delete SSE event. Use the new datastar-remove-fragments and datastar-remove-signals SSE events instead.
  • Removed the datastar-redirect and datastar-console SSE events. Use the new datastar-execute-script SSE event instead.
  • Removed sendDatastarEvent from 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

25 Oct 12:32

Choose a tag to compare

What's Changed

  • Fix data-ref processing 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

24 Oct 14:04

Choose a tag to compare

Added

  • data-headers-*
  • data-computed-*
  • data-class

What's Changed

New Contributors

Full Changelog: v0.19.7...v0.19.8

v0.19.7

22 Oct 17:58

Choose a tag to compare

Full Changelog: v0.19.6...v0.19.7

v0.19.6

22 Oct 16:11
c21d9d3

Choose a tag to compare

What's Changed

Full Changelog: v0.19.5...v0.19.6

v0.19.3

18 Oct 00:07

Choose a tag to compare

Added

  • The Getting Started page now has URLs for downloading module + source maps.
  • The datastar-console event now has error mode.

Changed

  • The datastar-model attribute now handles web components!

Fixed

  • Fixed the docs around datastar-signal syntax.
  • Fixed a bad handler in datastar-signal.
  • Fixed a bad handler in datastar-console.

v0.19.0

17 Oct 09:55

Choose a tag to compare

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-delete event that deletes all elements matching the provided selector.
  • Added the datastar-redirect event that redirects the page to the provided URI.
  • Added the datastar-console event that outputs a message to the browser console.

Changed

  • The datastar-signal event now accepts data: ifmissing true to update the store with new values only if the key does not exist.

Removed

  • Removed the datastar-signal-ifmissing event. Use the datastar-signal event instead, passing in data: ifmissing true.
  • Removed the restriction on data-model allowed elements. Should now work with any web component that implements a value prop and an oninput event