What Frontend tech do you use for Multi Page App?

Hello,

I just want to know what technology do you use for multi page app. My project is very simple(mostly CRUD) and react(SPA) is a bit overkill for me. i need to create a Reactive web page/ ex. the page does not reload when submitting new data etc.

I already tried Jquery, i don’t like its syntax. haha :smiley:

Thanks in advance :slight_smile:

1 Like

If your usercount is sufficiently low (I don’t really know how many users you’d have to have for this to be infeasible, it really depends on exactly how interactive the app is going to be) you can always try Drab (ElixirForum thread). It’s in my mind one of the most pleasant ways to build an interactive app, provided your project allows for it. Being that it’s driven by the server it does put more load on it, though, so for apps where there’s a lot happening most of that won’t be offloaded to the client.

From what you’re describing, though, I’d think it’s definitely one of the better choices.

4 Likes

thanks for your suggestion. I’ll take a look at it :slight_smile:

I highly recommend using Vue.JS on the front-end. I have already used it in couple of projects to achieve exactly what you describe. I set it on the front-end and use pure Phoenix JSON API on the back-end. It allows you to make actions (updating) database records without reloading the whole page (just updates the target row, not the whole front-end page/table).

There is some learning curve, but worth it :slight_smile:

2 Likes

Also check out the other threads in this section - there are lots and lots and lots :lol:

Such as:

5 Likes

Thank you :003:

1 Like

You could try elm.
You could see more about it here. http://elm-lang.org/


Dev.

4 Likes

i found this wonderful package react_phoenix it allows to render react components inside phoenix view :smiley:

Drab for single page, unpoly for mult-page. It takes a lot of work to get them working well together though. However Drab could potentially replace unpoly in the future.

2 Likes

Hello sir,
I visited the Drab example page, and the example is very slow to response. Is it because of my slow internet connection?

It could be any number of reasons, but I think the Drab Proof of Concept page is actually hosted on someone’s private Internet connection and it’s highly location dependent. My best guess would be that it’s on a private connection in Poland, being that that’s where Grych’s from. I get good response times to it from Bulgaria, but I assume the routing in terms of latency degrades pretty sharply with distance.

The reason it’s that noticable, I guess, is because you’re effectively running everything from the server, so the client has to send an event to the server, which then responds with whatever needs to happen. That round-trip time makes any kind of higher latency a bit more noticable than just client-side stuff.

3 Likes

Elm. Going to launch production code with it for the first time in a few weeks so I will have a more informed opinion then, but this is easily the most enjoyable front-end framework/language I’ve ever used. I actually enjoy Elm coding more than Elixir (I can’t believe I’m saying that about front-end).

If you can wrap your mind around both Elixir and React, I would strongly recommend Elm. Conceptually it is just like React, but it gives you the added benefits of a functional language. It is also a great way to break into Haskell if you are a developer; you experience the magic of FP without Haskell’s more arcane features.

2 Likes

Thanks sir :slight_smile:

1 Like

I feel/felt exactly as you do about Elm: It’s super fun and really enjoyable, especially for being front-end stuff. The paragraph I quoted, though, is something where I sort of feel bad about Elm. I ended up feeling like I wanted more of Haskell in my front-end work and I ended up looking elsewhere in languages like PureScript, Bucklescript, etc… I briefly tried to work with GHCJS to compile Haskell code into JS as well, but I ended up coming out of it pretty empty handed as I couldn’t actually get the proper type system of, let’s say PureScript, as well as the really streamlined front-end framework stuff in Elm.

There were some developments and promising things like Pux in PureScript when I last checked, but all in all it really does seem like you’re never supposed to have all the good things in one technology. :smiley:

As an on-topic addition here: The most promising things I’ve found, as someone who really doesn’t like front-end work by nature, but wants to work with the things that I like (functional programming, features from the year 2000+, etc.) is ReasonML’s react library or Bucklescript with @OvermindDL1’s TEA (The Elm Architecture) library. It’s either that or ClojureScript with OmNext.

The main issue with most of these choices is that it’s not really something you pick up for a project and then suddenly you’re just up and running. My own experience with Reason didn’t have too much of a long runway but I had previous exposure to a lot of ML style languages and OCaml specifically.

4 Likes

Thanks for the suggestion sir. I am almost new to Elixir Phoenix, and i really want to try Elm. Maybe when i become more comfortable with elixir. Hehe. Everytime i tried it, i dont know if should focus on elm or elixir. Haha.

2 Likes

Another way to get functional with the frontend is to use ReasonML, or Bucklescript. Both output javascript, but use ML syntax. That would fit a React frontend development.

I don’t want to troll ELM, but some people in this forum have a strong opinion about it.

Also, I think javascript targeting is bigger than elm’s.

  • React => web
  • React Native => mobile
  • Electron => desktop

That might also count in the balance.

3 Likes

I tried GHCJS. I dislike it in practice and theory. Haskell has too much power to use directly for development on the front-end; it would be like writing development code in C++.

I have not tried PureScript yet, but it sounds appealing. What are the pros and cons vs Elm? (I agree, Elm’s type system leaves something to be desired.)

1 Like

fwiw, I had a lot more fun learning Elm than Elixir (though I don’t speak for everyone here!). Elixir, however, is incredibly practical now. I’m getting job calls about it and everyone I know who does Rails is migrating over. Can’t say that about Elm.

I think Elm is a better learning experience though, it’s a great intro to ML languages.

2 Likes

I often use React with Phoenix. I don’t even use mentioned above phoenix_react, just output some JSON, using views in a data-whatever attribute, to some element, then have a little bit of JavaScript that detects presence of the element and initializes appropriate React component in it’s place. Works pretty well when say the whole layout is rendered using Phoenix, but only on some pages I have dynamic content.

4 Likes

Friend, did you use it? is it really a great app?