Skip to content

Compute props through the data store - #807

Open
pleek91 wants to merge 2 commits into
data-storefrom
props-on-data-store
Open

Compute props through the data store#807
pleek91 wants to merge 2 commits into
data-storefrom
props-on-data-store

Conversation

@pleek91

@pleek91 pleek91 commented Aug 1, 2026

Copy link
Copy Markdown
Member

Description

Second step of #805, stacked on #806. No behaviour changes — every existing test passes unchanged.

Props move onto the store added in #806, one store per navigation. A link prefetches into its own store and stages it when followed; the navigation it triggers adopts that store, and the one it replaces is disposed outright rather than picked over for entries the new route still needs.

A getter waiting on its parent now awaits a value rather than watching for one to appear:

await Promise.any([
  own.subscribe(parentKey),                  // the parent's props, if this link prefetches them
  navigation.current().subscribe(parentKey), // or the ones navigation computes
])

That removes the waiter machinery entirely — the detached effect scope, the watch handles, and the bookkeeping to discard them. Prefetch strategies also stop being separate buckets, so a value prefetched on render is visible to a getter that runs on hover without being passed along explicitly.

@pleek91
pleek91 force-pushed the props-on-data-store branch 2 times, most recently from 81e3580 to a1db7d7 Compare August 1, 2026 04:58
@pleek91
pleek91 force-pushed the props-on-data-store branch 13 times, most recently from 2dd40c1 to 4ddf4aa Compare August 3, 2026 05:06
@pleek91
pleek91 force-pushed the props-on-data-store branch 5 times, most recently from 2d124e1 to 41916dc Compare August 3, 2026 05:28
@pleek91
pleek91 force-pushed the props-on-data-store branch 3 times, most recently from 03c097e to e8a0954 Compare August 3, 2026 05:49
@pleek91
pleek91 force-pushed the props-on-data-store branch from e8a0954 to 53f141a Compare August 3, 2026 05:51
Props move onto scopes: a link computes into its own, hands it to the
navigation when followed, and drops it otherwise. A getter waiting on its
parent awaits a value rather than watching for one to appear, so the waiter
machinery, its detached effect scope, and the batch threaded through the
parent context all go away.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@stackoverfloweth stackoverfloweth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

left some small suggestions in a commit, love how much this simplifies the prefetching. The props store changes are pretty sweeping and hard to really grok fully but I like what I see

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.

2 participants