Fork me on GitHub
#shadow-cljs
<
2018-09-19
>
biscuitpants06:09:00

should builds not fail when a warning/error comes up like this?

npm package "slate-react" expected version "[email protected]^3.1.0" but "4.1.5" is installed.
npm package "slate" expected version "[email protected]^0.1.5" but "1.0.2" is installed.

biscuitpants06:09:14

or, is it possible to fail builds when this happens?

thheller06:09:58

not currently possible to fail builds due to that no.

thheller06:09:04

it is also pretty much unfixable

thheller06:09:23

since if you install the new version the other packages that were expecting the older versions will complain

biscuitpants06:09:56

cause we hit a compilation bug with this and so i’m a bit weary of it going unnoticed

biscuitpants06:09:09

is it possible this can happen “randomly”, when deps have not been touched?

thheller06:09:26

well if they haven't been touched no

thheller06:09:35

but npm install isn't exactly deterministic

thheller06:09:13

so just running npm install again may produce different results

thheller06:09:35

I will be adding additional functions for the UI for this so that you can run something like deps-check so see potential version conflicts and fail if there are

thheller06:09:43

don't actually need to compile for that

biscuitpants09:09:40

has anyone ever seen a problem for Symbol is undefined in IE11?

thheller09:09:17

not supported in ie11

biscuitpants09:09:22

would need a polyfill

biscuitpants09:09:09

do you know of any good polyfills/practices for this?

thheller09:09:48

depends on what you are doing and where you are doing it? are you using Symbol or is it a npm lib?

thheller09:09:50

(react uses symbol but self-polyfills it if not available typically)

biscuitpants09:09:00

all the online answers point to babel which i cannot/don’t want to use

thheller09:09:17

hmm closure should detect the use of Symbol and inject accordingly

thheller09:09:33

do you have a :language-out configured in your :js-options?

biscuitpants09:09:25

{:app {:target     :browser
        :output-dir "resources/cognician/manage/js/"
        :asset-path "/cognician/manage/js/"
        :devtools   {:loader-mode     :eval
                     :ignore-warnings true}
        :modules    {:app {:entries [cognician.manage.app]}}
        ;; build env specific settings
        :dev        {:compiler-options {:ignore-warnings true}
                     :closure-defines  {cognician.manage.DEBUG true
                                        goog.DEBUG             true}}
        ;; production
        :release    {:compiler-options {:infer-externs :auto
                                        :source-maps   true}}}}

thheller09:09:01

which npm lib?

biscuitpants09:09:40

getting a link now

biscuitpants09:09:28

and with it, slate-react (react counterpart lib)

thheller09:09:57

I'm a bit busy right now. I'll check later why the symbol polyfill isn't added.

thheller09:09:19

are you trying in dev or release or both?

biscuitpants09:09:04

i’ve yet to try dev, i’ll try that now

biscuitpants09:09:13

no worries man, thank you for the bit of help

thheller09:09:46

you can maybe cheat and just use js/Symbol in your CLJS

thheller09:09:56

and then set :compiler-options {:rewrite-polyfills true}

thheller09:09:18

but the entire polyfills handling is a bit weird right now

thheller09:09:34

since JS typically injects their own polyfills all over the place

biscuitpants09:09:19

i’ll try that out, thank you

grounded_sage13:09:40

I'm not quite sure what I am doing wrong. But when I use deps.edn shadow-cljs can't find the namespace I use for clj-run.

thheller13:09:32

is it on the classpath?

grounded_sage13:09:56

It runs fine when I am declaring dependencies the normal way in the shadow-cljs.edn file.

thheller13:09:30

that doesn't answer my question 😛

grounded_sage13:09:07

Well I assume it is on the classpath. I'm still kind of in the dark on a lot of the JVM stuff. lol

thheller13:09:09

what are your :source-paths? and does the deps.edn have matching :paths?

thheller13:09:11

you need to add those via :paths to deps.edn too

grounded_sage14:09:32

That fixed it. Cheers!

lwhorton17:09:29

@biscuitpants i just did a polyfill straight at the top of my index.html. ie11 doesn’t support Array.find natively, which was about the only older version incompat I found with cljs.

lwhorton17:09:45

but the rewrite polyfills option didn’t seem to work for that particular case, hence the direct inclusion

biscuitpants17:09:57

ah okay, that’s a good idea. i’ll try that

lwhorton17:09:46

i remember boot-clj has a :checkouts option which was useful for pointing to a local jar instead of a published mvn artifact. to do the equivalent in shadow do I just add the dir to the :source-paths config? i feel like I read somewhere that shadow-cljs cannot modify the classpath above/outside its root, but not sure if that’s right

thheller19:09:51

@lwhorton completely fine to add :source-paths to wherever. the rule for non-project files is only for node_modules

lilactown21:09:09

🤔 I just upgraded from 2.4.24 to 2.6.8 and I'm getting a bunch of inference warnings. I think I ran into this before...

thheller21:09:17

do you maybe have a pinned clojurescript version?

lilactown21:09:08

remembering now 😅 I have a pinned clojurescript + closure-compiler that I needed to remove to upgrade

dfcarpenter22:09:50

Is there anything like Prettier for cljs/reagent?