vnz

vnz

Phoenix integration with Pug (Jade)

Some 2-3 months ago we started a Phoenix 1.4 project. The designer uses Pug https://pugjs.org/ for generating the basic html design, as well as the initial js/css. He uses some own pipeline for generating all this (using gulp), then I get the generated html, split it and use in Elixir templates (eex). This has proven to be a major setback and it’s taking big time on my side to integrate the changes. The generated files are too big, lots of html/svg ****, etc. On top of that, we take the generated js/css and integrate it with the webpack pipeline of Phoenix, with additional changes. We took a Vue.js dev onboard for some of the features that call the Phoenix backend/api. So as you might guess, it’s a big pile of fancy technologies, everyone coming from their background and not seeing the big picture of the project, and at the bottom line it looks like a big pile of ****. On the other side, business ppl have been pressing too much on releasing the product live, even though it’s not finished.
So, the question is: what would you have done differently in such situations? How would you integrate the work of some designer with some weird pipeline who delivers you bunch of html/js/css? How can one (if possible) get out of this pile of ****? I have lost the enthusiasm to work in this project, feel burnt out, and just want to finish and get out.

Most Liked

chrismccord

chrismccord

Creator of Phoenix

It’s not clear what the requirements are, but it sounds like the use of a template language like pugjs was not at all needed. So that would be my first change in retrospect. Writing HTML is never the bottleneck, so I avoid template engines wherever possible. It sounds like the designer should have delivered well constructed HTML/css, but perhaps there are some client-side requirements we are missing.

peerreynders

peerreynders

What about combining Vue.js + Pug, serving it through node and having Phoenix strictly as a JSON backend - i.e. take EEx out of the picture entirely?

It not an unusual approach.

peerreynders

peerreynders

Then the new changes are added to the design, and propagated to me…

To speed this up it may be make sense to get the Designer back for a few sessions if possible so that you can pick his brain about the design rather that having to “deduce the functionalities” yourself.

In either case you may still end up discovering that either EEx or Vue.js has to go (Once Vue.js enters the picture there really isn’t much to do for EEx other than providing a container of the page body - with Vue.js gone you need a way to enable the page dynamics in concert with EEx).

Last Post!

jihantoro

jihantoro

sorry but expug has many error

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

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 54260 488
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
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
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
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 40165 209
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

We're in Beta

About us Mission Statement