Live-read all DOM attributes: forms and preloads too
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m49s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m49s
bindBoostForm re-reads method/action at submit time. bind-preload-for re-reads verb-info and headers at preload time. No closed-over stale values anywhere in the event binding system. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -780,17 +780,18 @@
|
||||
;; Bind preload event listeners based on sx-preload attribute
|
||||
(let ((preload-attr (dom-get-attr el "sx-preload")))
|
||||
(when preload-attr
|
||||
(let ((info (get-verb-info el)))
|
||||
(when info
|
||||
(let ((url (get info "url"))
|
||||
(headers (build-request-headers el
|
||||
(loaded-component-names) _css-hash))
|
||||
(events (if (= preload-attr "mousedown")
|
||||
(list "mousedown" "touchstart")
|
||||
(list "mouseover")))
|
||||
(debounce-ms (if (= preload-attr "mousedown") 0 100)))
|
||||
(bind-preload el events debounce-ms
|
||||
(fn () (do-preload url headers))))))))))
|
||||
(let ((events (if (= preload-attr "mousedown")
|
||||
(list "mousedown" "touchstart")
|
||||
(list "mouseover")))
|
||||
(debounce-ms (if (= preload-attr "mousedown") 0 100)))
|
||||
;; Re-read verb info and headers at preload time, not bind time
|
||||
(bind-preload el events debounce-ms
|
||||
(fn ()
|
||||
(let ((info (get-verb-info el)))
|
||||
(when info
|
||||
(do-preload (get info "url")
|
||||
(build-request-headers el
|
||||
(loaded-component-names) _css-hash)))))))))))
|
||||
|
||||
|
||||
(define do-preload
|
||||
|
||||
Reference in New Issue
Block a user