Skip to content

Refactor Data reactivity with signals#515

Merged
titouanmathis merged 2 commits into
feature/data-scopefrom
feature/data-signals
Jul 16, 2026
Merged

Refactor Data reactivity with signals#515
titouanmathis merged 2 commits into
feature/data-scopefrom
feature/data-signals

Conversation

@titouanmathis

@titouanmathis titouanmathis commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace manual Data group fan-out with synchronous signal-backed update channels powered by alien-signals
  • preserve keyed/unkeyed routing, repeated equal writes, hydration ordering, subclass set() dispatch and lifecycle disposal
  • keep the latest value consistent during reentrant group updates
  • extract form-control reading, model serialization and writing into Vue-inspired internal helpers without changing the public value model
  • add regression coverage for equal scoped writes, initial effect gating, hydration deduplication, lifecycle recreation, public set() overrides and reentrant updates

Implementation notes

The upstream alien-signals package is used directly instead of @webreflection/alien-signals: the latter is a Preact-style facade over the same dependency and does not reduce the final bundled core. Signals remain a private implementation detail.

The form-control extraction follows Vue's separation of DOM normalization from reactivity, while preserving the existing Data semantics for numbers, dates, grouped checkboxes, selects and the [] group convention.

Validation

  • npm run test — 47 files passed, 330 tests passed, 3 skipped, 1 todo
  • npm run lint — passed with 15 pre-existing warnings
  • npm run build
  • npm run docs:build
  • git diff --check

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.06452% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.81%. Comparing base (5711d5a) to head (41f13ef).
⚠️ Report is 1 commits behind head on feature/data-scope.

Files with missing lines Patch % Lines
packages/ui/Data/formControl.ts 96.42% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##             feature/data-scope     #515      +/-   ##
========================================================
- Coverage                 80.51%   79.81%   -0.70%     
  Complexity                  145      145              
========================================================
  Files                        99       96       -3     
  Lines                      3197     3067     -130     
  Branches                    610      569      -41     
========================================================
- Hits                       2574     2448     -126     
+ Misses                      545      541       -4     
  Partials                     78       78              
Flag Coverage Δ
unittests 79.81% <98.06%> (-0.70%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/ui/Data/DataBind.ts 100.00% <100.00%> (+2.55%) ⬆️
packages/ui/Data/DataChannel.ts 100.00% <100.00%> (ø)
packages/ui/Data/DataModel.ts 100.00% <100.00%> (ø)
packages/ui/Data/DataScope.ts 94.48% <100.00%> (+0.11%) ⬆️
packages/ui/Data/utils.ts 100.00% <ø> (ø)
packages/ui/Data/formControl.ts 96.42% <96.42%> (ø)

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

Code Review

Risk: Low — No blocking defects were identified in the reviewed diff; this looks safe to merge after the skipped lockfile change is checked separately.

This MR replaces the manual Data group fan-out with signal-backed channels, extracts form-control normalization into shared helpers, and updates DataBind, DataModel, and DataScope to publish through the new channel abstraction. The added regression coverage exercises the key behaviors called out in the intent, including reentrant updates, repeated equal scoped writes, hydration ordering, lifecycle resubscription, and public set() dispatch paths.

Notes:

  • package-lock.json was not reviewed because it was omitted from the diff.

Review usage: 227,659 in (195,584 cached) / 6,496 out tokens — $0.2265 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.3 for commit 41f13ef.

Previous review runs

Previous run archived 2026-07-16T12:29:05Z

Code Review

Risk: Low — I did not find any blocking defects in the reviewed diff; this looks safe to merge once the skipped lockfile is checked separately.

This MR replaces the manual Data group fan-out with a signal-backed DataChannel, refactors form-control read/write/serialization helpers into formControl.ts, and rewires DataBind, DataModel, and DataScope around the new synchronous publication path. The added tests cover the intended edge cases around equal scoped writes, hydration ordering, lifecycle teardown/recreation, public set() dispatch, and reentrant updates, and the implementation matches those scenarios.

Notes:

  • package-lock.json — not reviewed because it was skipped from the diff due to size limits.

Review usage: 211,739 in (178,688 cached) / 7,174 out tokens — $0.2349 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.3 for commit 0c3cc91.

Previous run archived 2026-07-16T12:25:54Z

Code Review

Risk: Low — no blocking issues; safe to merge aside from nits.

This MR replaces the manual Data group fan-out with signal-backed channels, extracts form-control read/write/serialization helpers, and adds regression coverage around hydration, equal writes, lifecycle recreation, set() dispatch, and reentrant updates. The overall direction matches the stated intent, but one channel-selection regression breaks group synchronization for scoped members that do not have a key.

Notes:

  • package-lock.json was skipped in the provided diff and was not reviewed.

Review usage: 487,194 in (421,376 cached) / 12,157 out tokens — $0.4522 (cloudflare-ai-gateway/gpt-5.4, thinking: medium)

Reviewed by @weareikko/code-review v0.8.3 for commit e82e59d.

@titouanmathis
titouanmathis force-pushed the feature/data-signals branch from e82e59d to 0c3cc91 Compare July 16, 2026 12:23
Comment thread packages/ui/Data/DataChannel.ts Outdated
@titouanmathis
titouanmathis merged commit 8dc5c45 into feature/data-scope Jul 16, 2026
19 checks passed
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.

1 participant