9 ms·
Great project! Tangential, but I've been thinking about this a lot lately and have an idea of what I'd like to see attempted next in this area. Like many have
by lucasyvas 4y ago
Great project! Tangential, but I've been thinking about this a lot lately and have an idea of what I'd like to see attempted next in this area.
Like many have said, the JS framework ecosystem (ok, while kind of a meme much of the time) is a total juggernaut.
I wouldn't mind seeing some kind of.. unholy combination of SSR for JS frameworks with a Rust (or even other language) backend if it was feasible.
JS is still a lot more mature and ergonomic for front-end. Rust is kind of a chore for this kind of work currently. It works, but wasn't designed for it and it feels a bit clumsy. On the flip side, Rust is a safe and super fast server language (Go a great choice as well, or others too).
I suppose I'd like to see some kind of framework that makes it easier to pair the two, instead of insisting that a single language isomorphic approach is best.
This might not be practical - I feel like routing might end up being a nightmare. I'm more just saying it seems harder to pair peanut butter with jelly than it should be and someone smarter than me could probably figure it out :). I'm naively guessing that as long as you had a JS interpreter on the server side, it could be made to work (no problem in Rust for either Node or Deno since embedding those is possible).
We've got thing like Next, SvelteKit, and Fresh. We've also got things like LiveView - there may be a further middleground between the two.
- clintonb 4y agoWhat problem are you solving with this “unholy combination”? Typescript gives you the relative safety. If you need faster compilation than tsc, you can use swc.
- POiNTx 4y agoI've been working on LiveSvelte[0] which might answer this in the LiveView example. It integrates LiveView with Svelte and has SSR support by calling Node from within Elixir, I wouldn't call it unholy, it's quite nice :) Routing is fully handled by Phoenix, and you can get quite fast page transitions with Live Navigation Events. It's just that whenever you need complex frontend state you can offload it to Svelte, while still maintaining that backend interopability, in this case with E2E reactivity. What's also really nice is that LiveView and Svelte are both very declarative in the way they handle the 'view' layer. And so they map really well onto eachother. I also wrote a blogpost[1] on the topic. [0]: https://github.com/woutdp/live_svelte https://github.com/woutdp/live_svelte [1]: https://wout.space/notes/live-svelte https://wout.space/notes/live-svelte