This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-09
Channels
- # announcements (17)
- # babashka (8)
- # beginners (68)
- # calva (28)
- # clj-kondo (36)
- # cljsrn (1)
- # clojure (232)
- # clojure-dev (3)
- # clojure-europe (13)
- # clojure-nl (14)
- # clojure-spec (9)
- # clojure-uk (11)
- # clojuredesign-podcast (3)
- # clojurescript (38)
- # core-async (3)
- # cursive (1)
- # datahike (4)
- # datomic (4)
- # fulcro (56)
- # graphql (1)
- # helix (3)
- # honeysql (5)
- # introduce-yourself (1)
- # kaocha (2)
- # lsp (67)
- # malli (7)
- # meander (2)
- # off-topic (1)
- # pathom (9)
- # re-frame (55)
- # reitit (3)
- # releases (8)
- # remote-jobs (12)
- # shadow-cljs (12)
- # sql (3)
- # tools-deps (55)
- # vim (5)
- # xtdb (3)
does anyone know what causes some nodes in a dom tree to be “ignored”? I’m getting an error that has a list of ignored nodes: https://gist.github.com/zendevil/aef84352e934bb810efea77d4d8ee126
Can you also link the code which is causing this error?
(deftest test-home
(render (r/reactify-component [:div [:p "Something"]]))
(.click fireEvent (.getByText screen "Something"))
(is (= "Something" (.getByText screen "Something")))
)
This is the react testing library apiI have the following:
[:img
{:on-click (fn [event]
(go
(<p! (.. @(rf/subscribe [:magic]) -oauth
(loginWithRedirect
#js {:provider "facebook"
:redirectURI
(.. js/window -location -origin)})))))
:src ""
:style {:display :block :cursor :pointer :height 50 :max-height 50
:width :auto
}}]
And I’m getting a warning (shadow-cljs):
70 | [:div {:style {:height 50 :display :flex :flex-direction :row}}
71 | [:img
72 | {:on-click (fn [event]
73 | (go
---------------------------^----------------------------------------------------
Cannot infer target type in expression (. inst_66948 -oauth)
--------------------------------------------------------------------------------
74 | (<p! (.. @(rf/subscribe [:magic]) -oauth
75 | (loginWithRedirect
76 | #js {:provider "facebook"
77 | :redirectURI
I tried ^object, but that still gives the warning. How to remove it?But I guess -oauth
could be extracted from the go
block. And I would definitely do that, given that I have no clue how Reagent reactive context works in go
blocks.
and what is :magic
? probably something you are not supposed to store in re-frame state?
yeah, perhaps not because my login isn’t really working correctly.
(let [^js magic @(rf/subscribe [:magic])]
[:img
{:on-click (fn [event]
(.. magic -oauth
(loginWithRedirect
#js {:provider "facebook"
:redirectURI
(.. js/window -location -origin)})))
:src ""
:style {:display :block :cursor :pointer :height 50 :max-height 50
:width :auto
}}])
magic is the following. This event called through a reitit controller:
(rf/reg-event-fx
:init-login
(fn [{:keys [db]} _]
(prn "init login")
(let [magic (Magic. "pk_live_E0A5A86F2EF4DE14"
(clj->js {:extensions [(OAuthExtension.)]}))]
{:db (assoc db :magic magic)
:set-logged-in magic})))
(rf/reg-fx
:set-logged-in
(fn [magic]
(go (rf/dispatch [:set-logged-in'
(<p! (.. magic -user (isLoggedIn)))]))))
(rf/reg-event-db
:set-logged-in'
(fn [db [_ logged-in?]]
(assoc db :logged-in? logged-in?)))
But my logged-in? value is still false after the redirect
once in a blue moon it’s true but I don’t know why this isn’t consistent
I’m kind of replicating this pure js code: https://codesandbox.io/s/2d9jo?file=/index.html
Yeah I’m building on top of it now from this api: https://magic.link/docs/client-sdk/web/api-reference
Is there a function that performs the name wrangling that the clojurescript compiler does with identifiers?
(At least on the basic optimization settings or lower. Obviously at higher levels its trickier... 😉 )
I only met you extremely briefly like 5 years ago when I was a freshman, but iirc at that time you or someone else in the dept was working on whalesong
This might be a dumb suggestion considering i've only seen 10 seconds so far - but it might be easier to integrate with sci