Fork me on GitHub
#clojurescript
<
2018-05-06
>
lwhorton02:05:49

here’s a doozy, does the cljs compiler support an option to spit out not an indexed source map, but an … non-indexed one? (not sure what you call a regular map)

lwhorton02:05:42

i’m trying to use http://sentry.io, but they don’t seem to support the v3 spec of indexed sourcemaps… so I’m kind of SOL if the compiler can’t spit out a format they support. I guess I could look for tools that converts between the two, but that seems rather fishy.

skeuomorf11:05:34

With this project.clj https://dpaste.de/8jrU I get an error in the console “Uncaught ReferenceError: goog is not defined”

skeuomorf11:05:33

if I set optimizations to :none

skeuomorf11:05:41

if I keep it as :whitespace it works fine

skeuomorf11:05:49

Also, if I try to enable source-maps, they kinda work but I get an error in the console “Uncaught SyntaxError: Unexpected token :”

mfikes12:05:00

@skeuomorf Can you share details on some ClojureScript source that causes the error? An ideal minimal repro would use cljs.main to compile it.

skeuomorf12:05:35

@mfikes

(ns playground.core)
     (println "Hello")

skeuomorf12:05:59

in a vanilla core.cljs file

mfikes12:05:38

@skeuomorf I can't repro using your project.clj and that source file in src/playground/core.cljs and when doing lein cljsbuild once

skeuomorf12:05:59

I am trying to repro using cljs.main

mfikes12:05:30

Cool. If you succeed in doing that, then you could create a JIRA, as clj is accepted as being "minimal".

skeuomorf12:05:10

Alright, will see

skeuomorf12:05:57

@mfikes Can’t reproduce using clj and a deps.edn

skeuomorf12:05:20

Guess the problem is with lein-cljsbuild, which channel should I discuss this on?

skeuomorf13:05:18

How does one pass {:source-map true} to clj --main cljs.main

mfikes13:05:34

I don't see an issue discussing it here; unfortunately others will need to be able to repro it, even with lein-cljsbuild

skeuomorf13:05:52

tried clj --main cljs.main --source-map true --optimizations none -c repro.core but it opened a repl without compiling the file

skeuomorf13:05:41

Nice, thanks

mfikes13:05:49

In your case, that would translate to -co '{:source-map true}' being added

skeuomorf13:05:45

Ok, was trying to reproduce the 2nd case, couldn’t 🙂

skeuomorf13:05:03

It’s on the lein-cljsbuild of things, let’s see if someone else has the same problem

skeuomorf15:05:42

Given the amount of headache that I am having when using lein, how feasible is it to not use a build tool and just use the deps stuff these days?

mfikes16:05:51

@skeuomorf I use deps.edn (without lein) in many ClojureScript projects without issue. But I suppose it depends on what you are really doing. I suppose you are really asking about lein-cljsbuild in particular.

mfikes16:05:24

Also, FWIW, if you'd still like to use lein, but get some of the benefits of using deps.edn (like the ability to use :local/root or :git/url / :sha coordinates), then this project is maturing https://github.com/RickMoynihan/lein-tools-deps

skeuomorf17:05:26

@mfikes Yeah, I think I maybe hassled by lein-cljsbuild in particular not so much lien in general

Casey20:05:39

@mfikes do you have (or know of) a non trivial example of a non-lein project? Something with deps, test runner, maybe different profiles/env contexts?

Casey20:05:13

I'm hassled by lein-cljsbuild myself because it doesn't expose the watch-fn opt of the cljs compiler which I need for a peculiarity of my project

javi08:05:01

Have you seen shadow-cljs? i am using it in a projec with a few different builds, code splitting etc... you can hook onto the lifecycle builds... https://shadow-cljs.github.io/docs/UsersGuide.html#_lifecycle_hooks some more examples https://github.com/shadow-cljs/examples and the theller, the creator is very active with updates and suggestions in the shadow slack channel

mfikes21:05:29

@ramblurr In some projects, like Planck, I just have scripts. In others like coal-mine, I wrote the "scripts" in Clojure, in others like, patch-tender the "scripts" are so small, I just creates :main-opts aliases. None of these are web projects, but for any of it, it seems like you can roll your own solutions, and it is a bit easier with cljs.main being available.