Fork me on GitHub
#shadow-cljs
<
2018-11-28
>
souenzzo12:11:55

when I run shadow-cljs with jvm11 it says Warning: Nashorn engine is planned to be removed from a future JDK release Is it a know issue?

achikin12:11:46

The error is The required namespace "decimal.extern.decimaljs" is not available, it was required by "decimal/core.cljs".

achikin12:11:13

I have asked in the funcool channel directly, but maybe somebody has a clue...

thheller13:11:15

yeah pretty much all funcool libs contain some kind of foreign lib

thheller13:11:46

I already added the shim for a few

thheller13:11:38

its probably an npm package that needs to be exported to some global

achikin13:11:58

Could that be fixed through shadow-cljs.edn config?

thheller13:11:41

(ns decimal.extern.decimaljs (:require ["decimal.js" :as dec])) (js/goog.exportSymbol "something" dec)

thheller13:11:13

just no idea which global it expects

achikin13:11:44

Thank you, I'll have a look!

thheller13:11:55

seems like its Decimal

achikin13:11:09

Do I understand correctly from this https://shadow-cljs.github.io/docs/UsersGuide.html#_requiring_js that I can use the decimal.js file, packaged inside [funcool/decimal] jar instead of installing it from npm?

achikin13:11:54

But Absolute requires like /some-library/components/foo mean that the compiler will look for a some-library/components/foo.js on the classpath;

thheller13:11:54

generally yes but you definitely don't ever want to do this for packaged sources

thheller13:11:11

just include it from npm if you want it done properly

thheller13:11:23

no guarantee that it will even work at all when importing from the classpath

thheller13:11:29

since classpath goes through :advanced

achikin13:11:06

I wanted to reuse that one for the sake of compatibility...ok, I got that.

achikin13:11:23

Thank you for clarifying!

thheller13:11:40

yeah foreign-libs on the CLJS side are not processed at all and just prepended

thheller13:11:00

JS from the classpath is actually fully processed so you typically only want to do it for you own sources

achikin14:11:07

Got another one šŸ™‚

File: ...
failed to require macro-ns "clojure.core.strint", it was required by "..."
FileNotFoundException: Could not locate clojure/core/strint__init.class or clojure/core/strint.clj on classpath.

achikin15:11:15

Oh, sorry. Seems like strint was moved from the core....

achikin15:11:32

I wonder how did it work under lein-cljsbuild...

achikin15:11:43

Oh, I had core.incubator in leiningen dependencies...

thheller15:11:50

yeah it was never in core

iha217:11:39

How do you load a file with shadowcljs repl.

iha217:11:10

I keep trying but I keep getting a ā€œfile not found in classpathā€ errors.

iha217:11:30

sorry if this is a simple question.

iha217:11:44

Iā€™m using load-file to try and reach the file.

ClashTheBunny17:11:12

Which repl are you in?

iha217:11:30

cljs-repl I guess.

ClashTheBunny17:11:52

In a specific build-id?

thheller17:11:56

@iha2 it is not currently possible to load files that are not on the classpath

iha217:11:37

Itā€™s in the folder of the parent app.

iha217:11:43

Does that make it in the classpath.

thheller17:11:43

you can (require '[some.ns :as x]) as normal but load-file is limited to files in your :source-paths

iha217:11:09

ok cool itā€™s in there

thheller17:11:34

it must also have an ns form.

iha217:11:18

(load-file "DailyProgrammer/single_symbols_squares.cljs")

iha217:11:38

DailyProgrammer is in src

iha217:11:44

is that correct?

aisamu20:11:20

Is it possible to have a cljs REPL connected to an :npm-module target?

thheller20:11:10

@iha2 no you need the full path from the project root or an absolute path

Bravi23:11:56

hi everyone. Iā€™m trying to use firebase npm module with my app and Iā€™m having issues importing things from the module. for example, when I try to

(:require ["firebase/database" :as database])
it comes up as an empty object

Bravi23:11:56

but some things work, like for example if I do

(:require ["firebase/app" :as firebase])

Bravi23:11:20

any ideas anyone, what could be causing this?

flyboarder23:11:09

@bravilogy is this for nodejs or browser?

Bravi23:11:55

itā€™s for browser

flyboarder23:11:59

you probably want ["firebase/database"] instead, and initialize with (def database (.firestore firebase))

flyboarder23:11:03

or something like that, I have a really old firebase library here: https://github.com/degree9/firebase-cljs see how things are initialized

Bravi23:11:35

yeah it seems to work with cljsjs

Bravi23:11:46

canā€™t figure out what Iā€™m missing šŸ˜•

Bravi23:11:35

ok I think I figured it out. I think I just have to do

(:require ["firebase/app" :as firebase]
          ["@firebase/database"])