Skip to content

Releases: meursyphus/comwit

v1.3.0

28 May 15:15

Choose a tag to compare

First stable release of the 1.3.x line (supersedes 1.2.0 on the latest tag).

Highlights

  • Model history (undo/redo). Built-in undo/redo for models, with a configurable history limit (default 100) and safe handling of concurrent async transactions.
  • Observer-based gcTime (TanStack Query v5 semantics). Garbage collection now starts when a model loses its last useModel observer instead of from lastFetchedAt. Cache entries are never evicted while a model has active subscribers, which fixes isLoading flicker on same-key refetches. gcTime now defaults to 5 minutes, applied only after a model reaches zero observers.
  • Improved flush / cancel helpers for @Debounce / @Throttle. flushDebounce / cancelDebounce / flushThrottle / cancelThrottle are now keyed per instance (two instances of the same class no longer share a window) and return a deferred result, so the surrounding interceptor stack (@OnError, @Retry, …) observes the flushed call's return value or rejection.

Fixes

  • refetch() always returns a Promise, even when the query has no active entry yet — previously it returned undefined and broke .then / .catch callers (#76).

Breaking / migration

  • Removed the cacheTime option (it was an alias for gcTime). Use gcTime instead.
  • FieldPlugin.bindState gains an optional modelKey argument and a new optional onSubscriberChange(modelKey, bag, registryState, hasObservers) hook. External plugins implementing the FieldPlugin interface must accept (or ignore) the extra argument.

Docs

  • New History and Utilities API documentation, plus a refreshed llms.txt.

v1.0.0 — stable

26 Apr 10:31

Choose a tag to compare

First stable release of comwit.

Highlights since 0.x

Features

  • computed() primitive for derived state (#44)
  • Model lifecycle hooks: onObserve / cleanup (#43)
  • Streaming query support via AsyncIterable (#45)
  • DevTools integration layer (__COMWIT_DEVTOOLS__) (#42)
  • toPlain() utility for proxy-to-POJO conversion (#55)
  • Removed valtio dependency — inline proxy reactivity engine (#52)

Fixes

  • Reset query state when arg changes without keepPreviousData (#60)
  • Synchronous subscribe() to fix IME composition (#56)
  • Expose .snapshot() type on nested proxy objects (#64)

Docs

  • Full docs site moved to https://library.comwit.io
  • computed(), lifecycle hooks, dependent queries, suspense docs (#54)
  • SWC decorator setup step in llms.txt (#57, #59)
  • Class-level lazy decorator example (#65)

Install

npm i comwit

LLM setup: pass https://library.comwit.io/llms.txt to Claude Code.

v0.2.5

26 Feb 02:33

Choose a tag to compare

Fix

  • fix(proxy): synchronous notification for IME composition support (#48, #49)
    • Replaced microtask-based (Promise.resolve().then()) listener notification with synchronous notification
    • Fixes Korean/Japanese/Chinese IME composition breaking in controlled inputs
    • Fixes cursor jumping to end of input on every keystroke
    • React 18's automatic batching handles grouping multiple synchronous updates, so no performance regression
    • Matches the approach used by Zustand (synchronous by default) and Valtio ({ sync: true } option)

Migration

No breaking changes. This is a drop-in upgrade — controlled inputs with CJK IME will now work correctly without needing onCompositionStart/onCompositionEnd workarounds.

v0.2.1

20 Feb 15:23

Choose a tag to compare

Bug Fix

query().query() no longer throws on second call (#35)

Calling .query() on a resource field threw TypeError: Cannot assign to read only property '0' on subsequent calls. The proxy engine now shallow-clones frozen snapshot objects before wrapping, preventing in-place mutation of cached state.

Fix: #36

Upgrade

yarn add comwit@0.2.1

Drop-in replacement. No API changes.

v0.2.0

20 Feb 15:03

Choose a tag to compare

What's New in v0.2.0

Features

  • Suspense Supportquery() and query.infinite()suspense: true 옵션 추가. React <Suspense>와 자연스럽게 통합되며, 별도 hook 없이 기존 useModel() / create()로 동작. TypeScript에서 dataNonNullable<T>로 자동 추론됨 (#32)

  • Real-time Subscriptionsquery.realtime() 디스크립터 추가. WebSocket, SSE 등 실시간 데이터 소스를 query() 패턴으로 통합. connectionStatus, isConnected 상태 제공, subscribe 콜백으로 update(), set(), onStatus(), onError() 지원 (#30)

  • Persist Pluginpersist() 필드 디스크립터 추가. localStorage, sessionStorage 기본 어댑터 제공, 커스텀 PersistAdapter 인터페이스 지원. 크로스탭 동기화, 디바운스 write-back, SSR 안전, 커스텀 직렬화/역직렬화 (#31)

  • Decorators@Retry, @Queue, @Log, @Validate 데코레이터 추가. 글로벌 인터셉터, derived state, model validation 지원

Architecture

  • Plugin System — 모놀리식 구조에서 플러그인 아키텍처로 리팩토링. FieldPlugin 인터페이스를 통해 query, persist, realtime 등 기능이 코어 수정 없이 동적으로 등록됨. registerPlugin()으로 확장 가능 (#33)

  • Custom Proxy Layer — valtio 의존성 제거, 자체 프록시 기반 반응성 엔진 구현

Bug Fixes

  • query isLoading 계산 순서 수정 — error-retry 시 로딩 상태 정상 표시 (#17)
  • stale response race condition 수정 — 빠른 query arg 변경 시 최신 응답만 반영 (#17)
  • set() 호출 시 캐시 동기화 — staleTime 내 읽기 시 set 데이터 유지 (#17)
  • nextFetch cursor history 개선 — 다단계 뒤로가기 네비게이션 지원 (#17)
  • infinite query withCursor 제거, hasMore 가드 추가 (#15)

Docs

  • llm.txt 모듈형 레퍼런스 분리 — query, decorator 상세 레퍼런스 추가 (#34)

Full Changelog: v0.0.2...v0.2.0

v0.0.2 — Initial Release

17 Feb 08:20

Choose a tag to compare

comwit v0.0.2

React state management for vibe coding. Pass llm.txt to Claude Code.

Highlights

  • model() / action() / create() — core state management API
  • query() / query.infinite() — built-in data fetching with caching
  • silent() — SSR hydration without re-renders
  • Decorators: @OnError, @OnSuccess, @Debounce, @Throttle, @Authorized
  • createInterceptor — reusable decorator factories
  • MuchaProvider — React context with default query options
  • Full llm.txt support — just pass the URL to Claude Code

Links