ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1K
active users

I saw my JavaScript dos and donts post making the rounds and people have criticisms. I do not want to engage because I am very fragile. YOU WIN.

I volunteer @slightlyoff (?) for you to argue with.

But anyways I added an addendum to address and clarify some criticism:

- this doesn't scale
- what is a dash
- what is the point

I don't mean to throw my CV around but I doubt most folks asking about scaling has had to serve as many users as GitHub had to. But you do you!

muan.co/posts/javascript

Mu-An ChiouJavaScript dos and donts @ Mu-An ChiouDo When the core functionality of a feature cannot function with only HTML. When the core functionality of a feature can benefit from some JavaScript. Start with only HTML, then progressively enhance it, so it can still work without Jav...

@muan @slightlyoff you're right. I've written some pretty big ones, GitHub size or worse (meaning higher traffic).

A lot of that stuff happened because you had to write C++ or at least pretty advanced JVM/C# code to really make it work. If it was Python or Ruby... making the client do it JS made sense.

Now, there's Rust, Go, and all the older ones are better too. I have done all of them. Astro seems close to the approach you're describing here.

@sayrer I think Jekyll is the closest. Not just serving but also in the making (dependency management). I don't need to write Ruby to build a blog with Jekyll but I need to write JavaScript with Astro (to get collections in order to forloop them, for example).

I think gem authors also seem to be more careful with adding dependencies than JS module authors. Perhaps I am biased.

@muan I'd say try the Astro tutorial first, unless you have already done it and really don't like it. Once you get to the routing and rendering of Markdown files, it just kind of works. It would not be the best if you have 100k posts, but I think that is an edge case.

@sayrer yea I didn’t know what Astro is until you just mentioned it, so I went through the tutorial just now before replying. I was surprised ES syntax in front matter was featured over YAML, had to dig deeper to find that YAML is fine until you needed collections. To me Jekyll just works too… do you have a different opinion?

I heard tons of good things about 11ty too but a JS config file put me off, then having to set eleventy.addPassThroughCopy for static assets drove the knife through.

@muan I think Astro is better if you need to make little dynamic parts in the pages (what they call "Islands architecture"). Jekyll and 11ty both seem fine to jam out some web pages, but it seems weird to rebuild everything so much.

@sayrer That is true. This part of Jekyll has annoyed me but not so much. Thanks for the suggestion.

@muan @sayrer 11ty builds are so fast (if you don't lard up the pipeline) that the rebuilding thing isn't a problem in practice.

@konnorrogers @muan @sayrer +1. Lots of folks instinctively add "optimization" passes to re-create small savings from JS-industrial-complex stacks that turn out not to matter if you just stick to modern HTML/CSS.