Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .clinerules
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ You are working on bQuery.js (`@bquery/bquery`), a batteries-included TypeScript

bQuery.js is not a utility library; its broad module surface is the product. The reactive module now also covers HTTP clients, polling, pagination, WebSocket / SSE, REST helpers, request queues, and request deduplication.

Current release baseline: **1.11.1**.
Current release baseline: **1.12.0**.

Version `1.11.1` adds no new public APIs — it is a patch release with dev-dependency updates only (`@typescript-eslint` 8.59.3, `eslint` 10.3.0, `globals` 17.6.0, `vite` 8.0.12 + stable `rolldown` 1.0.0). Version `1.11.0` added the dedicated `@bquery/bquery/server` entry point plus a major runtime-agnostic `@bquery/bquery/ssr` expansion (`renderToStringAsync()`, `renderToStream()`, `renderToResponse()`, runtime adapters, snapshots, resumability), while preserving the `1.10.0` concurrency helpers and the `1.9.0` watch/view/media APIs as first-class public surface.
Version `1.12.0` adds Store plugin teardown APIs (`unregisterPlugin()`, `clearPlugins()`), promotes `WebSocketSendData` to a public Reactive type export, and tightens `/full` bundle type-export drift checks through `bun run check:full-bundle`. Version `1.11.0` added the dedicated `@bquery/bquery/server` entry point plus a major runtime-agnostic `@bquery/bquery/ssr` expansion (`renderToStringAsync()`, `renderToStream()`, `renderToResponse()`, runtime adapters, snapshots, resumability), while preserving the `1.10.0` concurrency helpers and the `1.9.0` watch/view/media APIs as first-class public surface.

## Before You Start

Expand Down Expand Up @@ -53,6 +53,7 @@ Version `1.11.1` adds no new public APIs — it is a patch release with dev-depe
| `linkedSignal()` | Read-write derived value |
| `watchDebounce()` | Debounced watcher callback |
| `watchThrottle()` | Throttled watcher callback |
| `WebSocketSendData` | Public raw WebSocket payload type union |
| `runTask()` | One-off zero-build worker task |
| `createTaskPool()` | Bounded task-worker pool with queueing |
| `createRpcWorker()` | Named worker RPC dispatch |
Expand All @@ -70,8 +71,10 @@ Version `1.11.1` adds no new public APIs — it is a patch release with dev-depe
| `reduce()` | Off-main-thread reduction with stable order |
| `pipeline()` | Optional immutable fluent layer over helpers |

| 1.11.0 API | Reminder |
| 1.12.0 / 1.11.0 API | Reminder |
| -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `unregisterPlugin()` / `clearPlugins()` | Store plugin teardown for tests and runtime reloads |
| `WebSocketSendData` | Public Reactive type for raw WebSocket frames and serializers |
| `renderToStringAsync()` / `renderToStream()` / `renderToResponse()` / `createSSRContext()` / `createSSRHandler()` | Runtime-agnostic SSR surface across Node 24, Bun, and Deno |
| `createServer()` / `isWebSocketRequest()` / `isServerWebSocketSession()` | Dependency-free backend routing plus runtime-agnostic WebSocket session flow |
| `createRpcWorker()` / `createRpcPool()` / `createReactiveTaskWorker()` / `createReactiveRpcPool()` / `parallel()` / `pipeline()` | Explicit browser-first concurrency surface with reusable workers and helpers |
Expand Down
10 changes: 7 additions & 3 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ You are working on bQuery.js, a batteries-included TypeScript full-stack web fra

> Derived snapshot for Cursor. If this file conflicts with `package.json`, `src/*/index.ts`, or `AGENT.md`, trust those files in that order and then realign this one.

Current release baseline: **1.11.1**.
Current release baseline: **1.12.0**.

bQuery.js is not a utility library; treat its broad module surface as the product, and keep guidance aligned with that scope.

Expand All @@ -22,8 +22,11 @@ bQuery.js is not a utility library; treat its broad module surface as the produc
- `useSignal()`, `useComputed()`, and `useEffect()` from `@bquery/bquery/component` must be called from component lifecycle hooks, not from `render()`.
- When version, engine, or repo guidance files change, run `bun run check:ai-guidance` before finishing.

## 1.11.1 API Notes
## 1.12.0 API Notes

- `@bquery/bquery/store` includes `unregisterPlugin()` and `clearPlugins()` for plugin teardown, test isolation, and runtime plugin reloads.
- `@bquery/bquery/reactive` exports the public `WebSocketSendData` type for raw WebSocket frames, serializers, and heartbeat messages.
- `src/full.ts` and `bun run check:full-bundle` now cover public type-only export drift for platform, a11y, and media surfaces.
- `@bquery/bquery/server` is a public backend helper entry point; keep `createServer()`, SSR-aware responses, and runtime-agnostic WebSocket session helpers visible in guidance.
- `@bquery/bquery/ssr` includes `renderToStringAsync()`, `renderToStream()`, `renderToResponse()`, `createSSRContext()`, runtime adapters such as `createSSRHandler()`, hydration strategies, store snapshots, and resumability hooks.
- `@bquery/bquery/concurrency` includes explicit RPC workers, task/RPC pools, opt-in reactive worker wrappers, and high-level helpers such as `parallel()`, `batchTasks()`, `map()`, `filter()`, `reduce()`, and `pipeline()`.
Expand All @@ -46,14 +49,15 @@ import {
useResource,
useSubmit,
} from '@bquery/bquery/reactive';
import type { WebSocketSendData } from '@bquery/bquery/reactive';
import { batchTasks, createReactiveRpcPool, createReactiveRpcWorker, createReactiveTaskPool, createReactiveTaskWorker, createRpcPool, createRpcWorker, createTaskPool, createTaskWorker, every, filter, find, map, parallel, pipeline, reduce, runTask, some } from '@bquery/bquery/concurrency';
import { component, html } from '@bquery/bquery/component';
import { storyHtml, when } from '@bquery/bquery/storybook';
import { animate, transition, spring } from '@bquery/bquery/motion';
import { sanitizeHtml, escapeHtml } from '@bquery/bquery/security';
import { storage, cache } from '@bquery/bquery/platform';
import { createRouter, navigate } from '@bquery/bquery/router';
import { createStore, defineStore } from '@bquery/bquery/store';
import { clearPlugins, createStore, defineStore, unregisterPlugin } from '@bquery/bquery/store';
import { mount } from '@bquery/bquery/view';
import { createForm, required } from '@bquery/bquery/forms';
import { createI18n } from '@bquery/bquery/i18n';
Expand Down
10 changes: 6 additions & 4 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Work autonomously inside the scope of the current request, but do not invent a h

bQuery.js is a batteries-included framework, not a utility library. It is modular, tree-shakeable, has zero runtime dependencies, and currently ships **23 public entry points**.

Current release baseline: **1.11.1**.
Current release baseline: **1.12.0**.

Start here before making assumptions:

Expand All @@ -30,10 +30,12 @@ Prefer pointing back to those files instead of duplicating large architecture se

For repo guidance refreshes, keep the role split clear: `AGENT.md` is the deep reference, `llms.txt` is the compact mirror, this file stays behavioral/meta-oriented, and `.cursorrules` / `.clinerules` are derivative tool snapshots.

## Version 1.11.1 highlights
## Version 1.12.0 highlights

- `@bquery/bquery/server` is now a first-class public entry point; repo guidance should treat `createServer()` and the runtime-agnostic WebSocket session helpers as part of the documented surface.
- `@bquery/bquery/ssr` now includes runtime-agnostic async/streaming rendering (`renderToStringAsync()`, `renderToStream()`, `renderToResponse()`), DOM-free fallback rendering, `createSSRContext()`, runtime adapters, snapshots, and resumability helpers.
- `@bquery/bquery/store` now includes `unregisterPlugin()` and `clearPlugins()` for plugin teardown, test isolation, and runtime plugin reloads.
- `@bquery/bquery/reactive` now exports the public `WebSocketSendData` type for raw WebSocket frames, serializers, and heartbeat messages.
- The `/full` bundle and `bun run check:full-bundle` now cover public type-only export drift for platform, a11y, and media surfaces.
- The `1.11.0` server/SSR runtime surface remains first-class; repo guidance should still treat `createServer()`, runtime-agnostic WebSocket sessions, `renderToStringAsync()`, `renderToStream()`, and `renderToResponse()` as documented surface.
- The `1.10.0` concurrency additions plus the `1.9.0` watcher/view/media APIs remain first-class public surface and should still appear in documentation refreshes.
- Publish and local validation target Node.js `>=24.0.0` and Bun `>=1.3.13`; when release metadata or repo guidance changes, `bun run check:ai-guidance` is part of the expected validation.

Expand Down
13 changes: 8 additions & 5 deletions AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | bQuery.js |
| Package | `@bquery/bquery` |
| Version | 1.11.1 |
| Version | 1.12.0 |
| License | MIT |
| Language | TypeScript (strict) |
| Runtime | Browser (ESM, UMD, IIFE), plus Node.js, Bun, and Deno for SSR/server workflows |
Expand Down Expand Up @@ -40,11 +40,12 @@ bun run dev # VitePress docs server

Project-specific starter prompts live in [`.github/prompts/`](.github/prompts/) for common workflows such as starting a task, fixing a bug, extending a public API, adding a module, working on SSR/server features, and refreshing AI guidance.

## Version 1.11.1 Highlights
## Version 1.12.0 Highlights

- `@bquery/bquery/server` is now a first-class public entry point for dependency-free backend routing, SSR-aware `render()` responses, repeated-query parsing, and runtime-agnostic WebSocket session handling through `createServer()`.
- `@bquery/bquery/ssr` now spans runtime-agnostic sync/async/streaming rendering with `renderToStringAsync()`, `renderToStream()`, `renderToResponse()`, DOM-free fallback rendering, `createSSRContext()`, head/asset managers, runtime adapters, route loaders, store snapshots, mismatch checks, and resumability hooks.
- The `1.10.0` concurrency helpers and the `1.9.0` watcher/view/media additions remain first-class public APIs; keep them visible in docs and AI guidance instead of treating them as historical footnotes.
- `@bquery/bquery/store` now exposes `unregisterPlugin()` and `clearPlugins()` so plugin registries can be torn down for test isolation and runtime reloads without affecting stores that already received extensions.
- `@bquery/bquery/reactive` now promotes `WebSocketSendData` to a public type-only export for custom serializers, raw WebSocket frames, heartbeat messages, and parity with the server-side `ServerWebSocketData` union.
- The `/full` bundle now re-exports the public platform, a11y, and media type-only surfaces, and `bun run check:full-bundle` statically validates runtime + type export drift before release.
- `@bquery/bquery/server` and `@bquery/bquery/ssr` remain first-class public surfaces from the `1.11.0` runtime-agnostic baseline, including `createServer()`, `renderToStringAsync()`, `renderToStream()`, and `renderToResponse()`.
- Local validation and publish checks target Node.js `>=24.0.0` and Bun `>=1.3.13`; whenever release metadata or AI guidance changes, `bun run check:ai-guidance` should pass before you stop.

---
Expand Down Expand Up @@ -158,6 +159,7 @@ When version metadata or public exports change, refresh the AI-facing files as a
| `readonly(sig)` | function | Read-only wrapper around a signal |
| `isSignal`, `isComputed` | functions | Type guards |
| `Signal`, `Computed` | classes | Signal and Computed value classes |
| `WebSocketSendData` | type | Public raw WebSocket payload union for native sends |

### Concurrency (`@bquery/bquery/concurrency`)

Expand Down Expand Up @@ -284,6 +286,7 @@ When version metadata or public exports change, refresh the AI-facing files as a
| `mapActions`, `mapGetters`, `mapState` | functions | Helper mappers for stores |
| `watchStore(store, sel, cb)` | function | Watch specific store property |
| `registerPlugin(plugin)` | function | Register a global store plugin |
| `unregisterPlugin`, `clearPlugins` | functions | Remove one plugin registration or clear all |
| `destroyStore(id)` | function | Remove store from registry |
| `getStore(id)`, `listStores()` | functions | Registry access |

Expand Down
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ and this project adheres to Semantic Versioning.

- [Changelog](#changelog)
- [Releases](#releases)
- [Unreleased](#unreleased)
- [Added (Unreleased)](#added-unreleased)
- [Fixed (Unreleased)](#fixed-unreleased)
- [\[1.12.0\] - 2026-05-16](#1120---2026-05-16)
- [Added (1.12.0)](#added-1120)
- [Changed (1.12.0)](#changed-1120)
- [Fixed (1.12.0)](#fixed-1120)
- [\[1.11.1\] - 2026-05-12](#1111---2026-05-12)
- [Changed (1.11.1)](#changed-1111)
- [\[1.11.0\] - 2026-04-15](#1110---2026-04-15)
- [\[1.11.0\] - 2026-04-30](#1110---2026-04-30)
- [Added (1.11.0)](#added-1110)
- [Changed (1.11.0)](#changed-1110)
- [Fixed (1.11.0)](#fixed-1110)
Expand Down Expand Up @@ -70,6 +77,27 @@ and this project adheres to Semantic Versioning.
- [\[1.0.0\] - 2026-01-21](#100---2026-01-21)
- [Added (1.0.0)](#added-100)

## [Unreleased]

### Added (Unreleased)

### Fixed (Unreleased)

## [1.12.0] - 2026-05-16

### Added (1.12.0)

- **Reactive / WebSocket**: Promoted `WebSocketSendData` to a public type-only export from `@bquery/bquery/reactive`. The alias was previously `@internal` even though it already surfaced through `UseWebSocketReturn.sendRaw`, `WebSocketSerializer.serialize`, and `WebSocketHeartbeatConfig.message`. Consumers can now `import type { WebSocketSendData } from '@bquery/bquery/reactive'` to reuse the union, matching the existing `ServerWebSocketData` export from `@bquery/bquery/server`.
- **Store / Plugins**: Added `unregisterPlugin(plugin)` and `clearPlugins()` to `@bquery/bquery/store`. `unregisterPlugin()` removes the first matching registration by identity and returns whether one was found; `clearPlugins()` empties the registry in one call. Already-created stores keep extensions that were applied before unregister; subsequent `defineStore()` / `createStore()` calls no longer receive the removed plugins. The previously global, append-only plugin registry now has a proper teardown path for test isolation and runtime plugin reloads.

### Changed (1.12.0)

- **Docs / Server**: Expanded the server guide with a public-surface reference, commonly used server types, null-prototype `params` / `query` details, route-scoped middleware examples, custom error handling, and WebSocket middleware short-circuit behavior. Added server module export tests for the barrel, root entry point, and full bundle.

### Fixed (1.12.0)

- **Full bundle / Tooling**: `src/full.ts` now re-exports all public type-only module exports from the platform, a11y, and media barrels, and `bun run check:full-bundle` now validates runtime and type exports statically so `/full` declaration drift is caught before release.

## [1.11.1] - 2026-05-12

### Changed (1.11.1)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ If you change the public runtime surface, release version, or supported engines,

After those updates, run `bun run check:ai-guidance` to verify the version / engine / guidance metadata still matches `package.json`.

If public exports changed, also keep `src/full.ts` aligned with the module barrels under `src/*/index.ts`.
If public exports changed, also keep `src/full.ts` aligned with the module barrels under `src/*/index.ts` and run `bun run check:full-bundle` to catch runtime or type export drift.

## Pull Requests

Expand Down
Loading
Loading