vapor-chamber 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/README.md +252 -196
- package/ROADMAP.md +497 -497
- package/bin/vc-vitest-mcp.mjs +3 -3
- package/dist/LICENSE.txt +3 -4
- package/dist/action-filter.d.ts +37 -0
- package/dist/action-filter.d.ts.map +1 -0
- package/dist/applied-remotely.d.ts +28 -0
- package/dist/applied-remotely.d.ts.map +1 -0
- package/dist/{library-names.js → applied-remotely.js} +3 -1
- package/dist/applied-remotely.js.map +1 -0
- package/dist/bounds.d.ts +2 -2
- package/dist/bounds.js.map +1 -1
- package/dist/chamber-vapor.js +1 -1
- package/dist/chamber.d.ts +3 -3
- package/dist/chamber.d.ts.map +1 -1
- package/dist/chamber.js +44 -34
- package/dist/chamber.js.map +1 -1
- package/dist/command-bus.d.ts +92 -27
- package/dist/command-bus.d.ts.map +1 -1
- package/dist/command-bus.js +210 -90
- package/dist/command-bus.js.map +1 -1
- package/dist/directives2.js +1 -1
- package/dist/failure.d.ts +18 -5
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +22 -5
- package/dist/failure.js.map +1 -1
- package/dist/http-cache.d.ts +4 -3
- package/dist/http-cache.d.ts.map +1 -1
- package/dist/http-errors.d.ts +4 -4
- package/dist/http.d.ts +8 -6
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +89 -22
- package/dist/http.js.map +1 -1
- package/dist/iife-core.js +1 -1
- package/dist/iife-elements.js +1 -1
- package/dist/iife.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +118 -67
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts.map +1 -1
- package/dist/ledger.js +8 -4
- package/dist/ledger.js.map +1 -1
- package/dist/mcp.d.ts +30 -20
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +23 -16
- package/dist/mcp.js.map +1 -1
- package/dist/outbox.d.ts +13 -9
- package/dist/outbox.d.ts.map +1 -1
- package/dist/outbox.js +12 -10
- package/dist/outbox.js.map +1 -1
- package/dist/plugins-core.d.ts +15 -7
- package/dist/plugins-core.d.ts.map +1 -1
- package/dist/plugins-core.js +18 -15
- package/dist/plugins-core.js.map +1 -1
- package/dist/plugins-extra.d.ts +45 -25
- package/dist/plugins-extra.d.ts.map +1 -1
- package/dist/plugins-io.d.ts +3 -2
- package/dist/plugins-io.d.ts.map +1 -1
- package/dist/plugins-io.js +2 -2
- package/dist/plugins-io.js.map +1 -1
- package/dist/plugins-schema.js +1 -1
- package/dist/poll-with.d.ts +6 -3
- package/dist/poll-with.d.ts.map +1 -1
- package/dist/router/engine.d.ts +1 -1
- package/dist/router/history.d.ts +2 -1
- package/dist/router/history.d.ts.map +1 -1
- package/dist/router/router-type.d.ts +3 -1
- package/dist/router/router-type.d.ts.map +1 -1
- package/dist/router.js +9 -9
- package/dist/router.js.map +1 -1
- package/dist/schema.d.ts +43 -9
- package/dist/schema.d.ts.map +1 -1
- package/dist/shared-bus.js +1 -1
- package/dist/ssr.d.ts +2 -2
- package/dist/ssr.d.ts.map +1 -1
- package/dist/ssr2.js +6 -5
- package/dist/ssr2.js.map +1 -1
- package/dist/store/core.d.ts +1 -1
- package/dist/store/core.d.ts.map +1 -1
- package/dist/store/core.js.map +1 -1
- package/dist/store-base.d.ts +38 -7
- package/dist/store-base.d.ts.map +1 -1
- package/dist/store-base.js +110 -30
- package/dist/store-base.js.map +1 -1
- package/dist/store.d.ts +4 -4
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/transports.d.ts +22 -11
- package/dist/transports.d.ts.map +1 -1
- package/dist/transports2.js +56 -21
- package/dist/transports2.js.map +1 -1
- package/dist/utilities.d.ts +13 -12
- package/dist/utilities.d.ts.map +1 -1
- package/dist/vapor-chamber-core.iife.js +386 -156
- package/dist/vapor-chamber-core.iife.js.map +1 -1
- package/dist/vapor-chamber-core.iife.min.js +1 -1
- package/dist/vapor-chamber-elements.iife.js +386 -156
- package/dist/vapor-chamber-elements.iife.js.map +1 -1
- package/dist/vapor-chamber-elements.iife.min.js +1 -1
- package/dist/vapor-chamber.iife.js +508 -256
- package/dist/vapor-chamber.iife.js.map +1 -1
- package/dist/vapor-chamber.iife.min.js +1 -1
- package/dist/vitest-mcp.d.ts +6 -5
- package/dist/vitest-mcp.d.ts.map +1 -1
- package/dist/vitest-mcp.js +5 -5
- package/dist/vitest-mcp.js.map +1 -1
- package/dist/vitest-pure.d.ts +5 -5
- package/dist/vitest-pure.d.ts.map +1 -1
- package/dist/vitest-pure.js.map +1 -1
- package/package.json +1 -1
- package/scripts/check-console-shape.mjs +1 -1
- package/scripts/check-size.mjs +91 -3
- package/src/action-filter.ts +85 -0
- package/src/applied-remotely.ts +25 -0
- package/src/bounds.ts +2 -2
- package/src/chamber.ts +55 -41
- package/src/command-bus.ts +335 -126
- package/src/failure.ts +48 -9
- package/src/http-cache.ts +16 -15
- package/src/http-errors.ts +4 -4
- package/src/http.ts +145 -37
- package/src/index.ts +5 -1
- package/src/ledger.ts +10 -2
- package/src/mcp.ts +58 -38
- package/src/outbox.ts +23 -17
- package/src/plugins-core.ts +38 -19
- package/src/plugins-extra.ts +104 -47
- package/src/plugins-io.ts +4 -3
- package/src/poll-with.ts +12 -4
- package/src/router/engine.ts +1 -1
- package/src/router/history.ts +4 -3
- package/src/router/index.ts +9 -9
- package/src/router/router-type.ts +3 -1
- package/src/schema.ts +64 -16
- package/src/ssr.ts +10 -6
- package/src/store/core.ts +1 -1
- package/src/store-base.ts +202 -55
- package/src/store.ts +4 -4
- package/src/testing.ts +21 -25
- package/src/transports.ts +74 -28
- package/src/utilities.ts +27 -16
- package/src/vitest-mcp.ts +10 -9
- package/src/vitest-pure.ts +5 -5
- package/dist/library-names.js.map +0 -1
- package/dist/settled.js +0 -31
- package/dist/settled.js.map +0 -1
- package/dist/store-core.d.ts +0 -4
- package/dist/store-core.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v1.27.0 - 2026-10-06
|
|
6
|
+
|
|
7
|
+
- Added `createActionFilter(expressions)`, which compiles CloudEvents filter expressions (`exact`, `prefix`, `suffix`, `all`, `any`, `not`) into an action-name predicate. It throws `core:invalid:filter` on what the spec rejects.
|
|
8
|
+
- Added the `actionFilter` option to every plugin that takes `actions` and to `PluginParts`. Given both, both must match, and `actions` is unchanged.
|
|
9
|
+
- Added `ActionScope`, the type of a plugin's `actions` filter, where absent or `[]` is every action, as before. It and `ActionList` are `string[]`, so code typed against 1.26 compiles unchanged.
|
|
10
|
+
- Added `ActionList`, the type of the mandatory list of `debounce`, `throttle` and `optimisticUndo`, where `[]` is none.
|
|
11
|
+
- Changed the store option `actions` to `reducers`, as in `defineChamberStore(id, { state, reducers: { add: (s, id) => ... } })`. Each key names an action, so `add` on store `cart` is `cart.add` and `cartAdd`.
|
|
12
|
+
- Changed `ChamberStoreOptions` to hold the map under `reducers`. Rename the key in typed options.
|
|
13
|
+
- Changed `StoreAction` to `StoreReducer`.
|
|
14
|
+
- Fixed `debounce([])`, `throttle([])` and `optimisticUndo(bus, [])` acting on every action since v1.26.0. An empty list acts on none again, as in 1.25.
|
|
15
|
+
- Fixed `cache`, `idempotent` and `debounce` answering a `$` command, such as `store.$reset()` or an undo, from memory. `throttle`, `rateLimit` and `circuitBreaker` may still refuse one, as before.
|
|
16
|
+
- Updated `RegisterOptions.undo` to state that the original command it receives carries that dispatch's signal, which `supersede` may have aborted.
|
|
17
|
+
- Fixed the Vue todo example giving a todo a new id on redo. The id is now sent with the command.
|
|
18
|
+
- Fixed an abort of a dispatch having three shapes. A handler or plugin that rethrows the signal's reason now gets `core:aborted:dispatch`, not the raw DOMException or `plugin:failed:plugin`, and every abort is a BusError named `AbortError` with the reason as `cause`. Code that checked `instanceof DOMException` after a mid-flight abort reads `e.cause`.
|
|
19
|
+
- Fixed a transactional batch rolling back a copy of each command instead of the command that ran. A store with `undo: true` in the batch now returns to its state before the batch, where before the command object became its state, and the `$undo` command's `causationId` names the command that ran.
|
|
20
|
+
- Fixed an `undo: true` store erasing every later write when an older step is rolled back, as `optimisticUndo` and a failed batch do. The store now re-applies the later steps, writes from other tabs included.
|
|
21
|
+
- Fixed an undo for a step a store does not hold writing a command object into its state. It now changes nothing.
|
|
22
|
+
- Fixed a redo of an `undo: true` store step running the reducer again, so a minted id came back different. The store now writes the state the action produced, the same object.
|
|
23
|
+
- Fixed history undoing locally a command a bridge sent, and sending it again on redo. Such a step now reads `canUndo` false. Reverse a server write with a compensating command.
|
|
24
|
+
- Added a development check to `undo: true` stores: each reducer runs twice, and two different results warn once per action. Mint ids and times in the call.
|
|
25
|
+
- Updated `RegisterOptions.canUndo` to state that a rollback, by `optimisticUndo` or a transactional batch, does not consult it.
|
|
26
|
+
- Fixed the async bus and the HTTP client re-sending a write when nothing identifies it, after no reply, a 502 or 504, or a verdict with `Retry-After`. It now fails once, no reply marked `context.outcome: 'unknown'` with a development warning. Key the command or declare the action idempotent to keep the re-send. The client also waits the `RateLimit` header's `t` when a policy has no quota left.
|
|
27
|
+
- Fixed a request header sent in two spellings, such as an app `idempotency-key` beside the bridge's `Idempotency-Key`, going out once with both values joined. Each name now goes out once, under its first spelling with the last value, and a FormData upload or a 419 refresh deletes a name in every spelling.
|
|
28
|
+
- Fixed a `share` store opened later losing its first writes to a tab that had written before. A tab now asks for the current state when it opens, and its next write builds on it.
|
|
29
|
+
- Security: fixed `authGuard({ protected: ['admin*'] })` protecting nothing. A trailing `*` now reads as the prefix it names, and `'*'` protects every action.
|
|
30
|
+
- Fixed one idempotency key standing for two requests. `idempotent()` now adds the payload to its default key, and the outbox gives each queued record its own key, so a second write is never answered or dropped as the first. Keys without a payload, custom keys and stored records are unchanged.
|
|
31
|
+
- Fixed the async bus's `request()` answering two requests with different payloads with one result, and a joined caller waiting on another caller's timeout and abort. Each caller now keeps its own wait, and the responder receives the command the plugins saw.
|
|
32
|
+
- Fixed the batching bridge sending a dispatch aborted while it waited for its window, and reporting it `ok`. An aborted dispatch now settles `core:aborted:dispatch` at once and is never sent, and a sent batch is cancelled once every command in it has aborted.
|
|
33
|
+
- Fixed a GET made after a write to its URL joining a read already in flight from before the write. A write, or `invalidateCache`, again stops new reads joining it.
|
|
34
|
+
- Fixed `circuitBreaker` opening on the caller's own cancels, such as `supersede` cancelling a search. An abort no longer counts as a backend failure.
|
|
35
|
+
- Fixed `createReaction`'s `maxHops` missing an indirect cycle such as `a -> b` plus `b -> a`. Every reaction on a bus now shares one hop count.
|
|
36
|
+
- Fixed the MCP handler against the 2025-06-18 spec: `initialize` answers only a version it speaks, an unknown or not allowed tool is the JSON-RPC error -32602 instead of an `isError` result, and a request with `id: null` gets -32600. In tests, `mcpClient().call` of an unlisted tool now rejects with `code: -32602`.
|
|
37
|
+
- Fixed `useCommandError` and `useCommandHistory` throwing on a sealed bus. Like `useSharedCommandState`, they now observe it, and the bus stays sealed.
|
|
38
|
+
- Fixed a `NaN` option failing open in `rateLimit` (`max`, `window`), `createReaction` (`maxHops`), `pollWith` (`interval`, `maxWait`), `useCommandError` and `useSharedCommandState` (`maxSize`) and `createSSRPlugin` (`maxSize`). A `NaN` now behaves like the missing option.
|
|
39
|
+
- Fixed a schema key written as `cart_add` typing only that name while the bus validates and lists `cartAdd`. The camelCase name is now a typed name too, the raw one still compiles, and the development warning says to use the camelCase name. It no longer prints in production.
|
|
40
|
+
- Fixed `createTestBus().dispatchBatch` ignoring `transactional` and `continueOnError`. It now runs the bus's own batch rule, rollback included.
|
|
41
|
+
- Changed `optimisticUndo` to accept an async bus in its types, as its example and `history()` do. Fixed the docs of `ErrorCodeEntry.retryable`, the `inspectBus` example and a test-helper example to say what the code does.
|
|
42
|
+
- Added `ActionSchema.annotations`, MCP's `ToolAnnotations` (`readOnlyHint`, `idempotentHint`, `destructiveHint`, `openWorldHint`, `title`). The MCP handler lists them on each tool, and `readOnlyHint` or `idempotentHint` makes the async bus treat the action as idempotent when `retry` is unset.
|
|
43
|
+
- Changed the async bus's `retry: { actions }` to `retry: { actionPolicies }`, and `RetryDeclaration` to `RetryPolicy`. The most specific match now wins (an exact name, then the longest prefix, then `*`), whatever the written order, so `cartAdd: false` is never re-sent because of an earlier `'cart*'`. Rename the key and the type.
|
|
44
|
+
- Changed `createMcpHandler`'s allowlist from `actions` to `actionFilter`, its one selection. Replace `actions: ['cart*']` with `actionFilter: createActionFilter([{ prefix: { action: 'cart' } }])`, and `['*']` with `createActionFilter([])`. To expose nothing, do not mount the handler. A leftover `actions` is ignored, so every schema action is exposed.
|
|
45
|
+
- Fixed a redo doing nothing when `cache` or `idempotent` had kept the command's first answer: the store stayed undone and history read it as redone. Once an undo lands, the bus calls the new `PluginParts.forget(cmd)` on every plugin, and those two drop that answer.
|
|
46
|
+
- Fixed a custom `key` on `cache` or `idempotent` answering a `$` command, such as `store.$reset()`, with an app command's stored answer when the two keys matched. A `$` command now always takes the default key.
|
|
47
|
+
- Fixed `idempotent` joining a second `$reset` or undo to the first one still in flight, so the second never ran. A `$` command now always runs.
|
|
48
|
+
- Added the store option `answer(state, value, cmd)`: a bridged store action writes the server's answer as one step of that command. Without it, nothing changes.
|
|
49
|
+
- Added `RegisterOptions.answer(cmd, value)`, called when a transport answered in place of the handler, before the plugins outside it.
|
|
50
|
+
- Added the store option `version(state)`: an answer older than the held state is not written. An answer with no `state` writes nothing.
|
|
51
|
+
- Added `stores` to the wire answer, store states by store id: `{ state, stores: { cart: {...} } }`. Each store with that id takes its state, over its own `answer`. A state that is not an object is not written. The Laravel example controller returns it.
|
|
52
|
+
- Fixed the HTTP client serving a stale GET after a write named that URL in `Location` or `Content-Location`. A write now drops those URLs too, on its own origin only.
|
|
53
|
+
- Changed `idempotent`'s `maxKeys` to `maxSize`.
|
|
54
|
+
- Changed `metrics`' `maxEntries` to `maxSize`.
|
|
55
|
+
- Changed `createOutbox`'s `maxQueue` to `maxSize`.
|
|
56
|
+
- Changed `createSSRPlugin`'s `maxCommands` to `maxSize`.
|
|
57
|
+
- Changed `errorCap` to `maxSize` on `useCommandError` and `useSharedCommandState`.
|
|
58
|
+
- Changed the bus option `bufferLimit` to `maxBufferSize`.
|
|
59
|
+
- Changed `teardown()` to `dispose()` on `createSseBridge` and `createEchoBridge`.
|
|
60
|
+
- Changed `createChannel()`'s `close()` to `dispose()`.
|
|
61
|
+
- Changed `destroy()` to `dispose()` on the router and its history.
|
|
62
|
+
- Changed `VitestMcpServer.close()` to `disposeAsync()`.
|
|
63
|
+
- Fixed the README's `optimisticUndo` example calling the server from its inverse. The inverse now reverses the local change only.
|
|
64
|
+
- Fixed docs that named what the code lacks: an `onReceive` hook on `createWsBridge`, an LRU in `matchesPattern`, and a `vitest-pure` subpath (it is `vitest/pure`).
|
|
65
|
+
- Improved a sync `dispatch` on a bus with no plugin, hook or listener: 7 to 12 ns faster, it no longer allocates a meta nothing reads. A dispatch through plugins or listeners measures about 3 ns slower.
|
|
66
|
+
|
|
5
67
|
## v1.26.0 - 2026-10-04
|
|
6
68
|
|
|
7
69
|
### Fixed (the 1.26 evaluation's bug list)
|