Skip to content

refactor(app): remove redundant project setter wrappers - #47085

Merged
kitlangton merged 3 commits into
v2from
project-store-setter
Sep 3, 2026
Merged

kitlangton merged 3 commits into
v2from
project-store-setter

Conversation

@kitlangton

@kitlangton kitlangton commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Why

Project writes pass through three wrappers (setProjects, setBootStore, and set) that ultimately call the native Solid store setter without transforming the data. The wrappers add array/function checks and type assertions to operations the setter already supports.

What Changes

Pass setGlobalStore directly to bootstrap, use it directly for project updates, and retain the returned setter as set: setGlobalStore.

// Before
bootstrapGlobal → setBootStore → setProjects → setGlobalStore
project.update  → setProjects → setGlobalStore
sync.set        → set → setProjects or setGlobalStore

// After
bootstrapGlobal → setGlobalStore
project.update  → setGlobalStore
sync.set        → setGlobalStore

Project-array replacement and functional updates retain their store behavior. The declared SetStoreFunction contract returns void; the removed wrappers' incidental return values have no production consumers. No loading, refresh, or reconnect rules change.

Scope

packages/app/src/runtime/server/sync.tsx: +3 / −23, net −20 production lines. No new production helper or dependency. The existing bootstrap test file gains coverage for a real client with a fixture transport, native-setter bootstrap, functional updates, empty-array replacement, and another bootstrap; test code is +49 / −1, net +48 lines.

This is separate from the pending-inbox reconnect fix and the client location-spread cleanup. It changes no visible UI or session/timeline code.

Verification

With Bun 1.4.0, from packages/app:

bun run test
bun run test:browser ./src/runtime/server/global-sync/bootstrap.test.ts
bun typecheck
bunx prettier --write src/runtime/server/sync.tsx src/runtime/server/global-sync/bootstrap.test.ts
git diff --check
  • 718 unit tests passed, 1 skipped; 113 browser-runtime tests passed.
  • The additional browser-condition run includes the five bootstrap tests: 118 passed. Project-array assertions compare explicit field projections so they also work with browser Solid proxies.
  • App typecheck passed; the normal pre-push hook completed all 33 workspace typecheck tasks.
  • No live app/server restart, end-to-end recording, or performance benchmark was needed for this setter-only cleanup.

@kitlangton
kitlangton enabled auto-merge (squash) September 3, 2026 16:21
@kitlangton
kitlangton merged commit c370a1b into v2 Sep 3, 2026
8 checks passed
@kitlangton
kitlangton deleted the project-store-setter branch September 3, 2026 16:33
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant