This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-18
Channels
- # aws (10)
- # beginners (43)
- # calva (1)
- # cider (7)
- # cljs-dev (83)
- # clojure (132)
- # clojure-dev (20)
- # clojure-europe (6)
- # clojure-greece (4)
- # clojure-italy (2)
- # clojure-nl (6)
- # clojure-spec (21)
- # clojure-sweden (16)
- # clojure-uk (21)
- # clojuredesign-podcast (16)
- # clojurescript (74)
- # cursive (41)
- # datomic (7)
- # emacs (3)
- # fulcro (30)
- # graalvm (3)
- # graphql (2)
- # instaparse (1)
- # jobs (1)
- # joker (13)
- # kaocha (14)
- # off-topic (118)
- # pathom (13)
- # re-frame (5)
- # reagent (22)
- # shadow-cljs (67)
- # spacemacs (7)
- # sydney (1)
- # testing (1)
- # tools-deps (82)
- # vim (4)
- # xtdb (1)
@emccue I added a new :js-provider
recently which may become handy for this. basically you set :js-options {:js-provider :external :external-index "foo/index.js"}}
the intent is that you build foo/index.js
with whatever external tool you prefer (so in your case react-native metro, but could be webpack, parcel, etc)
basically just an automated way for the webpack setup described in the official docs
I’m using this lib and struggling to get the right incantation to refer some of its components https://github.com/kmagiera/react-native-reanimated
I have this
["react-native-reanimated"
:default Animated
:refer
[Easing
Easing.inOut
Easing.ease
Transition
Transition.Together
Transition.Change
Transition.Sequence
Transition.Out
Transitioning
Transitioning.View]]
so far, and I’m trying to use a component called Animated.View
which is in the default export (Animated)
I think the .
is causing some problems
I get the error
152 | [Animated.View {:style (merge (s [:absolute-fill :bg-ui0])
------------^-------------------------------------------------------------------
Use of undeclared Var buoyancy.entry-point/Animated
I can workaround by doing (def animated-view (.-View Animated))
but I was wondering if there was a more elegant way
@danieleneal hmm yeah that isn't very elegant. the .
isn :refer
is also kind of problematic
I could change the default resolve rules to also account for :default
as it does with :as
but the handling of .
is already quite bad and even worse in normal CLJS
js libraries always manage to find some way to be different
ah that would be awesome but can appreciate it might be gnarly. I’ll stick with my workaround for now
@thheller after playing with react-native a bit, im curious as to your insights into what role Metro plays when you have a tool like shadow-cljs in front of it
is it largely unnecessary such that we could evolve the react-native flow to consume shadow output directly?
unfortunately they decided that it is ok to use non-standard JS (Flow mostly) in their packages
therefore shadow-cljs can't process it unless I add support for JS and all other kinds of non standard stuff they decided to add
I wasnt sure if it was injecting hooks, etc, into the final bundle, or whether it was just re-optimizing the already optimized shadow output
shadow-cljs basically just produces one file that metro is going to include like any other .js
file
yeah they provide the require
results (so all JS dependencies, shadow-cljs doesn't process any of them for rn)
the non-standard stuff is the problem. otherwise shadow-cljs or webpack would just work as alternatives
right..im sure it made sense at some level if you are looking at providing turnkey support for pulling in a bunch of human edited js/jsx
but for consuming compiler output from something like shadow-cljs, it makes less sense
there is https://github.com/callstack/haul which replaces metro entirely I think