Fix infinite scroll and all sx-trigger/sx-get element binding

Root cause: process-elements during WASM boot-init marks elements as
processed but process-one silently fails (effect functions don't execute
in WASM boot context). Deferred process-elements then skips them.

Fixes:
- boot-init: defer process-elements via set-timeout 0
- hydrate-island: defer process-elements via set-timeout 0
- process-elements: move mark-processed! after process-one so failed
  boot-context calls don't poison the flag
- observe-intersection: native JS platform function (K.registerNative)
  to avoid bytecode callback issue with IntersectionObserver
- Remove SX observe-intersection from boot-helpers.sx (was overriding
  the working native version)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 00:17:02 +00:00
parent 9594362427
commit 90a2eaaf7a
4 changed files with 22 additions and 17 deletions

View File

@@ -428,7 +428,7 @@
(observe-intersection
el
(fn () (execute-request el nil nil))
false
true
(get mods "delay"))
(= kind "load")
(set-timeout
@@ -438,7 +438,7 @@
(observe-intersection
el
(fn () (execute-request el nil nil))
true
false
(get mods "delay"))
(= kind "event")
(bind-event el (get trigger "event") mods verbInfo))))
@@ -1484,8 +1484,8 @@
(el)
(when
(not (is-processed? el "verb"))
(mark-processed! el "verb")
(process-one el)))
(process-one el)
(mark-processed! el "verb")))
els))
(process-boosted root)
(process-sse root)