@getforma/core
Advanced tools
+30
-5
@@ -55,3 +55,3 @@ 'use strict'; | ||
| fragment2.appendChild(endMarker); | ||
| const cache = /* @__PURE__ */ new Map(); | ||
| const cache2 = /* @__PURE__ */ new Map(); | ||
| let currentNode = null; | ||
@@ -91,3 +91,3 @@ let currentMatch = UNSET; | ||
| if (matchedCase) { | ||
| let entry = cache.get(val); | ||
| let entry = cache2.get(val); | ||
| if (!entry) { | ||
@@ -100,3 +100,3 @@ let branchDispose; | ||
| entry = { node, dispose: branchDispose }; | ||
| cache.set(val, entry); | ||
| cache2.set(val, entry); | ||
| if (DEBUG) console.log("[forma:switch] rendered new branch for", String(val), "\u2192", node.nodeName, "type", node.nodeType); | ||
@@ -118,6 +118,6 @@ } else { | ||
| switchDispose(); | ||
| for (const entry of cache.values()) { | ||
| for (const entry of cache2.values()) { | ||
| entry.dispose(); | ||
| } | ||
| cache.clear(); | ||
| cache2.clear(); | ||
| }; | ||
@@ -226,2 +226,25 @@ return fragment2; | ||
| // src/dom/template.ts | ||
| var cache = /* @__PURE__ */ new Map(); | ||
| function template(html) { | ||
| let node = cache.get(html); | ||
| if (!node) { | ||
| const tpl = document.createElement("template"); | ||
| tpl.innerHTML = html; | ||
| node = tpl.content.firstChild; | ||
| cache.set(html, node); | ||
| } | ||
| return node; | ||
| } | ||
| function templateMany(html) { | ||
| let node = cache.get(html); | ||
| if (!node) { | ||
| const tpl = document.createElement("template"); | ||
| tpl.innerHTML = html; | ||
| node = tpl.content; | ||
| cache.set(html, node); | ||
| } | ||
| return node.cloneNode(true); | ||
| } | ||
| // src/dom/activate.ts | ||
@@ -1146,2 +1169,4 @@ var FORBIDDEN_PROP_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); | ||
| exports.siblings = siblings; | ||
| exports.template = template; | ||
| exports.templateMany = templateMany; | ||
| exports.toggleClass = toggleClass; | ||
@@ -1148,0 +1173,0 @@ exports.trackDisposer = trackDisposer; |
+25
-1
@@ -657,2 +657,26 @@ /// <reference path="./jsx.d.ts" /> | ||
| /** | ||
| * Forma DOM - Template | ||
| * | ||
| * Runtime helper for compiled template output. Memoizes template parsing | ||
| * so that each unique HTML string is parsed once and then cloned per use. | ||
| * | ||
| * The returned node should be cloned via `.cloneNode(true)` before use | ||
| * in component instances. | ||
| */ | ||
| /** | ||
| * Create a reusable template node from an HTML string. | ||
| * | ||
| * The returned node is a cached prototype. Callers must call | ||
| * `.cloneNode(true)` to get a unique DOM tree for each component instance. | ||
| */ | ||
| declare function template(html: string): Node; | ||
| /** | ||
| * Create a reusable template DocumentFragment from an HTML string. | ||
| * | ||
| * Used when the template has multiple root nodes. The returned fragment | ||
| * is a cached prototype; callers must call `.cloneNode(true)`. | ||
| */ | ||
| declare function templateMany(html: string): DocumentFragment; | ||
| /** | ||
| * Hydrate an SSR island in-place. Runs the component in hydration mode so | ||
@@ -995,2 +1019,2 @@ * h() returns descriptors, then walks the descriptor tree against the SSR DOM | ||
| export { $, $$, type CleanupFn, type ComponentDef, type Context, type CreateListOptions, type Dispatch, type ErrorHandler, type EventBus, Fragment, type HistoryControls, type IslandHydrateFn, type KeyOptions, type ListTransitionHooks, type PersistOptions, type ReconcileResult, type Ref, type SetupFn, SignalGetter, type StoreSetter, type SwitchCase, activateIslands, addClass, batch, children, cleanup, closest, createBus, createComputed, createContext, createEffect, createErrorBoundary, createHistory, createList, createMemo, createPortal, createReducer, createRef, createRoot, createShow, createStore, createSuspense, createSwitch, createText, deactivateAllIslands, deactivateIsland, defineComponent, delegate, disposeComponent, fragment, h, hydrateIsland, inject, mount, nextSibling, on, onCleanup, onError, onIntersect, onKey, onMount, onMutation, onResize, onUnmount, parent, persist, prevSibling, provide, reconcileList, removeClass, setAttr, setHTMLUnsafe, setStyle, setText, siblings, toggleClass, trackDisposer, unprovide, untrack }; | ||
| export { $, $$, type CleanupFn, type ComponentDef, type Context, type CreateListOptions, type Dispatch, type ErrorHandler, type EventBus, Fragment, type HistoryControls, type IslandHydrateFn, type KeyOptions, type ListTransitionHooks, type PersistOptions, type ReconcileResult, type Ref, type SetupFn, SignalGetter, type StoreSetter, type SwitchCase, activateIslands, addClass, batch, children, cleanup, closest, createBus, createComputed, createContext, createEffect, createErrorBoundary, createHistory, createList, createMemo, createPortal, createReducer, createRef, createRoot, createShow, createStore, createSuspense, createSwitch, createText, deactivateAllIslands, deactivateIsland, defineComponent, delegate, disposeComponent, fragment, h, hydrateIsland, inject, mount, nextSibling, on, onCleanup, onError, onIntersect, onKey, onMount, onMutation, onResize, onUnmount, parent, persist, prevSibling, provide, reconcileList, removeClass, setAttr, setHTMLUnsafe, setStyle, setText, siblings, template, templateMany, toggleClass, trackDisposer, unprovide, untrack }; |
+25
-1
@@ -657,2 +657,26 @@ /// <reference path="./jsx.d.ts" /> | ||
| /** | ||
| * Forma DOM - Template | ||
| * | ||
| * Runtime helper for compiled template output. Memoizes template parsing | ||
| * so that each unique HTML string is parsed once and then cloned per use. | ||
| * | ||
| * The returned node should be cloned via `.cloneNode(true)` before use | ||
| * in component instances. | ||
| */ | ||
| /** | ||
| * Create a reusable template node from an HTML string. | ||
| * | ||
| * The returned node is a cached prototype. Callers must call | ||
| * `.cloneNode(true)` to get a unique DOM tree for each component instance. | ||
| */ | ||
| declare function template(html: string): Node; | ||
| /** | ||
| * Create a reusable template DocumentFragment from an HTML string. | ||
| * | ||
| * Used when the template has multiple root nodes. The returned fragment | ||
| * is a cached prototype; callers must call `.cloneNode(true)`. | ||
| */ | ||
| declare function templateMany(html: string): DocumentFragment; | ||
| /** | ||
| * Hydrate an SSR island in-place. Runs the component in hydration mode so | ||
@@ -995,2 +1019,2 @@ * h() returns descriptors, then walks the descriptor tree against the SSR DOM | ||
| export { $, $$, type CleanupFn, type ComponentDef, type Context, type CreateListOptions, type Dispatch, type ErrorHandler, type EventBus, Fragment, type HistoryControls, type IslandHydrateFn, type KeyOptions, type ListTransitionHooks, type PersistOptions, type ReconcileResult, type Ref, type SetupFn, SignalGetter, type StoreSetter, type SwitchCase, activateIslands, addClass, batch, children, cleanup, closest, createBus, createComputed, createContext, createEffect, createErrorBoundary, createHistory, createList, createMemo, createPortal, createReducer, createRef, createRoot, createShow, createStore, createSuspense, createSwitch, createText, deactivateAllIslands, deactivateIsland, defineComponent, delegate, disposeComponent, fragment, h, hydrateIsland, inject, mount, nextSibling, on, onCleanup, onError, onIntersect, onKey, onMount, onMutation, onResize, onUnmount, parent, persist, prevSibling, provide, reconcileList, removeClass, setAttr, setHTMLUnsafe, setStyle, setText, siblings, toggleClass, trackDisposer, unprovide, untrack }; | ||
| export { $, $$, type CleanupFn, type ComponentDef, type Context, type CreateListOptions, type Dispatch, type ErrorHandler, type EventBus, Fragment, type HistoryControls, type IslandHydrateFn, type KeyOptions, type ListTransitionHooks, type PersistOptions, type ReconcileResult, type Ref, type SetupFn, SignalGetter, type StoreSetter, type SwitchCase, activateIslands, addClass, batch, children, cleanup, closest, createBus, createComputed, createContext, createEffect, createErrorBoundary, createHistory, createList, createMemo, createPortal, createReducer, createRef, createRoot, createShow, createStore, createSuspense, createSwitch, createText, deactivateAllIslands, deactivateIsland, defineComponent, delegate, disposeComponent, fragment, h, hydrateIsland, inject, mount, nextSibling, on, onCleanup, onError, onIntersect, onKey, onMount, onMutation, onResize, onUnmount, parent, persist, prevSibling, provide, reconcileList, removeClass, setAttr, setHTMLUnsafe, setStyle, setText, siblings, template, templateMany, toggleClass, trackDisposer, unprovide, untrack }; |
+29
-6
@@ -56,3 +56,3 @@ import { hydrateIsland } from './chunk-VTPFK5TJ.js'; | ||
| fragment2.appendChild(endMarker); | ||
| const cache = /* @__PURE__ */ new Map(); | ||
| const cache2 = /* @__PURE__ */ new Map(); | ||
| let currentNode = null; | ||
@@ -92,3 +92,3 @@ let currentMatch = UNSET; | ||
| if (matchedCase) { | ||
| let entry = cache.get(val); | ||
| let entry = cache2.get(val); | ||
| if (!entry) { | ||
@@ -101,3 +101,3 @@ let branchDispose; | ||
| entry = { node, dispose: branchDispose }; | ||
| cache.set(val, entry); | ||
| cache2.set(val, entry); | ||
| if (DEBUG) console.log("[forma:switch] rendered new branch for", String(val), "\u2192", node.nodeName, "type", node.nodeType); | ||
@@ -119,6 +119,6 @@ } else { | ||
| switchDispose(); | ||
| for (const entry of cache.values()) { | ||
| for (const entry of cache2.values()) { | ||
| entry.dispose(); | ||
| } | ||
| cache.clear(); | ||
| cache2.clear(); | ||
| }; | ||
@@ -227,2 +227,25 @@ return fragment2; | ||
| // src/dom/template.ts | ||
| var cache = /* @__PURE__ */ new Map(); | ||
| function template(html) { | ||
| let node = cache.get(html); | ||
| if (!node) { | ||
| const tpl = document.createElement("template"); | ||
| tpl.innerHTML = html; | ||
| node = tpl.content.firstChild; | ||
| cache.set(html, node); | ||
| } | ||
| return node; | ||
| } | ||
| function templateMany(html) { | ||
| let node = cache.get(html); | ||
| if (!node) { | ||
| const tpl = document.createElement("template"); | ||
| tpl.innerHTML = html; | ||
| node = tpl.content; | ||
| cache.set(html, node); | ||
| } | ||
| return node.cloneNode(true); | ||
| } | ||
| // src/dom/activate.ts | ||
@@ -1000,4 +1023,4 @@ var FORBIDDEN_PROP_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); | ||
| export { $, $$, activateIslands, addClass, children, closest, createBus, createContext, createErrorBoundary, createHistory, createPortal, createStore, createSuspense, createSwitch, createText, deactivateAllIslands, deactivateIsland, defineComponent, delegate, disposeComponent, inject, mount, nextSibling, onIntersect, onKey, onMount, onMutation, onResize, onUnmount, parent, persist, prevSibling, provide, removeClass, setAttr, setHTMLUnsafe, setStyle, setText, siblings, toggleClass, trackDisposer, unprovide }; | ||
| export { $, $$, activateIslands, addClass, children, closest, createBus, createContext, createErrorBoundary, createHistory, createPortal, createStore, createSuspense, createSwitch, createText, deactivateAllIslands, deactivateIsland, defineComponent, delegate, disposeComponent, inject, mount, nextSibling, onIntersect, onKey, onMount, onMutation, onResize, onUnmount, parent, persist, prevSibling, provide, removeClass, setAttr, setHTMLUnsafe, setStyle, setText, siblings, template, templateMany, toggleClass, trackDisposer, unprovide }; | ||
| //# sourceMappingURL=index.js.map | ||
| //# sourceMappingURL=index.js.map |
+1
-1
| { | ||
| "name": "@getforma/core", | ||
| "author": "Forma <victor@getforma.dev>", | ||
| "version": "1.0.4", | ||
| "version": "1.0.5", | ||
| "description": "Real DOM reactive library — fine-grained signals, islands architecture, SSR hydration. No virtual DOM, no diffing. ~15KB gzipped.", | ||
@@ -6,0 +6,0 @@ "type": "module", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
3917668
0.25%38772
0.24%