Fork me on GitHub
#shadow-cljs
<
2018-11-01
>
Wilson Velez00:11:59

I’ve configured shadow to run with lein

Wilson Velez00:11:36

I’m trying to release the code but I’m getting the error above.

cmal03:11:36

@thheller OK, thanks. I'll try that.

cmal05:11:40

It works all right now.

thheller05:11:31

@wvelezva that error happens when using an invalid closure compiler version

thheller05:11:58

make sure its [com.google.javascript/closure-compiler-unshaded "v20180910"] or later

👍 4
lassemaatta06:11:32

since everyone else seems to be pasting their exceptions, I might as well participate too 🙂

lassemaatta06:11:39

sometimes during compilation we get this:

thheller06:11:03

strange. shadow-cljs isn't even on the stack. not much I can do about that

lassemaatta06:11:49

yeah, I guess it has something to do with that hawk library.

thheller06:11:16

yeah thats the file watcher on OSX

thheller06:11:26

other platforms don't use that but the others are too slow on OSX

lassemaatta06:11:23

is that watcher activated dynamically based on the platform or should it be always there? I'm asking because I'm running linux 🙂

thheller06:11:54

oh right. remembered wrong. only windows uses the default JDK watcher

thheller06:11:10

but hawk also switches again and uses the JDK one for linux

lassemaatta06:11:42

okay, thanks for the info 👍 I think I'll report this to the hawk project, let them sort it out. in any case, the error doesn't seem to cause any issues, most likely it just fails to watch one or more files

thheller06:11:52

hawk is more or less dead I think

thheller06:11:56

no updates for years

thheller06:11:41

problem is OSX since the JDK watcher is so slow. otherwise I wouldn't use it at all

thheller06:11:19

but for linux I can probably filter it out and directly use the JDK one

thheller06:11:29

yeah let me do that

lassemaatta06:11:35

wow, thanks 🙂

thheller06:11:52

@lasse.maatta try 2.6.23. error might still happen but now I should be able to fix it if it does.

👍 4
Wilson Velez14:11:06

thanks @thheller, I didn’t know I had to add the closure compiler myself

Wilson Velez14:11:12

anyone know if I can have a specific name for my release file?

Wilson Velez15:11:53

right now I’m using a hook to the :flush stage to execute a “cp <outputfile> <releasefile>”

tony.kay15:11:53

@wvelezva you know about the file name hashing support, right?

tony.kay15:11:44

if you’re renaming the file to avoid cache issues, you probably want that instead

tony.kay15:11:53

otherwise I think it’s just the build name

tony.kay15:11:56

I think you might be able to use a filename in :output-to, but I have not tried

tony.kay15:11:08

that might just be for node

Wilson Velez15:11:04

yes the :output-to it is only for node

tony.kay15:11:43

rather..module name, is what I meant

tony.kay15:11:55

yeah, module name…so using a diff kw as the module name will cause a diff name for the file

Wilson Velez15:11:07

I got it, I just need two builds sections, one for my dev with the paths for dev

Wilson Velez15:11:14

and a new one for my release

tony.kay15:11:25

I don’t think that’s a great idea

tony.kay15:11:29

why do you care about the filename?

tony.kay15:11:40

when you run the release you get an optimized file

tony.kay15:11:05

and code splitting is going to rely on those names, so…I think perhaps you’re asking for future trouble

tony.kay15:11:48

I have not tried it, but you could perhaps set different output directories with https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration

tony.kay15:11:04

if you’re worried about “accidents” or something in deployment

Wilson Velez15:11:47

it’s because we are used to use a name during development and then when the js file is complete we compilete it in the right production folder

Wilson Velez15:11:34

I also test that and it “works”, but it is the same name for dev and prod

Wilson Velez15:11:40

it is not really a problem

Wilson Velez15:11:57

It’s just an old habit

tony.kay15:11:04

yeah, figured.

Wilson Velez15:11:41

but I’m going to use it, it’s really simple that way

manandearth19:11:59

Hi there, Can someone refer me to an example of a shadow-cljs project with both cljs and clj files in order for me to understand how data can be required from one to the other? I basically want some to use some Clojure libraries in the back and serve the data in the cljs front.

thheller20:11:51

@adamgefen not sure I understand the question. shadow-cljs generally focuses only on CLJS development and I recommend using lein for CLJ. as far as sharing sources is concerned you just point both at the same :source-paths and use the code as normal

manandearth20:11:54

@thheller so if I use some Java scraping library to grab xml to a clojure data structure, I should write it as edn to :source path and slurp it back in my cljs file?

thheller20:11:32

no you probably want to create a HTTP server in CLJ for that and let the CLJS app talk to that

thheller21:11:32

(assuming you are building something for the browser)

manandearth21:11:17

Ok. I'll look into that.

thheller21:11:38

if you want something full stack I'd suggest looking at #fulcro

manandearth21:11:40

I want it for the browser but I did think that it will be useful to keep some logic in the back in order to be able to expand.

grav21:11:37

@adamgefen If you want the browser to convert xml into edn, you could go with an npm package such as https://www.npmjs.com/package/xml2js and then transform it to edn with js->clj.

manandearth21:11:11

thanks @grav, I'll have a look.

vigilancetech22:11:57

@thheller yeah, that was pretty old. Came in from here (what I started with to build the example): https://github.com/shadow-cljs/examples/blob/master/electron/package.json