Repository navigation
chore: reapply October PRs (#101, #102, #103) onto release-1.22 - #106
Merged
Merged
Conversation
Reapply #101 (76a3f89) onto release-1.22. - drag/drop split into backend-agnostic mechanics plus a core backend (unchanged semantics) and a host backend used only when window.NoJS.hostApi >= 1, which core never defines - attribute contract for the NoJS-Server compiler (plugin.contract) - init-hook re-bind skips dnd nodes already bound by the real directive against the live context, so an `each` inside a [drop] zone keeps re-rendering - dnd expressions captured at init, as in v1.21.1
Reapply #102 (709b675) onto release-1.22. - @testing-library/jest-dom 7.0.0 -> 7.0.1 - esbuild 0.28.1 -> 0.28.2 - jest-environment-jsdom 30.4.1 -> 30.5.2 - jest 30.4.2 -> 30.5.2 - babel-jest 30.2.0 -> 30.5.2 - @babel/preset-env 8.0.2 -> 8.0.7 - @playwright/test 1.61.1 -> 1.64.0 - @babel/core 8.0.1 -> 8.0.7 Lockfile from #102 (npm 10) with the root version kept at 1.22.0. dist/ rebuilt with esbuild 0.28.2 is byte-identical.
Reapply #103 (73fa034) onto release-1.22. With validate-on, per-field value listeners were bound before the field's own `model` listener. checkValidity() notified the context synchronously, so `model` re-rendered its stale value over what the user typed or picked. - re-append the value listeners of `model` fields in a microtask, once the subtree is processed, so they run after `model` - `model` select/checkbox/radio sync on "change", so validate listens on "change" for those fields - fields without `model` keep their v1.21.1 listener order
#103 moved the validate-on value listener of select/checkbox/radio fields with `model` from "input" to "change". A script-dispatched "input" no longer validated those fields, unlike v1.21.1. - listen on "input" again, in the v1.21.1 position; no "change" listener, so a real pick (input then change) validates once and an explicit validate-on keeps its v1.21.1 meaning - before validating, write the field value to its `model` the way core's `model` does on "change", so the validation notify no longer re-renders the stale value over the pick - skip that write for an unchecked radio and for an if-gated `model`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reapplies the three October PRs that were dropped when
mainwent back to v1.21.1. Each one is a separate commit on top ofrelease-1.22, withdist/rebuilt. A follow-up commit (a620d2a) closes one gap that #103 opened against v1.21.1.6f8cae5NoJS.hostApi >= 1, which core never defines. One observable change, which fixes a bug: the plugin init hook no longer re-binds[drag]/[drop]nodes that the real directive already bound against the live context (details below).7ad69a7npm ciworks.dist/built with esbuild 0.28.2 is byte-identical.75d73dbmodel, and the legacy path (novalidate-on), keep the v1.21.1 listener order. Onlymodelfields undervalidate-onchange, and in v1.21.1 those discarded every keystroke or choice.a620d2amodelselect/checkbox/radio fields frominputtochange, so a script-dispatchedinputstopped validating them. The listener is back oninputin its v1.21.1 position, with nochangelistener: a real pick validates once and an explicitvalidate-onmeans what it did in v1.21.1. Before validating, the field value is written to itsmodelthe same way core'smodeldoes onchange, so the pick is no longer reverted. That write is skipped for an unchecked radio and for anif-gatedmodel.Evidence
Unit tests (Jest)
release-1.22(4fcd400) and against Core v1.21.1.src/: 498/498 pass (5 skipped). This is identical to the v1.21.1 baseline.E2E (Playwright 1.64, chromium + firefox + webkit)
release-1.22.validation-modelspec (27).dnd A/B (#101)
release-1.22. Each combination ran twice: once with the plugin installed before init, once with it installed after init.drag,drag-type,drag-effect,drag-handle,drag-image(+ offset,none),drag-ghost-class,drag-class,drag-disabled(reactive),drop,drop-accept(list and*),drop-effect,drop-class,drop-reject-class,drop-disabled,drop-max,drop-sort+drop-placeholder+drop-placeholder-class, keyboard Space/Enter/Escape, allnojs:dnd-*events, all implicit variables,drag-listreorder/move, anddrag-multipleselect + group drag.[drop]zone are initialised once instead of twice. For example,on:initfires 1× instead of 2× (2× instead of 3× when the plugin is installed late).release-1.22, aneachinside a[drop]zone re-renders after a drop. On v1.21.1 the state updated but the list did not.validate A/B (#103 + follow-up)
input/changewithvalidate-onset toinput,blurandsubmit. Each form also holds a plain select as a control. Run against both cores.modelwithoutvalidate-on: identical to v1.21.1.modelundervalidate-on(on:input/on:focusoutreading$form,aria-invalidtiming): identical to v1.21.1.modeltext fields undervalidate-on: the v1.21.1 build wiped typed text. With this branch the text is kept, and behaviour (includingon:inputordering) matches themodel-without-validate-onpath.modelselect/checkbox/radio undervalidate-on: a script-dispatchedinputvalidates, as in v1.21.1. The v1.21.1 build then reverted the pick; this branch keeps it. A change-only dispatch does not validate, as in v1.21.1. Dirty/touched/error feedback matches the plain select for everyvalidate-onvalue.modelcases fail (the pick is reverted); against75d73db(fix(validate): keep model values when fields use validate-on #103 alone) the choice-control cases fail (inputdoes not validate).NoJS-Server (
release-1.22, sibling layout with Corerelease-1.22+ this branch)tsc --noEmit: clean.npm test: 155 + 1167 + 150 + 34 pass.test:e2e: 11/11 pass.test:parity: 12/12 pass, includingdnd-reorder.release-1.22Elements head, Server's plugin compiler suites fail 5 tests. With this branch they pass 119/119.npm run version:check: OK 1.22.0.