Skip to content

feat!: preserve array field identity with signals - #12

Open
LouisHaftmann wants to merge 1 commit into
masterfrom
feat/signals-identity-issue-4
Open

LouisHaftmann wants to merge 1 commit into
masterfrom
feat/signals-identity-issue-4

Conversation

@LouisHaftmann

Copy link
Copy Markdown
Contributor

Summary

Array edits could leave fields attached to the wrong row. Object and array fields now keep their keys, dirty state, and errors when their values move, using stable @solidjs/signals store identities.

Before reorder: [row A → field A, row B → field B]
After reorder:  [row B → field B, row A → field A]

Scope

  • Replace the Vue core engine and mutation-mirroring cache with signals stores, a writable data facade, and setData(recipe).
  • Preserve primitive fields positionally, reset positionally, and support keyed source refreshes. Guard same-batch edits and failed submissions from source overwrites.
  • Bridge React through useSyncExternalStore and Vue through flushed notifications. Preserve input focus and selection during row moves.
  • Keep schema metadata, hooks, translation, and validated submit output. Treat files, blobs, and class instances as opaque leaves.

Breaking changes: writes are microtask-batched, field keys are opaque, and the /reactive exports use signals. The internal form['~'].flush() forces values current; validation remains asynchronous. Migration notes are in README.

Verification

Run on Node 24.13.1:

  • pnpm test: 91 tests pass, including type assertions.
  • pnpm type-check: passes.
  • pnpm --filter './packages/**' -r run type-check: all three library packages pass.
  • pnpm lint:ci: passes.
  • pnpm build: all three packages build ESM, CJS, and declarations.
  • Playwright MCP: Vue and React preserve input DOM identity, focus, selection, and edited text through reorder at 1000px and 390px. Reset preserves input identity and focus. No horizontal overflow.

Reviews

Review Found Fixed
Standards 4 4
Spec 9 9
Complexity 3 3

Findings overlap across reviews. Follow-up reviews report no remaining findings.

Screenshots

Temporary test page exercising both adapters at mobile width:

Vue and React array inputs at mobile width

Issues

Closes #4

Needs attention

  • Signals is pinned to 2.0.0-rc.6. That release has no public reverse-path lookup, so paths are derived from live proxy identities. Its deep() misses nested edits after a sibling edit; core tracks reads through the tree instead. Both have focused behavioral coverage.
  • The extra playground typecheck fails before reading project code: existing vue-tsc@3.3.9 cannot load TypeScript 7's lib/tsc export. Both dependencies are unchanged from the base commit. Library checks and required CI do not use this command.

Replace positional mutation mirroring with store identity, batched writes,
and React/Vue subscriptions. Preserve positional primitive fields and reset,
keyed source refreshes, validation timing, and opaque values.

Closes #4

BREAKING CHANGE: Writes are microtask-batched, field keys are opaque, and reactive helpers use @solidjs/signals.

Created with AI.

Co-authored-by: Codex <codex@openai.com>
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.

Array-element field identity via @solidjs/signals store (replace on-change sync)

1 participant