TLDR: after/if this is finished, Photon will support no-javascript usage a lot better with authentication and settings respected. It’ll be more suitable as a default interface for Lemmy instances.

Photon currently is a client-side only app, with optional guest SSR. This works great as a web app, but not for SEO. While you can enable SSR for SEO, it is not authenticated and will lead to a flash of content from a guest user instead of your profile–making things clunky for actual users.

this pr aims to do the following:

  • Rewrite app-side data to use a unified userHost object that can be filled with either data from a cookie, or localStorage.
  • this will allow for a hybrid mode, where you can either use server-side user data or client-side user data.
  • userHost data is stored in a JSON state, but can be loaded into reactive classes for the client/rendering.
  • Instead of using global state in the form of profile or settings objects, use Svelte’s getContext and setContext to access this data.
  • Maintain a near-identical user experience for client-side instances, such as at phtn.app.

This will be relatively difficult, as I’ll have to rewrite every instance of those globals being used, and I’ll have to update all API calls to go through the server.

  • Pika@rekabu.ru
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    Take all the time in the world!

    Photon is doing just fine, and it’s a good time to focus on the backbone of the project.