libraryPackage manifestv6.0.4

lib.contracts-runtime-client-react

React runtime adapters for ContractSpec contracts

@lssm-tech/lib.contracts-runtime-client-react
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 6.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
webserverbrowserbunnode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.contracts-runtime-client-reactplatform

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

8 déclarations · les 6 premières affichéesSELECT TO INSPECT

@lssm-tech/lib.contracts-runtime-client-react

React runtime adapters for ContractSpec contracts.

Query/result primitives, feature and presentation declarations use their complete Core owners. Locale and translation factory exports use TranslationRuntime; feature registration retains the canonical Kernel FeatureRegistry class. The form renderer uses the complete Core Form contracts and FormsRuntime runtime helpers. Its tests retain the canonical DesignCatalog showcase singleton and Core identity/layout helpers. PWA update checks consume the complete portable Core /pwa/types contracts; all Source and test imports use their canonical owners. Public entrypoints and React peer requirements are unchanged. The canonical registry and Forms runtime bindings require Forms839a and the complete Kernel FeatureRegistry owner to be composed before qualification.

What It Provides

  • Couche: lib.
  • Consumers: design-system, presentation-runtime-react, bundles.
  • Related ContractSpec packages include @lssm-tech/lib.contracts-spec, @lssm-tech/lib.schema, @lssm-tech/tool.bun, @lssm-tech/tool.typescript.
  • Related ContractSpec packages include @lssm-tech/lib.contracts-spec, @lssm-tech/lib.schema, @lssm-tech/tool.bun, @lssm-tech/tool.typescript.

Installation

npm install @lssm-tech/lib.contracts-runtime-client-react

or

bun add @lssm-tech/lib.contracts-runtime-client-react

Usage

Import the root entrypoint from @lssm-tech/lib.contracts-runtime-client-react, or choose a documented subpath when you only need one part of the package surface.

The form renderer supports the expanded FormSpec field set: readonly inputs, email, autocomplete, address, phone, date, time, datetime, semantic groups, repeated grouped arrays, grid layout hints, progressive layout.flow sections/steps, and text/textarea/email input groups. Drivers are expected to provide dedicated slots for rich widgets plus shadcn/Radix-style Field* and optional InputGroup* slots. Email fields render through the standard input slot with native email input behavior. When input-group slots are absent, text, email, and textarea fields fall back to plain controls.

Autocomplete fields support local filtering and resolver-backed search. Resolver calls receive the current query, watched dependency values, field name, and an AbortSignal through the existing resolver args object; stale responses are ignored and selected remote options remain visible when later searches return a different result set. Custom autocomplete driver slots can read optional loading, error, emptyText, loadingText, and errorText props to expose async state.

PWA update checks

usePwaUpdateChecker from @lssm-tech/lib.contracts-runtime-client-react/pwa-update-client checks the pwa.update.check API, exposes required/blocking versus optional update state, supports polling, and delegates actual service worker activation to a host-provided onApply callback.

LSSM OS durable-operation status

useLssmOsOperationStatusV1 from @lssm-tech/lib.contracts-runtime-client-react/lssm-os-operation-status accepts the provider-neutral Runtime Node operation client port and returns its ui projection unchanged. HTTP hosts may inject @lssm-tech/integration.lssm-os-operation-client, but this React library has no upward integration dependency. It polls only while the canonical operation is nonterminal or its canonical error is retryable, aborts obsolete scopes, and never derives a UI-specific status, receipt, or error mapping.

Adaptive form support

resolveAdaptiveFormExperience from @lssm-tech/lib.contracts-runtime-client-react/adaptive-form maps ResolvedAdaptiveExperience into generic form guidance, density, control, and recovery defaults. It is a lightweight adapter for form renderers and vertical applications that want adaptive behavior without coupling forms to analytics or product-specific labels.

Use the result as an editable runtime recommendation. It should not override permissions, validation, authorization, or business rules.

Query and mutation hooks

useContractQuery(envelope, options?) and useContractMutation(options?) are thin bindings over the in-house engine in @lssm-tech/lib.contracts-runtime-core† — no @tanstack/*. Wrap the surface in ContractDataEngineProvider with a createDataEngine({ transport }), then:

  • useContractQuery returns the canonical QueryState<TData> verbatim (status, fetchStatus, data, error, cacheStatus, isStale, isOffline, conflict, versionToken) plus refetch — so it flows straight into the I/O-free design-system QueryState components with zero adapter.
  • useContractMutation returns the canonical mutation state (status, data, problem, conflictOutcome, isPending) plus mutate(request, { optimistic? }).

The engine owns the cache, request dedup, durable offline queue + replay, etag conflict resolution, optimistic apply/rollback, and recoverable auth-expiry. This package no longer ships cache-key/storage/policy helpers or a ./query-client subpath — they were removed in the data-fetching ecosystem reset (the engine owns all of it). parseContractResponse (structuredContent-first MCP/GraphQL decode) remains for non-engine response interpretation.

Provider props for the local/offline mode

ContractDataEngineProvider accepts either a host-composed engine or a transport from which it builds and owns the engine:

tsx
<ContractDataEngineProvider
  transport={transport}
  mode={offlineEnabled ? "offline-capable" : "online-only"}
  offline={{ storage, reachability }}
>
  <App />
</ContractDataEngineProvider>
  • mode takes online-only, memory-cache or offline-capable, or a policy resolved with resolveLocalOfflinePolicy({ env, flag }). Without mode, offline.storage selects offline-capable and no storage keeps online-only.
  • offline is passed to the engine as its advanced options. Durable offline.storage and offline.cacheStore are forwarded only in offline-capable mode and dropped in online-only and memory-cache, so the same offline object works while mode toggles.
  • The engine is rebuilt only when transport, the resolved mode, the forwarded offline.storage or offline.reachability changes, so inline offline objects are safe.
  • The host reachability source is followed only while the provider is mounted, so a replaced engine stops draining the offline queue.
  • On the explicit path, engine keeps working unchanged. An optional transport there only feeds realtime subscriptions.

Realtime subscriptions

useContractSubscription(tags, options?) listens on the provider transport's subscribe() seam, for example createWebSocketTransport from @lssm-tech/lib.contracts-runtime-core. For each pushed event it marks the matching cached reads stale and, when any matched, runs the engine's maintenance.revalidateStale(), then calls onInvalidate. That pass refetches every stale cache entry, not only the reads for the pushed tags. It returns { supported, active, lastEvent, eventCount }. A transport without subscribe(), such as REST, reports supported: false. Reconnects, backpressure and resync stay in the transport. Revalidation runs on the engine's background path without a per-call ctx, and a failed invalidation or revalidation goes to onError. An online-only engine has no cache to revalidate, so in that mode use onInvalidate to refetch.

Architecture

  • src/adaptive-form.ts is part of the package's public or composition surface.
  • src/drivers is part of the package's public or composition surface.
  • src/feature-render.ts is part of the package's public or composition surface.
  • src/form-render.impl.tsx is part of the package's public or composition surface.
  • src/form-render.ts is part of the package's public or composition surface.
  • src/index.ts is the root public barrel and package entrypoint.

Public Entry Points

  • Export . resolves through ./src/index.ts.
  • Export ./adaptive-form resolves through ./src/adaptive-form.ts.
  • Export ./drivers/rn-reusables resolves through ./src/drivers/rn-reusables.ts.
  • Export ./drivers/shadcn resolves through ./src/drivers/shadcn.ts.
  • Export ./feature-render resolves through ./src/feature-render.ts.
  • Export ./form-render resolves through ./src/form-render.ts.
  • Export ./form-render.impl resolves through ./src/form-render.impl.tsx.
  • Export ./pwa-update-client resolves through ./src/pwa-update-client.tsx.
  • Export ./lssm-os-operation-status resolves through ./src/lssm-os-operation-status.tsx.
  • Export ./subscriptions/use-contract-subscription resolves through ./src/subscriptions/use-contract-subscription.tsx.

Local Commands

  • bun run dev — contractspec-bun-build dev
  • bun run build — contractspec-bun-build build
  • bun run lint — bun run lint:fix
  • bun run lint:check — biome check .
  • bun run lint:fix — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
  • bun run typecheck — tsgo --noEmit
  • bun run publish:pkg — bun publish --tolerate-republish --ignore-scripts --verbose
  • bun run publish:pkg:canary — bun publish:pkg --tag canary
  • bun run clean — rm -rf dist
  • bun run build:bundle — contractspec-bun-build transpile
  • bun run build:types — contractspec-bun-build types
  • bun run prebuild — contractspec-bun-build prebuild

Recent Updates

  • Replace eslint+prettier by biomejs to optimize speed.
  • Add generic adaptive form experience helpers for runtime guidance defaults.

Notes

  • Driver interface must stay compatible with both shadcn and RN Reusables.
  • Form rendering pipeline is a critical path; test thoroughly before changing.

Declared capabilities.

Lib Contracts Runtime Client React

React runtime adapters for ContractSpec contracts

Use it to

  • Adopt react runtime adapters for contractspec contracts

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.contracts-runtime-client-react package constraints do not match the target runtime or platform.

@lssm-tech/lib.contracts-runtime-client-react

@lssm-tech/lib.contracts-runtime-client-react/adaptive-form

@lssm-tech/lib.contracts-runtime-client-react/contract-data-engine-context

@lssm-tech/lib.contracts-runtime-client-react/contract-result-client

@lssm-tech/lib.contracts-runtime-client-react/contracts-runtime-client-react.feature

@lssm-tech/lib.contracts-runtime-client-react/drivers/rn-reusables

@lssm-tech/lib.contracts-runtime-client-react/drivers/shadcn

@lssm-tech/lib.contracts-runtime-client-react/feature-render

@lssm-tech/lib.contracts-runtime-client-react/form-render

@lssm-tech/lib.contracts-runtime-client-react/form-render.impl

@lssm-tech/lib.contracts-runtime-client-react/i18n

@lssm-tech/lib.contracts-runtime-client-react/lssm-os-operation-statususeLssmOsOperationStatusV1

@lssm-tech/lib.contracts-runtime-client-react/i18n/catalogs

@lssm-tech/lib.contracts-runtime-client-react/subscriptions/use-contract-subscriptionuseContractSubscription

Imports and export paths.

24 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

24 imports

Dependencies and related packages.

Runtime dependencies 8
Peer dependencies 5
@hookform/resolvers
catalog:ui
@types/react
catalog:types
react
catalog:
react-dom
catalog:
react-hook-form
catalog:ui
Development dependencies 5
happy-dom
catalog:testing
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
cleanrm -rf dist
lintbun run lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
pack:verifybun run build && bun scripts/verify-packed-package.ts
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
devcontractspec-bun-build dev
Votre vue

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Votre contexte

The different parts of you

Choose a starting point

Un mélange utile de contexte, de visuels et de guidage discret.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Confort de lecture

Choisir votre langue

La langue de l’interface change uniquement le texte. Les marchés, les prix et les parcours conservent leurs propres paramètres.

Couverture des traductions

Une partie du contenu est affichée en anglais.

Navigation151
Graphe616
Catégories378
Portfolio833
Exemples2 035
Aperçu de la source1 542

D’autres traductions seront ajoutées à mesure que le contenu sera relu.

Cette préférence est enregistrée dans ce navigateur.

Rechercher sur le site

Des points de départ utiles

Aucun résultat. Essayez une expression plus courte, un nom d’opération ou un autre périmètre de recherche.

UN PEU DE PLACE POUR EXPLORER

Trouvez quelque chose à explorer.

Ouvrez un aperçu détaillé sur cette page, essayez une autre perspective ou suivez le détail vers sa propre page.

Fonctionnement des aperçus et des commandes
01

Regarder avant de partir

Survolez un lien ou sélectionnez-le avec Tab pour voir un aperçu. Cliquer sur le lien d’origine ou appuyer sur Entrée ouvre toujours sa destination.

02

Rester dans le contexte

Entrez dans l’aperçu pour explorer ses sections. Depuis un lien sélectionné, utilisez Alt + ↓ pour y entrer au clavier. Échap le ferme.

03

Ouvrir les possibilités

Les lignes dépliables, les choix de perspective et les commandes mises en évidence révèlent davantage. Votre vue adapte le confort de lecture et le contexte exploré.

Un bouton séparé pour voir de plus près

Affichez de petits boutons d’aperçu à côté des liens quand l’espace le permet. Touchez l’œil pour examiner ou le lien pour y aller directement. Ce choix reste dans cet onglet.

Aucun historique de navigation n’est collecté. La réduction des animations suit votre appareil et Votre vue.