Fork me on GitHub
#biff
<
2023-02-27
>
macrobartfast06:02:03

Embarrassingly giddy about the authentication plugin. Started talking about it to a total stranger at Walmart at 2:30 am and soon security arrived. However, when I explained it to security they totally understood. Pretty soon the manager showed up and made me go over it all again. Everyone was excited and, weirdly, I ended up with the greeter job.

sheepy 4
🎅 2
4
macrobartfast06:02:05

I’m working on grokking the retrofit of an existing project with the new auth… there’s not too much in that project, so I could just create a new Biff project and bring the app in, or would it be trivial to upgrade the old project?

pavlosmelissinos07:02:38

How old is the project? https://github.com/jacobobryant/biff/releases/tag/v0.7.0 Haven't done the upgrade to 0.7.0 myself (yet) but the instructions have been amazingly helpful so far!

macrobartfast07:02:48

Oh, sweet! There are the upgrade directions. Thank you! I should have spotted that. I have :deps {com.biffweb/biff {:git/url "" :sha "83622612e39e5b0aaa6a496dac9c72947776a870"} There isn’t a :tag in my deps (or I’m not spotting it or not understanding)… but I can play around with it.

macrobartfast07:02:34

It mentions following upgrade directions for previous releases… maybe I should look at those.

macrobartfast07:02:03

I guess we can all deduce I haven’t been upgrading my Biff projects. 😳

pavlosmelissinos07:02:01

Haha How old is that commit? Not that it matters, the upgrades are all quite painless (I went through them once) so I'd go ahead and just do them if I were you

pavlosmelissinos07:02:20

> Dec 17, 2022 Ok that's not awfully old

macrobartfast07:02:18

I’ll do them all, and thank you for this help!

Jacob O'Bryant16:02:19

I've since started adding the tag to the biff dep in new projects so it's easier to see what version you're currently on--but yeah, you can just start at whatever release comes first after Dec 17 :)

m.q.warnock00:02:39

my approach has been to generate a new template with the same names and use meld (my diff tool of choice) to figure out what I have to change

✔️ 2
macrobartfast00:02:03

Right on… thanks for the date to start after @U7YNGKDHA … and I’ll look at meld, for sure… sounds like a great tool for lots of things.

brianwitte00:02:22

+1 on meld if you don’t have one that you like, yet. I used it until I jumped on the emacs train @U0X9N9ZK5

Jacob O'Bryant01:02:51

Note also that with all the releases that include changes to the default project, I separate those changes into their own commits and link to them from the release notes' upgrade instructions. e.g. https://github.com/jacobobryant/biff/commit/6a5ba0a7a0a052d3ee88adaad645dcddf8bc3876 was the commit for the latest release. (Most releases don't have quite so many changes fortunately.)

🤝 2
macrobartfast02:02:59

@U03810HB7QS since I’m a hopeless Emacs addict… what is your approach now?

brianwitte03:02:01

Its using ediff heavily under the hood so its good to look at those docs, too https://www.gnu.org/software/emacs/manual/html_mono/ediff.html magit also uses ediff

macrobartfast03:02:31

I need to get better at reading docs. I’ll practice on these.

✔️ 2
macrobartfast03:02:55

I was dabbling in magit, too… was a bit baffling… I’ll look at those docs too.

brianwitte03:02:00

Take your time and don’t get stuck fiddling with emacs. I have been writing software for awhile and it took me a bit of time to really understand how to use alot of the features that emacs and its ecosystem offer. As long as you are having fun and making progress on your goals, its worth digging into. If it’s frustrating and blocking you, just use something else

macrobartfast03:02:39

Sound advice. Emacs is a bit like NYC… infinite but I only need a few things.

macrobartfast03:02:20

Not to turn this into an Emacs megathread… but have you been live loading deps with anything i.e. pomegranate?

brianwitte03:02:46

No, I have not

brianwitte03:02:06

Feel free to DM

👍 2
ag23:02:56

How do I execute a bb task from repl instead of calling it from the command line? can someone explain the structure of bb.edn? What exactly this line means in it?

{:deps {com.eelchat/tasks {:local/root "tasks"}}
I know, probably this isn't a biff-specific question, and I'm a noob in babashka as well, and this bb.edn is from biff's tutorial

Jacob O'Bryant23:02:50

you could do (clojure.java.shell/sh "bb" "name-of-task"). or use an editor-specific command for launching a shell command (e.g. :!bb name-of-task in vim). bb.edn is a babashka-specific config file; I believe it's discussed in the Tasks section of the babashka book. that :deps line lets you define tasks in a separate folder/project instead of defining them inside the bb.edn file. it has the same format as :deps in deps.edn

ag00:02:24

Ah, that's a bit inconvenient. For some reason, I expected to be able to run bb tasks as easily from the repl as from the command line. When I connect to bb dev instance of a biff app, I can't even require babashka namespaces. Even though presumably they should be transitive and available. Interestingly if I run bb nrepl-server and connect to it, I can see babashka.tasks and even run tasks in the repl, e.g. (tasks/run :hello) But I can't run com.biffweb.tasks/dev task, it is blocking the repl.

Jacob O'Bryant01:02:00

> For some reason, I expected to be able to run bb tasks as easily from the repl as from the command line. Yeah, you can think of bb tasks more like shell scripts that just happen to be written with parens. > When I connect to bb dev instance of a biff app, I can't even require babashka namespaces. Even though presumably they should be transitive and available. The babashka tasks are stored in a separate project from the main Biff library and your application. Babashka namespaces are available to tasks since they're being run with babashka. If you want to call your tasks directly from your main repl, you could add your tasks folder as a dependency by adding {:deps {com.eelchat/tasks {:local/root "tasks"}} to your deps.edn file. You'll also need to add explicit dependencies for any babashka libs that are used by the tasks, e.g. https://github.com/babashka/fs or https://github.com/babashka/process (I'm not sure where the babashka tasks lib is stored; didn't find it from a quick search). That being said--is there a reason that calling bb hello etc as an external command doesn't work? If you just want to have repl access while you develop tasks, running bb nrepl-server would be the way to go.

ag04:02:14

> is there a reason that calling bb hello etc as an external command doesn't work? well, initially, I just wanted to find a way to restart the server. I figured I can just eval (com.biffweb/refresh), but since I started digging, now I want to be able to call any task from the repl :) If I figure out how to tweak com.biffweb.tasks/dev so it doesn't block when called from the repl, that may work.

👍 2
Jacob O'Bryant04:02:35

for the dev task there's a chicken-and-egg problem: that task starts up the jvm process + repl server, so if you already have a repl started, then calling dev would give you a second jvm + repl.

Jacob O'Bryant04:02:14

I'm not sure what would be causing it to hang 🤷

ag04:02:44

yeah, it calls clojure (clj cli), which by default creates repl. I need it to create nrepl instance or something... anyway... it's not hugely important. I didn't mean to waste your mental energy on that. You already helped me.

ag04:02:01

Thank you!

Jacob O'Bryant05:02:39

no worries, and you're welcome!