Comparing version 1.6.11 to 1.6.12
@@ -677,3 +677,3 @@ let taskIdCounter = 1, | ||
Updates = []; | ||
if ("_SOLID_DEV_") throw new Error("Potential Infinite Loop Detected."); | ||
if (true) throw new Error("Potential Infinite Loop Detected."); | ||
throw new Error(); | ||
@@ -723,3 +723,4 @@ } | ||
} | ||
handleError(err); | ||
node.updatedAt = time + 1; | ||
return handleError(err); | ||
} | ||
@@ -904,3 +905,3 @@ if (!node.updatedAt || node.updatedAt <= time) { | ||
if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) { | ||
if (source !== ignore) runTop(source); | ||
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source); | ||
} else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore); | ||
@@ -1417,3 +1418,3 @@ } | ||
return createMemo(() => (Comp = comp()) && untrack(() => { | ||
if ("_SOLID_DEV_") Object.assign(Comp, { | ||
if (true) Object.assign(Comp, { | ||
[$DEVCOMP]: true | ||
@@ -1420,0 +1421,0 @@ }); |
@@ -608,3 +608,3 @@ const equalFn = (a, b) => a === b; | ||
count: 0, | ||
id: ctx.id + "0.f", | ||
id: ctx.id + "0-f", | ||
noHydrate: true | ||
@@ -621,3 +621,3 @@ }); | ||
count: 0, | ||
id: ctx.id + "0.f" | ||
id: ctx.id + "0-f" | ||
}); | ||
@@ -624,0 +624,0 @@ ctx.writeResource(id, "$$f"); |
@@ -653,3 +653,4 @@ let taskIdCounter = 1, | ||
} | ||
handleError(err); | ||
node.updatedAt = time + 1; | ||
return handleError(err); | ||
} | ||
@@ -833,3 +834,3 @@ if (!node.updatedAt || node.updatedAt <= time) { | ||
if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) { | ||
if (source !== ignore) runTop(source); | ||
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source); | ||
} else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING) lookUpstream(source, ignore); | ||
@@ -836,0 +837,0 @@ } |
@@ -301,3 +301,3 @@ import { effect, style, insert, untrack, spread, createComponent, delegateEvents, classList, mergeProps, dynamicProperty, setAttribute, setAttributeNS, addEventListener, Aliases, PropAliases, Properties, ChildProperties, DelegatedEvents, SVGElements, SVGNamespace } from 'solid-js/web'; | ||
parseNode(child, childOptions); | ||
i++; | ||
if (!childOptions.multi && child.type === "comment" && child.content === "#") node.children.splice(i, 1);else i++; | ||
} | ||
@@ -392,4 +392,8 @@ options.counter = childOptions.counter; | ||
parts.push(`"${child.content}"`); | ||
} else if (child.type === "comment" && child.content === "#") { | ||
parts.push(`exprs[${options.counter++}]`); | ||
} else if (child.type === "comment") { | ||
if (child.content === "#") parts.push(`exprs[${options.counter++}]`);else if (child.content) { | ||
for (let i = 0; i < child.content.split("###").length - 1; i++) { | ||
parts.push(`exprs[${options.counter++}]`); | ||
} | ||
} | ||
} | ||
@@ -396,0 +400,0 @@ }); |
{ | ||
"name": "solid-js", | ||
"description": "A declarative JavaScript library for building user interfaces.", | ||
"version": "1.6.11", | ||
"version": "1.6.12", | ||
"author": "Ryan Carniato", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -321,7 +321,4 @@ import { $PROXY, DEV as DEV$1, $TRACK, getListener, batch, createSignal } from 'solid-js'; | ||
if (target === previous) return; | ||
if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) { | ||
if (target !== previous) { | ||
if (property === $ROOT) return target; | ||
setProperty(parent, property, target); | ||
} | ||
if (property !== $ROOT && (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key])) { | ||
setProperty(parent, property, target); | ||
return; | ||
@@ -328,0 +325,0 @@ } |
@@ -298,7 +298,4 @@ import { $PROXY, $TRACK, getListener, batch, createSignal } from 'solid-js'; | ||
if (target === previous) return; | ||
if (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key]) { | ||
if (target !== previous) { | ||
if (property === $ROOT) return target; | ||
setProperty(parent, property, target); | ||
} | ||
if (property !== $ROOT && (!isWrappable(target) || !isWrappable(previous) || key && target[key] !== previous[key])) { | ||
setProperty(parent, property, target); | ||
return; | ||
@@ -305,0 +302,0 @@ } |
@@ -71,3 +71,5 @@ export declare const $RAW: unique symbol, $NODE: unique symbol, $NAME: unique symbol; | ||
type W<T> = Exclude<T, NotWrappable>; | ||
type KeyOf<T> = number extends keyof T ? 0 extends 1 & T ? keyof T : [T] extends [readonly unknown[]] ? number : [T] extends [never] ? never : keyof T : keyof T; | ||
type KeyOf<T> = number extends keyof T ? 0 extends 1 & T ? keyof T : [T] extends [never] ? never : [ | ||
T | ||
] extends [readonly unknown[]] ? number : keyof T : keyof T; | ||
type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>; | ||
@@ -74,0 +76,0 @@ type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never] ? never : K extends MutableKeyOf<T> ? [Part<T, K>, ...RestSetterOrContinue<T[K], [K, ...U]>] : K extends KeyOf<T> ? [Part<T, K>, ...RestContinue<T[K], [K, ...U]>] : never; |
import { Accessor } from "./signal.js"; | ||
/** | ||
The MIT License (MIT) | ||
Copyright (c) 2017 Adam Haile | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
/** | ||
* reactively transforms an array with a callback function - underlying helper for the `<For>` control flow | ||
@@ -4,0 +27,0 @@ * |
@@ -0,1 +1,24 @@ | ||
/** | ||
The MIT License (MIT) | ||
Copyright (c) 2017 Adam Haile | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
import { requestCallback } from "./scheduler.js"; | ||
@@ -2,0 +25,0 @@ import type { JSX } from "../jsx.js"; |
@@ -1,2 +0,2 @@ | ||
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createSignal, onCleanup, splitProps, createMemo, $DEVCOMP } from 'solid-js'; | ||
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createMemo, createSignal, onMount, onCleanup, splitProps, $DEVCOMP } from 'solid-js'; | ||
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, mergeProps, untrack } from 'solid-js'; | ||
@@ -531,2 +531,3 @@ | ||
const isServer = false; | ||
const isDev = true; | ||
const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; | ||
@@ -545,33 +546,37 @@ function createElement(tagName, isSVG = false) { | ||
marker = document.createTextNode(""), | ||
mount = props.mount || document.body; | ||
mount = () => props.mount || document.body, | ||
content = createMemo(renderPortal()); | ||
function renderPortal() { | ||
if (sharedConfig.context) { | ||
const [s, set] = createSignal(false); | ||
queueMicrotask(() => set(true)); | ||
onMount(() => set(true)); | ||
return () => s() && props.children; | ||
} else return () => props.children; | ||
} | ||
if (mount instanceof HTMLHeadElement) { | ||
const [clean, setClean] = createSignal(false); | ||
const cleanup = () => setClean(true); | ||
createRoot(dispose => insert(mount, () => !clean() ? renderPortal()() : dispose(), null)); | ||
onCleanup(() => { | ||
if (sharedConfig.context) queueMicrotask(cleanup);else cleanup(); | ||
}); | ||
} else { | ||
const container = createElement(props.isSVG ? "g" : "div", props.isSVG), | ||
renderRoot = useShadow && container.attachShadow ? container.attachShadow({ | ||
mode: "open" | ||
}) : container; | ||
Object.defineProperty(container, "_$host", { | ||
get() { | ||
return marker.parentNode; | ||
}, | ||
configurable: true | ||
}); | ||
insert(renderRoot, renderPortal()); | ||
mount.appendChild(container); | ||
props.ref && props.ref(container); | ||
onCleanup(() => mount.removeChild(container)); | ||
} | ||
createRenderEffect(() => { | ||
const el = mount(); | ||
if (el instanceof HTMLHeadElement) { | ||
const [clean, setClean] = createSignal(false); | ||
const cleanup = () => setClean(true); | ||
createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null)); | ||
onCleanup(() => { | ||
if (sharedConfig.context) queueMicrotask(cleanup);else cleanup(); | ||
}); | ||
} else { | ||
const container = createElement(props.isSVG ? "g" : "div", props.isSVG), | ||
renderRoot = useShadow && container.attachShadow ? container.attachShadow({ | ||
mode: "open" | ||
}) : container; | ||
Object.defineProperty(container, "_$host", { | ||
get() { | ||
return marker.parentNode; | ||
}, | ||
configurable: true | ||
}); | ||
insert(renderRoot, content); | ||
el.appendChild(container); | ||
props.ref && props.ref(container); | ||
onCleanup(() => el.removeChild(container)); | ||
} | ||
}); | ||
return marker; | ||
@@ -599,2 +604,2 @@ } | ||
export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets }; | ||
export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isDev, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets }; |
@@ -786,2 +786,3 @@ import { sharedConfig, splitProps } from 'solid-js'; | ||
const isServer = true; | ||
const isDev = false; | ||
function render() {} | ||
@@ -807,2 +808,2 @@ function hydrate() {} | ||
export { Assets, Dynamic, Hydration, HydrationScript, NoHydration, Portal, addEventListener, delegateEvents, escape, generateHydrationScript, getAssets, getHydrationKey, hydrate, insert, isServer, pipeToNodeWritable, pipeToWritable, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, stringify, useAssets }; | ||
export { Assets, Dynamic, Hydration, HydrationScript, NoHydration, Portal, addEventListener, delegateEvents, escape, generateHydrationScript, getAssets, getHydrationKey, hydrate, insert, isDev, isServer, pipeToNodeWritable, pipeToWritable, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, stringify, useAssets }; |
@@ -1,2 +0,2 @@ | ||
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createSignal, onCleanup, splitProps, createMemo } from 'solid-js'; | ||
import { createRoot, createRenderEffect, sharedConfig, untrack, enableHydration, createMemo, createSignal, onMount, onCleanup, splitProps, $DEVCOMP } from 'solid-js'; | ||
export { ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, createComponent, createRenderEffect as effect, getOwner, createMemo as memo, mergeProps, untrack } from 'solid-js'; | ||
@@ -103,2 +103,3 @@ | ||
t.innerHTML = html; | ||
if (check && t.innerHTML.split("<").length - 1 !== check) throw `The browser resolved template HTML does not match JSX input:\n${t.innerHTML}\n\n${html}. Is your HTML properly formed?`; | ||
let node = t.content.firstChild; | ||
@@ -249,2 +250,4 @@ if (isSVG) node = node.firstChild; | ||
if (!sharedConfig.context || !(node = sharedConfig.registry.get(key = getHydrationKey()))) { | ||
if (sharedConfig.context) console.warn("Unable to find DOM nodes for hydration key:", key); | ||
if (!template) throw new Error("Unrecoverable Hydration Mismatch. No template for key: " + key); | ||
return template.cloneNode(true); | ||
@@ -439,3 +442,3 @@ } | ||
current = value; | ||
} else ; | ||
} else console.warn(`Unrecognized value. Skipped inserting`, value); | ||
return current; | ||
@@ -531,2 +534,3 @@ } | ||
const isServer = false; | ||
const isDev = false; | ||
const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; | ||
@@ -545,33 +549,37 @@ function createElement(tagName, isSVG = false) { | ||
marker = document.createTextNode(""), | ||
mount = props.mount || document.body; | ||
mount = () => props.mount || document.body, | ||
content = createMemo(renderPortal()); | ||
function renderPortal() { | ||
if (sharedConfig.context) { | ||
const [s, set] = createSignal(false); | ||
queueMicrotask(() => set(true)); | ||
onMount(() => set(true)); | ||
return () => s() && props.children; | ||
} else return () => props.children; | ||
} | ||
if (mount instanceof HTMLHeadElement) { | ||
const [clean, setClean] = createSignal(false); | ||
const cleanup = () => setClean(true); | ||
createRoot(dispose => insert(mount, () => !clean() ? renderPortal()() : dispose(), null)); | ||
onCleanup(() => { | ||
if (sharedConfig.context) queueMicrotask(cleanup);else cleanup(); | ||
}); | ||
} else { | ||
const container = createElement(props.isSVG ? "g" : "div", props.isSVG), | ||
renderRoot = useShadow && container.attachShadow ? container.attachShadow({ | ||
mode: "open" | ||
}) : container; | ||
Object.defineProperty(container, "_$host", { | ||
get() { | ||
return marker.parentNode; | ||
}, | ||
configurable: true | ||
}); | ||
insert(renderRoot, renderPortal()); | ||
mount.appendChild(container); | ||
props.ref && props.ref(container); | ||
onCleanup(() => mount.removeChild(container)); | ||
} | ||
createRenderEffect(() => { | ||
const el = mount(); | ||
if (el instanceof HTMLHeadElement) { | ||
const [clean, setClean] = createSignal(false); | ||
const cleanup = () => setClean(true); | ||
createRoot(dispose => insert(el, () => !clean() ? content() : dispose(), null)); | ||
onCleanup(() => { | ||
if (sharedConfig.context) queueMicrotask(cleanup);else cleanup(); | ||
}); | ||
} else { | ||
const container = createElement(props.isSVG ? "g" : "div", props.isSVG), | ||
renderRoot = useShadow && container.attachShadow ? container.attachShadow({ | ||
mode: "open" | ||
}) : container; | ||
Object.defineProperty(container, "_$host", { | ||
get() { | ||
return marker.parentNode; | ||
}, | ||
configurable: true | ||
}); | ||
insert(renderRoot, content); | ||
el.appendChild(container); | ||
props.ref && props.ref(container); | ||
onCleanup(() => el.removeChild(container)); | ||
} | ||
}); | ||
return marker; | ||
@@ -586,2 +594,5 @@ } | ||
case "function": | ||
Object.assign(component, { | ||
[$DEVCOMP]: true | ||
}); | ||
return untrack(() => component(others)); | ||
@@ -597,2 +608,2 @@ case "string": | ||
export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets }; | ||
export { Aliases, voidFn as Assets, ChildProperties, DOMElements, DelegatedEvents, Dynamic, Hydration, voidFn as HydrationScript, NoHydration, Portal, PropAliases, Properties, SVGElements, SVGNamespace, addEventListener, assign, classList, className, clearDelegatedEvents, delegateEvents, dynamicProperty, escape, voidFn as generateHydrationScript, voidFn as getAssets, getHydrationKey, getNextElement, getNextMarker, getNextMatch, hydrate, innerHTML, insert, isDev, isServer, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrSpread, ssrStyle, style, template, use, voidFn as useAssets }; |
@@ -6,3 +6,4 @@ import { hydrate as hydrateCore } from "./client.js"; | ||
export * from "./server-mock.js"; | ||
export declare const isServer = false; | ||
export declare const isServer: boolean; | ||
export declare const isDev: boolean; | ||
export declare const hydrate: typeof hydrateCore; | ||
@@ -9,0 +10,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 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
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
797210
22189