Skip to content

Fire source's propchange before cascading to dependents#119

Merged
DmitrySharabin merged 1 commit into
fix-issue-98from
fix-propchange-source-first-order
May 16, 2026
Merged

Fire source's propchange before cascading to dependents#119
DmitrySharabin merged 1 commit into
fix-issue-98from
fix-propchange-source-first-order

Conversation

@DmitrySharabin
Copy link
Copy Markdown
Member

@DmitrySharabin DmitrySharabin commented May 15, 2026

Summary

Props.propChanged previously cascaded to dependents first and fired the source's propchange event last. This meant el.plain = 5 produced events for computed and fnDefault before the event for plain — surprising for listeners who expect to hear about the prop they just wrote to first.

Swap the order: fire the source's event, then cascade. The cascade still runs synchronously and dependent events follow in declaration order.

Test impact

  • defaultProp re-fires when its source prop changes — was red on cascade-first order, now passes.
  • default() with reactive deps: synthetic prop event fires before declared and Events fan out across plain, get, and default() props — both Roll back signals and batching and reimplement them #113 baseline tests had their expectations corrected upstream on the props-behavioral-tests branch (per #113 design clarification: synthetic default props are consumer-visible, analogous to .value/.defaultValue on native form controls). They were red until source-first ordering landed; this PR makes them pass.

🤖 Generated with Claude Code

@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch 3 times, most recently from 504f092 to e144f56 Compare May 15, 2026 14:17
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch from 6a9beff to 2d6e200 Compare May 15, 2026 14:19
@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch from e144f56 to 70c36ac Compare May 15, 2026 14:19
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch from 2d6e200 to 65a893d Compare May 15, 2026 17:51
@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch from 70c36ac to c4e3cf8 Compare May 15, 2026 17:52
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch from 65a893d to 7cc97fd Compare May 15, 2026 18:05
@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch from c4e3cf8 to 05ccdb9 Compare May 15, 2026 18:05
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch from 7cc97fd to 2b667b9 Compare May 15, 2026 18:08
@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch from 05ccdb9 to d1d74a5 Compare May 15, 2026 18:08
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch from 2b667b9 to bd68789 Compare May 15, 2026 21:34
@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch 3 times, most recently from d1d74a5 to e163920 Compare May 15, 2026 21:45
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch 2 times, most recently from 80acf81 to 94c292e Compare May 15, 2026 22:03
@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch 2 times, most recently from 3625381 to f7356e7 Compare May 15, 2026 22:07
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch from 94c292e to 522905e Compare May 15, 2026 22:07
`Props.propChanged` previously cascaded to dependents first and fired the
source's `propchange` event last. This meant `el.plain = 5` produced events
for `computed` and `fnDefault` before the event for `plain` — surprising
for listeners who expect to hear about the prop they just wrote to first.

Swap the order: fire the source's event, then cascade. The cascade still
runs synchronously and dependent events follow in declaration order.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DmitrySharabin DmitrySharabin force-pushed the fix-propchange-source-first-order branch from f7356e7 to 5d2dac7 Compare May 16, 2026 12:01
@DmitrySharabin DmitrySharabin force-pushed the fix-defaults-convert-and-null branch from 522905e to 4610bd7 Compare May 16, 2026 12:01
Base automatically changed from fix-defaults-convert-and-null to fix-issue-98 May 16, 2026 12:01
@DmitrySharabin DmitrySharabin merged commit 5d2dac7 into fix-issue-98 May 16, 2026
@DmitrySharabin DmitrySharabin deleted the fix-propchange-source-first-order branch May 16, 2026 12:01
@DmitrySharabin
Copy link
Copy Markdown
Member Author

Note: this PR was auto-merged by GitHub as a side effect of a restack error — the head branch was force-pushed such that it became an ancestor of the base, which GitHub interprets as "already merged." The original commit f7356e7 was preserved by cherry-picking it onto rollback-signals as commit 7b6df25, so the change is correctly landed there.

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.

2 participants