top | item 29312845

(no title)

ianbutler | 4 years ago

I really wish there were frameworks that developed ways to plug in with your already favorite backend kit instead of solely isometric with Node.

You couldn't pay me to give up Phoenix in Elixir for backend work but it does lock off a healthy amount of the neat things being done to make data loading on the frontend more optimal. Phoenix has LiveView + AlpineJS but I really don't want to give up React which still feels more productive to me.

This looks neat but just like NextJS and Sapper it will not nicely play with my stack.

discuss

order

rokob|4 years ago

You might be interested in inertiajs: https://inertiajs.com/

It only technically is built for Rails and Laravel but reading the “spec” and the code I got it to work pretty quickly with a Rust backend.

It would be nice for more of these frontend niceties to be built around an API contract rather than a particular JS on the server implementation.

nine_k|4 years ago

I'd say that framework are like, mmm, rails. (RoR was a genius and very candid name.) They allow you move fast and safely as long as you move in the direction the creators if the framework had in mind. Their keyword is cohesion, and their drink is kool-aid.

When you need to move in a slightly or severely different direction, you're better of with a set of libraries. They allow you to build a contraption that matches your unique problem space. They require much more time and thought to achieve the first results. Their keyword is composability, and their drink is a cocktail.

At the start, or if you are a contractor, you want something really fast, so a framework is usually inevitable, unless you're overqualified.

Down the road you keep needing to move across the rails, so you slowly switch to using more libraries.

mrkurt|4 years ago

We've done some "fat app servers" that consume GraphQL APIs. You could build a Phoenix + Absinthe app, then consume it from something like Remix.

The real problem is switching languages. I sure get slow when I change from Elixir to JavaScript. There's not a bright line between backend/frontend in a fullstack app, so I've been much happier minimizing how often I have to switch languages.

jkcxn|4 years ago

It’s definitely possible. I have a project that does the same thing with Python and React but you could switch out the backend to anything that outputs html. The cool thing is your front end is just super modular components and your backend does all the heavy lifting, can talk directly to your DB and you don’t have to write a single API. Was thinking of putting something open source together, let me know if that might be of interest

rolisz|4 years ago

Yes, it would be if interest to me. I've been looking for something similar lately. One thing that I found is https://github.com/ChrisKnott/Eel but it's more geared towards making desktop apps

nelsonic|4 years ago

We're in the same boat. Wouldn't give up Phoenix on the backend for anything. We are gradually adopting LiveView with great support for components. Have you tried it?

Agree Remix looks good though!

colinclerk|4 years ago

There's no strong requirement to use Node for your backend...your Remix codebase can fetch() data from anywhere in the `loader` function:

https://remix.run/docs/en/v1/guides/api-routes#api-routes

Grimm1|4 years ago

I get that I can run this as a SPA, but then don't I lose out on the prerendered HTML fetched from the server? That's what I mean by isometric with Node.