This may be an old topic but very relevant to me. I'm an old school, full stack developer, from the rooter to the tooter (yes from the country) I've just learned knockout and love it for its data binding and its promise for developing a set of components to dynamically handle complex data structures. These are for my personal projects on which I'm working but at my job, my team leader loves Vue js so I wonder if I'm reluctant to step into the next century of client side programming or is it as I suspect and these new libraries are just not equipped to handle my development needs.
Most popular doesn't mean better
As someone already said, but I see the popularity of React and Angular (although less now than a year ago). Neither of which do I know, but I've been trying to discover the reason for their popularity and if it fits what I want to do. If I use Angular I may as well forget about using .Net MVC except to build an API that my Angular code would consume which isn't a bad idea. But if I want to get my products out as soon as possible should I embark on the learning curve required to build the dynamic tools I need for my projects using Angular and its host of accompanying libraries, converters, server generators and transpilers... not to mention its own library which seem humongous. React and Vue (my boss' favorite) both seem to lack the data binding I need for my complex data structures. I'm going to have to learn Vue for my job and am in the process of doing so, but find myself have to try to find reasons to like it... with knockout it was instant.. I was loved it from the start and continue to, but am afraid that it could be gone, especially considering the fact that object.observable() is being retracted. But its lightweight, highly extendable, and very practical for creating components.
What the hell is so complex about my data?
My data isn't any more special than anyone else's but some of it is used to manage the properties of the websites. There are objects within objects several layers down, some with object arrays and some with enumerators and constant values. With Vue, I'm still trying to discover how to load my data separately from my instantiation of a Vue object and it hasn't worked yet. With knockout, I go back and forth to the server as I need to and can load data when I want and watch the table rows appear, or the tree levels get added and extended and it matches my data. So if I want to update a portion of that data, bound to element via its component, its been very stout at updating the object behind it (as does Vue and I imagine every other library), and I can very easily use methods within that component to update my back end database as I please. My projects aren't about displaying some hot new set of graphics with endless bells and whistles that make it so wonderful, its about number crunching health care membership data, its accompanying EDI transactions all while handling a constant stream of data and its auditing mechanisms going back and forth to update multiple data sources, users and nodes using ajax and duplex communication.
What Started all of this?
I was trying to build a dynamic table using Vue and it will not render because the data is loaded via Ajax after the pag is loaded... With knockout, I set it, then bind it and the table appears... with Vue I'm still trying to figure it out and then in their documentation under the header "Change Detection Caveats" I read this:
"...Due to the limitations of modern JavaScript (and the abandonment of Object.observe
), Vue cannot detect property addition or deletion. Since Vue performs the getter/setter conversion process during instance initialization, a property must be present in the data
object in order for Vue to convert it and make it reactive..."
and my world stop. First, and unless I miss my guess, suggest I cannot dynamically create properties which means I have to define objects inside Vue with data values which explains why my table isn't rendering... but and here's where the world momentarily stopped spinning, said abandonment of "Object.observe". Isn't that on what knockout is based? Is knockout about to die? Then research led me to a page where it said that I should not base any new development on "Object.observe" because it is obsolete. My searches on the condition of knockout has led me here and while I am drawing a cautious sigh of relief, I have to learn if this means knockout must die because the technology on which I always though it was based is about to die.
My Rant!
I just started using knockout js and love it mainly because of its databinding and the ability to extend the bindinghandlers and create components utilizing templates. I don't want to see knockout go because out of all of the other libraries it seems to be the only one that is based on data binding. That's. What. I. Need. I don't need routing... yet.... and when I do, I have .Net for that (however, client side routing with .Net Core 2 based API does sound intriguing... very intriguing). I don't need a virtual DOM (hell I can create that using basic JavaScript object variables!). Unless browsers covert to it, I don't need ES6 although I wish they would convert to it because it's just so powerful. I definitely don't need transpilers, bundlers, application structure generators or Grunt to run my JavaScript tasks as some sort of quasi server. Also don't need to be told how to code my objects or when to code my objects or when to make them available to make it easier for the next programmer to read. I need something that can, out of the box, handle my data or at least provide me the mechanism to do so without hacking through their code. If I gotta hack, its outta wack... I just made that up and I'm sticking with it.
My experience thus far with Vuejs
Now, I'm just learning Vue but even its own documentation says it can't do what I need. Apparantly, I'd have to use coding constructs of ES6, then a transpiler to convert it back to ES5 just to accomplish what that in which knockout specializes. Right now, my table is flowing through its for loop to load and its documentation seems to suggest it won't unless I load the data before I initialize the Vue object... the end result is my table isn't loading after the rendering. It appears to still consider the array object to be as empty as it was when it was initialized (per their instructions). With knockout, I bind it and I'm good. I disappointed to discover that I'll have to add multiple layers of black boxes on to my projects just to create some javaScript. I thought Angular was very nice, but again, there's so much extra stuff to add to the learning curve to get it going. Vue seems to be its kid brother. Its taboo to suggest adding a link to the library, referencing it and keeping it moving. I've got to have an entire new system on which to build the application structure. As a .Net programming I already have a solution that's doing that. Plus, since browsers seem reluctant to step into ES6, I've got to have bundlers and transpilers and grandma's special sauce just to develop my application. and its all overhead to my code. Its like JavaScript, HTML and CSS is being made overly complex to solve a problem that doesn't exist.
Irregardless is still not a word, but... Irregardless
No matter how you slice it, I'm going to have to learn and use Vue because my job requires it and that's cool. I'll use what they want, hell in the end it can only help me. But for my personal projects, as a full stack developer I need to use knockout and I need to know its going to survive this observable retraction. To my knowledge thus far, it gives me the greatest flexibility to create my own library of complex components, to handle complex data structures that I'm discovering libraries like Vue Js, may require tons of extra programming to handle, but again... after all of that I ask, is it still going to be there when I need it or is there some FBI conspiracy to get rid of it... how can it survive without object.observable or... please God let it be so, am I wrong on it being based on it in the first place.
