No longer run callable on init (#703)

* No longer run callable on init

* Add release note
This commit is contained in:
Ben Croker 2025-02-24 19:57:34 -06:00 committed by GitHub
parent 9e12b9076c
commit 2c0cc510e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 15 additions and 11 deletions

View File

@ -14,13 +14,17 @@ Each tagged version of Datastar is accompanied by a release note. Read the [rele
- Updated Idiomorph to version [0.7.2](https://github.com/bigskysoftware/idiomorph/blob/main/CHANGELOG.md#072---2025-02-20).
- When using `data-bind` on an element, the signal value now defaults to the elements `value` attribute, provided the signal has not already been defined ([#685](https://github.com/starfederation/datastar/issues/685)).
- The expression passed into `data-on-signals-change` is no longer executed on page load ([#682](https://github.com/starfederation/datastar/issues/682)).
- Whitespace is now maintained in merged fragments ([#658](https://github.com/starfederation/datastar/issues/658)).
- Attribute plugins now define a hash of their contents, preventing duplicate applies ([#691](https://github.com/starfederation/datastar/issues/691)).
- Attribute plugins are now applied to the `html` element instead of the `body` element ([#691](https://github.com/starfederation/datastar/issues/691)).
- Removed Datastar singleton and export functions directly for `setAlias`, `load`, `apply`
### Fixed
- Fixed a bug in which `datastar-remove-fragments` events were not having any effect ([#664](https://github.com/starfederation/datastar/issues/664)).
- Fixed a bug in which `datastarNaN` could be used as an auto-generated element ID ([#679](https://github.com/starfederation/datastar/issues/679)).
- Fixed a bug in which `data-attr` was not removing the element attribute when using object syntax and the value was `false` ([#693](https://github.com/starfederation/datastar/issues/693)).
- Fixed a bug in which `data-attr` was not removing the element attribute when using object syntax and the value was `false` ([#693](https://github.com/starfederation/datastar/issues/693)).
### Removed
- Removed the ability to import the Datastar class. The `setAlias`, `load`, and `apply` functions are exported instead.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -120,7 +120,6 @@ export const On: AttributePlugin = {
if (key.startsWith(SIGNALS_CHANGE_PREFIX)) {
if (key === SIGNALS_CHANGE_PREFIX) {
callback()
const signalFn = (event: CustomEvent<DatastarSignalEvent>) =>
callback(event)
document.addEventListener(DATASTAR_SIGNAL_EVENT, signalFn)

4
sdk/go/consts.go generated
View File

@ -7,8 +7,8 @@ import "time"
const (
DatastarKey = "datastar"
Version = "1.0.0-beta.7"
VersionClientByteSize = 39523
VersionClientByteSizeGzip = 14661
VersionClientByteSize = 39519
VersionClientByteSizeGzip = 14659
//region Default durations

View File

@ -20,6 +20,7 @@
<pre
class="border-2 border-accent bg-base-200 text-accent text-sm rounded-lg focus:ring-primary focus:border-primary block w-full p-2.5"
data-text="ctx.signals.JSON()"
data-on-signals-change="ctx.el.textContent = ctx.signals.JSON()"
>
Stuff in signals