Fork me on GitHub
#biff
<
2023-12-18
>
Christopher Causer11:12:30

Hello #biff! Trying to learn this framework. Coming up against some sticky areas for someone like me; a Clojure novice: • The bb dev command seems to just run clojure so, if like me you think "aha! I'll run bb dev --help", you get the help text for clojure, which confused me somewhat at the start. For the record, I was trying to find out how to change the port on which the webserver listened. • On that subject, it seems to have 7888 repl port hard-coded. Can that be made a variable? Many thanks for your time. It looks like a very promising project!

Jacob O'Bryant16:12:48

Hey! I actually might be switching from bb to plain clj altogether--I'm experimenting with this currently. Sounds like this is another indication that would be a good thing to do/try. For the nrepl port, you can edit config.edn. there's an option in the :tasks section that should have a "--port" "7888" but you can edit. That being said, commands that interact with the production app via nrepl (`bb prod-dev`, bb soft-deploy) will still expect it to be on port 7888. I'll make those commands configurable too, perhaps during the switch from bb to clj if that happens.

Christopher Causer13:12:17

Thanks for the quick reply! I must not understand the code enough as I thought 7888 was hard-coded at L#276 at https://github.com/jacobobryant/biff/blob/master/tasks/src/com/biffweb/tasks.clj#L276 Switching to clj I agree would make things a fair bit clearer, although I do really like the fast startup of bb so I'm a bit torn. It seems that many of the tasks just call out clojure anyway so it's not like bb's fast start-up is being used here.

Jacob O'Bryant18:12:27

oh yeah, that's another bit that should be configurable/inferred. Although it doesn't determine which port is actually used, it does give a hint to your editor on which port it should try to connect to.

Jacob O'Bryant18:12:27

I had the same thoughts on bb vs. clj. One factor in favor of clj is that for the commands that don't involve starting up the app, startup time might not even be that slow. e.g. time clj -e nil takes 0.6 seconds on my machine, so the main startup time cost is just from requireing stuff. And the commands that don't involve your app's codebase don't necessarily need to require that much stuff. I could possibly also do this stuff automatically to make requires faster: https://clojure.org/guides/dev_startup_time