Fork me on GitHub
#clojurescript
<
2017-08-15
>
lambdahands00:08:42

Hmm, I'm getting the error still - I think I need to do some more digging before I have an answer. Thanks for your help! 🙂

lambdahands00:08:50

Actually, it looks like your fix worked! 😄

lambdahands00:08:50

Yeah, looks like I was evaluating the old file when I applied your workaround. Is there somewhere to look into how tools.reader parses/outputs regexes?

mfikes00:08:23

Really, avoiding a regex literal fixes it? Wow

lambdahands00:08:45

Yeah, I tried evaluating my regex in a Clojure REPL:

(require '[clojure.tools.reader.edn :as edn])
(edn/read-string "#\".+@.+\..+\"")
I may not be escaping the string correctly, but it produces this error:
java.lang.RuntimeException: Unsupported escape character: \.
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unsupported escape character: \.
java.lang.RuntimeException: Unable to resolve symbol: .+ in this context
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: .+ in this context, compiling:(<truncaed>.clj)
 java.lang.RuntimeException: EOF while reading string
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: EOF while reading string

mfikes00:08:32

Try putting an extra slash in front of the slash in the string

lambdahands00:08:10

I get a much shorter error 😛 clojure.lang.ExceptionInfo: Unsupported escape character: \..

mfikes00:08:23

@lambdahands The reader appears to be able to read it:

user=> (require '[clojure.tools.reader :as r])
nil
user=> (r/read-string "#\".+@.+\\..+\"")
#".+@.+\..+"

bronsa07:08:34

@lambdahands edn has no support for regexes

dragoncube08:08:49

are any follow-up (maintenance) releases for 1.9.854 expected any time soon?

boyanb08:08:54

Hm, is there a known limitation requirement for using npm modules? It either works perfectly, or the :require goes down ni flames. e.g. jsdom 11.1.0 can't be resolved by the compiler despite a successful installation in node_modules.

myguidingstar10:08:11

@thheller I got the above error and shadow-cljs (yarn version) failed to start

dnolen11:08:25

@boyanb it’s an alpha quality feature, so lots of things aren’t going to work - these cases are getting sorted through slowly

boyanb11:08:43

Cool, is there an expectation to fill in reports on this so you can investigate, or should we just assume taht the feature is getting ironed out and no use in reporting?

dnolen11:08:35

@boyanb just filing a report isn’t particularly useful at this stage

dnolen11:08:00

if you want to dig into what’s going wrong so we get something specific to look at, that’s preferred

boyanb11:08:51

Alright, I can quickly wrap up a reproducable and will look at the generated google compiler deps, but I'm unsure if I will get far. I already noticed that the dep itself defines exports in a non clear way (no single export).

dnolen11:08:53

the list of why some random thing on NPM won’t work is surprisingly long

boyanb11:08:59

yeah, I guessed so

dnolen11:08:42

if the library dynamically generates exports you’re likely out of luck - I would file a report to the JS library

dnolen11:08:59

or submit a PR to fix that

boyanb11:08:18

Alright, I'll be in touch if I have a concrete issue on cljs side. Still, awesome work on this feature, keep it up.

dnolen12:08:02

I’m not doing so much on it actually 🙂 Thank @anmonteiro and @juhoteperi and others

boyanb12:08:10

Thanks to the whole team ;o)

amitayh12:08:36

how do you check a type of a record in cljs? (class ???) doesn’t work 😞

prepor12:08:42

Hello. I'm trying to realize what the problem with custom data readers. Here is my minimal case: https://github.com/prepor/cljs-data-readers (https://github.com/prepor/cljs-data-readers/blob/master/src/dr/core.cljs#L6)

(.log js/console (type #dr/pos {:line 1 :col 3}))
It prints
PersistentArrayMap
. Unsurprised, because it generates code like
console.log(cljs.core.type.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"line","line",212345235),(1),new cljs.core.Keyword(null,"col","col",-1959363084),(3)], null)));
Looks like, if I return records from data reader it compiles it as a plain map, not record.

darwin13:08:58

@prepor the code makes no sense to me, I believe custom data readers can be specified when you are doing your own reading, I’m not aware that you could customize clojurescript’s own reader to include your custom data readers when parsing your source code

prepor13:08:00

@darwin it's official feature of cljs. And it works nice with other return values

thheller13:08:17

@prepor safe yourself alot of headaches and just write (dr/pos {:line 1 :col 3}) without reader tags

thheller13:08:48

otherwise you’ll need to teach the CLJS compiler about every custom reader you add

prepor13:08:27

@thheller thank you for an advise. so, this is a bug in compiler or?

dnolen13:08:04

@prepor it should work but your case is not minimal

dnolen13:08:12

reproduce without external tooling please

prepor13:08:42

@dnolen you mean lein figwheel?

dnolen13:08:49

if you can, then file a issue in JIRA, everything must be inline

dnolen13:08:51

do not link outside

dnolen13:08:09

@prepor I mean any external tooling period

dnolen13:08:19

doesn’t matter lein, Maven, Figwheel, boot

dnolen13:08:22

you should be able to reproduce this with just the Quick Start uberjar

dnolen13:08:05

@darwin that’s not right actually 🙂

dnolen13:08:34

we made the necessary changes so that custom reader code can be applied at compile/runtime

thheller13:08:15

doesnt it still require adding a custom cljs.compiler/emit-constant defmethod?

dnolen13:08:10

it should not, if it does that’s a bug

darwin13:08:17

@dnolen this sounds like an “inception” situation to me 🙂 my understanding: in non-selfhosted mode, cljs compiler uses reader implemented in clojure and to customize it you would need to write some clojure code (which would run as a macro at compile time before cljs compiler tries to read actual cljs sources of the project including custom data readers)

dnolen13:08:51

@thheller oh maybe that’s true, that should be easy to fix, there’s no need to go through that for registered tags

darwin13:08:04

@prepor’s code was all cljs, without anything remotely resembling reader/read-string or other dynamic reading

thheller13:08:14

well but the compiler doesn’t know what reader tag something had

thheller13:08:22

since the reader only returns the read value

dnolen13:08:49

@thheller but we can just change that to return a seq w/ the read fn

nforgerit13:08:51

Hey guys! I was wondering if anyone knows of sth like Facebook's Dataloader (https://github.com/facebook/dataloader) written in Clojure

dnolen13:08:09

oh hrm yeah

dnolen13:08:38

@thheller actually in this case it doesn’t matter I think sorry

dnolen13:08:48

defrecords print readably

dnolen13:08:53

@prepor yes file an issue and put everything in line in the ticket

dnolen13:08:58

do not link outside like I said earlier

prepor13:08:01

@dnolen I always try to avoid your JIRA, guys 🙂 Ok, 1 min

dnolen13:08:20

@prepor your out of luck with ClojureScript far as that goes 😉

dnolen13:08:38

@thheller ok so I believe the bug is that defining records doesn’t augment reading

dnolen13:08:19

@prepor when you file the issue drop the link here thanks

dnolen13:08:26

hrm but actually it should just work if you have data_readers.cljc so we’ll just have to see

dnolen15:08:00

@bronsa hrm it appears by default the reader may convert records to maps?

dnolen15:08:17

er meant to message in #cljs-dev

yedi16:08:21

does anyone know if https://github.com/mhallin/forest is still be actively developed

yedi16:08:32

/ does anyone have suggestions for alternatives

deg16:08:05

I just hit a strange bug that I can't explain... I got the error Could not find artifact cljsjs:firebase:jar:3.2.1-0 in central () This is in a new project, where I added a dependency on [degree9/firebase-cljs "1.3.0"] in my project.clj. firebase-cljs, in turn, has a dependency on [cljsjs/firebase "3.2.1-0"]. (if relevant, it uses boot, while my project uses lein) The cljsjs dependency was properly installed into my ~/,m2, but then I got the error above. I worked around the problem by adding an explicit dependeny on the cljsjs project from my project. So, I'm not stuck for now. But, very puzzled about what went wrong here.

dnolen17:08:34

@prepor your issue appears fixed in master

dnolen17:08:29

thanks for the report and the nice minimal case - saved me a lot of time

dnolen17:08:26

@tony.kay your EDN file from yesterday is pretty unweildy, can you please resend with source mapping disabled?

thheller17:08:46

@dnolen FWIW you now only fixed the special case for records. it still relies on the special behavior for other types (eg. #inst, deftype, etc)

dnolen17:08:10

deftype doesn’t print readably so it doesn’t matter

thheller17:08:39

how is that related?

dnolen17:08:52

how is not related?

dnolen17:08:04

the other cases also don’t matter

thheller17:08:23

its about emitting JS code that can be executed not read

dnolen17:08:49

I don’t see your point, sorry

dnolen17:08:04

if you want to clarify further I’m listening

thheller17:08:44

when reading #some/tag "value" you need end up with that value in the analyzer

thheller17:08:16

which is treated as a constant, which is then emitted as JS code via cljs.compiler/emit-constant

thheller17:08:28

previously records slipped through the map? test

dnolen17:08:33

I do not see how emit-constant is relevant here

dnolen17:08:44

please set that aside

thheller17:08:50

other values such as #inst "2000" already have a special handler

dnolen17:08:05

it’s just implementation details

dnolen17:08:11

not interested in discussing that really

dnolen17:08:20

if you have a semantic point then I’m interested

thheller17:08:16

switch defrecord to deftype in CLJS-2323

thheller17:08:21

that would be legal in CLJ

dnolen17:08:43

I don’t follow

dnolen17:08:53

you need to be more verbose in your explanations

dnolen17:08:56

and focus on semantics

dnolen17:08:48

I’ll attempt to interpret what your getting at

dnolen17:08:00

Clojure actually lets you splice Java values at read time

dnolen17:08:07

deftype is not actually relevant here

dnolen17:08:16

and no, no intention of making that work on my end

thheller17:08:38

no the issue is that the CLJ reader (when compiling) evaluates the literal

dnolen17:08:15

the reader doesn’t compile

dnolen17:08:17

it just reads

thheller17:08:01

I didn’t say compile, I said evaluates

thheller17:08:13

{dr/pos dr/map->Position} the READER calls the handler fn

dnolen17:08:37

@thheller and the handler fn can return anything, including arbitrary Java values

dnolen17:08:51

there’s no way that is going to work

dnolen17:08:59

nor am I even interested in simulating it

thheller18:08:54

you are already simulating it …

dnolen18:08:06

it’s just a special case for records

dnolen18:08:22

and I’m not interested in other cases

dnolen18:08:56

records print readably so it’s trivial to cover all records, that’s it

thheller18:08:14

I do not understand what printing readably has to do with any of this

thheller18:08:21

the print method is NEVER called

dnolen18:08:39

because you’re just focused on implementation details

dnolen18:08:47

if some can print readably then it isn’t opaque

thheller18:08:47

we are talking about parsing actual CLJS code here

thheller18:08:58

not reading any arbitrary EDN data at run time

dnolen18:08:06

I don’t want to talk about CLJS code I already said that - it’s not relevant

dnolen18:08:20

if we’re going to keep going around in circles I’m moving on sorry 🙂

dnolen18:08:22

@tony.kay great thanks, 11mb of EDN is a bit much to sift through

tony.kay18:08:58

Yeah, I thought so as well, but thought you might have had an idea for using magic code on it 😉

tony.kay18:08:21

sent. @dnolen 152k is prob better.

tony.kay18:08:33

still a lot, though

dnolen18:08:03

@tony.kay nah, I need your :modules

tony.kay18:08:26

:modules       {:entry-point {:output-to "resources/public/js/demos/demos.js"
                                                             :entries   #{cards.card-ui}}
                                               :main        {:output-to "resources/public/js/demos/main-ui.js"
                                                             :entries   #{recipes.dynamic-ui-main}}}

deg18:08:27

Repeating msg that scrolled off earlier; sorry if this is spammy, but I'm puzzled by this: I just hit a strange bug that I can't explain... I got the error Could not find artifact cljsjs:firebase:jar:3.2.1-0 in central () This is in a new project, where I added a dependency on [degree9/firebase-cljs "1.3.0"] in my project.clj. firebase-cljs, in turn, has a dependency on [cljsjs/firebase "3.2.1-0"]. (if relevant, it uses boot, while my project uses lein) The cljsjs dependency was properly installed into my ~/,m2, but then I got the error above. I worked around the problem by adding an explicit dependeny on the cljsjs project from my project. So, I'm not stuck for now. But, very puzzled about what went wrong here.

tony.kay18:08:35

@deg My guess is that the dep you’re using lists firebase as “provided” so you can choose your own version

tony.kay18:08:04

ah, you’re right. That’s not it

tony.kay18:08:32

this really isn’t a cljs problem, per-se. More of a tooling issue. If you’re using lein, some possibilities might have to do with things in your user profile, configuration of remote repositories, etc. The error tends to make me think something about your build environment told it to only look in maven (not also in clojars), and perhaps it is only in clojars…that kind of thing. Just making possibilities up. The clojurescript compiler and language are not involved in that step.

deg18:08:39

Makes sense. But, I've never seen this on any other dependency. Not really sure how much I should worry about it... one line worked around the problem. But, still...

deg18:08:01

Is there a better channel to ask this question?

deg18:08:00

What's especially weird is that half the tooling worked. It did download to my local ~/.m2. But, then, it thought it had not found it.

tony.kay18:08:47

well, it might have downloaded from some other attempt earlier?

tony.kay18:08:02

Yeah, running out of ideas. Network glitch? Something wrong with your local download (perhaps it was partial and things got confused)…

tony.kay18:08:36

You might try the #leiningen channel

tony.kay18:08:47

Also look at the pom file from cljsjs firebase. It is just XML…see if it looks messed up. Perhaps the publisher of it got something wrong.

tony.kay18:08:02
replied to a thread:Nope.

Yeah, running out of ideas. Network glitch? Something wrong with your local download (perhaps it was partial and things got confused)…

tony.kay18:08:36
replied to a thread:Nope.

You might try the #leiningen channel

deg18:08:57

Nope, repeated tries, including changing the dependendy in degree9 to different versions of the cljsjs file. The problem was consistent.

deg18:08:46

I'm cleaning it up now to commit to github, and will post the question on #leinengen in a few minutes,

tony.kay18:08:47
replied to a thread:Nope.

Also look at the pom file from cljsjs firebase. It is just XML…see if it looks messed up. Perhaps the publisher of it got something wrong.

dnolen18:08:51

@tony.kay I do not see duping with your inputs & :modules config

dnolen18:08:02

what I do see is that the loader stuff ends up in :main

dnolen18:08:27

but this means that :main can only load stuff beneath it

dnolen18:08:20

both :main and :entry-point must require cljs.loader

tony.kay18:08:25

ah, so perhaps I need to do something to better specify what the actual entry point is supposed to be?

dnolen18:08:50

I don’t know, but your :modules at the moment doesn’t make any sense to me

dnolen18:08:05

anybody that needs to be loaded via cljs.loader must require cljs.loader

dnolen18:08:13

either directly or transitively

tony.kay18:08:17

That is true of this code

dnolen18:08:21

and they must call set-loaded!

deg18:08:27

FWIW, here's my project. I'll post on #lein too

tony.kay18:08:27

yep, true also

dnolen18:08:41

@tony.kay your inputs do not agree

tony.kay18:08:01

cards-ui requires a ns that requires the lib that does the load.

tony.kay18:08:13

the other uses loader directly

dnolen18:08:41

I can compute the entire dep graph for that ns and tell you if that’s actually true

tony.kay18:08:53

it is true in source

tony.kay18:08:59

I am certain

tony.kay18:08:04

card-ui requires dynamic-ui-routing which requires fulcro.client.routing which requires cljs.loader and issues the load (on user event). The startup code on dynamic-ui-routing does set-loaded on :entry-point dynamic-ui-main requires loader itself and does set-loaded for :main

tony.kay18:08:27

and it works perfectly if I drop devcards

tony.kay18:08:14

but that does change the dep graph because then I directly place dynamic-ui-routing in entry-point instead of the transitive from card-ui

dnolen18:08:08

@tony.kay you may believe that’s true

dnolen18:08:10

but this code says no

tony.kay18:08:24

I can link you to the lines of source if you want

tony.kay18:08:32

I’m looking right at them

dnolen18:08:56

this is topologically sorted list of nses it depends on

dnolen18:08:22

computed from your inputs files following :requires

tony.kay18:08:44

Can I show you the source path via github links?

tony.kay18:08:06

then I don’t know what to tell you. Your graph is wrong

dnolen18:08:09

show me what’s wrong in the topological sort here please

tony.kay18:08:11

in this topo sort, how do siblings show?

tony.kay18:08:15

just adjacent?

dnolen18:08:27

“siblings” what does that mean?

dnolen18:08:34

this is just every ns your ns depends on

tony.kay18:08:37

things that don’t depend on each other

dnolen18:08:46

it won’t appear here

dnolen18:08:52

this only what your ns depends on

tony.kay18:08:58

ok, so this is your graph for dynamic_routing_cards?

dnolen18:08:17

this is every dependency for cards.card-ui

tony.kay18:08:02

OK, first: cards.dynamic_routing_cards (which is in this list) requires recipes.dynamic-ui-routing which requires cljs.loader AND fulcro.client.routing (which in turn also requires cljs.loader).

tony.kay18:08:15

fulcro.client.routing is a cljc file, BTW, others are just cljs

tony.kay18:08:19

so routing is pulling cljs.loader via a conditional reader

dnolen18:08:33

ok great I can confirm that’s true in your inputs, but not reflected here

dnolen18:08:48

@tony.kay I see the problem, I think it’s a simple munging issue

dnolen18:08:17

definitely a bug, thanks

tony.kay18:08:01

excellent. You’re welcome. Thanks for your patience in clarifying your needs.

dnolen18:08:30

won’t release until this is sorted out

dnolen18:08:47

@tony.kay if you can confirm when I fix master that would be great

tony.kay18:08:12

would love to. I’m pretty jazzed about these simplifications, so anything I can do to help

flyboarder18:08:42

@deg I am more than willing to fix the degree9/firebase-cljs if you figure out the issue

juhoteperi19:08:26

@deg So the error about cljsjs/firebase not being available on Maven repo is normal, because cljsjs packages are only available from Clojars. Do you also see message about the artifact not being available from Clojars?

juhoteperi19:08:29

@flyboarder The firebase-cljs pom.xml file is created by boot-semver instead of Boot built-in task? Maybe it does something different.

deg19:08:47

@flyboarder @juhoteperi I only saw the error message I copied, about Maven.

juhoteperi19:08:50

@deg Do you change :repositories value in your project?

deg19:08:17

No, just a vanilla re-frame template project. This was the first commit into it.

deg19:08:07

I don't think it is an env problem here, but easiest way to test would be if you could try my project. (github link is above). Remove the commented dependency line in project.clj, and see it it also fails for you.

deg19:08:40

lein figwheel dev was how I triggered the problem.

deg19:08:51

As is, or did you remove the line?

juhoteperi19:08:56

Yes, removed the line

deg19:08:01

As checked in, it works for me too.

deg19:08:49

Hmmm. So my env. What should I check? lein profile, lein version, what else?

deg19:08:29

My ~/.lein/profiles.clj is pretty vanilla:

{:user {:plugins
        [;;
         [jonase/eastwood "0.2.4"]
         ;;
         [lein-ancient "0.6.10"]
         ;; Graphical presentation of project dependencies tree
         ;; See 
         [walmartlabs/vizdeps "0.1.6"]
         ]}}

deg19:08:59

$ lein version
Leiningen 2.7.1 on Java 1.8.0_131 OpenJDK 64-Bit Server VM

juhoteperi19:08:07

@deg I'm not sure what is the best way to check repositories in lein, but you can run lein pom and check that <repositories> in the created pom.xml file includes clojars

deg19:08:21

I'm having trouble reproducing the problem now. lein clean; lein figwheel dev was not enough. Will clear .m2 too in a minute.

deg19:08:04

Damn, I can't reproduce it, even after deleting ~/.m2/repository/cljsjs/firebase

deg19:08:47

Unless you think this is likely to be real, and have any tips for me to reproduce it, we may just have to credit this one to the flying spaghetti monster, and forget about it until it happens again. Damn, I hate these.

deg19:08:01

@juhoteperi @flyboarder I've managed to reproduce it. It does not happen with lein figwheel dev from a terminal, but does seem to happen in Emacs( (Cider) with C-c C-M-j from the a .cljs buffer.

dpsutton19:08:23

deg, can you post the error message exactly as it appears?

honzabrecka19:08:22

I just did a small tool that converts TypeScript definitions into Closure Compiler externs, so compiling in advanced mode shouldn’t be problem & manual work. https://github.com/honzabrecka/ts-to-goog

deg19:08:04

@dpsutton - Here's the whole flow, captured from Emacs *Messages* buffer: https://gist.github.com/deg/651b7b37ae5943b341e7868fc92590bf

juhoteperi19:08:44

@honzabrecka Interesting! I've been thinking about this but I didn't know about tsickle.

dpsutton19:08:56

don't know. was wondering if cider was trying to eval cljs in a clj repl, which i've seen a bit

deg19:08:46

I dunno. Debugging that is way above my Cider-fu. I guess I should move this over to #cider??

eggsyntax19:08:42

I'm extremely confused by some of the behavior of numeric cljs strings. In particular, can anyone clue me in on what's going on here? Why is a string var behaving so differently from a string literal?

cljs.user> (def num-str "-1")
#'cljs.user/num-str
cljs.user> (type num-str)
#object[String "function String() { [native code] }"]
cljs.user> (neg? num-str)
true
cljs.user> (type "-1")
#object[String "function String() { [native code] }"]
cljs.user> (neg? "-1")
----  Compiler Warning on   <cljs form>   line:1  column:1  ----

cljs.core/<, all arguments must be numbers, got [string number] instead.

1  (neg? "-1")
^--- 

deg19:08:05

Actually, could one of you try this in emacs, and see if you can reproduce it first? You need to:

- Remove the dependency from project.clj
- lein clean
- rm ~/.m2/repository/cljsjs/firebase/
- Open emacs buffer on src/cljs/trilystro/events.cljs
- C-c M-J

anmonteiro19:08:07

@eggsyntax because in the second case we can statically infer the type of the argument

eggsyntax20:08:12

@anmonteiro -- OK, I can see that. The second-level weirdness is that the result from (neg? num-str) isn't just an artifact of neg? -- both neg? and pos? successfully and consistently distinguish negative and positive number strings.

eggsyntax20:08:39

There seems to be some sort of implicit casting going on? Which I'm not used to seeing in clj/s.

anmonteiro20:08:09

yeah, it’s a platform thing

anmonteiro20:08:33

in JS:

"-1" < 0
true

eggsyntax20:08:45

Ah, ok, it's relying on JS numerics and JS is implicitly casting?

eggsyntax20:08:02

That totally clears it up. Thanks @anmonteiro !

deg20:08:20

@dpsutton @flyboarder @juhoteperi It's getting late here, and I need to sleep, and will be OoO tomorrow morning. I will report this on #cider afterwards. If one of you has time/tools meanwhile, much appreciated if you could try to reproduce too. Leave me a note here and I'll see it tomorrow. Thanks!

tees20:08:04

Beginner, looking for some help on how to communicate between cljs and electron. Let me know if I've posted this in the wrong place and I will delete / move it. I'm trying to get my clojurescript front end (re-frame) communicating with the electron node back end using the ipcRenderer. Problem is, I don't know the language well enough to know how to do so. The function in question:

ipcRenderer.on(channel<string>, listener<function>)
what I have
(Electron.ipcRenderer.send "asynchronous-message" "this is from cljs!")  ;; this works -> sends message to electron backend
(Electron.ipcRenderer.on "asynchronous-reply" (fn [event message]        ;; this does not
                                                (println event message)))
error I'm getting:
Uncaught TypeError: Cannot read property '_events' of null
    at _addListener (events.js:218)
    at addListener (events.js:276)
    at views.cljs?rel=1502829316642:11
thanks for any help you can afford, folks!

tony.kay21:08:31

@dnolen Success! Did exactly the right things, even in devcards.

tony.kay21:08:47

Could this have affected the optmizations problem?

mikerod21:08:13

Is there any explanation somewhere as to how the cljs versioning works?

mikerod21:08:39

I think the “1.9” correlates with clj, but then after that I don’t know what the number is

mikerod21:08:18

also, there appear to be even more versions that aren’t listed on the “changes” in GitHub, so I am just tryign to understand the pattern

reefersleep21:08:02

I was asking for suggestions for a good, free hosting service for Clojure/Clojurescript apps here the other day. A couple of peeps suggested Heroku, so I gave it a go. Having trouble with it now, so I'm just going to ask here again, since those people seemed helpful about the topic, even if it's not #clojurescript per se

anmonteiro21:08:39

@mikerod the number after the 1.9 is the number of commits to master after 1.9 was cut

anmonteiro21:08:06

currently there have been 904 commits after r1.9.0

anmonteiro21:08:18

which is why the current version would be 1.9.904 or something

anmonteiro21:08:46

a number of other Cognitect projects follow the same semantics

anmonteiro21:08:50

e.g. transit, core.async

mikerod21:08:51

@anmonteiro thanks, it makes sense now. I’ve seen that pattern before I suppose. Just didn’t remember.

reefersleep21:08:52

on git push heroku master, I get a long log of build actions from heroku, ending with

remote:        minifying assets...
remote:        Uberjar aborting because jar failed: /tmp/build_fe99283cdffe2c3578915edab91ec15b/resources/public/css/site.css (No such file or directory)
remote:  !     Failed to build.
remote:  !     Push rejected, failed to compile Clojure (Leiningen 2) app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to kingdomizer.
remote: 
To 
 ! [remote rejected] master -> master (pre-receive hook declined)
 error: failed to push some refs to ''

mikerod21:08:58

Ah, interesting

reefersleep21:08:20

but lein uberjar seems succesful locally

codefinger21:08:17

@reefersleep is public/css/site.css checked into Git, or is it generated during the build?

reefersleep21:08:19

@codefinger it's generated during build, it seems

reefersleep21:08:11

(I just transplanted my frontend code into a new lein template in order to make it more easily Heroku-deployable)

codefinger21:08:36

@reefersleep does it require node.js runtime by any chance? or does it all run in the JVM?

reefersleep21:08:54

weeeeeell, there's no mention of it in the project.clj

reefersleep21:08:54

it's based off of reagent-template

dnolen21:08:49

@tony.kay I mean it was just completely broken before

dnolen21:08:56

so you were seeing all kinds of issues

dnolen21:08:12

yes I would try a different optimization setting

reefersleep21:08:21

so from what I'm seeing, no node, only JVM

tony.kay21:08:00

@dnolen hm. I just was doing that. I still see breakage on :simple. It is possible it is on my end though. I’ll do some more homework and see what I can convince myself of.

dnolen21:08:28

@tony.kay well if you have something more specific than “breakage” then I can look at it

codefinger21:08:31

@reefersleep k. and locally you run lein uberjar, and nothing else. or was the site.css maybe generate in some command you ran earlier?

reefersleep21:08:43

just lein uberjar

dnolen21:08:48

@tony.kay your other issues were pretty boring

dnolen21:08:58

just wasn’t consistently munging ns names

tony.kay21:08:02

At the moment I get these two console errors when loading: “c is undefined” and “goog is undefined”

the-kenny21:08:07

@codefinger er, @reefersleep The reagent template seems to contain site.css literally

dnolen21:08:35

@tony.kay former sounds like externs, the later dunno

tony.kay21:08:53

yeah, like I said, I have to do more homework before I have something useful I think

dnolen21:08:10

doing a quick advanced test over here

tony.kay21:08:14

this does work all the wway to advanced with no modules…just FYI

dnolen21:08:36

that’s semi-useful information

tony.kay21:08:54

well, all except the dynamic loading 😜

reefersleep21:08:15

@the-kenny cheers, seems I'm a bit confused. I wasn't interested in all of that boilerplate, really, just wanted to deploy my app! 🙂

tony.kay21:08:30

@dnolen Any tips for something I can dump that might lead to more info?

dnolen21:08:13

not enough information for me to suggest anything

anmonteiro21:08:13

wouldn’t be an externs problem if you’re doing simple compilation

dnolen21:08:28

@tony.kay are you using :verbose compiler setting?

dnolen21:08:39

you should see how modules are composed and you should check that

codefinger21:08:47

i'm not following 😞 @reefersleep can i see your code? if it's private, I work at heroku so if you open a ticket at https://help.heroku.com i can peek at it.

reefersleep21:08:54

well, my repo is here: https://github.com/Reefersleep/kingdomizer . Don't know where that site.css file went off to.

reefersleep21:08:41

(and it's not that I haven't pushed it, it's not there locally, either)

dnolen21:08:52

@tony.kay advanced working here for me for trivial case, trying simple

reefersleep21:08:16

maybe I've just removed that folder, somehow. It would explain my error message.

codefinger21:08:17

@reefersleep oh, what version of lein you run locally?

tony.kay21:08:38

@dnolen :whitespace fails for me too….oh, on my trivial cases, it all worked, even the last build you had

tony.kay21:08:51

including the lib-based example

dnolen21:08:32

@tony.kay paste the modules portion of your :verbose output somewhere

dnolen21:08:38

feel free to PM if you like

reefersleep21:08:40

seems like a lein new reagent appname creates a resources folder

dnolen21:08:04

yeah :simple works fine for me too in trivial case

reefersleep21:08:05

ah wait. for some reason, the .gitignore contains the resources folder, which is present locally.

reefersleep21:08:39

let me just see if an amendment of that helps my Heroku issue...

codefinger21:08:43

@reefersleep yea, I got the same (No such file or directory) when uberjarring locally

codefinger21:08:00

/resources/public/css is in .gitignore, which might be right if the css is generated during the build. but otherwise, you might want to check it into Git

reefersleep21:08:39

trying git heroku push master again now... Success!

reefersleep21:08:12

So it seems like this is an error with reagent-template (unless I somehow botched things up during my frontend code transplant) wherein having the /resources/public/css folder in the .gitignore file just prevents a proper Heroku deploy during the build process. I guess I should mention this to the maintainer, @yogthos

yogthos21:08:27

Yeah public/css definitely shouldn't be in .gitignore

reefersleep21:08:45

Thanks again for your time, @codefinger , especially since I wasted it by fumbling through my own project 😞 😕 🙂

yogthos21:08:25

I'll take a look at updating that, and feel free to do a pr as well 😀

reefersleep22:08:25

@yogthos I'll do a PR tomorrow! Bedtime here 😴

yogthos22:08:35

Sounds good, I might get to it before then 😀

yogthos22:08:22

ok updated the template, and pushed a new version to clojars

yogthos22:08:47

neither resources/public/js nor resources/public/css should be in gitignore

reefersleep22:08:00

Great 😄👍

pwrflx22:08:17

hi! let's say I have an ratom that contains a vector, but the place where I'd like to use it requires the vector in a modified form (I need to run "map" on it). Is there some way to create an ratom from anoter ratom in a way that you can put a transformation in between?

sundarj22:08:14

try #reagent

reefersleep22:08:38

I think you might be looking for a reaction, @U4AH3T9QA

reefersleep22:08:44

reagent.ratom/reaction

reefersleep22:08:34

https://reagent-project.github.io/news/news060-alpha.html never found good docs for it, this is as close as it gets, I think

pwrflx14:08:30

thx, I'll look into it!

reefersleep20:08:34

Basically, it's something like

(let [readonly-reaction (reagent.ratom/reaction (process-the-contents-of (:whatever-path-into @my-state-atom)))]
  [:div @readonly-reaction]))

reefersleep20:08:42

The reaction is not swap!apple or reset!able, like an atom. You can only deref it

reefersleep20:08:37

but you can do whatever processing you want 🙂

reefersleep20:08:14

It'll do that whenever the part of your atom it cares about changes.

reefersleep20:08:24

You know, reactively 🙂