Fork me on GitHub
#clojurescript
<
2019-09-30
>
papachan12:09:30

hello, whats wrong with this?

cljs.user=> (+ (bigint 1) 2N)
WARNING: Use of undeclared Var cljs.user/bigint at line 1 <cljs repl>

cljs.user=> js/bigint
ReferenceError: bigint is not defined

papachan12:09:32

i have the same error than above: ReferenceError: BigInt is not defined

niwinz12:09:18

(BigInt) and (js/BigInt) are different stuff

niwinz12:09:31

the first one lookup on the cljs.core namespace

niwinz12:09:49

and the last lookps on the browser/nodejs global

niwinz12:09:03

cljs.user=> (+ (js/BigInt 1) (js/BigInt 2))
#object[BigInt 3]

niwinz12:09:35

if js/BigInt is not defined, then your execution environment does not supports the BigInt

papachan12:09:16

will look for a correct environment so

dnolen13:09:24

@papachan there is no BigInt in ClojureScript

👍 8
scknkkrer13:09:47

@papachan, You can find it in js namespace, because the namespace is synthetic and gives you a direct mapping to Runtime environment.

👍 4
papachan13:09:31

OK thanks !

ssdev16:09:01

Hello everyone. I'm currently trying to integrate sass compilation into an existing shadow-cljs build pipeline. I'd like the browser to reload when the css is updated, but when I use the watch-dir command, I don't see a browser reload. If I manually hit the browser reload button, I see the update, but the watch-dir command seems to be ignoring it. Am I missing anything?

:main       {:target     :browser
                       :asset-path "/js/main"

                       :modules    {:main {:entries [demo.client]}}
                       :devtools   {:watch-dir "resources/public/styles"
                                    :after-load demo.client/restart
                                                :preloads [fulcro.inspect.preload demo.development-preload]}}

lilactown16:09:03

@ssanders are you using the built-in HTTP server for shadow-cljs? or serving the files using some other way while developing?

ssdev16:09:06

This is from the fulcro scaffold, which seems to be using a separate server

ssdev16:09:37

I'm just realizing this should have gone in the shadow-cljs channel. Apologies for that. But now I'm assuming the watch-dir command only works if using the built in http server

lilactown17:09:57

I think the watch-dir should work w/o the the built in HTTP server

lilactown17:09:16

but I’m not super familiar with that feature, so I would post in #shadow-cljs and thheller might see it sooner

lilactown17:09:47

it might also depend if you’re using symlinks or some other virtual filesystem

ssdev17:09:55

Cool. Will do. Thanks