Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent changes to Reagent impact re-frame-10x #269

Closed
mike-thompson-day8 opened this issue Jul 7, 2020 · 2 comments
Closed

Recent changes to Reagent impact re-frame-10x #269

mike-thompson-day8 opened this issue Jul 7, 2020 · 2 comments
Assignees

Comments

@mike-thompson-day8
Copy link
Contributor

mike-thompson-day8 commented Jul 7, 2020

Reported by @andre on slack ....

In re-frame-10x for tracing components rendering static-fns from reagent had been monkeypatched, but in latest reagent alpha releases it was removed reagent-project/reagent@28c9b89 , are there any plans to integrate tracing in reagent ?

Background: see this code which does the monkey patching.

We probably need to ask for better APIs in the new alpha version. See also #115

@n2o
Copy link

n2o commented Aug 19, 2020

This problem now throws Errors every time a namespace is recompiled.

λ npx shadow-cljs watch app                                                                                                                                                                                                                                                                                     10:16:51
shadow-cljs - config: [...]/shadow-cljs.edn
shadow-cljs - starting via "clojure"
NPM dependency "react" has installed version "^16.13.1"
"16.13.0" was required by jar:file:/Users/n2o/.m2/repository/reagent/reagent/1.0.0-alpha2/reagent-1.0.0-alpha2.jar!/deps.cljs
NPM dependency "react-dom" has installed version "^16.13.1"
"16.13.0" was required by jar:file:/Users/n2o/.m2/repository/reagent/reagent/1.0.0-alpha2/reagent-1.0.0-alpha2.jar!/deps.cljs
NPM dependency "highlight.js" has installed version "9.18.3"
"9.18.1" was required by jar:file:/Users/n2o/.m2/repository/day8/re-frame/re-frame-10x/0.7.0/re-frame-10x-0.7.0.jar!/deps.cljs
shadow-cljs - HTTP server available at http://localhost:8700
shadow-cljs - server version: 2.10.21 running at http://localhost:9630
shadow-cljs - nREPL server started on port 8777
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (662 files, 1 compiled, 3 warnings, 7,55s)

------ WARNING #1 - :fn-arity --------------------------------------------------
 Resource: day8/re_frame_10x.cljs:34:28
--------------------------------------------------------------------------------
  31 |                                        {})
  32 |                           :operation (operation-name c)}
  33 |                          (if util/*non-reactive*
  34 |                            (reagent.impl.component/do-render c)
----------------------------------^---------------------------------------------
 Wrong number of args (1) passed to reagent.impl.component/do-render
--------------------------------------------------------------------------------
  35 |                            (let [rat        (gob/get c "cljsRatom")
  36 |                                  _          (batch/mark-rendered c)
  37 |                                  res        (if (nil? rat)
  38 |                                               (ratom/run-in-reaction #(reagent.impl.component/do-render c) c "cljsRatom"
--------------------------------------------------------------------------------

------ WARNING #2 - :fn-arity --------------------------------------------------
 Resource: day8/re_frame_10x.cljs:38:71
--------------------------------------------------------------------------------
  35 |                            (let [rat        (gob/get c "cljsRatom")
  36 |                                  _          (batch/mark-rendered c)
  37 |                                  res        (if (nil? rat)
  38 |                                               (ratom/run-in-reaction #(reagent.impl.component/do-render c) c "cljsRatom"
-----------------------------------------------------------------------------^--
 Wrong number of args (1) passed to reagent.impl.component/do-render
--------------------------------------------------------------------------------
  39 |                                                                      batch/queue-render reagent.impl.component/rat-opts)
  40 |                                               (._run rat false))
  41 |                                  cljs-ratom (gob/get c "cljsRatom")] ;; actually a reaction
  42 |                              (trace/merge-trace!
--------------------------------------------------------------------------------

------ WARNING #3 - :undeclared-var --------------------------------------------
 Resource: day8/re_frame_10x.cljs:68:11
--------------------------------------------------------------------------------
  65 |                                    :operation (last (str/split name #" > "))}
  66 |                                   (real-renderer c)))))
  67 | 
  68 |     (set! reagent.impl.component/static-fns static-fns)
-----------------^--------------------------------------------------------------
 Use of undeclared Var reagent.impl.component/static-fns
--------------------------------------------------------------------------------
  69 | 
  70 |     (set! reagent.impl.component/custom-wrapper
  71 |           (fn [key f]
  72 |             (case key
--------------------------------------------------------------------------------

@superstructor superstructor self-assigned this Feb 26, 2021
@superstructor
Copy link
Contributor

reagent 1.0.0 support fixed in re-frame-10x 1.0.0.

#115 covers improving the integration further via a better API so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants