Post/Code

HomeAboutUsesNow

First Thoughts: Vue and React.

As part of the learning process, I have recently been spending some time looking into Vue.js and React.js. My initial thoughts are:

Vue.js

Vue.js seems to sit somewhere between AngularJs and React in that:

  • Vue uses custom attributes such as v-model and v-for which are akin to Angular ng-model or ng-repeat (ngFor).
  • Vue seems to use props and data, which on the surface seems React-like.
  • It's interesting that Vue uses .vue files which separate out/contain template, script and style in sections in one file. This looks like it would be useful in small applications, but I am not sure how well it will work once apps get larger? (Maybe if components are kept small and data-flow is well managed it won't be an issue.)
  • Vue seems to 'just work' in a way that reminds me of the original AngularJs.

React

React.js looks to be quite different to Angular in several ways:

  • Everything is JavaScript.
  • Webpack/Babel was a bit tricky to setup (I did not use create-react-app). *
  • Very component based.
  • Seems to be just a view layer (whereas AngularJs bundles most of what you need together into one opinionated framework).
  • Redux is interesting...

Overall, it is far too early for me to have much of an opinion either way, but it is interesting to be trying something different for a change!

  • Regarding Webpack/Babel - The part I struggled with in setting up Webpack/Babel was that import would not be recognised. I tried updating to @babel without any luck. Then attempted using plugin-dynamic-import and node-plugin-dynamic import without success. Finally, I updated to Webpack 4 and removed the plugins and it just seemed to work! :)