Comparing version 1.7.5 to 1.7.6
@@ -288,3 +288,3 @@ let taskIdCounter = 1, | ||
pr = null; | ||
resolved = true; | ||
key !== undefined && (resolved = true); | ||
if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, { | ||
@@ -308,3 +308,3 @@ value: v | ||
if (err === undefined) setValue(() => v); | ||
setState(err !== undefined ? "errored" : "ready"); | ||
setState(err !== undefined ? "errored" : resolved ? "ready" : "unresolved"); | ||
setError(err); | ||
@@ -1268,2 +1268,8 @@ for (const c of contexts.keys()) c.decrement(); | ||
} | ||
function resolveSources() { | ||
for (let i = 0, length = this.length; i < length; ++i) { | ||
const v = this[i](); | ||
if (v !== undefined) return v; | ||
} | ||
} | ||
function mergeProps(...sources) { | ||
@@ -1298,16 +1304,32 @@ let proxy = false; | ||
const target = {}; | ||
const sourcesMap = {}; | ||
let someNonTargetKey = false; | ||
for (let i = sources.length - 1; i >= 0; i--) { | ||
if (sources[i]) { | ||
const descriptors = Object.getOwnPropertyDescriptors(sources[i]); | ||
for (const key in descriptors) { | ||
if (key in target) continue; | ||
Object.defineProperty(target, key, { | ||
enumerable: true, | ||
get() { | ||
for (let i = sources.length - 1; i >= 0; i--) { | ||
const v = (sources[i] || {})[key]; | ||
if (v !== undefined) return v; | ||
} | ||
const source = sources[i]; | ||
if (!source) continue; | ||
const sourceKeys = Object.getOwnPropertyNames(source); | ||
someNonTargetKey = someNonTargetKey || i !== 0 && !!sourceKeys.length; | ||
for (let i = 0, length = sourceKeys.length; i < length; i++) { | ||
const key = sourceKeys[i]; | ||
if (key === "__proto__" || key === "constructor") { | ||
continue; | ||
} else if (!(key in target)) { | ||
const desc = Object.getOwnPropertyDescriptor(source, key); | ||
if (desc.get) { | ||
Object.defineProperty(target, key, { | ||
enumerable: true, | ||
configurable: true, | ||
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)]) | ||
}); | ||
} else target[key] = desc.value; | ||
} else { | ||
const sources = sourcesMap[key]; | ||
const desc = Object.getOwnPropertyDescriptor(source, key); | ||
if (sources) { | ||
if (desc.get) { | ||
sources.push(desc.get.bind(source)); | ||
} else if (desc.value !== undefined) { | ||
sources.push(() => desc.value); | ||
} | ||
}); | ||
} else if (target[key] === undefined) target[key] = desc.value; | ||
} | ||
@@ -1319,4 +1341,4 @@ } | ||
function splitProps(props, ...keys) { | ||
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]); | ||
if ($PROXY in props) { | ||
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]); | ||
const res = keys.map(k => { | ||
@@ -1348,21 +1370,21 @@ return new Proxy({ | ||
} | ||
const descriptors = Object.getOwnPropertyDescriptors(props); | ||
keys.push(Object.keys(descriptors).filter(k => !blocked.has(k))); | ||
return keys.map(k => { | ||
const clone = {}; | ||
for (let i = 0; i < k.length; i++) { | ||
const key = k[i]; | ||
if (!(key in props)) continue; | ||
Object.defineProperty(clone, key, descriptors[key] ? descriptors[key] : { | ||
get() { | ||
return props[key]; | ||
}, | ||
set() { | ||
return true; | ||
}, | ||
enumerable: true | ||
}); | ||
const otherObject = {}; | ||
const objects = keys.map(() => ({})); | ||
for (const propName of Object.getOwnPropertyNames(props)) { | ||
const desc = Object.getOwnPropertyDescriptor(props, propName); | ||
const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable; | ||
let blocked = false; | ||
let objectIndex = 0; | ||
for (const k of keys) { | ||
if (k.includes(propName)) { | ||
blocked = true; | ||
isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc); | ||
} | ||
++objectIndex; | ||
} | ||
return clone; | ||
}); | ||
if (!blocked) { | ||
isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc); | ||
} | ||
} | ||
return [...objects, otherObject]; | ||
} | ||
@@ -1369,0 +1391,0 @@ function lazy(fn) { |
@@ -272,3 +272,3 @@ let taskIdCounter = 1, | ||
pr = null; | ||
resolved = true; | ||
key !== undefined && (resolved = true); | ||
if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, { | ||
@@ -292,3 +292,3 @@ value: v | ||
if (err === undefined) setValue(() => v); | ||
setState(err !== undefined ? "errored" : "ready"); | ||
setState(err !== undefined ? "errored" : resolved ? "ready" : "unresolved"); | ||
setError(err); | ||
@@ -1223,2 +1223,8 @@ for (const c of contexts.keys()) c.decrement(); | ||
} | ||
function resolveSources() { | ||
for (let i = 0, length = this.length; i < length; ++i) { | ||
const v = this[i](); | ||
if (v !== undefined) return v; | ||
} | ||
} | ||
function mergeProps(...sources) { | ||
@@ -1253,16 +1259,32 @@ let proxy = false; | ||
const target = {}; | ||
const sourcesMap = {}; | ||
let someNonTargetKey = false; | ||
for (let i = sources.length - 1; i >= 0; i--) { | ||
if (sources[i]) { | ||
const descriptors = Object.getOwnPropertyDescriptors(sources[i]); | ||
for (const key in descriptors) { | ||
if (key in target) continue; | ||
Object.defineProperty(target, key, { | ||
enumerable: true, | ||
get() { | ||
for (let i = sources.length - 1; i >= 0; i--) { | ||
const v = (sources[i] || {})[key]; | ||
if (v !== undefined) return v; | ||
} | ||
const source = sources[i]; | ||
if (!source) continue; | ||
const sourceKeys = Object.getOwnPropertyNames(source); | ||
someNonTargetKey = someNonTargetKey || i !== 0 && !!sourceKeys.length; | ||
for (let i = 0, length = sourceKeys.length; i < length; i++) { | ||
const key = sourceKeys[i]; | ||
if (key === "__proto__" || key === "constructor") { | ||
continue; | ||
} else if (!(key in target)) { | ||
const desc = Object.getOwnPropertyDescriptor(source, key); | ||
if (desc.get) { | ||
Object.defineProperty(target, key, { | ||
enumerable: true, | ||
configurable: true, | ||
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)]) | ||
}); | ||
} else target[key] = desc.value; | ||
} else { | ||
const sources = sourcesMap[key]; | ||
const desc = Object.getOwnPropertyDescriptor(source, key); | ||
if (sources) { | ||
if (desc.get) { | ||
sources.push(desc.get.bind(source)); | ||
} else if (desc.value !== undefined) { | ||
sources.push(() => desc.value); | ||
} | ||
}); | ||
} else if (target[key] === undefined) target[key] = desc.value; | ||
} | ||
@@ -1274,4 +1296,4 @@ } | ||
function splitProps(props, ...keys) { | ||
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]); | ||
if ($PROXY in props) { | ||
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]); | ||
const res = keys.map(k => { | ||
@@ -1303,21 +1325,21 @@ return new Proxy({ | ||
} | ||
const descriptors = Object.getOwnPropertyDescriptors(props); | ||
keys.push(Object.keys(descriptors).filter(k => !blocked.has(k))); | ||
return keys.map(k => { | ||
const clone = {}; | ||
for (let i = 0; i < k.length; i++) { | ||
const key = k[i]; | ||
if (!(key in props)) continue; | ||
Object.defineProperty(clone, key, descriptors[key] ? descriptors[key] : { | ||
get() { | ||
return props[key]; | ||
}, | ||
set() { | ||
return true; | ||
}, | ||
enumerable: true | ||
}); | ||
const otherObject = {}; | ||
const objects = keys.map(() => ({})); | ||
for (const propName of Object.getOwnPropertyNames(props)) { | ||
const desc = Object.getOwnPropertyDescriptor(props, propName); | ||
const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable; | ||
let blocked = false; | ||
let objectIndex = 0; | ||
for (const k of keys) { | ||
if (k.includes(propName)) { | ||
blocked = true; | ||
isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc); | ||
} | ||
++objectIndex; | ||
} | ||
return clone; | ||
}); | ||
if (!blocked) { | ||
isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc); | ||
} | ||
} | ||
return [...objects, otherObject]; | ||
} | ||
@@ -1324,0 +1346,0 @@ function lazy(fn) { |
{ | ||
"name": "solid-js", | ||
"description": "A declarative JavaScript library for building user interfaces.", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"author": "Ryan Carniato", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -1,2 +0,2 @@ | ||
import { $PROXY, DEV as DEV$1, $TRACK, getListener, batch, createSignal } from 'solid-js'; | ||
import { DEV as DEV$1, $PROXY, $TRACK, getListener, batch, createSignal } from 'solid-js'; | ||
@@ -3,0 +3,0 @@ const $RAW = Symbol("store-raw"), |
@@ -128,3 +128,3 @@ import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js'; | ||
}; | ||
const fn = isCE ? () => (node || (node = create())).cloneNode(true) : () => untrack(() => document.importNode(node || (node = create()), true)); | ||
const fn = isCE ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true); | ||
fn.cloneNode = fn; | ||
@@ -131,0 +131,0 @@ return fn; |
@@ -7,3 +7,2 @@ import { sharedConfig, createRoot, splitProps } from 'solid-js'; | ||
const BooleanAttributes = /*#__PURE__*/new Set(booleans); | ||
/*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]); | ||
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]); | ||
@@ -10,0 +9,0 @@ const Aliases = /*#__PURE__*/Object.assign(Object.create(null), { |
@@ -128,3 +128,3 @@ import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, getOwner, createEffect, runWithOwner, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js'; | ||
}; | ||
const fn = isCE ? () => (node || (node = create())).cloneNode(true) : () => untrack(() => document.importNode(node || (node = create()), true)); | ||
const fn = isCE ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true); | ||
fn.cloneNode = fn; | ||
@@ -131,0 +131,0 @@ return fn; |
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
816212
73
22819