Skip to content

Skip updating/updated hooks for bound fields that did not change - #11

Merged
xentixar merged 5 commits into
doppar:4.xfrom
techmahedy:techmahedy-4.x
Oct 31, 2026
Merged

xentixar merged 5 commits into
doppar:4.xfrom
techmahedy:techmahedy-4.x

Conversation

@techmahedy

@techmahedy techmahedy commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Bound fields ride along with every action request, and the browser sends them as strings. A "5" for an int $perPage that already holds 5 was applied through syncProperty(), so updating() and updated() ran on every action even though nothing changed.

A hook such as updated('perPage') that resets the page to 1 therefore fired on every Next/Prev click, and pagination could never leave page 1.

  • Component::isUnchanged() compares a client value with the property after
    type coercion.
  • ComponentManager::syncClientModels() skips unchanged values, so hooks run
    only for fields that actually changed.

Tests:

  • unchanged bound fields run no hooks and the action still sees its state
  • changed bound fields still run updating()/updated()
  • adds the HookCountComponent fixture

Reorder

  • DiffEngine emits the reserved move op (m) when keyed children change order. Keys already in order stay put, the rest are moved, then the normal diff runs. Repeated keys fall back to the in-place diff.
  • patch.js applies m and puts focus, caret and selection back on a moved row.

Polling

  • A poll tick due while another request runs is sent right after it instead of being dropped. One waiting run per poll element.

Uploads

  • Name post_max_size when a request is larger than the limit. PHP drops the body, so the endpoint used to say "Missing required upload parameters."

Navigation

  • The latest soft navigation wins. A superseded fetch is aborted and not applied, so Back right after Forward cannot leave the URL and page out of sync.

@techmahedy techmahedy added bug Something isn't working enhancement New feature or request labels Oct 30, 2026

@abdulmajidcse abdulmajidcse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Tested locally: the pagination hook fix, keyed reorder (including focus and selection), poll queuing and the post_max_size message all work as described, and CI is green.

@xentixar xentixar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you, @techmahedy

@xentixar
xentixar merged commit fcbc625 into doppar:4.x Oct 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants