omcljs / om

ClojureScript interface to Facebook's React
6.65k stars 364 forks source link

Clojurescript 1.9.293 breaks protocol adherence checks on components #839

Closed solussd closed 7 years ago

solussd commented 7 years ago
(defui RootView
  static om/IQuery
  (query [this]
    [:app/count])
  Object
  (render [this]
    (let [{c :app/count} (om/props this)]
      (dom/div nil (str "count: " c))
        (dom/button #js {:onClick #(om/transact! this `[(app/inc-count)]))} "Increment")))

transact!, get-query, and other om.next functions check if components implement the IQuery protocol using cljs.core.implements?

With ClojureScript 1.9.229:

(implements? om/IQuery RootView) ;=> true
(implements? om/IQuery (om/get-query (om/class->any reconciler RootView) ;=> true

With ClojureScript 1.9.293:

(implements? om/IQuery RootView) ;=> false
(implements? om/IQuery (om/get-query (om/class->any reconciler RootView) ;=> false

Possibly a regression caused by CLJS-1658? Just speculating.

anmonteiro commented 7 years ago

You need to be on Om 1.0.0-alpha47 to use ClojureScript 1.9.293.

It is indeed caused by CLJS-1658 because Om relies on certain internal details of the ClojureScript compiler.

solussd commented 7 years ago

ah ha! Thanks!