Skip to content

Commit 33feafb

Browse files
committed
v1.0.0-RC.4
1 parent 41d1b5d commit 33feafb

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- This is auto-generated by Datastar. DO NOT EDIT. -->
2-
[![Version](https://img.shields.io/badge/version-1.0.0–RC.3-orange)](https://github.com/starfederation/datastar/releases)
2+
[![Version](https://img.shields.io/badge/version-1.0.0–RC.4-orange)](https://github.com/starfederation/datastar/releases)
33
[![License](https://img.shields.io/github/license/starfederation/datastar)](https://github.com/starfederation/datastar/blob/main/LICENSE.md)
44
[![Stars](https://img.shields.io/github/stars/starfederation/datastar?style=flat)](https://github.com/starfederation/datastar/stargazers)
55

bundles/datastar-aliased.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundles/datastar-aliased.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundles/datastar-core.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundles/datastar.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundles/datastar.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@starfederation/datastar",
3-
"author": "Star Federation",
3+
"author": "Delaney Gillilan",
44
"description": "The hypermedia framework.",
5-
"version": "1.0.0-RC.3",
5+
"version": "1.0.0-RC.4",
66
"license": "MIT",
77
"private": false,
88
"homepage": "https://data-star.dev",

library/src/plugins/backend/watchers/patchElements.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -494,30 +494,6 @@ function morphNode(
494494
return oldNode
495495
}
496496

497-
const preserveAttrs = (
498-
(newNode as HTMLElement).getAttribute(aliasify('preserve-attr')) ?? ''
499-
).split(' ')
500-
501-
for (const { name, value } of (newNode as Element).attributes) {
502-
if (
503-
(oldNode as Element).getAttribute(name) !== value &&
504-
!preserveAttrs.includes(kebab(name))
505-
) {
506-
;(oldNode as Element).setAttribute(name, value)
507-
}
508-
}
509-
510-
const oldAttrs = (oldNode as Element).attributes
511-
for (let i = oldAttrs.length - 1; i >= 0; i--) {
512-
const { name } = oldAttrs[i]
513-
if (
514-
!(newNode as Element).hasAttribute(name) &&
515-
!preserveAttrs.includes(kebab(name))
516-
) {
517-
;(oldNode as Element).removeAttribute(name)
518-
}
519-
}
520-
521497
// many bothans died to bring us this information:
522498
// https://github.com/patrick-steele-idem/morphdom/blob/master/src/specialElHandlers.js
523499
// https://github.com/choojs/nanomorph/blob/master/lib/morph.js#L113
@@ -549,6 +525,30 @@ function morphNode(
549525
oldNode.firstChild.nodeValue = newValue
550526
}
551527
}
528+
529+
const preserveAttrs = (
530+
(newNode as HTMLElement).getAttribute(aliasify('preserve-attr')) ?? ''
531+
).split(' ')
532+
533+
for (const { name, value } of (newNode as Element).attributes) {
534+
if (
535+
(oldNode as Element).getAttribute(name) !== value &&
536+
!preserveAttrs.includes(kebab(name))
537+
) {
538+
;(oldNode as Element).setAttribute(name, value)
539+
}
540+
}
541+
542+
const oldAttrs = (oldNode as Element).attributes
543+
for (let i = oldAttrs.length - 1; i >= 0; i--) {
544+
const { name } = oldAttrs[i]
545+
if (
546+
!(newNode as Element).hasAttribute(name) &&
547+
!preserveAttrs.includes(kebab(name))
548+
) {
549+
;(oldNode as Element).removeAttribute(name)
550+
}
551+
}
552552
}
553553

554554
if (type === 8 /* comment */ || type === 3 /* text */) {

0 commit comments

Comments
 (0)