HTML, CSS, and ES6. Frameworks and other abstractions and magic I will avoid. Sprinkle jquery and other libraries as I go.
and use something like skeleton or maybe blaze instead of bootstrap.
Totally agree with you. I just finished a rather large SPA with complex data interaction (60+ models interconnected with a variety of relations), extensive use of websocketsâŠetc.
The backend is a json api server powered with elixir/pĄoenix (fell in love one year ago ).
The frontend is Ember.
Just for fun, Iâm currently playing with Vue.js, React/Redux, Phoenix/Unpoly⊠to see how I would recreate a similar app with those libraries/framework.
At first sight, what Iâm missing the most is Ember Data.
For instance, Ember natively âspeaksâ json api (handling includes, many to many relations, meta âŠ). When I modeled the application, I just had to declare the models and their relations, lightly customize the serializer and adapter to fit the Phoenix server, and voilĂ , I could CRUD the resources.
From what I read in other frameworkâs documentation (except Angular), it seems that I would need to spend a lot of coding time to achieve the same level of functionality as Ember Data.
Js-data.io tends to fill this gap but it does not feel as mature yet.
Actually, iâm using Js_of_OCaml. Because I like OCaml (and the binding will be easy, for example : broadcastchannel in Jsoo.
I like Elm and PureScript, and I will try ReasonML + BuckleScript
JSOO is pretty awesome! Itâs a compiler back-end plugin like bucklescript but targeted at the output of the processing chain, at that point all type information is lost and it is working on raw memory, that is why its output looks very machine-codeây, because it is. ^.^
It is pretty fast though even then.
If youâve not tried Bucklescript yet, you should, it hooks into the compiler just before the type information is lost so it can create very natural and fast javascript. I would recommend JSOO over Bucklescript if you work a lot more with OPAM though, although Bucklescript can work with OPAM libraries it is much more natural with NPM libraries (and there is a way to bring OPAM packages to NPM). Or if you work with PPXâs a lot, usually easier to stay with JSOO too.
The output of Bucklescript is just so fantastic though, and getting better (more natural, readable, faster) with every new version.
I use Ember/Java at work. I have tried Angular/PhoenixFramework for a side project and couldnât be more happy. Angular has a very low learning curve compared to that of Ember (unless you are a Rails dev). For me Angular seems pretty straightforward than Ember.
As hefty as the latest versions of Angular still are, Iâm impressed at just how fast it is now! Angular 1 was so so very slow, but the latest Angular 2âs are very impressive.
Agree. Elm is really, really nice program to in. Like, ultra amazing. If you code compiles, it works!
Itâs hard to really wrap your head around how cool Elm is until you completely refactor an entire project, spend 15 minutes getting rid of compiler errorsâand then it just works. Perfectly. Forever. Yay!
You would be loath to tackle the level of refactoring in other languages that youâd regularly do in Elm, for fear youâd break it permanently. And if you did, it would be a âPROJECTâ with a timeline, not an afternoonâs work.
Here is a simple example of using Elm with JS interop:
And yes, Daily Drip is a great way to learn Elm and Elixir.
Vue.js is nice in that you can just drop in existing HTML and wrap your code around it, similar to .html.eex files. They are called âsingle file componentsâ, and have html, js, and css in a single file.
https://vue-loader.vuejs.org/en/start/spec.html
If youâre looking at Vue.js, start with the CLI:
But it is pure javascript., and a lot can go wrong. I found that once you started adding a bunch of components and passing data around, things got quite hairy. Itâs all about managing state, no?
Speaking of which, Vue.js state management is based on Elm/TEA:
Backend if possible, Ember.js if there is a real, measurable profit or a necessity for the project to succeed. And it happens like almost never: someone from the Ember core team - Yehuda Katz or Tom Dale said that Ember shines within the apps that are a kind of âdesktop appsâ - ERP, CRM, workflow systems, i.e. those in which user spends most of his working time and I do agree with that. Otherwise, framework maintenance cost might be just too high.
I really love doing as much as possible on the backend, especially with Elixir because of JS is a leaky language with mostly predictable behaviors across browsers. Ember solves that to great extent, but once we left a prototype until we have more resources for the app and we couldnât upgrade it to the current Ember version one year after. That cost us around 300 man/hours and after that, I liberate myself from the seeing SPA as a âmodern way to do web appsâ.
There is an interest in mastering new technologies and there is an interest in doing products and I prefer the later.
Regarding Vue, I will never touch it because of two-way bindings and Elm application, IMO, is narrowed to the DOM manipulation. It was created to solve that problem and falls short everywhere outside that area so far and will do it for the next 5 years.
In the Phoenix case, page-specific JS views together with ES6 inheritance capabilities proved itself as a viable and sane solution.
Update: and also Iâm looking forward to trying TypeScript on the next project.
Uhh, just wait until you get to bigger projects. Donât forget it runs on Javascript and javascript is weird, so you can do things like randomly get NaNâs in your integers and things like event handlers in the DOM break in subtle ways in Elm unless you know just how the DOM works. In addition it has a lot of typing-system bugs because it is trying to fake a limited set of typeclasses without being full typeclasses, which let you suddenly start changing types among a huge host of other basic compiler issues in addition to a host of language issues (plus slow compilation). Iâd really say take a look at Bucklescript/ReasonML, at least that way youâd only be fighting the DOM and not a young language (since OCaml is very well proven at this point).
You can use Vue.js from Bucklescript/ReasonML, or you can use Elmâs TEA style with the bucklescript-tea library, or you can use React, or etc⊠etcâŠ
Letâs face it, everything has subtle bugs. With Elmâs are flagged, fixed and well known, whereas with React / Vue theyâre usually brought by lack of programmer discipline or knowledge of FP in the case of older, more general purpose FP languages.
The best thing is, if once get up to speed with Elm you can hop to other ML/FP languages : )
You can use Vue.js from Bucklescript/ReasonML, or you can use Elmâs TEA style with the bucklescript-tea library, or you can use React, or etc⊠etcâŠ
Iâm interested to know how (i.e., using Vue.js from Bucklescript).
Brunch. It breaks module imports inside my single file Vue components. Itâs webpack now for me.
Drab. The new live controller module seems amazing. Still havenât tested it properly.
Vuejs if you havenât already. It worke great with phoenix channels, especially for displaying, filtering and and editing lists of components.
OCaml has a full FFI system via external
. It is similar to typescript (in fact typescript modeled itâs a bit on how OCamlâs works) where you define âtypesâ for external calls, then you can call them as normal. That is how I, for example, wrapped the DOM in my bucklescript-tea library. Also a side bonus, Bucklescript can generate typescript type files for you.
Iâve tried React, and I think that itâs pretty good. The things that I like about it are as follows:
- The support for it is unmatched.
- Itâs very easy to drop React into an existing project and gradually migrate an interface to React.
- It works quite well with existing, plain JavaScript functionality.
- Itâs fast to get things going and really doesnât require much boilerplate.
However, I feel that React has the following drawbacks:
- I you donât have your entire interface written in React, the framework is going to give you some pushback. I feel that anything that isnât a single-page interface app is going to give you some trouble in React when you try to hop in and out of React and regular GET requests and try to transfer data around.
- Propagating data and up and down the hierarchy can get confusing and complicated very quickly.
- Bindings are annoying
Iâm now starting to try/learn Elm (so keep in mind I am a newbie at Elm), but Elm seems like it is less friendly to dropping it in an existing project with its own server, and all of that. So far, Elm has given me the impression as an entirely separate environment for building the interface of your application as a separate app, which I donât like very much. I will continue on with Elm and see how it goes. The major drive for me is that much of the Phoenix community seems like favor Elm so there are a lot of resources there. Iâm also interested in Vue but havenât tried it yet.
Bucklescript/ReasonML is being devâd by the same people that invented React.
I helped that drive along by pushing out a lot of examples and how it works and how to integrate it into the phoenix build system, but language and community issues around it pushed me away, like you mentioned I you don't have your entire interface written in React, the framework is going to give you some pushback. I feel that anything that isn't a single-page interface app is going to give you some trouble in React when you try to hop in and out of React and regular GET requests and try to transfer data around.
and Bindings are annoying
, but Elm makes that much much worse. In Bucklescript/ReasonML you can at least break out of it if necessary to make direct calls (though for sanity it is good to minimize those regardless).
Vue.js is a pretty cool library though, you should give it a whirl even if you do not use it.
Remarkable remark.
Oh! I did not mean it how it looks (I should have re-read it, but overall Iâm noisy about the things I find useful, why do you think Iâm so noisy around Elixir ^.^), I mean that I started posting up a lot of examples of code and how it works and how to integrate it with phoenix and all such (pre-bucklescript even existing)! It is a good language, just still very young and buggy, but the style is sound (hence why I duplicated it in bucklescript-tea).
I clarified it a touch. ^.^;
I actually really like this approach. Ember always just feels so âbigâ when a lot of the time I just need an ajax call.
This is all true, but brunch breaks your vue components, so webpack might be worth it in some cases. I still donât like it, especially because itâs very slow.
Actually the latest webpack2 versions (still in dev and not released) have stated to have made substantial strides in speed, Iâll be keeping an eye out on it soon.
Also I donât use brunch, I just use npm scripts directly since we have to have npm anyway, no point adding more stuff on top of that of which it can already do. ^.^