I saw my JavaScript dos and donts post making the rounds and people have criticisms.
-
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 pointI 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!
JavaScript dos and donts @ Mu-An Chiou安
Do 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...
Mu-An Chiou (muan.co)
-
@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.
-
-
-
@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.
-
@slightlyoff @muan @sayrer this is a very basic example of an Eleventy build, but it builds ~136k HTML pages in a few minutes.
GitHub - eatyourgreens/transcription-explorer: Explore volunteer transcriptions from Zooniverse projects. Built with Eleventy.
Explore volunteer transcriptions from Zooniverse projects. Built with Eleventy. - eatyourgreens/transcription-explorer
GitHub (github.com)
-
@eatyourgreens @muan @sayrer My blog is ~1.5k pages, and it's a few seconds. Minutes is painful!