Fork me on GitHub
#shadow-cljs
<
2018-12-17
>
flyboarder00:12:55

anyone know why this started popping up? could not find string alias for "socket.io-client" from app.client

flyboarder00:12:13

weird - I restart some of my builds and it went away

mj_langford17:12:37

Thank you very much for writing that up.

thheller17:12:16

@royalaid nice. why are you using the node.js JS REPL instead of a CLJS REPL though?

royalaid17:12:31

Mostly because I wanted to show what it looks like calling into CLJS from JS

royalaid17:12:08

I plan on making a follow up post gluing together DynamoDB and a lambda and using the NodeJS view of the world to show how to two are connected

royalaid17:12:31

That being said I also want to show the Dev workflow using the repl to debug too

royalaid17:12:56

but it really hard for me to capture that process in a meaningful using just text

royalaid17:12:36

It feels like the best way for newcomers to experience the repl is just watching a dev use it, like the first time someone watches a person who knows vim jet around a file

thheller17:12:43

I think it would be less confusing with a CLJS REPL but if showing the interop is your goal I guess thats fine

thheller17:12:11

this way you kinda have to know a few things about the internals

richiardiandrea17:12:12

Had the same thought, just finished reading the blog post simple_smile

royalaid17:12:26

Yeah still trying to find my feet with blogging so this feedback helps a ton, thank you!

thheller17:12:52

or this m.aws.createTable() isn't immediately obvious what this actually calls

royalaid17:12:18

Now that is something I may make an edit for clarity

thheller17:12:32

shadow-cljs node-repl (require '[server.create-table :as ct]) (ct/invoke) might be cleaner

Whiskas17:12:33

Someone here knows how to make cljs with live reloading debugabble?

thheller17:12:26

which part do you want to debug?

Whiskas17:12:21

So, in chrome, i am able to set breakpoints in code when i go in Sources tab at js/compiled/out/cljs-runtime/[…] , but when i update the code and live reload it, this code is’nt being updated too

Whiskas17:12:44

like, i think some implementations put a timestamp on these cljs files url everytime they are updated

thheller17:12:07

why not set the breakpoint in the cljs file?

Whiskas17:12:26

i set on the cljs,

Whiskas17:12:37

what i mean is that the files are not being updated as i change them

Whiskas17:12:48

so i can’t set breakpoints on new code

thheller17:12:26

not sure to be honest. never tried this. the timestamp is mostly used for cache busting, don't think it is used for debugging purposes

Whiskas17:12:26

it is usefull in the sense that when you cache bust the code you can debug what you have just written without reloading the page again, hah

Whiskas17:12:50

is it possible to enable it?

thheller17:12:37

you can try to take this file and put it into your classpath

thheller17:12:03

change that line to add "?rand=" (rand) at the end (after resource-name)

thheller17:12:23

maybe that does the trick

thheller17:12:39

it might be because shadow-cljs doesn't actually reload files

thheller17:12:47

it loads the files as edn and evals them

thheller17:12:54

so the load isn't async

thheller17:12:13

(and never has cache issues)

Whiskas17:12:28

if i re-define that function within the namespace it will work too?

Whiskas17:12:24

i put browser.cljs into the folder path /shadow/cljs/devtools/client but i think it was’t executed again, so i will try that

thheller17:12:54

may need to restart the server for this to work

thheller17:12:11

since it already has the old file loaded and may just ignore the new one

Whiskas18:12:17

Can you see if this is right? i reloaded the server and i think it did not got this file

thheller18:12:58

assuming src/cljs is your source path?

Whiskas18:12:57

i tried running the whole file on repl too

Whiskas18:12:20

on the cljs repl

jstaab22:12:29

Hey there, I'm running into trouble getting transitive dependencies to install (in particular the js dependencies of a cljs dependency, macchiato). Anything I'm missing? For now I'm just installing them myself.

thheller22:12:51

@jstaab since most cljs packages still rely on cljsjs and do not support npm they in turn don't properly declare their npm dependencies

thheller22:12:00

so we can't install them automatically

jstaab22:12:37

Where would I find the package.json for the installed version of my immediate dependency so I can hack something together?

jstaab22:12:01

Or I guess that would be the problem wouldn't it

thheller22:12:49

there is only the package.json in your project which you add the deps to manually

jstaab22:12:30

Is there any way to get at that? Maybe it's excluded from the installed version

thheller22:12:40

in its project but not in its .jar

jstaab22:12:25

where would shadow-cljs put that?

thheller22:12:52

it doesn't exist. do not waste your time looking for it

jstaab22:12:00

Ok, thanks

thheller22:12:04

it will be located in the maven repo

thheller22:12:23

so ~/.m2/repository/whatever/macchiato..../something-version.jar

thheller22:12:55

you can check whats in it with jar -tvf that.jar

thheller22:12:17

but even if it would ship its package.json it would not be a common thing to do

thheller22:12:27

so you'd need to talk to every library author to add it

thheller22:12:41

and at that point you could instead convince them to add deps.cljs instead

thheller22:12:08

there is no "standard" for this yet and I don't know what to do to get one

jstaab22:12:21

Does shadow-cljs support deps.cljs?

thheller22:12:21

its a complicated situation thats not just solved by adding a package.json or whatever

thheller22:12:33

:npm-deps in deps.cljs yes. nothing else.

jstaab22:12:41

I didn't even realize maven was involved

jstaab22:12:45

Ok, cool I'll try that

jstaab22:12:12

I mean, it doesn't solve my problem, but seems better than a package.json, which is what I'm currently doing

thheller22:12:15

definitely use a package.json in your project

thheller22:12:37

I cannot emphasize that enough. do NOT rely on deps.cljs

thheller22:12:53

always use package.json and KEEP your lock file

jstaab22:12:05

Is deps.cljs just for libs? or is that just the non-existent standard you were talking about?

thheller22:12:09

otherwise npm becomes one unpredicatable mess

jstaab22:12:19

yeah, I learned about lockfiles the hard way

thheller22:12:20

deps.cljs is just for libs

jstaab22:12:32

thanks again!

jstaab22:12:34

This is complex

jstaab22:12:47

I started reading shadow's source at one point and got completely lost

thheller22:12:54

it does a lot of stuff these days 😉