This page summarizes the public package entrypoints.
Use subpaths for feature-specific imports.
Common runtime exports:
state()derive()selector()defineScope()readScope()getSignal()- JSX runtime exports:
jsx,jsxs, andFragment
Public types:
StateStateSetterStateTupleDerivedSelectorScopePropsThe shared runtime props bag stays intentionally generic. Intrinsic JSX elements layer common DOM-style contracts such asclass,style,ref, and high-use event handlers on top of it, and the JSX runtime gives high-use tags likea,button,form,input,label,select,option, andtextareaplus common layout/content tags such asdiv,span,section,main,article,header,footer,nav,p, and headings, along with common semantic inline/content tags such asblockquote,code,em,figure,figcaption,pre,small, andstrong, plus list, table, output, and common SVG tags such asul,li,ol,table,caption,thead,tbody,tfoot,tr,td,th,output,svg,g,circle,rect,path, andtitle, their own attribute contracts, including table-cell props such ascolSpan,rowSpan,headers,scope, andabbr, output props such ashtmlFor,name, andform, and SVG props such asviewBox,strokeWidth,strokeLinecap,strokeLinejoin,fillRule, andclipRule. Compatibility props such asclassName,htmlFor, and those common camelCase SVG props are normalized to their rendered attribute names.
-
@askrjs/askr/boot- app startup and lifecycle helpers such ascreateIsland,createIslands,createSPA,hydrateSPA,cleanupApp, andhasApp -
@askrjs/askr/components-ErrorBoundary -
@askrjs/askr/actions- browser-safedefineAction, reactiveaction, and native-firstActionForm -
@askrjs/askr/control- JSX control-flow helpers- For reactive list rows, see the control-flow guide
for the
selector()and thunk-prop patterns. A row callback is reconciled by<For>and should not rely on plain closure captures of changing parent state.
- For reactive list rows, see the control-flow guide
for the
-
@askrjs/askr/data-createDataRuntime,getDefaultDataRuntime,createQuery,createQueryCollection,createMutation,invalidate, andinvalidateOnInterval -
@askrjs/askr/testing- component harness helpers such asrender,mount,renderRoute,dispatch,flush, andcleanup, plus query and router fixtures -
@askrjs/askr/resources- async resource helpers such asresource,stream,on,timer,task,capture,getSignal,routeActive,documentVisible, andwindowFocused -
@askrjs/askr/router- typedRouteRefdeclarations and destinations, metadata, criticalrouteData, and deferredResolveboundaries -
@askrjs/askr/fx- timing and scheduling helpers -
@askrjs/askr/ssr- synchronous rendering plusrenderRouteRequest()for explicitly deferred Web streams -
@askrjs/askr/ssg- static-site generation helpers -
@askrjs/askr/foundations- structural primitives such aslayout,Slot,Presence, plus runtime-backed portal helpers likedefinePortal,DefaultPortal, andPortal -
@askrjs/askr/foundations/structures- structural registries and layering helpers such ascreateCollectionandcreateLayer, plusisElementandcloneElementfor framework-compatible JSX composition -
@askrjs/askr/foundations/utilities- prop composition and ID helpers -
@askrjs/askr/foundations/interactions- interaction-policy helpers -
@askrjs/askr/foundations/state- controllable-state helpers -
@askrjs/askr/foundations/icon- icon contract helpers -
@askrjs/askr/jsx-runtime- JSX factory exports plusJSXElement,JSXComponent, andJSXElementType -
@askrjs/askr/jsx-dev-runtime- JSX development runtime exports plus the same JSX public types
Both JSX runtime entrypoints also intentionally export the JSX namespace
used by TypeScript's automatic JSX transform. Its intrinsic-element and
children contracts are part of the supported public API.
import { derive, state } from '@askrjs/askr';
const [count, setCount] = state(0);
const doubled = derive(() => count() * 2);
setCount((value) => value + 1);import { createSPA } from '@askrjs/askr/boot';
import { createRouteRegistry, route } from '@askrjs/askr/router';
const registry = createRouteRegistry(() => {
route('/', () => <Home />);
route('/about', () => <About />);
});
await createSPA({ root: document.body, registry });- Move startup helpers like
createIsland,createIslands,createSPA,hydrateSPA,cleanupApp, andhasAppto@askrjs/askr/boot. - Move
ErrorBoundaryto@askrjs/askr/components. - Move
createQuery,createMutation, andinvalidateto@askrjs/askr/data. - Move
createCollectionandcreateLayerto@askrjs/askr/foundations/structures. - Use the dedicated
@askrjs/askr/foundations/*subpaths for utilities, interactions, state, and icon helpers.
For,Show,Case, andMatchare available from@askrjs/askr/control.Showrender-function children receive the resolved truthy value, and literal falsey branches are excluded from that callback type when TypeScript can see them.- A
Scopecomponent accepts normal renderable children or a zero-argument render callback. Imperative DOMNodechildren are not part of that public contract. ErrorBoundaryprotects initial and scheduled descendant renders, including portal content associated with a logical writer or bounded host. Fallbacks accept normal JSX boundary content, and the client runtime also allows an imperative DOMNodefallback when you need one.Link,layout,Slot,Presence, and the default portal surfaces accept normal renderable child content. Imperative DOMNodechildren are not part of that public contract.- Router page components,
lazy()route components, and router layout functions also return normal renderable content rather than imperative DOMNodevalues. lazy()preserves its import factory until the route is matched. Call the returned component'spreload()method when an interaction or application policy should fetch that route earlier.createQuery()exposesconsistencyplusstaleReasonso settled stale states can be narrowed intoinconsistent,aborted, orerrorwithout guessing from broad booleans alone.createQueryCollection()owns a dynamic keyed set of one query definition, bounds collection-started loads and retries, and exposes aggregate results and per-key errors without introducing another cache.createDataRuntime()creates isolated query and mutation state for tests, embedded apps, and multi-root shells; pass it through data operation options withruntime.resource()is available from@askrjs/askr/resources.renderToString(),renderToStream(),resolveRequest(), andcreateStaticGen()accept route registries captured withcreateRouteRegistry().