Using Backbone or similar framework with Silverstripe - backbone.js

I am replicating an existing application in Silverstripe (PHP framework). The application has a lot of jQuery already and while its organised well at the moment it could get out of control as I grow it past its current point.
Having spent most of my development experience in PHP/MySQL, I have little experience in js front-end frameworks and would not likely use a framework to manage data manipulation with the server from the get go. Really I'm just looking for a suitable solution to organise and manage the js in the short term and something I can eventually evolve (with more experience under my belt) to a point I can manage all frontend logic with.
Is backbone the way to go? Any other advice?

I've been using SilverStripe framework with EmberJS and EmberData with great success. Ember connects to SilverStripe with a RESTful API module
But you can very well use any JS framework and mkae your own SS controller of find other SS modules to help http://addons.silverstripe.org/

Related

use reactJS with angularJS

I need to design a huge client side application by following MVC architecture.
As of I know angular is best for developing a SPA by in mvc architecture.
I'm not familiar with ReactJS, when i'm going through ReactJS i came to know that ReactJS is best creating user interfaces and building reusable components.
link https://facebook.github.io/react/docs/why-react.html says React as the V in MVC.
From that my question is:
is it possible to use both angularJS (framework) & reactJS(library) in same SPA.
is it possible to create Views using ReactJS and other part of my application in angularjs (M & C part in MVC).
You are correct, React in itself as a smaller scope than Angular, it is not a so-called "framework" but it's a library used to render views, or components inside a view. You will have to assemble many other libraries around React to get a full SPA application, however the good news is that skilled developers already picked them for you and pulled out very useful boiler plates that should get you started much much faster than if you were to do all the work by yourself.
Take a look at those:
Find your perfect React starter project
react-boilerplate
react-redux-starter-kit
I based my latest app on the 3rd one and I love it, but it's personal ...
Now your questions:
Yes you can use both, take a look at ngReact, let's you run React components in an Angular app. If you start from scratch however and don't have legacy code or libs written in one of the two technologies, my recommendation would be to either use one or the other. This kind of hybrid solution would let you slowly migrate an Angular app to React by rewritting one by one your components without breaking the whole app at once.
That's pretty much what I said in 1/ this can be done but if I were to write the app from scratch I would pick either Angular or React depending on time constraints, existing code base and willingness to learn a new framework. My recommendation: take a few days to experience various boilerplates and pick the one that you feel the most comfortable with...

Angular2 Multi-page Application Consuming Spring Rest Microservices API

Good day Pals, I have no experience of Angular 2, but a bit of Angularjs 1x. Having done my little research.
I found out that for a new project I am better off going for ng2.
Also, that there is better support for TypeScript against JavaScript.
This is more learning curve for me, since I am from a JS background.
In my project we have built multiple spring bootstrap rest microservices and we need to knock out UI as speedily as possible using Angularjs2, HTML5, CSS3/Bootstrap.
I am looking for a good sample application for Angular2 showing features like: multiple page routing/navigation, templates, directives and components to implement calling our existing rest endpoints/API. Typical CRUD application references will be appreciated etc
It will be good to to see a rich client application partitioned/architectured with best practice in mind.
I have googled and there isn't much out there, I need some expert guidance please. References to code/bloggs/github etc
Thanks in advance.

Convert Silverlight APP to HTML5 SPA – tools and technologies

My team is working on a strategy to convert our cloud based Silverlight app to HTML5 app. Although we have been working on formulating a strategy to find best possible set of tools, technologies, and methodologies to convert our App to HTML, I am asking this question here to get some feedback from the large community at SO and to learn from experiences of the people who may have done similar things in recent past.
My question has a few parts.
Our app is written in Silverlight and uses WCF RIA services. Most importantly, we rely a lot on MVVM and we wish not to rewrite that logic again hence to reuse as much code as possible. What would be, in your opinion, the best possible combination of tools and technologies for us to use?
In order to make SPA, we would like to use some of the “cool” new frameworks out there but we really want to minimize our work (due to hard deadlines) and be able to thoroughly test our app easily and quickly (hence the code reuse). Is SPA even a good option or should we go for traditional MVC app? Keeping in mind that there are more than 200+ views in our app.
If we chose to go the SPA route, which framework is best suited in terms of life span. We have to move away from Silverlight because it is going to die soon. We don't want to be in the same situation again in near future.
Moving an existing Silverlight app to and HTML5 web app is the perfect project for AngularJS. Angular has it's own similar MV* design pattern, but you will not be "reusing" code from your existing silverlight apps. The main ideas and abstractions may be similar, but just the nature of how html and js work together, and especially how they work in angular, you have to do it the angular way.
Also, Angular is somewhat of an engineering approach to web development. It is not a learn-it-in-a-weekend piece of cake framework to master. There's a lot that goes into it. There's noob ways to do things in Angular, somewhat noob-ish ways to do the same things, and then the so-called "right" way of doing it so you may find yourself learning some ways of doing things only to have them replaced with "better ways".
If you want to "minimize your work" then Angular might not be the best choice, but if you want your HTML5 app to be really awesome then any framework you with will require some studying in addition to getting used to the inherent quirks of Javascript.
Angular 2 is hot and just launched a Beta release, but I'm still happily using AngularJS 1.4 for all production apps.

Front end material design stack with angular.js

I am trying to get better at coding and am trying to figure out exactly what front end stack I need. I have red a lot and about a lot of tools but it is too much and I don't know which ones work good together or not.
Currently my idea is to do a web app with the design principles of Material Design from google and use angular for the logic of the front end.
I have red about and used these tools: Angular.js, Material Design Lite, Angular-material, polymer, ionic, bootstrap, Materialize and other various material design frameworks.
I am playing with this demo that I wanted to try out Material Design Lite but went too further and ended up needing Polymer for some input drop-down components. Playing further more with MDL I found out that it is not sufficient as bootstrap as I am used to work and would like to have this in it, but don't get me wrong I like MDL.
ionic has some good features for the local server and easy set up of template app as well other nice things like export to ios,android app, push notifications, but I ended up deleting ionic.css cause it was interfering with MDL and Polymer
I am asking some more experienced web app developers to help me out with this stack dilemma. I would like to get this out of my mind so I can be free and develop more.
Also tools like GRUNT, BOWER and so on? which one is the best in my case?
note: if u got interested the back end would be cakePhP and Mysql and the data type is going to be JSON (angular will send json to php into DB).
It can be overwhelming trying to learn all the tools and using them at the same time. My advice is to just use the tools when you need to.
If your web app is simple you may not even need a framework like angular. If you want to play with material design, you can do that with the css classes that MD lite offers no matter if you use angular / polymer / or plain javascript. ( If you want to use Polymer you already have some material design styles included. )
Some people prefer starting with the most simple solution and keep adding more sophisticated tools gradually. Others prefer starting with a more complex solution that has integrated the best practices, and in that case using a "Starter kit" may be useful.
Regarding Grunt/gulp... etc. You could worry about that later when you need to have a "build system" to do tasks like compressing files, optimising images and other things that are important for publishing.
After years doing frontend development i realised that is not possible to master all the tools available ( and having a life outside code ). You eventually settle for some tools (everybody have different preferences) and the important experience comes with solving real problems.
i would recommend you to use angular-material for your project if :
you have good knowledge of angularjs or if you find it interesting to learn
you have gone through google design and you want to implement it in angularjs way
try implementing missing features or take online help
Angular-material team is working on adding more and more features as already build in directives and services. Check releases on github page & demo guide
( Drop downs are already there in latest version as menu)
Few points
Google has an awesome open source guide for design.
Angular-material is a framework that helps you implement and follow that design language and principles using angularjs.
Bootstrap is just a framework which gives implementation of css, js related to front end work. Look and feel will be entirely different from google design.
Ionic is again a completely different framework which provides implementation and guide for mobile app development.
You can read about diff in angular-material/bootstrap/ionic in my post here
Bower/Grunt
bower ( package manager) and grunt ( task runner) are tools which work in node environment.
if your development environment is nodejs you should use them to get work done quickly and efficiently.
Check there sites for more information.
cakePhp/mySql
If your backend runs on these and you have angularjs in frontend.
Angularjs can make restfull calls in JSON to your api and it would all work good.

AngularJS with Durandal?

Is it possible to run AngularJS in a Durandal project? We are using Durandal now but want to move to AngularJS while still keep the site operational. Is it even a good idea to attempt this?
Any suggestion would be greatly appreciated.
You could run them side-by-side, but then you would just have two separate SPAs hosted on the same site. The doesn't seem like a good upgrade strategy to me. I think you would be better off to fully develop the new version and then replace the site altogether.
I would also advise that you wait for the release of AngularJS 2.0 (if possible). Rob Eisenberg has announced that he is currently working with the AngularJS team to provide core changes and plugins that will make Angular 2.0 more familiar to developers with Durandal experience, as well as to provide a migration path from Durandal to Angular 2.0.
The other answer isn't exactly correct. I have an example that proves it wrong.
Durandal is a module loader that can load any view / view model pair. If you choose to load an angular application and leave out the router portion it works just fine. It really isn't that difficult to get it set up.
Wrap your Angular.js application initialization code in an AMD module (view model) with a matching view and it just works.

Resources