Fork me on GitHub
#shadow-cljs
<
2020-03-30
>
fabrao00:03:54

hello, I know that import { Card } from 'antd'; -> ["antd" :refer (Card)] but const { Meta } = Card; ?

lilactown00:03:50

use JS interop

fabrao00:03:49

I got it -> (def Meta (.-Meta Card))

👍 4
Bardia Pourvakil03:03:46

Anyone have any idea why I’m not able to access my namespaces in my CIDER nrepl session into my shadow-cljs project ?

Saikyun05:03:58

how would one set some code from the http-server that is "injected" into my cljs-code? in my case I want to set an url to a server depending on which server my cljs-code is running from. like so:

server hosting cljs          rest api server
localhost                    localhost:1234
              
                     

Saikyun05:03:35

right now I use ring and just serve static files. was thinking that maybe one could modify something in the files when ring sends the static files

Saikyun05:03:51

now that I think about it, maybe this is a question for the server, not shadow-cljs... 🙂

Saikyun05:03:46

is it possible to add more release-"variants"? so that I could do: shadow-cljs dev-release app and keep the server-config in :closure-defines?

thheller08:03:39

@saikyun what I recommend is passing this stuff via HTML. so you call <script>your.app.init("the-server-url");</script> in your HTML and (ns ) (defn ^:export init [server-url] ...) in your code

Saikyun16:03:00

aha, interesting. thanks for the tip 🙂 that sure is helpful

David Pham11:03:56

I am developping a node-js script and it compiles to a single file. Is there a way to also compile all the dependencies from npm into that single file?

David Pham11:03:05

(hello everyone)

sogaiu13:03:03

@neo2551 i think thheller mentioned ncc the other day: https://github.com/zeit/ncc -- does that look relevant?

David Pham13:03:43

I will try. Seems quite good. Thanks.

thheller15:03:32

yeah ncc is recommended

martinklepsch17:03:54

Is there a way to run shadow/node-repl with :reader-features #{:node} ? (i.e. without attaching to a specific build and with a “built in” runtime as node-repl provides)

thheller17:03:46

@martinklepsch you can try via (shadow/node-repl {:config-merge [{:compiler-options {:reader-features #{:node}}]})

thheller17:03:55

that might only work by accident though, not actually sure 😛

thheller17:03:09

otherwise you can open an issue, currently that build isn't very customizable

martinklepsch18:03:36

@thheller that actually worked, great!