zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
105 stars 30 forks source link

Home page content doesn't load if client-side JS fails #6344

Open eatyourgreens opened 15 hours ago

eatyourgreens commented 15 hours ago

Package

Describe the bug

If client-side JS fails, the new home page is a loading spinner, which runs forever.

The new About pages, which are rendered on the server, do show static content.

https://github.com/user-attachments/assets/0ac8a293-f020-48c3-b7a1-5b24917d2b9e

To Reproduce

Either disable JS, or block one of the home page bundles from loading, then visit the home page.

Alternatively, use dev tools to throttle your connection to a very slow speed.

Expected behavior

Static content, like the list of blog posts, should at least load, even if JS is required to log in and fetch recent projects, classifications, etc.

Additional context

Client-side JS will fail for ~1% of any site's visitors. I think I had a slide about this in one of my old Zoominar presentations. It's best practice to show some static HTML & CSS content, even when JS is disabled.

eatyourgreens commented 10 hours ago

Projects show static HTML and CSS if JS fails, though you do lose the ability to log in or classify.

https://github.com/user-attachments/assets/4ceff0ed-8c13-4139-b50c-fad8e1ff9d88