Fork me on GitHub
#biff
<
2022-11-23
>
macrobartfast01:11:38

What is the role of the tailwind binary in Biff? I’m familiar with including tailwind as a script, but this may be something a bit different.

Jacob O'Bryant01:11:43

The binary makes it so we don't have to include npm

Jacob O'Bryant01:11:59

If you have other npm dependencies, it's recommended to include tailwind the normal way

Jacob O'Bryant01:11:47

I think it was actually added because DHH asked for it, for rails

Jacob O'Bryant01:11:13

(or maybe that was incidental, either way I remember reading somewhere that DHH wanted it for rails)

macrobartfast01:11:22

I remember rails.

macrobartfast01:11:37

Wow… just googled it. It’s very alive and well.

Jacob O'Bryant01:11:53

yeah, they just made a rails foundation too

macrobartfast01:11:05

To think of all I’ve been through… and I could have just started and stayed with rails.

macrobartfast01:11:34

So… this strays into Basic Web Dev Knowledge Questions… but why is a Tailwind binary type approach better than including a script tag?

macrobartfast01:11:41

More optimization?

macrobartfast01:11:05

Side question: I was including arbitrary hiccup (not rum) copy-pasta HTML with tailwind classes and it wasn’t, I think I recall, rendering correctly until I blindly included Tailwind via a script tag… is that expected?

macrobartfast01:11:26

Tonight is about Understanding Tailwind In Biff, it turns out.

macrobartfast01:11:34

I’ve been using Hiccup at times as opposed to Rum (confession).

Jacob O'Bryant01:11:25

Oh, I see what you were asking earlier. (this is I think what you're referring to: https://tailwindcss.com/docs/installation/play-cdn) Optimization is a big part. There are tons of tailwind classes, so if you use the CDN file, it'll include a bunch of stuff you don't need, making your app slower to load for users. Also, there are certain special classes you can't use, e.g. w-[14px]. (https://v2.tailwindcss.com/docs/just-in-time-mode)

macrobartfast01:11:30

Ah, gotcha. Yeah. That’s what I did… the CDN… then maybe downloaded it and included it by path. Because I didn’t understand what was going on and somehow not everything was getting compiled by the binary, I’m guessing.

Jacob O'Bryant01:11:34

> Side question: I was including arbitrary hiccup (not rum) copy-pasta HTML with tailwind classes and it wasn’t, I think I recall, rendering correctly until I blindly included Tailwind via a script tag… is that expected? Rum vs. hiccup shouldn't have anything to do with how tailwind is included. Maybe there was something else wrong with tailwind that was causing it to not compile your css.

Jacob O'Bryant01:11:00

I actually ran into some issues with the compiler when I started working on eelchat, maybe you were hitting the same thing

macrobartfast01:11:26

No… when I run into problems it’s because of something I’m doing. Let’s get that clear right off.

Jacob O'Bryant01:11:02

it would just keep crashing. super annoying. But I got a different binary (don't remember if I copied it from one of my other projects or if I downloaded it again) and the crashing stopped. 🤷 . I vaguely remember that the version didn't even change. maybe there was some weird corruption or something.

macrobartfast01:11:21

However, I have gotten into the habit of adding an additional arbitrary change to, say home.clj if I’m working in it and saving, to force recompilation. That seems natural as it was the way for so long with various dev situations.

Jacob O'Bryant01:11:50

If you run into problems like that again, I'd delete the bin/tailwindcss file and run bb dev again, which will cause it to re-download. If it still breaks, then I'll believe maybe it's something you're doing wrong 🙂

Jacob O'Bryant01:11:06

> However, I have gotten into the habit of adding an additional arbitrary change to, say home.clj > if I’m working in it and saving, to force recompilation. That seems > natural as it was the way for so long with various dev situations. Yep, I do that too

macrobartfast01:11:22

Ok. I’m normal then. Whew.

Jacob O'Bryant01:11:31

in fact if you just save the file without making changes that can trigger recompilation I think too

macrobartfast01:11:04

Oh, wow… ok. I thought it was hashing all the files to trigger compilation. Ok.

macrobartfast01:11:25

Overall I’ve had almost no issues (css or compilation). Biff’s been a dream compared to other situations.

Jacob O'Bryant02:11:08

I've also cleaned up https://github.com/jacobobryant/eelchat/commits/master and added "view the code for this section" links to the top of each of the tutorial pages

Jacob O'Bryant02:11:44

Planning to publish an announcement post tomorrow morning. Tonight I'll also look into doing something different with the diff things. other than that I'm planning to wipe my hands of this project for now, hoo hoo if there are any bugs you'll have to report them to @macrobartfast

🙌 5
🥶 1
💫 3
Jacob O'Bryant05:11:42

I ended up just cleaning up the diff code blocks a bit, for example:

Jacob O'Bryant05:11:29

I've still got improving them further on my todo list, but tbh it's probably not high enough priority to get done anytime soon. Eventually I might like to overhaul the documentation setup, e.g. switch from markdown to asciidoc. if/when I get around to that I'll probably do code formatting improvements at the same time.

Jacob O'Bryant05:11:06

(I tried out https://markdoc.dev/ briefly as well, but it looked like even minor customizations would require a bunch of janky react stuff... no thanks)

malcolmsparks20:11:16

Came here to say hi and nice article! Was browsing HN and saw it.

malcolmsparks20:11:50

Keen to try out the tutorial over the w/e

Lyn Headley23:11:52

Is there a link to the Hn discussion?

Jacob O'Bryant23:11:50

There weren't any comments, but here's the link: https://news.ycombinator.com/item?id=33721730 (It's on page 2 now)

Jacob O'Bryant22:11:50

> There weren't any comments At the time; now there are a few

Lyn Headley23:11:51

That's a good answer about why not postgres. I had the same question myself. Is that in a faq somewhere? Should be.

👌 1
Jacob O'Bryant03:11:35

not yet. I'll add it to the docs soon.