hoplon

The :hoplon: ClojureScript Web Framework - http://hoplon.io/
2017-12-21T06:04:44.000088Z

does anyone know of something in hoplon that changes the way that NodeList works?

2017-12-21T06:27:17.000026Z

hmmm

2017-12-21T06:27:22.000083Z

(defn- set-insertBefore!
  [this kidfn]
  (set! (.-insertBefore this)
        (fn [x y]
          (this-as this
            (with-let [x x]
              (ensure-kids! this)
              (cond
                (not y)     (swap! (kidfn this) conj x)
                (not= x y)  (swap! (kidfn this) #(vec (mapcat (fn [z] (if (= z y) [x z] [z])) %)))))))))

2017-12-21T06:27:33.000071Z

this looks suspicious, and probably is breaking the editor

2017-12-21T06:34:33.000068Z

@micha @alandipert could i get a little help/advice on this?

2017-12-21T06:36:55.000065Z

i might be getting a bit beyond my understanding of hoplon internals here

2017-12-21T06:38:36.000095Z

why do we need to override low level fns like insertBefore? and why not wrap default functionality instead of replacing it?

2017-12-21T08:08:14.000373Z

looks like set-appendChild! has explicit handling for native? elements with a fallback to the native fn, but removeChild, insertBefore, replaceChild, setAttribute have no native element handling

2017-12-21T08:08:43.000101Z

and setAttribute is not added to the prototype, but the others are

2017-12-21T15:13:01.000697Z

thedavidmeister it sounds likely to me, your theory that the patched nodes are the problem

2017-12-21T15:14:46.000140Z

thedavidmeister are you passing an element you created with a hoplon.core constructor function to ckeditor? the workaround would be to pass it an element you created yourself with document.createElement

flyboarder 2017-12-21T19:29:10.000280Z

@alandipert do you recall why we override the low level function?

flyboarder 2017-12-21T19:51:27.000340Z

@thedavidmeister maybe comment out all the overrides and see what breaks?