Comparing version 1.7.3 to 1.7.4
@@ -1315,3 +1315,3 @@ let taskIdCounter = 1, | ||
function splitProps(props, ...keys) { | ||
const blocked = new Set(keys.flat()); | ||
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]); | ||
if ($PROXY in props) { | ||
@@ -1318,0 +1318,0 @@ const res = keys.map(k => { |
@@ -1270,3 +1270,3 @@ let taskIdCounter = 1, | ||
function splitProps(props, ...keys) { | ||
const blocked = new Set(keys.flat()); | ||
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]); | ||
if ($PROXY in props) { | ||
@@ -1273,0 +1273,0 @@ const res = keys.map(k => { |
{ | ||
"name": "solid-js", | ||
"description": "A declarative JavaScript library for building user interfaces.", | ||
"version": "1.7.3", | ||
"version": "1.7.4", | ||
"author": "Ryan Carniato", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -136,3 +136,6 @@ import { $PROXY, DEV as DEV$1, $TRACK, getListener, batch, createSignal } from 'solid-js'; | ||
if (node = getDataNode(nodes, property, prev)) node.$(() => value); | ||
if (Array.isArray(state) && state.length !== len) (node = getDataNode(nodes, "length", len)) && node.$(state.length); | ||
if (Array.isArray(state) && state.length !== len) { | ||
for (let i = state.length; i < len; i++) (node = nodes[i]) && node.$(); | ||
(node = getDataNode(nodes, "length", len)) && node.$(state.length); | ||
} | ||
(node = nodes._) && node.$(); | ||
@@ -139,0 +142,0 @@ } |
@@ -130,3 +130,6 @@ import { $PROXY, $TRACK, getListener, batch, createSignal } from 'solid-js'; | ||
if (node = getDataNode(nodes, property, prev)) node.$(() => value); | ||
if (Array.isArray(state) && state.length !== len) (node = getDataNode(nodes, "length", len)) && node.$(state.length); | ||
if (Array.isArray(state) && state.length !== len) { | ||
for (let i = state.length; i < len; i++) (node = nodes[i]) && node.$(); | ||
(node = getDataNode(nodes, "length", len)) && node.$(state.length); | ||
} | ||
(node = nodes._) && node.$(); | ||
@@ -133,0 +136,0 @@ } |
@@ -459,3 +459,3 @@ import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js'; | ||
current = array; | ||
} else if (value instanceof Node) { | ||
} else if (value.nodeType) { | ||
if (sharedConfig.context && value.parentNode) return current = multi ? [value] : value; | ||
@@ -476,8 +476,9 @@ if (Array.isArray(current)) { | ||
let item = array[i], | ||
prev = current && current[i]; | ||
if (item instanceof Node) { | ||
prev = current && current[i], | ||
t; | ||
if (item == null || item === true || item === false) ; else if ((t = typeof item) === "object" && item.nodeType) { | ||
normalized.push(item); | ||
} else if (item == null || item === true || item === false) ; else if (Array.isArray(item)) { | ||
} else if (Array.isArray(item)) { | ||
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic; | ||
} else if ((typeof item) === "function") { | ||
} else if (t === "function") { | ||
if (unwrap) { | ||
@@ -492,6 +493,3 @@ while (typeof item === "function") item = item(); | ||
const value = String(item); | ||
if (prev && prev.nodeType === 3) { | ||
prev.data = value; | ||
normalized.push(prev); | ||
} else normalized.push(document.createTextNode(value)); | ||
if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value)); | ||
} | ||
@@ -498,0 +496,0 @@ } |
@@ -292,6 +292,6 @@ import { sharedConfig, createRoot, splitProps } from 'solid-js'; | ||
function ssrElement(tag, props, children, needsId) { | ||
let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `; | ||
if (props == null) props = {};else if (typeof props === "function") props = props(); | ||
const skipChildren = VOID_ELEMENTS.test(tag); | ||
if (props == null) props = {};else if (typeof props === "function") props = props(); | ||
const keys = Object.keys(props); | ||
let result = `<${tag}${needsId ? ssrHydrationKey() : ""} `; | ||
let classResolved; | ||
@@ -321,9 +321,8 @@ for (let i = 0; i < keys.length; i++) { | ||
} | ||
if (skipChildren) { | ||
return { | ||
t: result + "/>" | ||
}; | ||
} | ||
if (skipChildren) return { | ||
t: result + "/>" | ||
}; | ||
if (typeof children === "function") children = children(); | ||
return { | ||
t: result + `>${resolveSSRNode(children)}</${tag}>` | ||
t: result + `>${resolveSSRNode(children, true)}</${tag}>` | ||
}; | ||
@@ -384,3 +383,3 @@ } | ||
} | ||
function resolveSSRNode(node) { | ||
function resolveSSRNode(node, top) { | ||
const t = typeof node; | ||
@@ -393,3 +392,3 @@ if (t === "string") return node; | ||
for (let i = 0, len = node.length; i < len; i++) { | ||
if (typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`; | ||
if (!top && typeof prev !== "object" && typeof node[i] !== "object") mapped += `<!--!$-->`; | ||
mapped += resolveSSRNode(prev = node[i]); | ||
@@ -420,3 +419,3 @@ } | ||
} = {}) { | ||
return `<script${nonce ? ` nonce="${nonce}"` : ""}>(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host instanceof Node?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{let s=o.composedPath&&o.composedPath()[0]||o.target,a=t(s);a&&!e.completed.has(a)&&e.events.push([a,o])}))))})(window._$HY||(_$HY={events:[],completed:new WeakSet,r:{},fe(){},init(e,t){_$HY.r[e]=[new Promise((e=>t=e)),t]},set(e,t,o){(o=_$HY.r[e])&&o[1](t),_$HY.r[e]=[t]},unset(e){delete _$HY.r[e]},load:e=>_$HY.r[e]}));</script><!--xs-->`; | ||
return `<script${nonce ? ` nonce="${nonce}"` : ""}>(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{let s=o.composedPath&&o.composedPath()[0]||o.target,a=t(s);a&&!e.completed.has(a)&&e.events.push([a,o])}))))})(window._$HY||(_$HY={events:[],completed:new WeakSet,r:{},fe(){},init(e,t){_$HY.r[e]=[new Promise((e=>t=e)),t]},set(e,t,o){(o=_$HY.r[e])&&o[1](t),_$HY.r[e]=[t]},unset(e){delete _$HY.r[e]},load:e=>_$HY.r[e]}));</script><!--xs-->`; | ||
} | ||
@@ -423,0 +422,0 @@ function Hydration(props) { |
@@ -459,3 +459,3 @@ import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js'; | ||
current = array; | ||
} else if (value instanceof Node) { | ||
} else if (value.nodeType) { | ||
if (sharedConfig.context && value.parentNode) return current = multi ? [value] : value; | ||
@@ -476,8 +476,9 @@ if (Array.isArray(current)) { | ||
let item = array[i], | ||
prev = current && current[i]; | ||
if (item instanceof Node) { | ||
prev = current && current[i], | ||
t; | ||
if (item == null || item === true || item === false) ; else if ((t = typeof item) === "object" && item.nodeType) { | ||
normalized.push(item); | ||
} else if (item == null || item === true || item === false) ; else if (Array.isArray(item)) { | ||
} else if (Array.isArray(item)) { | ||
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic; | ||
} else if ((typeof item) === "function") { | ||
} else if (t === "function") { | ||
if (unwrap) { | ||
@@ -492,6 +493,3 @@ while (typeof item === "function") item = item(); | ||
const value = String(item); | ||
if (prev && prev.nodeType === 3) { | ||
prev.data = value; | ||
normalized.push(prev); | ||
} else normalized.push(document.createTextNode(value)); | ||
if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);else normalized.push(document.createTextNode(value)); | ||
} | ||
@@ -498,0 +496,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
792659
22031