Fork me on GitHub
#shadow-cljs
<
2019-10-21
>
lilactown01:10:15

@lvbarbosa yes I’ve seen this, I think it’s a CIDER bug

lilactown01:10:35

sometimes it works when I press enter a few times in the REPL, esp. with a CLJS buffer open next to it

lilactown01:10:38

seems finnicky

Lucas Barbosa01:10:25

Seems like it works if I cider-set-repl-type to cljs

Lucas Barbosa01:10:21

Nope, goes back to clj mode after a while :(

dpsutton02:10:51

what version of shadow-cljs are you on? I remember seeing this in the past

Lucas Barbosa02:10:44

I am trying to rollback cider to an older version to see what happens

dpsutton02:10:02

and what version of CIDER?

Lucas Barbosa02:10:26

previously on 0.23, now trying 0.21

Lucas Barbosa02:10:32

Same thing.. I'll try to downgrade shadow-cljs now Nothing. Went back to a few months ago and still have the same problem. I have no idea on what it might be

David Pham05:10:12

I usually do shadow-CLJS watch app

David Pham05:10:16

And then cider-connect-cljs

Lucas Barbosa13:10:41

Screen Shot 2019-10-21 at 10.12.06 (3).png

Lucas Barbosa13:10:54

Same thing with watching the build on terminal and connecting to the repl

Lucas Barbosa13:10:09

The repl work, but it is "disconnected" from the project files. I can't evaluate code in the cljs buffer, nor cider-switch-to-repl-buffer while in .cljs files. I just noticed that the repl buffer says "clojure" and not "clojurescript". Is that an evidence of something?

Lucas Barbosa13:10:10

I forgot to include cider-nrepl this time

Lucas Barbosa13:10:31

Alright, now there's the old message: "WARNING: No Clojure Project was detected" Still can't switch to repl buffer/evaluate code in source files. What versions of cider and shadow-cljs are you using? @UEQGQ6XH7 Screen Shot 2019-10-21 at 10.17.19 (3).png

David Pham13:10:58

Try to your shadow-cljs.edn file on GitHub

David Pham13:10:06

And we can maybe find your problem

David Pham13:10:27

Seems to work

Lucas Barbosa13:10:39

It is the default acme sample app from shadow-cljs: npx create-cljs-project acme-app

David Pham13:10:10

I am at work but I will try to check

thanks2 4
David Pham13:10:34

But you have access to the repl?

Lucas Barbosa13:10:36

If I do a cider-set-repl-type and change the repl to cljs, it works for a while, but then it goes back to clj mode and stops working on cljs files

David Pham13:10:55

By the way yes

David Pham13:10:11

The issue that the repl does not say clojureSciprz is an issue

David Pham13:10:21

Or cider-connect-CLJS

Lucas Barbosa13:10:03

:dependencies
 [[cider/piggieback "0.4.2"]
  [cider/cider-nrepl "0.23.0-SNAPSHOT"]]

Lucas Barbosa13:10:10

This is what I'm using

Lucas Barbosa13:10:17

Does the ordering matter?

thheller15:10:40

@lvbarbosa I changed something in the latest release that may be causing these issues. can you try 2.8.64 and see if those problems are still there?

Lucas Barbosa16:10:45

Thanks @thheller, it worked after a downgrade!

Lucas Barbosa16:10:32

@thheller I went to 2.8.64 and it works also! I was on 2.8.52 previously

thheller16:10:13

thx for the info. getting this nrepl stuff to work as expected has been a struggle

Lucas Barbosa16:10:09

I can imagine... thank you so much for the effort!

Lucas Barbosa16:10:23

I'll take a deeper look at the tool in the future

thheller17:10:12

@lvbarbosa @U0ETXRFEW could you try 2.8.66? I think it should be fixed but I have no clue how to use emacs so I can't test myself

Lucas Barbosa17:10:27

of course, just a sec

pez17:10:12

I have no clue how to use emacs, either. But I'll try with Calva. 😎

calva 4
Lucas Barbosa17:10:48

@thheller works fine on Emacs!

thheller17:10:24

well lets hope it is correct this time

thheller17:10:30

I'm sure there still stuff wrong 😛

Lucas Barbosa17:10:07

This is my first time doing cljs, so I'm not an "advanced" user. I'll keep an eye on things, but it works for what I need right now

pez18:10:30

Yes, this behaves like 2.8.52 in Calva. Thanks!!

David Pham05:10:38

Make sure to have piggieback as well

bbss09:10:21

I recently updated to 2.8.64 and that was working on one project, but on a different project I am getting

CompilerException: java.lang.RuntimeException: Unable to resolve symbol: read+string in this context, compiling:(shadow/cljs/devtools/server/repl_system/clojure.clj:113:32)
still works when I manually include 2.8.16 (which was what I was using before iirc) so I not a big issue right now.

thheller09:10:51

@bbss thats a bad tools.reader version on the classpath

thheller09:10:08

oh no wait .. its an old clojure?

bbss09:10:25

it shouldn't be..

bbss09:10:42

org.clojure/clojure {:mvn/version "1.9.0"}
, kinda old.

thheller09:10:45

that may require 1.10?

thheller09:10:55

yeah I think it was added in 1.10

bbss09:10:07

alright, that worked, time to fix the issues that come with the higher version closure compiler now.

thheller09:10:33

still can't use the very latest. that needs fixes in CLJS itself

bbss09:10:09

Well the one that came with .64.. I had some troubles with importing js a certain way in the other project.

bbss09:10:47

And in this case it was complaining it couldn't find process and I had to npm install it, I'm thinking that was the thing you mentioned earlier when I said I had to include js-options to get my build to work. e.g. npm install shadow-cljs

bbss09:10:27

and that made my build succeed with the latest versions so all good :thumbsup:

Lucas Barbosa13:10:09
replied to a thread:And then `cider-connect-cljs`

The repl work, but it is "disconnected" from the project files. I can't evaluate code in the cljs buffer, nor cider-switch-to-repl-buffer while in .cljs files. I just noticed that the repl buffer says "clojure" and not "clojurescript". Is that an evidence of something?

David Pham13:10:58
replied to a thread:And then `cider-connect-cljs`

Try to your shadow-cljs.edn file on GitHub

knubie13:10:01

is it possible to generate source maps for releases?

Drew Verlee14:10:16

in https://shadow-cljs.github.io/docs/UsersGuide.html#_preloads it mentions it adds cljs-devtools (https://github.com/binaryage/cljs-devtools) to preloads as long as the dep is on the path (in dependencies). When i do this, cljs-devtools formatting feature is enabled but not the "hints" feature (https://github.com/binaryage/cljs-devtools/blob/master/docs/faq.md#what-is-the-hints-feature). Any hint on how to enable this in the shadow setup?

Drew Verlee14:10:55

i tried adding features to install [:formatters :hints] to my devtools map

thheller15:10:40

@drewverlee that goes into the :compiler-options {:external-config {:devtools/config ...}} not :devtools

👍 4
thheller15:10:03

@steedman87 sure, :compiler-options {:source-map true}

👍 4
knubie16:10:46

Can't believe I missed that in the user docs

thheller21:10:09

I was accepted into the Github Sponsors Beta some days ago ... still kinda clueless about the tiers stuff. any comments are welcome

🎉 32
👍 24
🙌 8
David Pham22:10:21

I am gonna sponsor you through GitHub then :)

David Pham22:10:34

With the matching mechanism it will double :)

dpsutton22:10:06

is there a reason to prefer github to patreon? happy to switch if there's a benefit for you @thheller

thheller22:10:21

well github matches so it is 2x but I'm happy either way 🙂

dpsutton22:10:09

i'll move it over then 🙂

isak22:10:00

Using shadow-cljs, is possible to pre-process/manipulate code before it gets sent to the ClojureScript compiler?

thheller22:10:36

yes, but it isn't recommended since it can destroy source maps and so on

4
thheller22:10:03

what do you want to do?

isak23:10:36

Considering enabling something like this feature in Elixir (Phoenix), where one can give a name to a set of imports/requires, and then use them in any file:

defmodule MyAppWeb.UserController do
  use MyAppWeb, :controller
  ...

isak23:10:01

Kind of to avoid stuff similar to this (though I don't use fulcro):

isak23:10:07

May not be worth it in Clojure, since namespaces tend to be bigger, though part of the reason for that is also how bad ns is, so not sure

lilactown23:10:36

is ns a regular macro in CLJS?

thheller23:10:05

no, it is a special form

thheller23:10:10

@isak changing what the ns does is not really possible from the outside. it already is complicated enough as it is

4
4
thheller23:10:31

you also rarely use all of them in the fulcro case, I usually have no more than 3 often just 1