52points

Knockout JS

Knockout JS
vs

Knockout JS review: 52 facts and highlights

Knockout JS

Why is Knockout JS better than the average?

  • Minified file size without dependencies
    ?

    43KBvs75.64KB
  • Versions of Internet Explorer supported
    ?

    6vs7.33

Which are the most popular comparisons?

General info

Has a mechanism to filter views based on scope variables (for example when searching) without the need to write much extra code.
Template engines allow for easy and flexible UI building.
Allows the use of functions as properties to compute properties of objects.
JSX is a templating engine that allows the developer to write markup directly in their code, which is then live- or pre-compiled to plain JavaScript. This eliminates the separation between view markup and code and offers speed improvements over string-based templating languages.
Extends HTML
Knockout JS
Some people see this as an advantage as it eliminates the overhead from another template language.
The MIT License is a very permissive license which allows all uses, including business use, without warranty.
Can be used to replace a part of another framework without removing the remaining features.
Allows for nesting view templates into top-level views from within a template.
Has an official or well known boilerplate project which lays out the recommended file structure and allows developers to get started faster.

Plugins

Has a plugin which includes facilities to easily create view animations.
Plugins offer an easy way to extend the functionality or integrate with other services. A high number of plugins may indicate an active community of users. Only official plugins are taken into account.
This shows that the framework has a living ecosystem, large community support and allows for more flexibility and faster development.
Plugin to help validate client input before it gets processed or sent to a server. While this does not replace server-side validation, it can vastly improve the user experience.
Includes utilities to keep models in sync with their server-side representation without the need of writing jQuery boilerplate ajax calls.
Has a plugin to keep models in sync with their server-side representation without the need of writing boilerplate ajax calls.
Supports animation
Knockout JS
Includes facilities to easily create view animations.
Has plugin which offers a simple functionality to synchronize models with the HTML5 LocalStorage.

Libraries & Packages

Does not require or seriously encourage the use of a specific library (like jQuery, Zepto or MooTools) to handle DOM manipulation and can be used with one the developer prefers.
Asynchronous Module Definition libraries allow for easy modular, clean programming. If a framework does not work well with such libraries, it might have some other means to modularize its components and resolve dependencies, like Dependency Injection.
Bower is an easy-to-use, npm-like package manager for frontend apps.
The node package manager can also be used for managing front end scripts.
Includes jQuery Lite
Knockout JS
Uses jQuery Lite elements where DOM manipulation is necessary. This way, developers get jQuery’s comfortable helper functions without having to include the entire library. In many use cases, this eliminates the project’s dependency on jQuery.
Has the popular utility library underscore.js as a dependency. Underscore includes helper functions for list manipulation and functional programming.

Data binding

Models and views can be bound to update each other.
Views can be bound to update automatically when an observable object changes.
This makes for easier data transfer between the app and REST Services or the LocalStorage. It also reduces complexity from getter and setter functions.
Mixins are a programming technique that allows different objects to share common behaviour without the need for object-oriented inheritance.
Can be extend to support models and views updating each other. This adds more filesize but allows for more flexibility.
Models are observed for changes. This is a well known pattern. Can be more performant than dirty-checking in some cases.
Uses Dirty-Checking
Knockout JS
Checks for any changes, and updates the corresponding fields. Can be more performant than observers in some cases.

Performance

Smaller file size means faster load times.
Routing allows interaction with the browser url. This is very important for a good user experience if you are building one-page apps.
Uses Promises
Knockout JS
Has an internal implementation of the Promises/A+ specification. Promises are a popular alternative to callbacks when dealing with server responses.
Supports a template engine that can be pre-rendered on the server. This possibly improves page speed, especially on devices with low computing power.
This greatly improves search engine crawlability. This possibly improves page speed, especially on devices with low computing power.
This improves testability and modularity.
Less dependencies means less extra scripts to include, usually resulting in less development overhead and faster load times.
Model changes do not immediately result in view updates but are queued and dispatched as a group. This can be a lot more performant than instant view updates.
Allows the use of libraries like jQuery Deferred to support promises. Promises are a popular alternative to callbacks when dealing with server responses.

Which are the best MV* frameworks?

Show all
This page is currently only available in English.