This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-22
Channels
- # aws (4)
- # bangalore-clj (2)
- # beginners (99)
- # boot (8)
- # clojars (22)
- # clojure (87)
- # clojure-dev (2)
- # clojure-greece (10)
- # clojure-russia (22)
- # clojurescript (80)
- # cursive (4)
- # data-science (2)
- # datomic (10)
- # emacs (1)
- # fulcro (1)
- # garden (2)
- # luminus (1)
- # lumo (29)
- # off-topic (20)
- # om (6)
- # onyx (18)
- # parinfer (7)
- # perun (1)
- # portkey (28)
- # re-frame (93)
- # reagent (59)
- # ring-swagger (2)
- # shadow-cljs (31)
- # slack-help (15)
- # spacemacs (5)
- # uncomplicate (3)
- # yada (6)
Hi, I try to use re-frame-trace
. I found the re_frame.trace.is_trace_enabled_QMARK_()
returns true
in browser, but in the window nothing shows when I hit C-h
. Is there a way to start it by code? Thanks!
@cmal make sure you've got selection focus in the browser viewport, but not selected on a text box, i.e. just click on the background
@danielcompton Still not opened. This is my page which has re-frame-trace
installed: https://m.beta.joudou.com/wx/doumi
@cmal re-frame-trace
available only on dev
mode, use lein figwheel dev
to start up your app, you should be able to see the expected trace panel
What's the best way to disable re-frisk in production profile? Now I just comment/uncomment it)
@lovuikeng how to determine the :preloads
were run? I use shadow-cljs
to generate .js
files and sure I use the dev
mode.
I tried to add a (.log js/console "blabla")
into the preload.cljs
after the (trace/init-tracing!)
and lein install
to install re-frame.trace
in local repo.
and then I shadow-cljs compile app
but no console log were printed in the chrome console.
using the +re-frisk with re-frame-template
the project file is configured only for dev
mode
:profiles
{:dev
{:dependencies [[binaryage/devtools "0.9.4"]
[re-frisk "0.5.0"]]
:cljsbuild
{:builds
[{:id "dev"
:source-paths ["src/cljs"]
:figwheel {:on-jsload "rfrisk.core/mount-root"}
Nice, it seems re-frisk docs has been updated, last time I read it, it was (re-frisk/enable-re-frisk!)
WARNING: :preloads should only be specified with :none optimizations
when adding re-frisk within preloads
@cmal I've made a small shadow-cljs + re-frame-trace example: https://github.com/mhuebert/shadow-re-frame
It uses React 16 so I had to include my own fork of re-frame-trace for compatibility
Must I add this?
:js-options {:resolve {"d3" {:target :npm
:require "d3/build/d3.js"
:require-min "d3/build/d3.min.js"}}}
?@mhuebert and where the d3/build/d3.js
should be? Can I use cljsjs.d3
as the compiling error tells: The required namespace "cljsjs.d3" is not available, it was required by "day8/re_frame/trace/subvis.cljs".
?
@cmal ah yes, this is a bit awkward at the moment. shadow-cljs does not directly support cljsjs (explanation: https://code.thheller.com/blog/shadow-cljs/2017/09/15/js-dependencies-going-forward.html). What we do in the example:
1) require d3 via npm (see :npm-deps
in src/deps.cljs
) so that you could (:require ["d3" …])
,
2) in order to support libraries that still use cljsjs
, we create boilerplate cljsjs
namespaces (see the src/cljsjs directory in my example) for d3, react, and react-dom, which both provide the cljsjs.*
namespaces and also write these libs from npm into the expected global variables like d3
, React
, ReactDOM
3) but, Google Closure has a bug where it does not allow certain TypeScript-specific keywords to be used in non-typescript files, and that is why we need that extra :require because the normal d3 module build can’t be processed by Closure
i worked through this yesterday with @thheller, I think it’s still not entirely clear what the ideal path forward is for something like this, but the config in my example is at least a temporary workaround
@mhuebert Why the events count keeps growing fastly? I found this in my project, and I cloned your project, it is the same.
@danielcompton Yeah, it works now.
So the events count growing fastly is normal? I found it grows in your browser, too. @danielcompton
Not normal, not sure why that's happening
It's doing lots of rendering
Are you using React 16?
It doesn't support React 16 yet, I've seen there's a PR, I'll take a look on Tuesday (Monday is a public holiday)
hi @mhuebert ! @danielcompton says try to use react 15 instead.
@cmal the problem is that requires changing a bunch of dependencies including using an older version of re-frame I think
the underlying problem is that re-frame-trace has to prevent itself from monitoring its own activities, otherwise it gets into an infinite loop of render -> show render in trace -> render -> show render in trace
etc.
re-frame-trace relies on some React internals (not part of public API, but unavoidable for this kind of thing) which changed in 15->16 and broke the way it detects these ‘self renders’
@mhuebert Hi, if I git pull
and then lein install
in re-frame-trace
. How to use this installed version in shadow compile app
?
but instead of requiring [day8.re-frame/trace ...]
you would require [braintripping/re-frame-trace "0.1.9"]
in whatever app you are using. but again with the caveat that there is no clean way to resolve the d3 dependency yet.
when you use the most recent versions of shadow-cljs it will automatically install the npm deps (ie. add the correct versions of react, react-dom and d3 to node_modules), as well as all the non-js deps listed in :dependencies
I wish this window can be departed from the document so that I can debug it while keeping the window a mobile view.
No, that is a developer tool of wechat
. Oauth login needed to debug. Only in this tool can I debug this app. And this tools provide only mobile views.
Maybe the re-frame-trace
can add a switch to attach to the bottom of page, from the right.
looking for some advice. I have a component showing a list of things, and after clicking on a list-item, the item dissapears from the list. The parent div, the list-container, has CSS: overflow-y: scroll. If I scroll down, click on a list item, the thing gets re-rendered, and the scrolling restores to top. Which I do not want
Is there any kind of idiomatic/reactive way of doing this, or should i go to manipulating the DOM myself? (which would be my last resort)
@kah0ona usually it's something like this:
(for [item items]
^{:key item} [:li "Item " item])
or ^{:key (:id item)}
or ^{:key (str (:title item) (:description item))
etc