Fork me on GitHub
#cljsrn
<
2017-07-17
>
shoxter00:07:28

Can someone tell me what the :> notation means when using components? (i.e)

(fn []
   [:> someComponent {}])

tianshu01:07:43

Hi, I saw there's a project https://github.com/ds300/react-native-typescript-transformer it provides a transform module to RN packager, can cljs do this?

skapoor06:07:47

@shoxter IIRC, it's a short form for adapt-react-class that can be directly used in hiccup.

seantempesta08:07:40

I’m having a problem where my app is working with :simple compilation, but failing in :advanced. If I enable :source-map support, how can I get Chrome Devtools to use the source map?

carocad08:07:52

@seantempesta unfortunately the last version of the rn packager broke the patch that re-natal used to enable source-maps in chrome. I am having the same problem. Still searching way to make it work

carocad08:07:27

I also enabled them and can see them on my project but somehow devtools simply ignores them on the source tab 😕

carocad08:07:22

Right now I am looking into trying to replicate the re-natal patch for the rn packager into the latest version.

pesterhazy08:07:36

@seantempesta you can use pseudo-names instead to trace the mangled name

pesterhazy08:07:45

you could also search for all instances of (.- and (. in your code 🙂 or look at the mangled bundle

carocad09:07:45

@seantempesta have you tried using the master branch of re-natal? I just saw that @drapanjanas recently fixed that: https://github.com/drapanjanas/re-natal/blame/master/re-natal.coffee#L372

tap10:07:53

I’m trying to use DeckSwiper from NativeBase. http://rawgit.com/GeekyAnts/native-base-docs/v2.0/_book/Components.html#deckswiper-headref I got this error at renderItem attribute of the DeckSwiper component. “Objects are not valid as a React Child (found: object with keys {name, id, class} ….“. Any idea how to translate this to reagent/hiccup syntax?

<DeckSwiper renderItem={item => <Card></Card>} />

tap10:07:11

Wrap [card ..] with r/as-element seems to solve the issue.

daiyi10:07:36

I have an extremely basic question that I can't seem to dredge up an answer for from the internet: how do I add binaryage/devtools to a cljsrn app? I added it to :dependencies and [devtools.preload] to :preloads, is there something else to it? it should just show up right?

seantempesta11:07:57

@daiyi Are you calling (devtools/install! [:formatters :hints]) somewhere in your code?

daiyi14:07:16

I am not, because I'm following these instructions in the documentation: "ClojureScript supports :preloads compiler option which allows you to require namespaces prior your :main namespace. This means that you can use this feature to add cljs-devtools support to your project without modification of your code. You simply add devtools.preload into the :preloads list." https://github.com/binaryage/cljs-devtools/blob/master/docs/installation.md#install-it-via-preloads

daiyi15:07:28

okay I put it at the top of my main.cljs and now it says "Installing CLJS DevTools 0.9.4 and enabling features :formatters :hints :async" in the console! but nothing is formatted D:

gonbe7712:08:42

also, :preloads and :closure-defines don't seem to work in re-natal atm: https://github.com/drapanjanas/re-natal/issues/46 - hacking figwheel-bridge.js as described seems to work fwiw.

carocad15:07:54

mfikes: it seems that your request was granted faster than expected 😄 https://clojurians.slack.com/archives/C0E1SN0NM/p1500059378739469

mfikes15:07:31

Yes. He couldn’t resist 🙂

carocad21:07:03

@mfikes do you know how could this inpact re-natal? I mean currently we have this .re-natal file such that we can require the modules beforehand such that figwheel recognizes them (at least that is my understanding). Would that change with this release?

mfikes21:07:26

What is the context of the question? Are you asking whether using :target :nodejs affects re-natal?

carocad21:07:03

no. I am asking whether the cljs compiler recognizing node requires affects figwheel? which in turn would then affect re-natal (afaik)

mfikes21:07:13

We, I’m using re-natal with Figwheel, and have converted my project to use :target :nodejs, as well as all of the code in it to use stuff in ns forms, and nothing has broken.

mfikes21:07:26

Ahh, I also have an external component I’m using without any issue.

mfikes21:07:29

(That’s mentioned in the last butlast butlast paragraph in the article)

carocad21:07:40

So I guess you still need to call use-component to get figwheel to play nicely with react-native?

mfikes21:07:28

Yes, like it mentions in that paragraph

carocad21:07:44

thanks. I was just wondering since I dont understand all the internal 🙂

misha14:07:40

@mfikes what's the difference between these 2 when it comes to requiring node modules? (I saw the former few days ago in one of the cljs compiler announcements, if I am not confusing it with something else):

(:require ["foo-bar" :as fb])
;; and
(:require [foo-bar :as fb])

mfikes14:07:04

I think for that example there ends up being no difference, but it matters when the thing being required really needs to be a string.

mfikes14:07:39

"react-dom/server" is in the news post

martinklepsch14:07:22

FWIW I thought this was confusing a bit in the post (in Antonio’s)

mfikes14:07:22

I suspect that internally, a string may be afforded different behavior inside the compiler, but I’m not sure

mfikes14:07:11

António Monteiro is probably the best to ask for clarification.

misha14:07:21

> it matters when the thing being required really needs to be a string kappa

mfikes14:07:40

My guess is that it turns into a path, where symbols would be invalid. Like "foo/@bar", etc.

mfikes14:07:10

If you figure it out, write a blog post with some exposition on it 🙂

zlrth15:07:27

(the app works, which kinda concerns me, but i’d prefer to compile without errors)

misha15:07:45

not too enlightening harold


Thomas, like I said we should have updated the ticket. I also suggested string based require and it just didn't have anything to do with all this other stuff that you are suggesting in this issue. Supporting Node.js style paths as requires is just never, ever going to happen. Whatever you had in mind is not what I had in mind 

misha15:07:13

it is going to be "`aget` vs. goog.obj/get" round 2

anmonteiro16:07:34

@misha react-dom/server is an invalid symbol, which is why we added strings to the require spec

anmonteiro16:07:50

foo-bar is valid and should be used

misha17:07:21

@anmonteiro thank you. Is it valid to say: strings are only for slashes? Or are there any other corner cases?

anmonteiro17:07:08

@misha I don’t know. NPM has half a million packages or something

anmonteiro17:07:18

who knows what crazy names people give their packages? 🙂