This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-19
Channels
- # announcements (9)
- # babashka (11)
- # beginners (157)
- # calva (10)
- # cider (18)
- # clara (4)
- # clj-kondo (40)
- # cljsrn (8)
- # clojure (29)
- # clojure-europe (11)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-spec (4)
- # clojure-sweden (1)
- # clojure-uk (39)
- # clojurescript (32)
- # conjure (1)
- # core-async (2)
- # cursive (20)
- # datomic (7)
- # duct (9)
- # emacs (1)
- # figwheel-main (1)
- # fulcro (24)
- # helix (1)
- # hoplon (20)
- # hugsql (3)
- # jackdaw (5)
- # jobs-discuss (7)
- # lambdaisland (1)
- # malli (5)
- # music (4)
- # off-topic (54)
- # parinfer (2)
- # pedestal (13)
- # re-frame (12)
- # reagent (22)
- # reitit (9)
- # shadow-cljs (89)
- # spacemacs (2)
- # xtdb (21)
Have someone succeed using https://docs.swmansion.com/react-native-reanimated/docs/installation#babel-plugin ? Basically to run babel post-precessing for code which is live loaded and evaled on device. I tried to monkey-patch clojurescript compiler, to run babel on generated code before returning it but thats an uglly method which I would like to avoid.
I didn't know re-animated 2 was out yet. I am also interested in how to get this working with shadow-cljs. @U050KSS8M had a cljc macro that he used to create worklet function with javascript directive "worklet". I don't know if he has actually tried to use re-animated 2 this way though.
Important, put this in a *.cljc file:
(defmacro js-directive
[directive]
(list 'js* (str "'" directive "'")))
The actual problem is not in adding directives, but in the fact that they use a babel plugin which transform functions with directives into special closures that then are executed in a separated JS env. More on that here: https://github.com/software-mansion/react-native-reanimated/blob/master/plugin.js
I think re-animated 2 is quite rough for now. They said that they wanted to make the installation part of it simpler in the future. Maybe just wait until it has matured a little bit. But it would be so nice if this could be solved. Looks so good with re-animated 2! 😄