Live data from Hacker News

I wrote JavaScript to avoid JavaScript

markentier.tech

51–60 of 61 posts

Re: I wrote JavaScript to avoid JavaScript

#51
post #28

Earlier quoted context omitted.

Huh? Can you link such a study? I always found it easier to read justified text. Already the annoyance, that the text is not ending at the same "column" on the screen on the right side of the text is distracting. It also looks like no one really took care and simply dumped a ton of words, when it is left aligned, at least to me.

In print, you have fixed, known in advance width; hyphenation; sophisticated multipass algorithms; manual review of the typesetter. Justification can make sense. On the web, with responsive design, container width is dynamic. Algorithms are less sophisticated. Hyphenation is kinda supported but only for few languages and few websites use it ( https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens ) although Eric Me…

Thank you for the detailed response. Interesting links I will work through over time.

Re: I wrote JavaScript to avoid JavaScript

#52

Wonderful! I am so irritated with JavaScript bloat... completely unnecessary cruft 99% of the time. I built my blog with the goal to have zero js but I had to capitulate for google analytics. The blog is a static website deployed on a CDN and I have no access to access.log - I honestly couldn’t find any analytics solution that won’t require js.

> I had to capitulate for google analytics. Ask yourself how much you actually need analytics. I found I seldom looked at it. I myself replaced Google Analytics with self-hosted Matomo for a while, but then I just dropped it altogether because I simply don’t need it. Now I do have server logs that I can look at, and from time to time I do (and they reveal things like Atom feeds consume the substantial majority of the…

I decided to have no (client side) tracking at all, for both usually it requires JS and cookies. And honestly I don't like to have both on my site if not strictly necessary (as a European citizen I'm also quite aware of all the shenanigans one has to do wrt privacy and consent).

Re: I wrote JavaScript to avoid JavaScript

#53

> The only annoying part is still that the image dimensions are not reserved appropriately, even with present width and height attributes. So the layout can jump around if you scroll past the not yet loaded image. If you have an idea how to deal with that within picture groups, I love to hear about it. See https://www.andyshora.com/css-image-container-padding-hack.h... I used the trick on https://jessicakhope.com's b…

Thank you for the tip/link. Seems to be an appropriate solution, just have to fiddle with my build process for a bit.

Re: I wrote JavaScript to avoid JavaScript

#54
post #41

Earlier quoted context omitted.

Yep, I am writing the posts in HTML. The reason to avoid Markdown (which I love) and other things is to avoid any kind of building tools. I tried to install Gatsby on a Windows machine and I had several errors. I wanted to remove any dependency on external software. I wanted it to be modifiable with just a text editor and nothing else. Regarding the use of is because the tag with the chosen CSS leaves too much space…

You can use Jekyll for a JS-less markdown to static site generator.

Also zola, hugo, and other pretty light weight generators are quite okay. I'm using zola which runs nicely on Win/Mac/Linux. All you need to get started is some theme/template and your blog posts in Markdown. Then enrich it with whatever floats your boat.

Re: I wrote JavaScript to avoid JavaScript

#56

So whenever I see an article about this topic I like to open the Network tab of Developer Tools, disable cache and refresh to see how this work out in practice. This page loaded in just under a second, and had 1.30MB of data in total. Pretty good! However , when looking at where all the data is there seems to be something fishy going on. Basically, for some reason it loaded both a .webp and .webm file for the sticky…

I think I should just remove the poster, it was initially replacing the GIF, which was megabytes in size. Given that the sizes of the WebP and WebM animations are pretty close I can live without it; all major browsers support both formats anyway.

I cannot help with the caching fun here, quick tested in both Chrome and Firefox. There's probably something strange in the video tag, either by design or by implementation.

Re: I wrote JavaScript to avoid JavaScript

#57

On OSX Chrome, this page is always horizontally scrollable because the navbar is wider than the rest of the content by a margin of the vertical scrollbar's width. You can set max-width: 100% on the navbar to fix this.

That's interesting. I'll have Mac access only next month. The setting `max-width: 100%` actually breaks the design completely, chopping it down to a half.

I have to try this solution[1] to see if that helps to avoid the scrolling.

[1] https://stackoverflow.com/a/56382662/653173

Re: I wrote JavaScript to avoid JavaScript

#58
post #28

Earlier quoted context omitted.

In print, you have fixed, known in advance width; hyphenation; sophisticated multipass algorithms; manual review of the typesetter. Justification can make sense. On the web, with responsive design, container width is dynamic. Algorithms are less sophisticated. Hyphenation is kinda supported but only for few languages and few websites use it ( https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens ) although Eric Me…

I think the lacking hyphenation is the main problem for web content, since it creates large empty spaces in conjunction with justified text. But having hyphenation would mean that browsers would need to have an extended dictionary for all languages. For reading I actually prefer it when done right, but that is subjective, I never stopped the time.

Browsers already maintain hyphenation dictionaries (and/or know how to ask host OSes for them), it's just that because hyphenation and justification are two different knobs in CSS a lot of sites turn on one without the other.

Browsers also support some of the same tricks that designer tools support to encourage/support hyphenation such as supporting soft hyphens (https://en.wikipedia.org/wiki/Soft_hyphen). But those tools are something that require training and/or forethought and not something that average web content would likely include.

Re: I wrote JavaScript to avoid JavaScript

#59

Earlier quoted context omitted.

Next has two different ways to deploy: 1. Next renders the React page server-side and sends it as html/css. Once everything is done loading on the client, it becomes a regular React page. Requires a server. 2. Next pre-renders your whole website with data fetched at build time, like Hugo or Jekyll. Drop it on a CDN and you're golden.

Is it able to somehow transform dynamic loading of content into expected clicking of links, upon which the server delivers another static HTML + CSS page? Or is this "prerendering" limited to already static parts of the website? It would be great to have a web framework, which automatically transforms everything into links, which, when clicked, cause the server to deliver an updated HTML + CSS, which shows the same i…

Something like this? https://github.com/turbolinks/turbolinks

Re: I wrote JavaScript to avoid JavaScript

#60
post #59

Earlier quoted context omitted.

Is it able to somehow transform dynamic loading of content into expected clicking of links, upon which the server delivers another static HTML + CSS page? Or is this "prerendering" limited to already static parts of the website? It would be great to have a web framework, which automatically transforms everything into links, which, when clicked, cause the server to deliver an updated HTML + CSS, which shows the same i…

Something like this? https://github.com/turbolinks/turbolinks

Hmmm more like: "I actually have a JS framework website, which would use AJAX to load parts of the page to update pages and not reload the whole page, _however_, if you have JS deactivated or blocked, I will automatically work using normal links, which then work as if someone had taken the effort of writing all the code for making the dynamic portion of the page work by just using links and full page reloads." -- So kinda like magic.

But what you linked to is interesting nevertheless. :)

Post reply on HN