Fork me on GitHub
#calva
<
2019-06-15
>
pez06:06:34

I think Calva treats *.joker files as Clojure files. I wasn't aware of that other forehand extension. I can add it to Calva.

kstehn06:06:31

@pez could you also add then boot to the extension list :)

pez06:06:00

Now I don’t find any reference to any file extension at all … did I dream that up, maybe. How strange.

kstehn06:06:53

Correct it is for the buildtool boot

pez07:06:11

I had sort of dreamt it. This is provided by vscode’s built in Clojure extension: https://github.com/microsoft/vscode/blob/master/extensions/clojure/package.json

pez07:06:16

But I have experimented with bringing that inside Calva. And I did bring the grammar part in. Maybe Calva should take over the rest as well. It is not like Microsoft maintain the Clojure support very actively.

pez07:06:57

Regarding boot, what would be more important is to support boot jack-in. Do you use boot, @slack1038?

kstehn07:06:23

No not really Only when i Update some cljsjs package Reagrding the Support by vscode: well i have to Set the File extension to clojure everytime becaus now Code highlighting

pez07:06:26

Here’s a build adding Clojure associations to .joke, and .boot. @hairfire, @slack1038

pez07:06:12

Is there a way to get notifications about one file changing in some Github repo? I’d like to know if they change that file in the vscode repo…

pez07:06:26

@slack1038 you can also instead merge in upstream/master, I just pushed the change

kstehn07:06:55

https://app.github-file-watcher.com/ Here for the notifications Will Do later and also test it :)

kstehn09:06:33

@pez works perfect for .boot files 😄

pez14:06:48

calva-friends: I’ve changed to webpack for the production builds. From my testing it seems to install much faster now and things seem to work. Can you help me test this package some, in case there is some problem lurking in there that I have missed?

pez14:06:43

This also meant some reconfiguration for the dev watchers, so anyone who is hacking on Calva, please merge in upstream/master. ping @slack1038 @brandon.ringe

gerred14:06:22

I haven't tried this yet, since I'm not doing much CLJS at the moment...but I think my question applies to calva and nrepl in general. does calva start one repl for the whole project? it's not per file right? and can I start up a clojure session and clojurescript session simultaneously if I'm doing full stack development?

gerred14:06:38

(i should probably do more cljs development :))

gerred14:06:28

i see the demo

gerred14:06:29

of clicking to switch

pez14:06:47

@gerred for cljs projects calva starts four nrepl sessions, actually. One clj repl backing all clj files, one clj repl for the clj repl window, one cljs repl backing all cljs files and one cljs repl backing the cljs repl window. For cljc files there is a toggle button in the status bar for choosing which file backing repl should be used.

gerred14:06:26

is there a function there I can make a keymap binding for that toggle? happy to document that if there is.

pez14:06:37

When you jack in to a cljs project (Calva does not support self hosted, only jvm projects) both a clj and a cljs repl window will open.

pez14:06:15

The toggle is bound to ctrl+alt+c ctrl+alt+t by default.

gerred14:06:39

interesting. ok, why one for all clj files and one for the repl window? so they're effectively different execution environments

gerred14:06:00

when I've sent a form over to the repl window, I've been assuming I'm in the same execution environment

pez14:06:20

Well, you are, except for dynamic variables and such.

pez14:06:35

So you can choose to be in different namespaces, for instance.

gerred15:06:01

newer to clojure so I could be misunderstanding. if I eval a form in the clj repl for backing all files (append as a comment), then switch over to the repl, is say...

pez15:06:02

But Calva will execute forms you send from a file in that file’s namespace.

gerred15:06:24

is something I def-ed in the clj files repl available in the repl window?

john15:06:25

"why one for all clj files and one for the repl window" @gerred I don't think that's what he meant

gerred15:06:39

or do I need to send it over to the repl window and evaluate the def there

gerred15:06:46

I think I'm misunderstanding 😄

john15:06:57

One is a CLJ repl and one is a CLJS repl

pez15:06:57

I might be explaining it weirdly.

gerred15:06:04

oh ignoring that for the moment @john

gerred15:06:09

there's 4 REPLs right?

gerred15:06:19

i'm not worried about bridging between clj and cljs from a repl perspective

john15:06:20

It's not like one is for files and the other for strings

gerred15:06:29

no that I know too

pez15:06:37

I think it is @john misunderstanding it some… 😃

john15:06:59

Probably a good bet 😉

gerred15:06:00

I'm just trying to understand when I evaluate a form, where I've evaluated it and what are the rules when I evaluate in one clj session and don't in the other.

gerred15:06:09

now that I know there are separate ones

pez15:06:14

Let’s take the simpler clj only case.

gerred15:06:16

lol I'm totally off of my cljs question now because this is so interesting.

pez15:06:50

The there are two nrepl sessions. One for the files and one for the repl window. Since it is clojure they will share the same idea about the system. So if something is defed in a file (evaluated) it will be defed in the repl window session as well.

gerred15:06:15

is this true for something inside (comment ...)?

gerred15:06:24

where I late evaluate it only when I'm using it

pez15:06:34

But dynamic variables, like *ns*, *1, and your own such variables, are session specific.

gerred15:06:36

and is it true for something I've now written post-startup, and evaluated after evaluating the files.

john15:06:40

Okay reading the backlog, I can see that I went said something the opposite of which is true lol

pez15:06:37

What is true for something inside a comment, @gerred?

gerred15:06:00

I think I'm confused about "same idea about the system" between different nrepl sessions.

gerred15:06:10

I guess these aren't separate JVMs running for two separate instances of my application

pez15:06:26

The repls are connected to the same application.

gerred15:06:46

so calva isn't forking off two totally separate jvms.

gerred15:06:54

NEXT QUESTION 😄

pez15:06:02

No, sessions are pretty lightweight things.

gerred15:06:43

let's say I want that behavior, I'm working on two totally separate applications that I want that disconnect between, but they're related (let's say I'm working on two microservices in this contrived example, and I want to write code on both at once)

gerred15:06:11

and let's say I'm using a monorepo in my contrived example. I'm not, and I'm not doing microservices right now, just to be clear.

gerred15:06:08

is there a way I can get two separate full on applications running, each with their own set of repls, from the same "project", because I've for some reason set this up as a monorepo? or is my constraint now that I open up two different vscode instances, each in the root directory for that particular service, and screw the monorepo

gerred15:06:28

(with the exception question of dealing with shared code between two services in said monorepo)

gerred15:06:44

i'm not doing any of this, I'm just curious. 🙂

gerred15:06:27

(if the answer is: why are you doing that, you can totally just run your individual services separately from one repl by running the serve function on each, that's a perfectly good answer too)

john15:06:07

I haven't seen that done with clj repls over microservices per say

gerred15:06:35

^ my scars are definitely driven by the Go + monorepo culture I've been in a bit lately doing kubernetes development, where this is pretty common

john15:06:08

But, the way stuff like figwheel works, if you set it up right, you can have many browser tabs (or clients anywhere in the world) connect to the repl and you can switch between connected execution environments with the repl special focus macro

gerred15:06:27

oh, that's interesting.

gerred15:06:53

and really cool. so I could have a couple tabs open, playing with different options, and selecting the sessions I want to focus on for whatever I'm trying

john15:06:59

so, it's entirely feasible to be operating over multiple evaluation contexts

gerred15:06:01

like live A/B testing. i definitely want to follow up on that.

john15:06:21

You can also set it so that repl commands broadcast to all connected evaluation envs, IIRC

pez15:06:33

I would open that in two separate vscode windows, each with separate project roots.

gerred15:06:52

sorry, this probably has expanded beyond a #calva-dev scoped conversation. super helpful though.

pez15:06:24

It is certainly within calva-dev scope 😃

gerred15:06:29

ha that could be really interesting with vscode live share though.

gerred15:06:31

like really interesting.

gerred15:06:59

you and I are working on our site, we each have figwheel sessions going to the running app, but each trying out things only scoped to our own local tabs since we're using live share's server share

gerred15:06:11

and then at some point eval all the forms to broadcast when we're happy

pez15:06:16

Calva doesn’t really support monorepos yet.

gerred15:06:17

oh, how does calva work with vscode live share? am I using the host's nrepl sessions when I evaluate a form, or is it running on a local session/app?

john15:06:27

so somebody just mentioned this in another channel: https://github.com/GoogleChromeLabs/jsvu It'd be really interesting to have multiple cljs repls up - like shadow repls - where repl commands are broadcast to each vm type, with feedback on deviations in engines, while you're repling

pez15:06:16

it works with live share, but people do not see each other’s evaluations and stuff. That is on the todo to implement.

gerred15:06:36

i'm going to carve out some time to contribute for sure once I get fully comfortable with the edges of it today

pez15:06:53

I look forward to it!

gerred15:06:01

"i'm only running on chrome right now for anything visual, but this is totally valid and evaluates correctly in spidermonkey, right?" - @john

gerred15:06:02

so if for some reason @pez I have a monorepo the answer is to just open up two different vscode instances and treat them totally separately

gerred15:06:35

this wouldn't work for any shared code between the two things in that monorepo. maybe setting a calva root for each one would be valuable idk. or don't use monorepos and point deps.edn at your filesystem 😉

pez15:06:41

I almost do not know what a monorepo is, so can’t really advice much. But I don’t think different calva project roots would work either, because that’s either a user or a workspace setting…

pez15:06:42

I think monorepo support demands that we get hold of someone with experience with those with clojure.

pez15:06:22

We can also check with the cider people if monorepos are supported there, and how they do it.

pez15:06:07

But it is not highest on my todo list right now. There are so many pressing things to take care of.

gerred15:06:10

right now just trying to figure out the boundaries 🙂

pez15:06:18

Yeah, no worries. Calva is pretty bare bones, so you should soon have figured then out. 😎

john15:06:08

Since the repl is the exploratory mechanism, it'd be nice to get cross-engine coverage during your exploration

john15:06:59

"This returned result to 30% longer to return on chakra"

pez15:06:55

Yeah, if you for some reason have a monorepo, I think you’re option is two different vscode windows/workspaces.

minhnn15:06:46

When I add new dep in deps.edn, Do I need to restart repl or there is a way to auto reloading new dep ?

pez15:06:59

Maybe someone in #tools-deps knows more about that, @minhnhat10bk

bringe16:06:11

Loving the increased wiki docs 🙂

bringe16:06:37

@pez I just re-cloned the repo, ran npm install, ran the Watch CLJS task, and then when I run Watch TS I get an error

bringe16:06:40

> Executing task: npm run watch-ts <


> [email protected] watch-ts C:\Development\calva
> rm -rf ./out/* && rm ./tsconfig.tsbuildinfo && tsc -watch -p ./tsconfig.json

rm: cannot remove './tsconfig.tsbuildinfo': No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-ts: `rm -rf ./out/* && rm ./tsconfig.tsbuildinfo && tsc -watch -p ./tsconfig.json
`

bringe16:06:42

If I remove the && rm ./tsconfig.tsbuildinfo from the build task it runs successfully

bringe16:06:16

Oh I see that it creates that file on first build 🤔

bringe16:06:28

I don't think removing that tsconfig.tsbuildinfo file is necessary, because I notice when I build without removing, it just overwrites it. I think the && rm ./tsconfig.tsbuildinfo needs to be removed to avoid errors on first-time builds.

bringe16:06:41

Ok, was getting a weird issue after doing that and trying to run jack-in in debug mode (it could not find the extension). I reset it back to the current state of master, and now when I run the extension in debug mode and try to run the jack-in task, I get this error notification.

bringe16:06:10

So it seems something could be wrong with jack-in on master

bringe16:06:59

(This is when selecting Leiningen at jack-in)

bringe16:06:52

If I revert back to 337f2d9ce81591fdc83f1bdd20f73c7ac95a0133 (June 11, the one I've been running in debug from), jack-in works fine, so I think something is indeed broken.

pez17:06:53

There is an issue mentioning that endsWith thing. So now we have a clue on that.

pez17:06:27

About removing the tsbuild file. It has to do with the build of the production package. It builds only one file. If the tsbuild cache is kept after that, the computer thinks there is no work needed to be done.

bringe21:06:15

@pez Oh ok. Well, it's going to cause an error for anyone who freshly clones the project and tries to run the Watch TS build task, until they either run it without that part of the task command, or until they create a dummy tsconfig.tsbuildinfo file.

bringe21:06:52

After it runs successfully once it will be fine, but before that some manual intervention will have to happen to make it succeed

pez21:06:12

We'll just add -f.

pez21:06:52

Thanks for testing it. You did two great catches! 🎯

bringe21:06:08

Oh that works! No problem

bringe21:06:32

Glad to help even though I have limited time to try to write/change code.