Skip to content

Latest commit

 

History

History
73 lines (64 loc) · 2.12 KB

File metadata and controls

73 lines (64 loc) · 2.12 KB

Entrypoints

For npm consumers, @async/framework uses conditional exports: browser-aware tooling receives the browser entry, while Node receives the server-capable entry. Use explicit subpaths when the target matters. The root export also uses condition-specific declarations, so browser-conditioned root imports expose the same API as @async/framework/browser; server-only APIs remain declared on the Node/server entrypoints.

import {
  Async,
  Loader,
  attributeName,
  asyncSignal,
  createApp,
  createCacheRegistry,
  createComponentRegistry,
  createLazyRegistry,
  computed,
  component,
  createSignal,
  createHandlerRegistry,
  createRegistryStore,
  createScheduler,
  createServerProxy,
  createSignalRegistry,
  defineAsyncContainerElement,
  defineAsyncSuspenseElement,
  defineAttributeConfig,
  defineApp,
  defineCache,
  defineRegistrySnapshot,
  delay,
  effect,
  html,
  readSnapshot,
  signal
} from "@async/framework/browser";

Use feature subpaths when an app needs the larger browser systems:

import { AsyncStream } from "@async/framework/stream";
import { Async, defineRoute } from "@async/framework/router";
import { flow, flowSignal, flowStatus, compose, when, transition } from "@async/framework/flow";

The flow entry re-exports the complete @async/flow authoring surface: declaration helpers (flowSignal, flowComputed, flowAsyncSignal, flowStatus), step helpers (set, update, when, branch, guard, transition, dispatch, after, onError), condition helpers (bool, every, some, not, can, matches, inspect), and composition (compose, parallel, remember). Apps do not need to install @async/flow separately.

Server-only APIs live behind the server entry:

import {
  createRequestContextStore,
  createServerRegistry
} from "@async/framework/server";

Loader is the canonical loader factory. AsyncLoader remains as a compatibility alias for older code.

Related