News for hackers. Stuff that matters.
Re:Microbrowsers Are Everywhere by the_gipsy on Tuesday December 17, 2019 @12:48PM (#21816268)
Anybody knows what to do with an SPA that, without js, only displays "loading..." and doesn't generate any preview on any platform (whatsapp, telegram...)?

This is for a hobby project, so rewriting it to do server side rendering etc. is not an option.

Re:Microbrowsers Are Everywhere by lucideer on Tuesday December 17, 2019 @04:16PM (#21818933)
> This is for a hobby project, so rewriting it to do server side rendering etc. is not an option.

Rewrite it to do server side rendering.

Sorry if this seems facetious, but if you want it to be accessible, it needs to be server-side rendered.

Some crawlers have some (limited) JS-rendering abilities; notably Googlebot; but it's not full. Some crawlers may use a fully-fledged Chrome-headless but latency would make this uncommon.

In general, JS-dependent SPAs have always been a terrible terrible idea for anything public facing that needs to be crawled (they're fine for web applications, not for web pages).

Re:Microbrowsers Are Everywhere by the_gipsy on Wednesday December 18, 2019 @09:02AM (#21824868)
Sorry I didn't mention: it is a web game. Accessibility without JS is not possible.
Re:Microbrowsers Are Everywhere by lucideer on Wednesday December 18, 2019 @11:43AM (#21826655)
In that case, JS-only is fine, but presumably you're talking about serving fallback content (bots/crawlers are unlikely to be playing your game)
Re:Microbrowsers Are Everywhere by the_gipsy on Thursday December 19, 2019 @12:58PM (#21837383)
Yea, I will try some better fillers than just "loading...", and the metatags stuff.

I also might consider serving some other non-game pages statically, like the leaderboard, user profiles, etc.

Re:Microbrowsers Are Everywhere by sgtfrankieboy on Tuesday December 17, 2019 @01:16PM (#21816670)
Well, SSR. Almost all indexing bots (Google, 'Microbrowsers', etc.) will require it or at minimum heavily recommend it.

I doubt you will need to rewrite it if you use React or VueJS (or any other big framework) as they have SSR support.

Re:Microbrowsers Are Everywhere by baddox on Tuesday December 17, 2019 @08:05PM (#21820805)
SSR is definitely the best bet, but because you say that's not an option, I'm assuming you're just hosting static files without a proper server. In that case, a static site generator might be an option.

For React it seems that Gatsby is very popular: https://www.gatsbyjs.org/

Depending on the complexity of your hobby project it might even be feasible to write a simple script that runs node, outputs HTML files for each of your pages, and uploads them to online storage.

You might look into GitHub Pages too, although I'm not familiar with its capabilities: https://pages.github.com/

Re:Microbrowsers Are Everywhere by charliepark on Tuesday December 17, 2019 @04:02PM (#21818805)
Assuming you have some sort of control over the root index.html file, write the appropriate `meta` tags in the header there. This article is old, but has a good, illustrated view of what tags do what. https://medium.com/slack-developer-blog/everything-you-ever-...