Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local-First LiveView + Svelte ToDo App #157

Open
nelsonic opened this issue Jul 16, 2024 · 10 comments
Open

Local-First LiveView + Svelte ToDo App #157

nelsonic opened this issue Jul 16, 2024 · 10 comments

Comments

@nelsonic
Copy link
Member

Saw this on Elixir Forum a while back but forgot to share!
https://elixirforum.com/t/offline-enabled-apps-with-phoenix-liveview-and-livesvelte/61709
https://github.com/tonydangblog/liveview-svelte-pwa
This is super impressive and might be the answer to working offline with LiveView. 💡

@nelsonic
Copy link
Member Author

@nelsonic
Copy link
Member Author

@ndrean
Copy link

ndrean commented Jul 16, 2024

One point: seems like he is rendering...SSR ?! I am not sure I understood....
On the other side, if you render a client code, then you would need to sync via the socket, but... this does not survive navigation. I already tried this, both React and solidJS. If you don't have navigation, then I believe you could have service worker for only, and need some CRDT (or something like this). Yet another thing to dig in

@nelsonic
Copy link
Member Author

@ndrean
Copy link

ndrean commented Jul 21, 2024

A digression. Feel free to ask me to delete this remark as it may pollute your thread. Would you be interested with a writing on SolidJS? I already did something very similar, needs to be polished. Because SolidJS is among the most performant JS frameworks. No virtual DOM like Svelte, only 7kB. You write components with JSX, it is based on signals for reactivity (event listener that returns a function) so components only render only once. It scores very high on the Javascript frameworks benchmark (close to vanilla Javascript). You can do SSR. I believe you can go native mobile with Capacitor-Solid although I have no native mobile experience.
An extract of the scores:
Screenshot 2024-07-21 at 10 24 05

@nelsonic
Copy link
Member Author

With all respect to the very competent people who build SolidJS, they haven’t understood what makes Svelte so simple. It’s HTML with enhancements not JSX.

How often do you add 1000 rows in an App? 🤷
Feels a bit synthetic … 💭

If our only objective is absolute speed we should forget writing JavaScript/TypeScript. 🐌
We should all be compiling Zig to WebAssembly: dwyl/learn-zig#1 (comment) 🏎️

@ndrean
Copy link

ndrean commented Jul 21, 2024

Svelte is so simple. It’s HTML with enhancements not JSX.

LiveView is very JSX inspired, isn't it? And Signals might becomes part of JS, and that's all what Solid uses, nearly. The rest is vanilla, almost :)
In favour of Svelte, it has Svelte-native. Is it performant (enough)?

How often do you add 1000 rows in an App?

😄 yes!... but do you have in mind usage/need for WASM?

@nelsonic
Copy link
Member Author

Zero need for WASM. Just saying that if you're comparing "performance" of SolidJS and Svelte you might as well do what Figma are doing with Rust or Zig to WASM if you need to squeeze out every last drop of perf in the Browser. I don't think many people building Web Apps need that perf. Instead, we need a simple language that is easy for everyone to understand and maintain.

@github-project-automation github-project-automation bot moved this to More ToDo ThanCanEver Be Done in Nelson's List Aug 28, 2024
@ndrean
Copy link

ndrean commented Sep 3, 2024

One point: seems like he is rendering...SSR ?! I am not sure I understood.... On the other side, if you render a client code, then you would need to sync via the socket, but... this does not survive navigation. I already tried this, both React and solidJS. If you don't have navigation, then I believe you could have service worker for only, and need some CRDT (or something like this). Yet another thing to dig in

@ndrean
Copy link

ndrean commented Sep 3, 2024

This perhaps addresses my remark! Probably one day it will appear on YT.

Screenshot 2024-09-03 at 16 04 48

Screenshot 2024-09-03 at 16 29 48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: More ToDo ThanCanEver Be Done
Development

No branches or pull requests

2 participants