cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
ak-coram 2020-04-16T09:08:31.099100Z

feels like there's a new CLJS release looming, is there anything blocking it?

2020-04-16T12:10:56.108500Z

@dnolen I've been getting my head around what you said re: https://clojurians.slack.com/archives/C07UQ678E/p1586970679096300 and Krell etc. Although I think I understand this now, I don't feel like the news announce and the amended webpack guide make the picture as clear as it could be wrt cljs libraries having npm dependencies - how current tools support this, how they might in future etc. If I find time I could try adding PR's for what I think is missing to explain: "You can now publish ClojureScript libraries that depend directly on the JavaScript ecosystem without additional ceremony and be confident that the whole community can benefit regardless of what other JavaScript and ClojureScript build tools they may prefer." FWIW I've made a repo that follows the new webpack guide, but tries to depend on a lib that declares :npm-deps https://github.com/henryw374/cljs-webpack-bundle-using-lib-with-npm-deps . As you say 'cljs is currently either all Closure or :bundle' so this is not expected to work. I guess another angle on this is that afaik cljs libs using foreign code (e.g. the popular cljs react libs) will probably not yet be dropping cljsjs dependencies in favour of :npm-deps. It's actually not clear that a majority of potential users have any npm setup at all (but it'd be good if the Clojure survey asked this explicitly )

dnolen 2020-04-16T12:14:55.109400Z

@henryw374 you need to run clj -m cljs.main --install-deps to actually get the :npm-deps

dnolen 2020-04-16T12:15:09.109700Z

getting the deps and the bundle stuff are independent things

dnolen 2020-04-16T12:17:21.110500Z

@henryw374 reagent already supports using react from :npm-deps instead of CLJSJS

dnolen 2020-04-16T12:18:32.111800Z

we'll cover the lib publishing part in a separate guide, the webpack guide doesn't cover the install step because in this case it doesn't need to

๐Ÿ‘ 1
frozar 2020-04-16T12:46:43.112400Z

Hi folks, I'm working on the cljdoc-analyzer project and I got a failure by analyzing specter 1.1.3 package in cljs environment. After some works, I realised that the call of cljs.analyzer.api/analyze-file function on the specter.cljc file produce a crash. I'm definitely not able to figure out what's wrong. So to help the investigation, I create a demo repo of this crash: https://github.com/frozar/cljdoc_specter_support As the specter package can be use in any cljs project, maybe the call to the cljs.analyzer.api/analyze-file function is not good in the repo above. On the other hand, maybe the parse step of cljs.analyzer.api/analyze-file simply failed on this file (for a reason which has to be highlighted). I would like to understand what is wrong here, to be able to fix cljdoc-analyzer. If anyone has a clue, I would appreciate ^^

dnolen 2020-04-16T13:53:35.113200Z

@fabien.rozar what is the stack trace?

dnolen 2020-04-16T13:53:45.113500Z

@henryw374 what is the full stack trace?

2020-04-16T13:57:38.113600Z

Attached file. to recreate, clone that repo and run 'clj -m cljs.main -co build.edn -v -c -r'

dnolen 2020-04-16T14:05:24.114200Z

@henryw374 minor thing but remove :install-deps from your config

frozar 2020-04-16T14:06:28.114300Z

If you will, I share the generated file here.

dnolen 2020-04-16T14:07:13.114900Z

@henryw374 what JDK are you using?

dnolen 2020-04-16T14:07:29.115200Z

that stacktrace is very strange

2020-04-16T14:10:44.115400Z

but how else to get the :npm-deps picked up, other than including :install-deps compiler opt? I'm on openjdk 11.0.2.

dnolen 2020-04-16T14:14:10.115700Z

@henryw374 try with JDK 8 please

dnolen 2020-04-16T14:14:29.116200Z

@henryw374 :install-deps doesn't pick up :npm-deps

dnolen 2020-04-16T14:14:35.116500Z

it triggers an install on every build

dnolen 2020-04-16T14:14:43.116800Z

you almost never want it

dnolen 2020-04-16T14:14:51.117100Z

I'll probably deprecate this option in the future

dominicm 2020-04-16T14:26:01.118200Z

If you deprecate, what's the api equivalent? A function that takes the config? Asking because I use cljs programmatically.

dnolen 2020-04-16T14:29:54.118700Z

@dominicm deprecation doesn't really mean removal

dnolen 2020-04-16T14:30:02.119100Z

just an warning of some of some kind discourage future use

dominicm 2020-04-16T14:30:30.120300Z

I know. But if I'm not using cljs.main, I don't know how to install deps otherwise.

dominicm 2020-04-16T14:30:37.120700Z

I try to keep up with changes to apis.

dnolen 2020-04-16T14:30:38.120800Z

the warning won't be at the level of the API - probably only cljs.main

dnolen 2020-04-16T14:30:46.121Z

so you'll be fine

frozar 2020-04-16T14:31:06.121700Z

I also add the stack trace to the repo, just in case.

dominicm 2020-04-16T14:31:08.122Z

Ah, so cljs main will deprecate it, not the api. Cool.

dnolen 2020-04-16T14:31:21.122600Z

fwiw we fully embrace the Rich Hickey stance on API changes - i.e. NO

dnolen 2020-04-16T14:32:14.123600Z

@henryw374 all of this needs a lot of documentation - i understand why you might be confused

2020-04-16T14:33:48.125100Z

great. I think I did know about this a few years ago ๐Ÿ˜‰

dnolen 2020-04-16T14:34:09.125400Z

well probably the only thing that might ever cause an API change is project sustainability

dnolen 2020-04-16T14:34:55.126500Z

like dropping all the less used REPLs in the next release - but that's really a special case

martinklepsch 2020-04-16T16:10:48.126600Z

@dnolen hereโ€™s a link to view this outside slack, Iโ€™ve looked at this before and couldnโ€™t make much sense of it so weโ€™d very much appreciate your eyes on this ๐Ÿ™‚ ๐Ÿ˜„ https://github.com/frozar/cljdoc_specter_support/blob/master/resources/clojure-7761295136030698780.edn

dnolen 2020-04-16T16:13:28.127200Z

@fabien.rozar @martinklepsch let not use threads in this channel

๐Ÿ‘ 1
dnolen 2020-04-16T16:14:01.128Z

@fabien.rozar the stack trace says the failure is in Clojure

dnolen 2020-04-16T16:14:03.128200Z

not the analyzer

dnolen 2020-04-16T16:14:26.128800Z

and it gives a precise location, please drop a link to that failing line in the original source

dnolen 2020-04-16T16:28:40.129600Z

are you sure the version of Clojure you're running has coll?

dnolen 2020-04-16T16:28:54.130Z

the likelihood that the exception is wrong is small

frozar 2020-04-16T17:27:21.133500Z

In the project.cljs of this minimal repo, I specified [org.clojure/clojure "1.10.1"] I can use the coll? function from a clojure REPL in this minimal repository... For me, I think I have the coll? function and this exception doesn't make sense. @dnolen can you reproduce the bug locally? You just need to clone the repo and make lein run to get it (normally...).

dnolen 2020-04-16T17:35:31.133800Z

sorry I don't have time to look at that

dnolen 2020-04-16T17:35:50.134400Z

an exception like that is almost never wrong

dnolen 2020-04-16T17:35:55.134600Z

the failure is in Clojure

frozar 2020-04-16T17:39:16.136600Z

You right, is a kind of Clojure question, but this exception appear by using a function from [cljs.analyzer.api :as ana], that's why it seems to be related to ClojureScript... Maybe I should post it in the #clojure channel.

dnolen 2020-04-16T17:41:01.137200Z

@fabien.rozar actually it might not be I'm not really what's going on in that trace

dnolen 2020-04-16T17:41:15.137700Z

it looks like it's wrapped in something, sorry

martinklepsch 2020-04-16T17:41:57.137800Z

@fabien.rozar letโ€™s get together and try to further reduce the repro

๐Ÿ‘ 1
dnolen 2020-04-16T17:42:36.138200Z

@fabien.rozar what version of ClojureScript is this?

dnolen 2020-04-16T17:43:18.138600Z

the other possibilty is that your ClojureScript version is wrong

dnolen 2020-04-16T17:43:55.138900Z

hrm yeah no way coll? has existed since 2011

dnolen 2020-04-16T17:45:00.139400Z

@fabien.rozar that namespace ... is complicated

dnolen 2020-04-16T17:45:11.139700Z

I suspect there's a macro bug here - if so there's nothing you can do about it

dnolen 2020-04-16T17:45:16.139900Z

@martinklepsch ^

frozar 2020-04-16T17:45:39.140300Z

I use [org.clojure/clojurescript "1.10.597"] just in case

frozar 2020-04-16T17:47:33.142200Z

@martinklepsch yes, I think the best would be to get a more synthetic example...

dnolen 2020-04-16T17:49:37.143400Z

I looked a bit more closely at the source and trace - I really don't know - seems weird - agree that making a more minimal example would be useful