Skip to content

Store and path generalisation#32

Merged
forman merged 2 commits into
forman/v0.3.0from
forman/v0.3.0-store_and_path_generalisation
Jun 20, 2026
Merged

Store and path generalisation#32
forman merged 2 commits into
forman/v0.3.0from
forman/v0.3.0-store_and_path_generalisation

Conversation

@forman

@forman forman commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

Generalize RemoteState paths and root state handling

This PR generalizes RemoteState’s path model so the root state can be any value, not only an object-like mapping.

Changes

  • Allows empty paths to address the root state:
    • Python: "" / ()
    • TypeScript: "" / []
  • Allows paths to start with bracket segments, e.g. [0].label and ["display name"].value.
  • Makes Python Store generic over its root state type and exposes store.state.
  • Adds notebook-friendly Python item access:
    • store["items[0].label"]
    • store["items", 0, "label"]
    • store[()]
  • Defaults read APIs to the root state when no path is provided:
    • Python Store.get()
    • Python built-in Service.get()
    • TypeScript Store.get()
    • TypeScript useRemoteStateValue()
  • Simplifies the TypeScript path API by removing the redundant RelativePath export; Path is now the single parsed segment-array type.
  • Updates the TS store cache so root subscriptions overlap descendant updates, root updates materialize cached descendants, and leaf updates can patch cached root snapshots.
  • Updates README and CHANGES entries for both Python and TypeScript packages.

Checklists

Python package

  • pixi run format
  • pixi run lint
  • pixi run mypy
  • pixi run tests
  • Updated remotestate-py/CHANGES.md

TypeScript library

  • npm run format
  • npm run checks
  • npm run tests
  • npm run build
  • Updated remotestate-ts/CHANGES.md

Demo app

  • npm run checks
  • npm run build
  • Updated remotestate-demo/CHANGES.md

@forman forman marked this pull request as ready for review June 20, 2026 14:01

@forman forman left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@forman forman merged commit b5a6c1c into forman/v0.3.0 Jun 20, 2026
6 checks passed
@forman forman deleted the forman/v0.3.0-store_and_path_generalisation branch June 20, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant