Repository navigation
Conversation
Rebuilds every reflux store on a TanStack Store and drops reflux from our dependencies. Each store keeps its exported name and methods, so call sites and most tests don't change. `useLegacyStore` now wraps `useSelector` from `@tanstack/react-store`, which we already ship through react-form and react-pacer. Reflux `reset()`/`init()` replaced state without notifying listeners, and ~110 specs reset stores in `afterEach` while components are still mounted. `createLegacyStore` keeps that behavior with a `resetState` that skips subscribers, everything else goes through `setState`. The few direct `.listen()` callers and the trigger spies in store specs move to `subscribe`. TrialRequestedActions are plain functions now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@types/reflux, the jest unmock entry and a couple of comments still pointed at reflux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
📊 Type Coverage Diff
🔍 10 new type safety issues introducedNon-null assertions (
Type assertions (
This is informational only and does not block the PR. |
Drops the createLegacyStore and useLegacyStore shims. Each store owns a TanStack `Store` (exposed as `.store`) next to its existing methods, and components read it with `useSelector(XStore.store, selector)` so they only re-render on the fields they use. Subscribers use `store.subscribe()` and its `unsubscribe`. Resets notify subscribers now, which made specs that reset stores in afterEach re-render (and refetch) mounted components. Those resets move to beforeEach so each test starts from a clean store instead. Also drops reflux from dependabot, knip and the codeowners baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-pab7y0pd5.sentry.dev |
The root package never imports it, which knip flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The table renders before the events request resolves, so wait for the pagination links instead of asserting on them right away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scttcper
commented
Oct 27, 2026
Comment on lines
+24
to
+41
| const store = new Store<State>(initialState); | ||
|
|
||
| function onUpdate(org: Organization, options?: {replace: true}): void; | ||
| function onUpdate(org: Partial<Organization>, options?: {replace?: false}): void; | ||
| function onUpdate(updatedOrg: Partial<Organization>, {replace = false} = {}) { | ||
| const organization = ( | ||
| replace ? updatedOrg : {...store.state.organization, ...updatedOrg} | ||
| ) as Organization; | ||
| store.setState(() => ({ | ||
| loading: false, | ||
| dirty: false, | ||
| loading: true, | ||
| organization: null, | ||
| error: null, | ||
| errorType: null, | ||
| error: null, | ||
| organization, | ||
| })); | ||
|
|
||
| callSetOrganizationCallback(organization); | ||
| } |
Member
Author
There was a problem hiding this comment.
this is kind of a nightmare.
oh i see why its doing this based on the previous types
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Swaps reflux for TanStack Store across every remaining store. Each store owns a TanStack
Store(exposed as.store) and keeps its existing methods, so non-React callers (ConfigStore.get(...),openModal(), action creators) don't change. Components read withuseSelector(XStore.store, selector)and only re-render on the fields they use.useLegacyStoreis gone.Resets used to be silent in reflux, now they notify like any other update. Specs that reset stores in
afterEachwhile components were still mounted move that reset tobeforeEach.Pros
Cons
useStoretouseSelector, and 1.0 is in alphasetStateonly takes an updater, so every partial write issetState(prev => ({...prev, ...}))useSelectorneeds aget()source, which clashes with our stores' owngetmethods, so components go throughXStore.storesubscribereturns{unsubscribe}and listeners don't get the previous stateDraft for comparing against the zustand version in #128964. Server-data stores (projects, teams, groups) should still move to react-query over time.