Fork me on GitHub
#shadow-cljs
<
2018-05-03
>
wilkerlucio05:05:22

after upgrading to the latest shadow, I can't start the compilation, getting:

wilkerlucio05:05:23

[2018-05-03 02:09:34 - WARNING] HTTP startup failed
java.lang.IllegalArgumentException: XNIO001001: No XNIO provider found

wilkerlucio05:05:35

reverting to 2.2.18 works

thheller08:05:50

@wilkerlucio are you using deps.edn? if so you might need to upgrade that

thheller08:05:20

the XNIO package is a :scope "runtime" dep so older versions of tools.deps wouldn't pick that up. https://dev.clojure.org/jira/browse/TDEPS-26

wilkerlucio12:05:31

@thheller thanks, that works

javi12:05:49

In order to manage the complexity of my projects, Is there a way to the dependency graph (edited) of a src ? ie: to render graphs or as input for further analysis of code tools.namespace doesn't like stuff like ["codemirror" :as codemirror]. thanks!

thheller12:05:37

I think there is a word missing

thheller12:05:51

you want a dependency graph I assume?

javi12:05:59

yeah, sorry

thheller13:05:45

@steveb8n is working on https://github.com/stevebuik/Stu which wants to answer those questions

thheller13:05:26

rendering a dependency tree is surprisingly difficult since it gets unreadable pretty fast

thheller13:05:26

but it only aims to answer the "why is my build so big?" question. it does not yet answer "why is this in there?"

javi13:05:44

Yeah, my goal is to get the "what is in there and who asked for it" something like , lein's plugin that lets me get a high level view of a project'.

thheller13:05:27

thought about building something like that. just don't have the time to do it.

thheller13:05:19

but this is already pretty much unusable. can't see anything useful.

javi13:05:11

yeah, something like that. > thought about building something like that. just don't have the time to do it. understandable! 😀 I am gonna see what i can do... that way i learn more of how shadow and the cljs compiler work too.

javi13:05:51

will report back

thheller13:05:00

the release-snapshot function I linked above produces a bundle-info.edn

thheller13:05:11

this should contain everything you would need to build graphs

thheller13:05:37

so no real need to dig into any internals

thheller13:05:59

you can of course but all the data is already exported just in case

javi13:05:00

yeah, i was jus looking into stu and found a tree in there. makes sense

javi13:05:22

> so no real need to dig into any internals how could i not 🙂? I am learning a lot

thheller13:05:03

this would be another good example of an unreadable dep graph (IMHO)

javi13:05:07

I am aiming at something interactive and queryable... maybe dump the graph into datascript and use some datalog visual query browser that i have somewhere from a project challenge + coffee

pez16:05:21

@thheller is there a way to instruct shadow-cljs which path it should use for the sources entry in the source-map files? VS Code allows me to place breakpoints in my actual source files if I edit the source map. For instance for the message module in Calva shadow puts calva/repl/message.cljs in sources. If I change that to ../../src/main/calva/repl/message.cljs things start to work.

pez16:05:43

(I have :output-dir "out" in my build config, which puts the generated files in out/cljs-runtime)

thheller16:05:29

@pez hmm I could probably add an option for that

pez16:05:08

The user guide lists :source-map-path as unsupported or non-applicable. But maybe that is actually meant to point to where the source maps are…

thheller16:05:32

maybe. but it seems more logical to me to just emit the absolute file path?

thheller16:05:46

this doesn't make sense in a browser context of course

thheller16:05:55

but for node/vscode it probably works?

thheller16:05:08

:source-map-path only applies to the browser context I think when you want to have source maps in a different path not matching :asset-path

pez16:05:06

Absolute path works for node, I just tested.

pez16:05:28

For the browser, I am using the Chrome Debugger extension for Code and it has an option for rewriting paths. I haven’t figured it out, but I think it should be able to help.

Jon16:05:05

I got some trouble running my code bundled with shadow-cljs in release mode. (code running on http://tabletwo.topix.im/ )

Jon16:05:45

(sorry to break the thread though...)

pez16:05:35

no worries, this channel seems single threaded. 😃

😄 4
pez16:05:42

I haven’t tried debugging a shadow browser project, so it might work out of the box.

Jon16:05:03

tried 2.3.13 and 2.3.16 , happens in both.

thheller16:05:32

are you sure you tried the .16?

thheller16:05:45

maybe forgot to restart the server when updating?

thheller16:05:56

that issue should be fixed in .16

Jon16:05:01

Turned out I can still get two copies of window.shadow$provide in my bundle, with 2.3.16.

Jon16:05:13

Tried twice.

Jon16:05:46

I guess the code should be just shadow$provide, since it's defined with var somewhere in the file.

Jon16:05:00

probably!

Jon16:05:12

restarting server...

thheller16:05:40

@pez hmm but what do I do about sources in jars?

thheller16:05:54

vscode probably won't understand those?

thheller16:05:42

@pez what do I need to do to test this?

thheller17:05:17

@jiyinyiyong actually it is not fixed. sorry about that.

Jon17:05:10

😂 so it's still there...

Jon17:05:52

okay, I'm just waiting for an update.

thheller17:05:07

that damn :output-wrapper 😛

thheller17:05:18

gotta be careful when adding stuff

thheller17:05:53

problem is in the combination of :output-wrapper with multiple :modules

Jon17:05:51

I haven't noticed that feature... new feature..

thheller17:05:35

wait? you haven't turned that on?

Jon17:05:31

I don't know that option, :output-wrapper

thheller17:05:45

nevermind ... I'm just bad at boolean logic.

Jon17:05:54

it's working correctly now, with 2.3.17. cool.

thheller17:05:03

that particular feature is only supposed to be turned on with multiple modules

thheller17:05:17

but it actually also enabled with just one when it shouldn't be

thheller17:05:24

fixing that

Jon17:05:52

I'm currently bundling my code in a single file. Not trying to split them for now.

thheller17:05:34

yeah .. I really need more test builds

thheller17:05:47

all my builds use multiple modules so I didn't test this particular case

Jon17:05:19

I switched my workflow to single bundles like in last months, or a little earlier. Just for convenience. I found myself gain no obvious benefit by splitting them(at least for now).

kanwei19:05:32

it's safe to not

npm install --save-dev shadow-cljs
if we're just using the jar and compiling to browser, right? seems to work (get a warning)

thheller19:05:20

what do you mean?

thheller19:05:23

the install is required for certain things (ie. babel) so you definitely should always add it

verma21:05:40

I am having a weird problem getting CSS file watching to work with Windows, pretty sure I am screwing something up, but the source watching works fine, changes are compiled and pushed to my electron hosted app

verma21:05:23

but css doesn't, although the sass command that I run on file change, stages the file in the correct location (since hitting refresh loads the CSS changes)

verma21:05:51

I tried the :file-watch option to switch to :polling but I got an error about key (sorry can't seem to find that option to tell the exact error)

kanwei21:05:06

@thheller still seems to work without babel

kanwei21:05:56

trying to minimize dependencies for CI/builds

kanwei21:05:23

also found an issue where if you symlink node_modules to another folder, it doesn't build on shadow-cljs

thheller23:05:09

@verma how is you css embedded? it currently requires an absolute path

thheller23:05:43

doubtful that it is windows related given that I'm on windows myself. but I don't do any electron development so there might be something going on there.

thheller23:05:17

@kanwei it works without babel until you need babel. which you will for anything ES6 in node_modules.

thheller23:05:48

symlinking is a bit problematic yes. have not found an acceptable solution for that yet since I need to know the actual file path for caching and stuff