Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.4.0 #13

Draft
wants to merge 56 commits into
base: master
Choose a base branch
from
Draft

V0.4.0 #13

wants to merge 56 commits into from

Conversation

kennyfrc
Copy link
Owner

@kennyfrc kennyfrc commented Jul 14, 2024

Goals:

  • Production-grade state management / store (extracted from dev version of cami at prod)
  • Reduce manual synchronization between Elements and Stores
  • Sync with indexDB / localStorage
  • Reactive URL store (a router alternative)
  • Interaction context (ie. an object that contains the last user action taken), similar to what's seen in imgui frameworks

Planned:

  • Add query in the store
  • Add mutation in the store
  • Add state charts in the store
  • Add memos in the store
  • Deprecate query off ReactiveElement
  • Deprecate mutation off ReactiveElement
  • Deprecate unused functions / features
  • Context object available across actions, queries, mutations, memos, state machines
  • Add examples for the new store features
  • Decide whether or not to keep "models" / "slices" (store seems sufficient)
  • New API for actions, queries, mutations, memos, state machines
  • Cleanup code
  • Add dependency tracker to the store
  • DO VIA HOOKS: Decide whether or not to keep runtime checking in store
  • INDEXDB USING HOOKS INSTEAD: Async store w/ indexdb integration?
  • Apply all random bugfixes from prod
  • NOW USING HOOKS: Deprecate middleware?
  • More tests / immutability checks in certain methods
  • Decide on some patterns for documentation ("treat store as a module that you import in template", "use store where you only want 1 instance of a state space, element state if you want multiple instances of state space", "context object is available anywhere, with state, and payload. state is immutable where needed and only modifiable inside action methods")
  • Decide on data modeling recommendation for docs ("use the relational model & flat data structures")
  • KEEP: Decide whether to merge query / mutation into a "fetcher" or keep as is
  • Deprecate onConnect(), onDisconnect(), etc. Encourage use of web api and super()
  • Dispatch state change based on parameters and hashes using URL Observers
  • "Thunks" that allow dispatches to occur after specific async actions / events (defineThunk, dispatchAsync)
  • CANCEL: Topological sort when updating (buggy w/ animations)
  • Add useValidationThunk for invariant checking (e.g. dependent types)
  • Type system for the schema
  • Router alternative: "url store". Treat the url as a store that emits its state changes to a listener. Just client side and only for hash changes / parameters.
  • Interaction context

What breaks vs v0.3.x?

  • ReactiveElement mostly intact except for query & mutation (which are now moved to store)
  • Everything in Store

- added model
- fixed type tests
- added model test
jasmine unit tests are quite unpredictable and has race conditions
our new internal test suite is more predictable as it's managed by an async queue that flushes microtasks before heading over the next macrotask
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