Remix.run Logo
Alifatisk 14 hours ago

I like the new design, however, I strongly believe the website could've been optimized further and used much less JS. Opening the website with JS turned off makes the code examples not load and the front page freezes as "0%" loading.

What does it do exactly? It just fetches[1] to another part of site and retrieves static text[2] to be displayed. This part could've been kept as part of the html, no need for this artificial loading. It's not a webapp, it's a website.

1. https://www.ruby-lang.org/javascripts/try-ruby-examples.js

2. https://www.ruby-lang.org/en/examples/i_love_ruby

In this day and age, it is possible to have an appealing, responsive, lightweight website with no JS (maybe except for darkmode toggle).

lelandfe 13 hours ago | parent | next [-]

> used much less JS

The homepage loads 9.7kB of JS. Navigating to every single link in the main nav results in no additional JS being loaded.

The site is fine.

spiralganglion 10 hours ago | parent | next [-]

This page doesn't need JS. It doesn't need a loading indicator for said JS. It could just be html and css, otherwise unchanged.

satvikpendem 9 hours ago | parent | next [-]

Sometimes people want things we don't need. It doesn't need Javascript but it allows certain nice to have features, like instantaneous page loads.

Alifatisk 9 hours ago | parent [-]

> it allows certain nice to have features, like instantaneous page loads

Right, but I do not think this is the case here

10 hours ago | parent | prev [-]
[deleted]
self_awareness 5 hours ago | parent | prev [-]

Home pages: Ruby 4.3mb, Python 1.3mb, java.com 2.1mb, raku.org 360kb, typescript 2.1mb

lelandfe 4 hours ago | parent [-]

Yeah but them's highway miles. I have much less care about a site loading images than the stuff that makes the mobile nav work. Images are pretty!

For instance, here's Python's 144kB JS-powered homepage mid-load: https://imgur.com/a/OvYVAMS

And theirs doesn't even have any pretty images! That said, Ruby really ought to give those images a compress.

satvikpendem 11 hours ago | parent | prev | next [-]

I like instantaneous page loads after the initial first page load, which is what the JS does here. Hard to do so without it.

bmacho 9 hours ago | parent | next [-]

I don't think that JS does any preloading. When I open the front page and I click somewhere it loads normally for me, and it downloads the whole page content, after my click (desktop, Firefox).

9 hours ago | parent | prev | next [-]
[deleted]
troupo 10 hours ago | parent | prev [-]

wat

bmacho 13 hours ago | parent | prev [-]

Darkmode toggle can be (and usually is) achieved by CSS.

Alifatisk 9 hours ago | parent [-]

And the state of it persist across page loads or tabs?

bmacho 9 hours ago | parent [-]

No. It might, depending on what your browser does, but it's not in the web standard.

But you can have a button that saves your state when you enable javascript, and doesn't save your state (but still works) when you disable javascript.

edit: I think it is possible to save your state on the second click. So the UX is: you have 3 options with a slide. You click one of them, the page theme changes, and the option icon becomes a padlock. You click on it again, and the option is saved.

It seems to be a limitation that without javascript a single click can't change a switch and do something else--make a request to set a cookie. But you can do changing style on first click, then setting a cookie on the second. Here's a demo (written by Claude) (it doesn't work without server, just the HTML part) https://jsfiddle.net/r134vgo7/3/