Comparing version 5.11.2 to 5.11.3
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "5.11.2", | ||
"version": "5.11.3", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "types": "./types/index.d.ts", |
@@ -507,4 +507,20 @@ /** @import { Expression } from 'estree' */ | ||
parser.allow_whitespace(); | ||
value = read_attribute_value(parser); | ||
end = parser.index; | ||
if (parser.template[parser.index] === '/' && parser.template[parser.index + 1] === '>') { | ||
const char_start = parser.index; | ||
parser.index++; // consume '/' | ||
value = [ | ||
{ | ||
start: char_start, | ||
end: char_start + 1, | ||
type: 'Text', | ||
raw: '/', | ||
data: '/' | ||
} | ||
]; | ||
end = parser.index; | ||
} else { | ||
value = read_attribute_value(parser); | ||
end = parser.index; | ||
} | ||
} else if (parser.match_regex(regex_starts_with_quote_characters)) { | ||
@@ -511,0 +527,0 @@ e.expected_token(parser.index, '='); |
@@ -24,2 +24,3 @@ /** @import { Effect, TemplateNode } from '#client' */ | ||
import { assign_nodes } from '../template.js'; | ||
import { is_raw_text_element } from '../../../../utils.js'; | ||
@@ -120,2 +121,7 @@ /** | ||
if (render_fn) { | ||
if (hydrating && is_raw_text_element(next_tag)) { | ||
// prevent hydration glitches | ||
element.append(document.createComment('')); | ||
} | ||
// If hydrating, use the existing ssr comment as the anchor so that the | ||
@@ -122,0 +128,0 @@ // inner open and close methods can pick up the existing nodes correctly |
@@ -361,2 +361,4 @@ import { DEV } from 'esm-env'; | ||
element.value = element[key] = element.__value = value; | ||
} else if (key === 'selected' && is_option_element) { | ||
set_selected(/** @type {HTMLOptionElement} */ (element), value); | ||
} else { | ||
@@ -368,6 +370,27 @@ var name = key; | ||
if (value == null && !is_custom_element) { | ||
var is_default = name === 'defaultValue' || name === 'defaultChecked'; | ||
if (value == null && !is_custom_element && !is_default) { | ||
attributes[key] = null; | ||
element.removeAttribute(key); | ||
} else if (setters.includes(name) && (is_custom_element || typeof value !== 'string')) { | ||
if (name === 'value' || name === 'checked') { | ||
// removing value/checked also removes defaultValue/defaultChecked — preserve | ||
let input = /** @type {HTMLInputElement} */ (element); | ||
if (name === 'value') { | ||
let prev = input.defaultValue; | ||
input.removeAttribute(name); | ||
input.defaultValue = prev; | ||
} else { | ||
let prev = input.defaultChecked; | ||
input.removeAttribute(name); | ||
input.defaultChecked = prev; | ||
} | ||
} else { | ||
element.removeAttribute(key); | ||
} | ||
} else if ( | ||
is_default || | ||
(setters.includes(name) && (is_custom_element || typeof value !== 'string')) | ||
) { | ||
// @ts-ignore | ||
@@ -374,0 +397,0 @@ element[name] = value; |
@@ -32,3 +32,3 @@ /** @import { ComponentContext, Derived, Effect, Reaction, Signal, Source, Value } from '#client' */ | ||
import { add_owner } from './dev/ownership.js'; | ||
import { mutate, set, source } from './reactivity/sources.js'; | ||
import { internal_set, set, source } from './reactivity/sources.js'; | ||
import { destroy_derived, execute_derived, update_derived } from './reactivity/deriveds.js'; | ||
@@ -964,7 +964,8 @@ import * as e from './errors.js'; | ||
if ((dep.f & DERIVED) === 0) { | ||
mutate(dep, null /* doesnt matter */); | ||
// Use internal_set instead of set here and below to avoid mutation validation | ||
internal_set(dep, dep.v); | ||
} | ||
} | ||
} else { | ||
mutate(signal, null /* doesnt matter */); | ||
internal_set(signal, signal.v); | ||
} | ||
@@ -971,0 +972,0 @@ } |
@@ -19,3 +19,3 @@ /** @import { ComponentType, SvelteComponent } from 'svelte' */ | ||
import { validate_store } from '../shared/validate.js'; | ||
import { is_boolean_attribute, is_void } from '../../utils.js'; | ||
import { is_boolean_attribute, is_raw_text_element, is_void } from '../../utils.js'; | ||
import { reset_elements } from './dev.js'; | ||
@@ -28,5 +28,2 @@ | ||
/** List of elements that require raw contents and should not have SSR comments put in them */ | ||
const RAW_TEXT_ELEMENTS = ['textarea', 'script', 'style', 'title']; | ||
/** | ||
@@ -69,3 +66,3 @@ * @param {Payload} to_copy | ||
if (tag) { | ||
payload.out += `<${tag} `; | ||
payload.out += `<${tag}`; | ||
attributes_fn(); | ||
@@ -76,3 +73,3 @@ payload.out += `>`; | ||
children_fn(); | ||
if (!RAW_TEXT_ELEMENTS.includes(tag)) { | ||
if (!is_raw_text_element(tag)) { | ||
payload.out += EMPTY_COMMENT; | ||
@@ -79,0 +76,0 @@ } |
@@ -444,1 +444,9 @@ const regex_return_characters = /\r/g; | ||
} | ||
/** List of elements that require raw contents and should not have SSR comments put in them */ | ||
const RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']); | ||
/** @param {string} name */ | ||
export function is_raw_text_element(name) { | ||
return RAW_TEXT_ELEMENTS.includes(/** @type {RAW_TEXT_ELEMENTS[number]} */ (name)); | ||
} |
@@ -9,3 +9,3 @@ // generated during release, do not modify | ||
*/ | ||
export const VERSION = '5.11.2'; | ||
export const VERSION = '5.11.3'; | ||
export const PUBLIC_VERSION = '5'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2431713
53467