this post was submitted on 17 Jul 2023
177 points (99.4% liked)

Lemmy

12572 readers
32 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to [email protected].

founded 4 years ago
MODERATORS
 

For any UI devs:

I've starting working on a lemmy front end called lemmy-ui-leptos using leptos, a Rust UI framework with isomorphic support, and tailwind + daisyUI for the component styling. This could eventually replace the frankenstein's monster that lemmy-ui has become.

Some reasons for doing this:

  • lemmy-ui uses infernojs, which is based on the react model. IMO is largely superseded by signal-based reactivity in use in android jetpack-compose, SolidJS, and most new UI frameworks.
  • I had to hack on isomorphic support / server-side-rendering to infernoJS, and it's very messy. Leptos has isomorphic support out of the box.
  • All the benefits of Rust over javascript.
    • Since leptos is in Rust, we can import the lemmy types directly.
    • I've been waiting for years for a good rust UI framework, and I think we're finally here with leptos or sycamore.
  • lemmy-ui uses bootstrap, which is showing its age and limitations. Tailwind (and daisyUI) seem to be much more future-proof.

I plan on leaving the site design and component styling to other, more skilled UI devs, while I work mostly on the auth, services, params, and overall back-end structure.

  • Please use daisyUI classes tho whenever possible over exhaustive tailwind ones.
  • I'd also like it if the UI could match that of jerboa's (whenever possible), so that a change in one could be represented in the other, and so that things like badge appearance for admins, could be recognizeable across lemmy's front ends.

You don't really need to learn rust to help out with this, as the components look very similar to JSX. Instructions for running it are in the CONTRIBUTING.md . Feel free to contribute!

Right now only the home page, and post pages are working, but ready to be styled.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (2 children)

Good, because I speak Rust, so, if there is an itch to scratch, I will scratch it, even though I'm not a UI guy.

I tried running the UI yesterday standalone and had 'error loading' message or something like that.

btw, mentioning needing '../lemmy' available in path, and needing the wasm target installed (via rustup target install wasm32-unknown-unknown) may help non-rustaceans in particular, if added to the contributing instructions.

Also, the UI was listening on *:1237, not just localhost, so maybe a WARNING regarding that is advisable, together with explaining the purpose behind leptos also listening to port 3001.

[–] [email protected] 2 points 1 year ago (1 children)

@[email protected]

And btw, that's '../lemmy' in the comment above with two dots. I didn't write it wrong. The third dot comes from markdown-it (confirmed using their live demo)!!

[–] [email protected] 1 points 1 year ago (1 children)

How do you access the live demo? I don't see it anywhere in this thread nor on the Github repo.

[–] [email protected] 1 points 1 year ago

their live demo

I meant the markdown-it live demo.

I wrote a separate post about this.

[–] [email protected] 2 points 1 year ago

I updated this now to use the git version of lemmy_api_common. The other stuff will get altered once this comes out of development and gets its own docker image.