Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
66e0a38
feat(poc): store-based redesign of subscriber layer
fabioh8010 May 18, 2026
959946a
fix(poc): test fixes — initial-fire dedup, collection-snapshot suppre…
fabioh8010 May 18, 2026
5949c44
fix(poc): drop loading/loaded transitions, sourceValue partial arg, p…
fabioh8010 May 18, 2026
b3707d2
fix(poc): merge origin/main (skippable subscriptions revert) + adjust…
fabioh8010 May 18, 2026
b96fd8c
fix(poc): correct empty-collection-post-clear + initial-fire timing i…
fabioh8010 May 22, 2026
9cc6312
Remove subscribe and subscribeMembers from public API
fabioh8010 May 27, 2026
d59a04a
Remove waitForCollectionCallback
fabioh8010 May 27, 2026
9f33b83
Remove Legacy undefined-on-initial-empty behavior for collection keys
fabioh8010 May 27, 2026
ec1b88b
Remove `(undefined, undefined)` no-match legacy behavior
fabioh8010 May 29, 2026
78811ff
Explain and reuse NOT_DELIVERED symbol
fabioh8010 Jun 1, 2026
a1564d2
Extract createMemoizedSelector to a separate file
fabioh8010 Jun 1, 2026
45e4f4d
Implement tests for OnyxStore
fabioh8010 Jun 2, 2026
c8e6049
Improvements to useOnyxState
fabioh8010 Jun 2, 2026
516778d
Block collection-key writes in Onyx.set/multiSet/merge/update/init
fabioh8010 Jun 2, 2026
97c7619
Merge branch 'feature/onyx-store-poc-baseline' into feature/onyx-stor…
fabioh8010 Jun 10, 2026
9bbcf02
Align mergeCollection with cache-first/storage-second write invariant
fabioh8010 Jun 10, 2026
eacabc5
Fix perf tests
fabioh8010 Jun 10, 2026
fb9fc98
Fix TS
fabioh8010 Jun 10, 2026
75169e4
Fix lint
fabioh8010 Jun 10, 2026
886b6b9
Improve useOnyxState tests
fabioh8010 Jun 10, 2026
c71ad48
Merge branch 'main' into feature/onyx-store-poc
fabioh8010 Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 178 additions & 68 deletions lib/Onyx.ts

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions lib/OnyxCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,14 @@ class OnyxCache {
if (needsPrefixCheck && OnyxKeys.getCollectionKey(key) !== collectionKey) {
continue;
}
// Never treat the collection root key itself as a member. A direct write to a
// collection key (e.g. `Onyx.set('report_', ...)`, an unsupported anti-pattern)
// lands in storageMap under the prefix key, and `getCollectionKey('report_')`
// returns `'report_'` — which would otherwise match here and surface a phantom
// `{report_: ...}` member. Members live at `report_<id>`, never at the bare prefix.
if (key === collectionKey) {
continue;
}
const val = this.storageMap[key];
// Skip null/undefined values — they represent deleted or unset keys
// and should not be included in the frozen collection snapshot.
Expand Down Expand Up @@ -467,12 +475,12 @@ class OnyxCache {

const snapshot = this.collectionSnapshots.get(collectionKey);
if (utils.isEmptyObject(snapshot)) {
// We check storageKeys.size (not collection-specific keys) to distinguish
// "init complete, this collection is genuinely empty" from "init not done yet."
// During init, setAllKeys loads ALL keys at once — so if any key exists,
// the full storage picture is loaded and an empty collection is truly empty.
// Returning undefined before init prevents subscribers from seeing a false empty state.
if (this.storageKeys.size > 0) {
// Distinguish "init complete, collection genuinely empty" from "init not done yet."
// `setCollectionKeys()` (called inside `Onyx.init`) seeds every known collection
// with a frozen `{}` entry in `collectionSnapshots`, so the presence of the entry
// is a reliable post-init signal — and unlike `storageKeys.size > 0`, it doesn't
// flip back to "not done" after `Onyx.clear()` wipes the storage-keys index.
if (this.collectionSnapshots.has(collectionKey)) {
return FROZEN_EMPTY_COLLECTION;
}
return undefined;
Expand Down
271 changes: 0 additions & 271 deletions lib/OnyxConnectionManager.ts

This file was deleted.

Loading
Loading