marick

marick

Hooking one or more Elm single-page apps into Phoenix

I’m building an app that will be, on the client side, a combination of plain HTML and N single-page apps. It took me some time to figure out what Javascript to inject into the end of my layout such that - on the SPA pages - the appropriate Elm app would be launched into the appropriate <div>.

When I got it all wired together, I wrote a blog post. Hope it’s useful.

Most Liked

peerreynders

peerreynders

Are you intending to blog about this particular design decision?

I personally like the idea of smaller separate applications, each centered around a particular resource or context rather than stuffing everything into one super page application. However when I looked into it I quickly came across opinions like Mixing MPA and SPA: worst of both worlds which seems to be well represented - of course that doesn’t stop others like AngularJS and Multi Page Applications.

For the time being MPA seems be an ambiguous term that unfortunately many use to mean multiple (server-side rendered) page application - even though I think MPW (multi-page website; from The disadvantages of Single Page Applications) seems more appropriate for traditional websites.
(Seems only PWA is missing from this alphabet soup)

marick

marick

This is a temporary decision. I don’t yet have enough experience to make a good decision.

Where Next?

Popular in Discussions Top

gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
praveenperera
How We Replaced React with Phoenix By: Thought Bot
New
ejpcmac
I have discovered Nix last month and I am currently on my way to migrating to it—both on macOS at home and the full NixOS distrubution at...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
griffinbyatt
Sobelow Sobelow is a security-focused static analysis tool for the Phoenix framework. For security researchers, it is a useful tool for g...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
Qqwy
Looking at the stacks that existing large companies have used, WhatsApp internally uses Mnesia to store the messages, while Discord uses ...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement