Lemmy: Make Lemmy work without Javascript / Isomorphic / Archivability / SEO previews.

Created on 21 Aug 2019  路  17Comments  路  Source: LemmyNet/lemmy

It should be possible to use Lemmy while having Javascript disabled in the browser.

A checklist of things that need to be done for this.

  • [x] Translations as submodule #1123
  • [x] Add communityjoin, postjoin, etc #1122
  • [x] Remove UI from this codebase
  • [x] Fix nginx location for docs.
  • [x] Fix nginx to use the express server port instead.
  • [x] Set up jest tests.
  • [x] Fix up docs
  • [x] Lots of testing.
enhancement help wanted

Most helpful comment

Dont forget that some people prefer to use the web without Javascript. A lot of sites today makes this impossible, so it would be great if we could set a good example!

All 17 comments

Okay this didn't work for several reasons:

  • The Websocket / RXJS module couldn't hydrate. (Not sure how exactly live data would work in an isomorphic app anyway). This was pretty much the killer. I spose in an isomorphic app thats already in ts / js, you could just rewrite the web service to just do local activity, but the backend for this is in rust. The only other alternative would be to have rust serve up static pages, but again that wouldn't be live-updating and defeat the purpose of this or any front end.
  • Couldn't do things like detect and set browser language for translations.
  • Couldn't do things like window scrolling... pretty much any dynamic activity.
  • The browser routing would require a rewrite.

155

Next.js also works with Inferno (or did, last time I tried it, that might not be true in Next 8 according to this issue), and can work with websockets (open in a componentDidMount).

I've tried and failed twice at this, including using the tutorial from tylermcginnis above. Other than for analytics, there just doesn't seem to be much point: since we upped the DB performance, the page already loads in less than 2 seconds. Basically a LOT of work, on every component just to minimize that initial page load, after which all that work is pointless.

This is really a duplicate of #347 .

Crazy idea: Do you think we can have a fork of the webclient run on the server to pre-render the initial page and just have hooks that the browser can execute which connects it to web sockets?

That is what isomorphic means, and its not easy to implement.

That is what isomorphic means, and its not easy to implement.

As in literally having the same single page web app run on the server? I always imagined that the typical implementation would be (for Lemmy) to render the HTML using Rust through Actix.

You can read about how isomorphic apps work in the links above.

It should be possible to use Lemmy while having Javascript disabled in the browser.

Do I understand correctly that you want the site to be usable with JavaScript disabled? Answers etc.

Perhaps for search engines can be made easier. Look at Discourse with JavaScript disabled or under the User Agent of any search engine.

ya

If Javascript is missing, the script displays the templates: https://github.com/discourse/discourse/tree/master/app/views

This is not for users, but for search engines.

Perhaps it is easier to do this in Rust, if there is no JavaScript, then a different template is shown. This will be more static, but this is normal for search engines. This is not for users.

Do I understand correctly that you want the site to be usable with JavaScript disabled? Answers etc.

In the future, yes, but currently, it will show a little message saying javascript needs to be enabled to view this site.

This is not for users, but for search engines.

Correct, its mainly for search engines, but also important when other sites want to link to lemmy pages, so that they can build link previews, etc.

Dont forget that some people prefer to use the web without Javascript. A lot of sites today makes this impossible, so it would be great if we could set a good example!

I personally don't have time to build a non-interactive / read-only client, but if someone else wants to make one, they could always do so.

I love Lemmy but I don't run JS in my browser for security and privacy reasons.

Could this be integrated and used for stuff like described above?
https://github.com/IronOxidizer/lemmy-lite

We will likely add a route to make lemmy-lite available, once ironoxidizer gets a docker working, and feels its ready. But I don't know if it'd be usable to solve our problem here.

Making lots of progress on this recently. https://github.com/LemmyNet/lemmy-isomorphic-ui

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dessalines picture dessalines  路  6Comments

NicolasCARPi picture NicolasCARPi  路  5Comments

fsondej picture fsondej  路  5Comments

l1ving picture l1ving  路  5Comments

marek-lach picture marek-lach  路  6Comments