Repository navigation
feat(dnd): run dnd on the plugin host API (host.watch, value/sealed delivery, implicit-variable contract) - #101
Merged
Merged
Conversation
The plugin init hook re-bound every [drag]/[drop] node core had already walked, disposing and re-processing its subtree. An `each` loop inside a [drop] zone lost its template and stopped re-rendering, so reorders updated state but not the list. - record the context each real dnd directive binds against - re-bind only nodes bound to a stub or an orphan context
One package, two backends (ADR-021 dual-backend adapter). Under core the directives behave as before; under a compiled site (registrar carries `hostApi`) they do DOM mechanics only: - drag: echoes the server-sealed `drag` token as $drag, reads it at dragstart; drag-disabled is a delivered value, watched via host.watch - drop: reports the implicit variables to host.exec(bindingKey, payload) (serializable members only); drop-disabled/drop-max delivered values - shared mechanics (placeholder, index math, classes, a11y, keyboard) are the same code for both backends - plugin exposes `contract` (attr typing + implicit vars) for the compiler - unmigrated directives register warn stubs on compiled sites instead of crashing or staying silently inert
The dual-backend refactor made the core backends re-read drag-disabled, drop-disabled and drop-max from the DOM on every drag event and pass the current text to NoJS.evaluate. Any later write to those attributes (bound attribute, third-party script, injected markup) would then be evaluated as an expression. Restore init-time capture, as before the refactor. The host backend only JSON-decodes delivered values.
Host backend watches drop-disabled (host.watch): a server morph that disables the zone mid-drag removes the drag-over/reject classes and the placeholder; the next dragover recomputes.
Core binds null for both when the source is a `drag` element; the host contract's server-bound list members must match.
ErickXavier
marked this pull request as ready for review
October 13, 2026 03:34
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.
Summary
Draft — lands with the NoJS-Server P6 work and the next lockstep release; do not merge standalone.
src/_host.js(new): dual-backend adapter — core-backed (CDN) and compiled-backed (NoJS-Server host API).$drag/$dropIndex/$dragType/$dragEffectas schema-validated payload (ADR-021).src/dnd/contract.jsdeclares the attrs contract.eachinside a drop zone (8e746ca); dnd expressions are captured at init, not re-read from the DOM at event time (6e4e795, security); drag-over state cleared when a morph disables the drop zone.__tests__/dnd-host.test.js(new), updates toinstall-rebindanddnd; jest 518 passed / 5 skipped; e2e chromium 145/145 (dnd 20/20).dist/rebuilt.Pairs with NoJS-Server
feat/host-watch-dnd-spike(parity fixturednd-reordergreen under CDN core and compiled). Genesis: SRV-18.