day8 / re-frame-10x

A debugging dashboard for re-frame. X-ray vision as tooling.
MIT License
631 stars 68 forks source link

Reagent 1.0.xxx support #275

Closed cartesian-theatrics closed 3 years ago

cartesian-theatrics commented 4 years ago

Hello, I'm trying get re-frame-10x working with reagent 1.0.0-alpha2 and clojurescript 1.10.764. Getting lots of inference errors in the shadow-cljs build that I'm a bit confused about:

Cannot infer target type in expression (. (aget q i) _queued-run)
 124 |       (when-not (nil? q)
 125 |         (set! rea-queue nil)
 126 |         (dotimes [i (alength q)]
 127 |           (._queued-run (aget q i)))
 128 |         (recur)))))
 129 | 
 130 | (set! batch/ratom-flush flush!)
 131 | 
Warning :infer-warning in day8/re_frame_10x/inlined_deps/reagent/v0v10v0/reagent/ratom.cljs at 137:1
Cannot infer target type in expression (. (. RAtom -prototype) -day8$re-frame-10x$inlined-deps$reagent$v0v10v0$reagent$ratom$IReactiveAtom$)
 134 | 
 135 | (defprotocol IReactiveAtom)
 136 | 
 137 | (deftype RAtom [^:mutable state meta validator ^:mutable watches]
 138 |   IAtom
 139 |   IReactiveAtom
 140 | 
 141 |   IEquiv
Warning :infer-warning in day8/re_frame_10x/inlined_deps/reagent/v0v10v0/reagent/ratom.cljs at 216:1
Cannot infer target type in expression (. (. Track -prototype) -day8$re-frame-10x$inlined-deps$reagent$v0v10v0$reagent$ratom$IReactiveAtom$)
 213 |                 (set! (.-reaction obj) r))
 214 |               v))))
 215 | 
 216 | (deftype Track [f args ^:mutable reaction]
 217 |   IReactiveAtom
 218 | 
 219 |   IDeref
 220 |   (-deref [this]
Warning :infer-warning in day8/re_frame_10x/inlined_deps/reagent/v0v10v0/reagent/ratom.cljs at 257:1
Cannot infer target type in expression (. (. RCursor -prototype) -day8$re-frame-10x$inlined-deps$reagent$v0v10v0$reagent$ratom$IReactiveAtom$)
 254 | 
 255 | ;;; cursor
 256 | 
 257 | (deftype RCursor [ratom path ^:mutable reaction
 258 |                   ^:mutable state ^:mutable watches]
 259 |   IAtom
 260 |   IReactiveAtom
 261 | 
Warning :infer-warning in day8/re_frame_10x/inlined_deps/reagent/v0v10v0/reagent/ratom.cljs at 365:1
Cannot infer target type in expression (. (. Reaction -prototype) -day8$re-frame-10x$inlined-deps$reagent$v0v10v0$reagent$ratom$IReactiveAtom$)
 362 | ;; - state
 363 | ;; - watches
 364 | ;; - watching
 365 | (deftype Reaction [f ^:mutable state ^:mutable ^boolean dirty? ^boolean nocache?
 366 |                    ^:mutable watching ^:mutable watches ^:mutable auto-run
 367 |                    ^:mutable caught]
 368 |   IAtom
 369 |   IReactiveAtom
Warning :infer-warning in day8/re_frame_10x/inlined_deps/re_frame/v0v12v0/re_frame/interop.cljs at 22:3
Cannot infer target type in expression (. x -day8$re-frame-10x$inlined-deps$reagent$v0v10v0$reagent$ratom$IReactiveAtom$)
  19 |   (reagent/atom x))
  20 | 
  21 | (defn ratom? [x]
  22 |   (satisfies? ratom/IReactiveAtom x))
  23 | 
  24 | (defn deref? [x]
  25 |   (satisfies? IDeref x))
  26 | 
Warning :infer-warning in day8/re_frame_10x/inlined_deps/re_frame/v0v12v0/re_frame/interop.cljs at 51:9
Cannot infer target type in expression (. reactive-val -day8$re-frame-10x$inlined-deps$reagent$v0v10v0$reagent$ratom$IReactiveAtom$)
  48 |   "Produces an id for reactive Reagent values
  49 |   e.g. reactions, ratoms, cursors."
  50 |   [reactive-val]
  51 |   (when (implements? ratom/IReactiveAtom reactive-val)
  52 |     (str (condp instance? reactive-val
  53 |            ratom/RAtom "ra"
  54 |            ratom/RCursor "rc"
  55 |            ratom/Reaction "rx"

I'm also just trying out Shadow-cljs, so could be something in the build config:

:builds
{:dev
  {:target     :browser
   :compiler-options {:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}}
   :devtools   {:preloads [devtools.preload
                           day8.re-frame-10x.preload]}
   :modules    {:main {:init-fn ...}}
   :output-dir "resources/public/js/dev"
   :asset-path "/js/dev"}}

Any pointers would be greatly appreciated. Thanks!

ghost commented 3 years ago

Any update on this PR?

superstructor commented 3 years ago

@cartesian-theatrics Thanks for the PR 👍 😄

I have upgraded reagent to 1.0.0 and refactored the reagent integration significantly.

If you subsequently find any new issues, please feel free to open a new PR or issue.

@unonull See re-frame-10x 1.0.0 release.