Is JavaScript framework necessary for frontend?

Maybe twitter bootstrap then, for a quick test? In general I do not prefer to use large frameworks. Copy paste some things I wrote / copy pasted in the past about it:
“Prefer dedicated libraries to monolithic frameworks. When you choose a framework, you make a large, long term committment. You sign up to learn about the framework’s various inner workings and strange behaviours. You also sign up to a period of ineffectiveness whilst you’re getting to grips with things. If the framework turns out to be the wrong bet, you lose a lot. But if you pick and choose from libraries, you can afford to replace one part of your front end stack
whilst retaining the rest.”
“There will never be a perfect framework so you can just hack the most relevant features together. By using small libraries - components with a dedicated purpose and a small surface area - it becomes possible to pick and mix, to swap parts of our front end stack out if and when they are superceded. New projects can replace only the parts that matter, whilst core functionality whose designs are settled - routing APIs, say - can stay exactly the same between the years.” (http://www.breck-mckye.com/blog/2014/12/the-state-of-javascript-in-2015/)
If you wrap the libs they will be replacable with minimal effort. All in all a lot of work, you have to see for yourself if it could return the investment. I created a dynamic grid this way (see pic). Responsive design, mininimal config of the UI in the .html. I was rewriting the framework (not working at it now) so that it could take all UI definitions (except styling) in a json provided by the server which makes the ui even more flexible / dynamic (adaptable on the fly based on userproperties, f.e. language).

1 Like

You mentioned a “Hacker News”-like fashion portal. I think you’ll be just fine with server-side rendering. Are you familiar with Rails? If so, this is simple and straight forward in Phoenix. Each action maps to an eex template. Like some others have mentioned before, there’s nothing wrong with using just jQuery and introducing a client-side library or framework later. If you go the jQuery route, you can probably omit Brunch, $ mix phoenix.new --no-brunch. Happy hacking :slight_smile:

4 Likes

It sounds like omitting Brunch is good idea in my case. Thanks, @sudostack.

I think what you need is something like instantclick or barbajs

Instaclick takes 5 minutes to get up and running and is very effective if all you want is near instant page transitions.

Barbajs is also very easy to setup but it comes with a lot more options so you will have to spend some more time learning what it can do for you.

2 Likes

Keeping brunch is honestly a better idea. It will compress, minimize, and optimize the little javascript that you may have, as well as doing the same with your CSS and potentially more.

Just be careful with your long term investment in jQuery - it has a dangerous habit of discouraging acquisition of “proper” JavaScript skills (much in the same way many JS frameworks discourage acquisition of “proper” web application (solution) design skills :smirk:).

You Might Not Need jQuery
You Don’t Need jQuery (anymore)
5 Reasons Why You Need To Learn To Use JavaScript Before jQuery | kaidez
So you know jQuery. Now what? | Remy Sharp
jQuery considered harmful | Lea Verou

2 Likes

I don’t buy this. People that hate on jQuery forget that just a few years ago it was the cure to the madness that were different browser standards and APIs. It became a victim of its own success as browsers started to converge[1]. Obviously, you should know a bit of JS before using it (though not too much if you just want a basic site), but it’s definitely worth it and it may save Red a lot of trouble.

jQuery doesn’t discourage proper JS skills any more than Phoenix discourages OTP and Elixir knowledge or Rails does with Ruby knowledge. It’s not jQuery’s fault that people too lazy to learn JS call themselves JS devs when all they know is jQuery :stuck_out_tongue:

That said, your last link is great and there are smaller alternatives like Zepto and fetch (for Ajax) that do the job well. I just don’t like to see jQuery being bullied for the wrong reasons!

[1] Still useful: https://mobile.twitter.com/jeresig/status/590199945174634497

4 Likes

I’m partial to React, but if you’re looking for more of a framework, I suggest Ember. The performance improvements in their somewhat-recent 2.0 release have put it back on the map.

I really like this thread. I’ve learnt a lot from it. Thank you, everyone.

1 Like

Why is there no mention or recommendation of Elm?

3 Likes

Here ya go:

1 Like

If a person is looking to learn a framework to use in commercial projects Elm is not exactly at the top of the list :slight_smile:

Hey. NodeJS developer here.

Not necessary. Especially a website similar to Hacker News. You can just use plain Elixir/Phoenix (server rendered). This will also helps easier indexing by search engine.

In case you want an easy JS framework/library. I suggest React + MobX. I came from Angular, React/Redux, and I feel React + MobX has a nice balance between those two.

As others have suggested. Keep the brunch for now. It’ll come in handy

Care to share some criticism on elm? It’s maybe not ripe enough?

There is little demand for elm work, so if a person is looking to learn 1 framework and be able to make a living programming using it Elm is not an ideal candidate.

At the moment, you could say the same about Elixir as well. We are all generally here because we’re looking forward.

5 Likes

I think you should try Ember when you get to the point where you need more than Phoenix can offer. https://medium.com/peep-stack/building-a-performant-web-app-with-ember-fastboot-and-phoenix-part-1-fa1241654308#.lel3i8ekv

3 Likes

There is fairly strong uptake of Elixir compared to Elm you have places like DockYard and Erlang solutions and Plataformatec and large projects like bet365 and quite a few others using it. A good chunk of Ruby consulting shops is looking into adopting it. You have a very compelling value proposition with Elixir/Phoenix. I am not saying there will not be more production deployments of Elm but again if you need to make a living right now only knowing Elm would be really problematic vs you can actually get a day job doing Elixir.

2 Likes

Thank you, @sheriffderek. This is a good read.

This website (elixir forum) is and Ember app. : )