Fork me on GitHub
#shadow-cljs
<
2020-04-17
>
Mark Bailey05:04:56

Hello! anyone have any experience with shadow-cljs and tailwindcss?

Mark Bailey05:04:20

I am having trouble getting tailwindcss to load and be usable

sofra05:04:34

Hi all, anyone had any luck getting shadow-cljs, deps.edn and cider working nicely together? Things work perfectly just using shadow-cljs and cider but when I try to use deps.edn as well the cider-jack-in-cljs stops working. I select cider-jack-in-cljs -> clojure-cli and then my build and I get the following error. error in process filter: The shadow-cljs ClojureScript REPL is not available. Please check for details

thheller07:04:02

@sofra that is not an error from shadow-cljs and I can't help with the cider parts sorry

sofra07:04:39

@thheller yep understood, I will take it over to #cider

thheller07:04:39

should be easy to do though. just add shadow-cljs to deps.edn and then start as normal

sofra07:04:03

all the shadow-cljs stuff is working fine

thheller07:04:10

@mbbailey96 whats the issue? you just load the tailwind css file? shadow-cljs doesn't need to know anything about that?

sofra07:04:16

just the cider integration that breaks

thheller07:04:01

yeah dunno about cider. I use Cursive.

sofra07:04:10

no problem

David Pham07:04:58

I usually use cider-connect-cljs

David Pham07:04:13

I launch a watch process

Mikko Harju09:04:09

Question about https://code.thheller.com/blog/shadow-cljs/2017/11/06/improved-externs-inference.html I'm getting Cannot infer target type in expression (. c__41761__auto__ -ratomGeneration) when using r/with-let -form in reagent (in a react native project). The article would suggest that I should be use to tag it using ^clj but this does not help. Is this a known issue? I can always revert back to (let [] (fn [] ...)) and it works.

thheller09:04:12

the problem is in the code the macro generates. so you cannot typehint it properly without modifying the lib

thheller09:04:51

but wasn't that fixed? I thought it was fixed in newer reagent versions?

juhoteperi09:04:15

In what case does this happen? I'm running Reagent test suite with Shadow-cljs and extern inference so it should be okay.

juhoteperi09:04:39

But this probably requires version 0.9.1

Mikko Harju09:04:40

OK, maybe I need to update my libs then

Mikko Harju09:04:16

Yeah, this project is at 0.8.1, I'll update it. Thanks for your fast replies!

juhoteperi09:04:00

Yeah, and that change was released in 0.9

Mikko Harju09:04:18

Updated reagent to 0.9.1 and it works. Thanks!

Mark Bailey14:04:23

@thheller I am getting a js-invalid-requires message on watch, specifically pointing out a require located in the index.js file of tailwindcss. Docs recommended an NPM install of tailwind so that's what I did. When I view the app in browser, it give me "failed to load" errors again citing the 'require not defined'. I tried changing :js-options :js-provider to :require but that only fixed some of the issues. It's the closest I've gotten to a working build

dhale14:04:35

@mbbailey96 I like the shadow-cljs + tailwindcss workflow described in this YouTube video: https://www.youtube.com/watch?v=_CTTbC6owS0

Mark Bailey14:04:51

@iradavidhale, so do I! That's where I got the idea for tailwind from, but if you look at his git repo, he has the pulled tw css file already, not the node_modules. Errors like the ones I described above are only happening when I import the tailwind node module. Also, @thheller, I forgot to mention. I get the same failed to load in browser for

react
and
react-dom

thheller14:04:31

@mbbailey96 I don't know what you are trying to do. tailwind is a css file and doesn't have JS?

thheller14:04:49

you include it in your HTML. your CLJS build doesn't know anything about it?

thheller14:04:01

meaning you do NOT require it in your CLJS sources?

Mark Bailey14:04:45

As far as I understand when reading through the install docs on the official tw website, it calls for an install through npm or yarn, then adding @tailwind base (and others) to your site.css file.

thheller14:04:18

for the tailwind tools yes

thheller14:04:56

that creates a .css file for you

Mark Bailey14:04:20

Ah, then I gravely misunderstood the task at hand. Sorry to bother you @thheller

thheller14:04:21

you load that in your html via <link rel="stylesheet" href="/css/whatever.css">

thheller14:04:57

or you just skip the custom build stuff and just use <link href="" rel="stylesheet">

Mark Bailey14:04:20

Yep! Just read further into the site, and found that little gem.

Mark Bailey14:04:30

My apologies, didn't mean to ask stupid questions

jjttjj16:04:08

Is there anything that would prevent shadow from loading a cljs namespace in a resources/ path? I have resources as a source path in my deps.edn and :deps true in shadow-cljs.edn but when I try to require public.code.myns which is located in resources/public/code/myns.cljs I'm getting "The required namespace "public.code.myns" is not available"

thheller19:04:06

@jjttjj well is it (ns public.code.myns)?

thheller19:04:19

oh right. resources/public is filtered by default because it is were people usually output there code to

thheller19:04:28

dunno why you'd put actual code there?

jjttjj19:04:50

Yeah, kinda a weird situation where I have static code files I wanted to eval with a bootstrapped compiler, there are probably better ways to do it but I was doing it this way as a shortcut for now

jjttjj19:04:23

(and I was trying to get them to auto-reload)

Ivan Fedorov20:04:20

Been getting lots of those recently https://gist.github.com/spacegangster/c3ffcb526598c40cb03bfd37a120c436 Internal compiler error

thheller20:04:24

internal compiler error from the closure compiler

thheller20:04:35

not shadow-cljs

Ivan Fedorov20:04:06

could be ES6 forms again?

thheller20:04:39

why are you writing so much JS? đŸ˜›

Ivan Fedorov20:04:15

the opposite – porting some legacy))

thheller20:04:27

I haven't worked in direct JS support in a while so I imagine that it has several issues

thheller20:04:44

closure is fairly strict in the kind of code it accepts

Ivan Fedorov21:04:13

Yes. This time adding terminating semicolons helped.

Ivan Fedorov21:04:12

Nope, premature celebration, still digging the sources.

Ivan Fedorov21:04:38

But yeah, that’s something about Closure, not Shadow

emil0r21:04:04

@thheller Is it possible to programatically configure shadow-cljs.edn when it is loaded by shadow-cljs?

emil0r22:04:21

I would like to be able to set :devtools-url based on my current ip