Fork me on GitHub
#clojurescript
<
2018-04-10
>
darwin00:04:07

you are not asking browser if it is old, with js/old you are likely directly accessing window.old and this window.old does not exist under normal circumstances - it is not part of javascript standard, someone has to create it, you or some of your (javascript) libraries

cjmurphy00:04:30

Right - so some of the things I haven't included with this code may be defining old, so I ought to be including them. That makes sense. Need to work out which one of those libraries defined window.old.

cjmurphy00:04:44

That is great help. Thanks again 🙂

cjmurphy22:04:29

<script> var old = false; </script> <!--[if lte IE 8]> <script> old = true; </script>

cjmurphy22:04:37

It was that tiny bit of js in an index.html file that was not being called. I was using the wrong index.html file in other words.

justinlee00:04:59

@w Why is there an @ in that string require? That seems odd to me. Nonetheless, as I understand it, you should be able to do a string require. In case you are not familiar with the :npm-deps feature, note that it really is an alpha-level feature and will break with difficult-to-debug error messages on quite a few npm modules. It also runs npm modules through advanced compilation, which simply won’t work on every npm include without some work. If you are going to include lots of npm modules in your program, this is how I see things: https://gist.github.com/jmlsf/f41b46c43a31224f46a41b361356f04d

wjh00:04:47

It’s a NPM scoped package, they’re usually prefixed with @. I managed to sort this one, but getting an error about not being able to find stuff now. I’ll give shadow a go, thanks!

justinlee00:04:29

Interesting. I didn’t know about package scoping.

justinlee00:04:05

yea :npm-deps is promising tech but it’s painful to use if all you want to do is get stuff working in a reasonable way

justinlee00:04:43

hop into #shadow-cljs if you have issues

wjh00:04:47

Ahh yeah, it does seem promising, I hope it gets all sorted soon

Garrett Hopper02:04:01

Do npm-deps not get :optimizations :advanced compiled with :target :nodejs? If so, why not?

Garrett Hopper02:04:36

I think I answered my question: https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules#_works_on_node_js_too. Is there any way to force it to minify node modules into a single file?

timo13:04:13

crossposting my problem with advanced compilation of leaflet. I don't get the problem... the ext-file has the geoJSON-function but it throws an error when running as uberjar. Anyone has an idea?

thheller15:04:04

@timo it throws what?

athomasoriginal16:04:38

Any obvious reason why this would not match the case:

(:import [goog.events KeyCodes]))

(when (#{KeyCodes.UP KeyCodes.DOWN KeyCodes.ENTER} code)
    (case code
        KeyCodes.ENTER (do something...)

        ...

dnolen16:04:06

@tkjone case is for matching constant literals

dnolen16:04:47

there’s an exception, but I would ignore that over the fundamental usage

dnolen16:04:54

(doc case) should clear things up

athomasoriginal16:04:28

Thanks! Will take a look

dnolen16:04:56

@w scoped requires broke because of a problem with Google Closure

wjh16:04:20

Ahhh I see, thanks

dnolen16:04:52

waiting for a PR to get merged

justinlee16:04:29

@thheller: @timok is getting a Uncaught TypeError: L.$geoJSON$ is not a function but the externs file looks like it is specifying that function

justinlee16:04:21

I wish I knew more about the munging closure does. I’m wondering if the problem is in the symbol renaming one level up. i.e., geoJSON is not being munged but maybe the object it is attached to is

justinlee16:04:43

though i still don’t know why there are $ signs around its name if it is not being munged

timo16:04:20

I think that is because of the compiler-options I implemented:

timo16:04:40

:cljsbuild
             {:builds
              {:min
               {:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"]
                :compiler
                {:output-to "target/cljsbuild/public/js/app.js"
                 :optimizations :advanced
                 :closure-defines {dispatcher.env/DEV false}
                 :pretty-print true
                 :pseudo-names true
                 :print-input-delimiter true
                 :closure-warnings
                 {:externs-validation :off :non-standard-jsdoc :off}
                 :externs ["react/externs/react.js"]}}}}

thheller16:04:41

I see a geoJson not a geoJSON? things are case sensitive?

juhoteperi16:04:43

@timok Leaflet extern defines geoJson, looks like it should be geoJSON instead.

timo16:04:26

oha...let me see

timo16:04:58

that's a bit embarrassing, thanks for that hint! They are a bit inconsistent with the cases there

justinlee16:04:15

I didn’t see it either 🙂