Fork me on GitHub
#clojurescript
<
2019-07-31
>
rgm05:07:41

@lilactown so, what worked was reverting the project.clj back to figwheel 0.5.18, clojurescript 1.10.520 and re-frame 0.10.6. Go figure.

rgm05:07:24

still a lot of tooling rough edges, but at least cljs has that linux-like quality where once it’s in a working state and as long as I don’t bump anything, it’ll probably keep working longer than my expected years remaining.

rgm06:07:53

have a code-as-data question for cljs … if I’ve got a hold of the fn defined by (fn [_ _] [(subscribe [:a-thing]) (subscribe [:another-thing])]), is there a clever way to get at that as a data structure after eval? I’m not above some sort of re-binding of subscribe since really all I want is to go from that defined fn to [:a-thing :another-thing]

rgm06:07:19

I thought binding might work but it’s clear I don’t really understand how it works in cljs, and I also tried defining something like (defn fn' [& stuff] ,,, ) and wrapping real fn so that I could maybe just take the code and hive it away in metadata.

rgm06:07:30

(that led to inscrutability pretty quick)

rgm06:07:26

(the task at hand: I’m trying a quick-and-dirty graphviz generator for re-frame subscriptions by wrapping reg-sub).

rgm06:07:55

hm, maybe I just re-define subscribe temporarily so that when the fn is called (which is easy to do, since I have a hold of it) it spits out its arg.

rgm06:07:20

breaks the app but I don’t care after I’ve got the subscription graph

Racheal09:07:44

Hey guys, I have this if block in my function

(if
                                   (includes? error-msg "Validate Errors")
                                    (map
                                     #(vector :p %)
                                     (-> error-msg
                                         (replace #"above" "below")
                                         (subs 1)
                                         (split newline-regex)))
                                    error-msg))))
Basically, it is meant to check if validate errors is part of the error message and execute the functions on the macros The code works fine excepts for the tests that fail with this error #object[TypeError TypeError: undefined is not a constructor (evaluating 'str.indexOf(subString)')] The test is as follows :
(testing " Validate error message are displayed correctly"
    (let [component (form-upload-component project-owner
                                           :state
                                           {:error-msg
                                            "b  Validate Errors"})
          html-text (dommy/html component)]
      (is (re-find #"Validate Errors" html-text))))
Can anyone help me figure out where the problem is?

thheller09:07:31

@mwatelaraycee33 try posting with with 3 backticks instead of line by line

looks better that way

Racheal09:07:51

Oooh okay will edit that

thheller09:07:01

as for your problem do you have the rest of the stacktrace? kinda hard to guess from just a tiny code snippet

Racheal09:07:54

ERROR in (xlsform-upload-state-tests) (contains@file:91362:21)
Uncaught exception, not in assertion.
expected: nil
  actual: #object[TypeError TypeError: undefined is not a constructor (evaluating 'str.indexOf(subString)')]

thheller10:07:29

eek that is not very informative

thheller10:07:14

maybe trying running the code outside of deftest so the full exception is available and not only that useless truncated part

tianshu13:07:49

is it possible now for React Native to get the source map working?

souenzzo17:07:38

maybe with #shadow-cljs

thheller09:08:46

no it does not. problem is in metro and there is very little we can do. see https://github.com/facebook/metro/issues/104

👍 4