Releases: bcdev/remotestate
Releases · bcdev/remotestate
0.2.0
Changes in version 0.2.0
Python package
- Tightened the shared path grammar to a strict JSONPath subset without the
$.prefix:- Root paths must start with an identifier.
- Later segments may use dotted identifiers, bracketed integer indices, or
bracketed string keys. - Bracketed string keys may use either single or double quotes; formatting
stays canonical with double quotes. - Invalid paths now fail explicitly instead of silently returning a parsed
prefix.
- Added
format_path()as the public Python path formatter. - Updated parser docstrings, README examples, and path tests to match the
shared grammar. - Added
twineto dev-dependencies. - Changed member names in the
Serviceclass:init_appto_init_appget_statetogetset_statetosetupdate_tasktonotify
- Added
__version__attribute to main package. - Exposed the
pathsubmodule from the package root and movedPath,
PathSegment,Property, andIndexunderremotestate.path. - Changed the
Storedefault factory API:- Renamed the keyword argument from
default_value_factoryto
default_factory. - The factory now receives a parsed
Pathtuple instead of a path string.
- Renamed the keyword argument from
- Changed store update notifications to emit only the exact paths written by
Store.set(), instead of also including all parent prefixes. - Broadcast Python-side
Store.set()updates to connected WebSocket clients
even when the mutation did not originate from a JavaScript action. - Changed signature and behavior of
serve()function:- Replaced
open_browserandopen_iframewith a genericdisplay
parameter. serve()now returns aServeResultwith resolved server, WebSocket,
and UI URLs.- Renamed
iframe_heighargument intoheight, and addedwidth. - It is no longer using FastAPI/Uvicorn default
logging. Instead, all server logs are written toserver.log
and logging to stdout/stderr is suppressed.
- Replaced
TypeScript package
- Tightened the shared path grammar to a strict JSONPath subset without the
$.prefix:- Root paths must start with an identifier.
- Later segments may use dotted identifiers, bracketed integer indices, or
bracketed string keys. - Bracketed string keys may use either single or double quotes; formatting
stays canonical with double quotes. - Invalid paths now fail explicitly instead of silently returning a parsed
prefix.
- Added
normalizePath()as the public path validator/normalizer. - Updated parser docstrings, README examples, and path tests to match the
shared grammar. - Supporting optional remote backend with local state fallback:
- Added
fallback?: () => RemoteStateClienttoRemoteStateProvider. - Added
client?: RemoteStateClientsupport toRemoteStateProvider. - Removed
active?: booleanfromRemoteStateProvider. - Removed
useOptionalRemoteStateClient<S>(); hooks now always require a
provider with eitherurl,client, orfallback. createRemoteStateClient()now requires an explicit URL.- Added
createLocalStateClient()to wrap local stores and
action/query handlers as fallback clients. - Updated docs with:
- a basic counter RemoteState usage example
- an optional remote backend/local client fallback example
- root README references to
RemoteStateProvider
- Added
- Slimmed store update handling:
- The client now accepts exact changed paths from
action_resultupdates
instead of requiring redundant parent-prefix payloads. - Cached parent and child snapshots are reconciled locally when related
paths update. - Subscribed parent and child snapshots are now materialized from related
exact-path updates souseRemoteStateValue()rerenders for subpath
changes. Store.subscribe()now takes a required path first:
subscribe(path, listener).
- The client now accepts exact changed paths from
- Improved TypeScript package build output:
- Split library, Node/Vite config, and ESLint TypeScript projects.
- Clean
distbefore rebuilding to prevent stale artifacts. - Keep API docs in the bundled
.d.tsfile while stripping JSDoc blocks
from the bundled runtime JavaScript. - Ensure the library bundle externalizes React peer dependencies and avoids
publishing test/dev-only artifacts.
- Refactorings:
- Renamed
RemoteStatetoRemoteStateClient. - Renamed
RemoteStateOptionstoRemoteStateClientOptions. - Renamed
createRemoteStatetocreateRemoteStateClient. - Renamed
useRemoteStatetouseRemoteStateClient.
- Renamed
Full Changelog: v0.1.0...v0.2.0