Fork me on GitHub
#figwheel-main
<
2018-10-04
>
cfleming11:10:18

PSA - the Cursive EAP build I pushed yesterday allows using -m figwheel.main in clojure.main REPLs, so it’s easier to get a nice Figwheel REPL going.

bhauman11:10:36

@cfleming does this use clojure cli tools?

bhauman11:10:09

just wondering how folks specify a classpath?

cfleming11:10:09

If you’re using deps, yes. So you can use deps to manage your, um, deps, and run your REPLs via the CLI tools.

bhauman11:10:44

so folks can use alias’s like -A:fig

cfleming11:10:34

They can choose:

cfleming11:10:40

So they can choose either an nREPL REPL or clojure.main, and decide whether they want to run it using the classpath of the IntelliJ project or via lein/deps (depending on how they’re managing their module).

bhauman11:10:02

fantastic, and the can create any number of these

bhauman11:10:27

that’s great

cfleming11:10:41

When Cursive syncs the project to IntelliJ from lein/deps, it adds libraries etc so IntelliJ knows what the classpath should be, but that may happen using different profiles/aliases than they want to use for running, so they can also run via lein/deps to handle that.

cfleming11:10:05

Yes, arbitrary numbers of them, and they can run concurrently and they get docked in tabs.

cfleming11:10:50

My next step is to have a more complex tabbed interface which will allow for a particular REPL having CLJ and CLJS REPLs running concurrently in tabs, and server.log etc in another tab.

cfleming12:10:31

That will allow users to send clj or cljs forms and have them go to the right REPL automatically - I think CIDER does this already.

cfleming12:10:54

I’m not sure how many config options for the various REPLs they expose though - I should look at that.

cfleming12:10:21

If they choose to run nREPL with deps I add the nREPL bundled with Cursive at the end of the classpath, and -i a file which starts the server and pings Cursive with the port.

bhauman12:10:30

there are config options but there isn’t a notion of having many repl configurations for a build

bhauman12:10:52

named REPL configurations is a good thing

cfleming12:10:54

This should support that trivially.

bhauman12:10:10

@cfleming do you provide better language support for clojurescript under nREPL?

bhauman12:10:33

I’m assuming yes

cfleming12:10:42

So for figwheel, users can either use an alias with deps and add the alias there, or they can just enter -m figwheel.main in the “Parameters” box.

cfleming12:10:18

That’s Cursive specific obviously, presumably they may also want to run the REPL on the command line, or if they have heathen co-workers using something else.

cfleming12:10:10

No, I don’t - all the language support is via static analysis and works without the REPL. However nREPL does offer nice things like colourisation and formatting of output forms, which streaming ones don’t.

bhauman12:10:12

you can supply aliases and parameters correct?

cfleming12:10:52

Yes, params from aliases get added first, and then the IntelliJ ones after, so they could add something like a max memory in the IntelliJ box if they just wanted that temporarily or something like that.

bhauman12:10:05

this is good info, I mostly get my cursive information third hand

cfleming12:10:43

I’m actually slowly working on my doc generation system which will make it less like scratching my eyes out, and I’m going to get stricter on documenting all this stuff.

bhauman12:10:45

as trying out all the things takes time

cfleming12:10:58

So hopefully soon there’ll be a page you can point people to.

cfleming12:10:40

Yeah, I’m the same with CLJS info, there’s no way I can keep up on my own.

bhauman12:10:14

Yeah, last year when there was a group of folks declaring defiantly that they never use an editor connected REPL.

bhauman12:10:21

It really woke me up

cddr20:10:20

I remember reading about some gnarly bugs found in the onyx project using generative tests

bhauman12:10:40

This is motivating me to create better docs around that

bhauman12:10:05

it was mostly folks from the JS world

cfleming12:10:23

I must confess that I don’t use a CLJS REPL myself, because the tests were easier to set up

cfleming12:10:35

Which is also motivating for me.

bhauman12:10:57

yeah man I’m a buffer evaluating fool

bhauman12:10:10

can’t live without it

cfleming12:10:12

Once the Cursive CLJS REPL story is better I’ll have things like interactive test integration, which is super nice for clj

cfleming12:10:28

And worth fighting with REPLs for.

cfleming12:10:43

Although there’s less and less fighting required these days.

bhauman12:10:01

yeah, things are getting much much better

bhauman12:10:13

but for the VI hold outs its pretty bad

bhauman17:10:00

@dnolen so how about a :watch-n-webpack [src/js/index.js] option for figwheel.main

bhauman17:10:02

and its behavior wouldn’t actually watch but rather it would check before compile for changes to the bundle file and then run webpack it if there has been a change

bhauman17:10:34

so then you can simply change the index.js file and keep rolling

bhauman17:10:30

ah but then there is the :foreign-libs entries that will change

dnolen17:10:43

figwheel doesn’t really handle build config changes on the fly right?

bhauman17:10:28

well it could in this case using its current :npm>:bundles code

bhauman17:10:35

it would work in this situation

bhauman17:10:44

hmmm I guess you’re thinking about re-reading the build config file at runtime when it changes

bhauman17:10:41

a bit tricky

dnolen17:10:43

since that what needs to happen - index.js changes aren’t enough

dnolen17:10:16

my feeling is changing your index.js is a bit like changing your deps - making this auto-reload seems like a lot of machinery for something that happens less frequently than working on your application

👍 8
bhauman18:10:50

@pesterhazy but you actually have some of this stuff automated, I was trying to bring some of that automation to figwheel, but perhaps this is better done as an on-start operation and not an on build operation

bhauman19:10:07

@shaun-mahood @pesterhazy here is an initial doc on using NPM from ClojureScript via figwheel.main https://figwheel.org/docs/npm.html

bhauman19:10:33

feedback/proofreading on the above doc would be appreciated