<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Javascript on Minko Gechev&#39;s blog</title>
		<link>https://blog.mgechev.com/tags/javascript/</link>
		<description>Recent content in Javascript on Minko Gechev&#39;s blog</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Sat, 11 May 2019 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://blog.mgechev.com/tags/javascript/feed.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Dynamic imports solve all the problems, right?</title>
				<link>https://blog.mgechev.com/2019/05/11/dynamic-imports-javascript/</link>
				<pubDate>Sat, 11 May 2019 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2019/05/11/dynamic-imports-javascript/</guid>
				<description>&lt;p&gt;Since Angular version 8, we support dynamic imports in &lt;code&gt;loadChildren&lt;/code&gt; in the route declaration. In this article, I want to give more information about why dynamic imports could be tricky to handle from tooling perspective and why you should be careful with them.&lt;/p&gt;&#xA;&lt;img src=&#34;https://blog.mgechev.com/images/dynamic-imports/imports.png&#34; style=&#34;display: block; margin: auto; width: 100%;&#34;&gt;&#xA;&lt;p&gt;As engineers, we often have the perception that &lt;code&gt;dynamic == good&lt;/code&gt;. With statically typed languages, such as TypeScript, this has shifted over the years. Because of compile-time checking, more folks started appreciating what tooling can give us if we provide statically analyzable information at build time.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Introducing Guess.js - a toolkit for enabling data-driven user-experiences on the Web</title>
				<link>https://blog.mgechev.com/2018/05/09/introducing-guess-js-data-driven-user-experiences-web/</link>
				<pubDate>Wed, 09 May 2018 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2018/05/09/introducing-guess-js-data-driven-user-experiences-web/</guid>
				<description>&lt;p&gt;About two months ago I published my &lt;a href=&#34;https://blog.mgechev.com/2018/03/18/machine-learning-data-driven-bundling-webpack-javascript-markov-chain-angular-react/&#34;&gt;initial research&lt;/a&gt;&lt;sup&gt;[1]&lt;/sup&gt; on data-driven bundling. A few weeks after that, I had the opportunity to present my work on &lt;a href=&#34;https://2018.render-conf.com/&#34;&gt;RenderConf&lt;/a&gt; in Oxford, UK in my talk &lt;a href=&#34;https://www.youtube.com/watch?v=L5tPWCB7jX0&#34;&gt;&amp;ldquo;Teach Your Bundler Users&amp;rsquo; Habits&amp;rdquo;&lt;/a&gt;&lt;sup&gt;[2]&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The original goal of the article was to show &lt;strong&gt;how data can help in improving the user-perceived page load performance&lt;/strong&gt; by using &lt;a href=&#34;https://en.wikipedia.org/wiki/Predictive_analytics&#34;&gt;predictive analytics&lt;/a&gt;&lt;sup&gt;[3]&lt;/sup&gt;. The artifacts from the article were executable node modules which can be used for predictive pre-fetching &amp;amp; data-driven clustering of JavaScript chunks.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Machine Learning-Driven Bundling. The Future of JavaScript Tooling.</title>
				<link>https://blog.mgechev.com/2018/03/18/machine-learning-data-driven-bundling-webpack-javascript-markov-chain-angular-react/</link>
				<pubDate>Sun, 18 Mar 2018 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2018/03/18/machine-learning-data-driven-bundling-webpack-javascript-markov-chain-angular-react/</guid>
				<description>&lt;p&gt;In this article, I&amp;rsquo;ll introduce the early implementation of a few tools which based on techniques from the machine learning allow us to perform data-driven chunk clustering and pre-fetching for single-page applications. &lt;strong&gt;The purpose is to provide a zero-configuration mechanism which based on data from Google Analytics for the users&amp;rsquo; behavior performs the most optimal build.&lt;/strong&gt; We&amp;rsquo;re also going to introduce a &lt;strong&gt;webpack plugin which works with Angular CLI and Create React App&lt;/strong&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>JavaScript Decorators for Declarative and Readable Code</title>
				<link>https://blog.mgechev.com/2018/01/29/javascript-decorators-aop-autobind-memoization/</link>
				<pubDate>Mon, 29 Jan 2018 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2018/01/29/javascript-decorators-aop-autobind-memoization/</guid>
				<description>&lt;p&gt;Decorators in JavaScript are now in &lt;a href=&#34;https://github.com/tc39/proposals&#34;&gt;stage 2&lt;/a&gt;. They allow us to alter the definition of a class, method, or a property. There are already a few neat libraries which provide decorators and make our life easier by allowing us to write more declarative code with better performance characteristics.&lt;/p&gt;&#xA;&lt;p&gt;In this blog post I&amp;rsquo;ll share a few decorators which I&amp;rsquo;m using on a daily basis. We&amp;rsquo;ll take a look at:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How to write more efficient React components with &lt;code&gt;@autobind&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;How to cache results of computations using &lt;code&gt;@memo&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Improving separation of concerns and cohesion with &lt;code&gt;aspect.js&lt;/code&gt;&amp;rsquo;s &lt;code&gt;@beforeMethod&lt;/code&gt; and &lt;code&gt;@afterMethod&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Developing more decoupled code using Angular&amp;rsquo;s dependency injection with &lt;code&gt;injection-js&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;autobind&#34;&gt;Autobind&lt;/h2&gt;&#xA;&lt;p&gt;Autobind is a decorator which allows given method to be automatically bound to a class instance. For example:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Ahead-of-Time Compilation in Angular</title>
				<link>https://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-precompilation/</link>
				<pubDate>Sun, 14 Aug 2016 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-precompilation/</guid>
				<description>&lt;p&gt;Recently I added Ahead-of-Time (AoT) compilation support to &lt;a href=&#34;https://github.com/mgechev/angular-seed&#34;&gt;angular-seed&lt;/a&gt; and got a lot of questions about the new feature. In order to answer most of them, we will start from the beginning by explaining the following topics:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why we need compilation in Angular?&lt;/li&gt;&#xA;&lt;li&gt;What needs to be compiled?&lt;/li&gt;&#xA;&lt;li&gt;How it gets compiled?&lt;/li&gt;&#xA;&lt;li&gt;When the compilation takes place? Just-in-Time (JiT) vs Ahead-of-Time (AoT).&lt;/li&gt;&#xA;&lt;li&gt;What we get from AoT?&lt;/li&gt;&#xA;&lt;li&gt;How the AoT compilation works?&lt;/li&gt;&#xA;&lt;li&gt;Do we loose anything from using AoT vs JiT?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;why-we-need-compilation-in-angular&#34;&gt;Why we need compilation in Angular?&lt;/h2&gt;&#xA;&lt;p&gt;The short answer of this question is - &lt;strong&gt;We need compilation for achieving higher level of efficiency of our Angular applications.&lt;/strong&gt; By efficiency I mostly mean performance improvements but also energy and sometimes bandwidth consumption.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Using Stripe with Angular (Deprecated)</title>
				<link>https://blog.mgechev.com/2016/07/05/using-stripe-payment-with-angular-2/</link>
				<pubDate>Tue, 05 Jul 2016 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2016/07/05/using-stripe-payment-with-angular-2/</guid>
				<description>&lt;h2 id=&#34;the-content-in-this-post-uses-deprecated-apis&#34;&gt;The content in this post uses deprecated APIs&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong class=&#34;deprecation-notice&#34;&gt;To learn about the latest version of the Stripe APIs check out their &lt;a href=&#34;https://stripe.com/docs&#34;&gt;documentation page&lt;/a&gt;&lt;/strong&gt;.&#xA;&lt;br&gt;&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&lt;style&gt;&#xA;#post-body {&#xA;  color: #bbb;&#xA;}&#xA;&#xA;.deprecation-notice {&#xA;  color: black;&#xA;}&#xA;&lt;/style&gt;&#xA;&lt;p&gt;Stripe offer a set of APIs which allow businesses and individuals to easily accept and manage payments online. In a typical scenario you want your users to pay for a service that you&amp;rsquo;re offering using Stripe as a mediator.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Implementing the Missing &#34;resolve&#34; Feature of the Angular 2 Router</title>
				<link>https://blog.mgechev.com/2016/05/21/angular2-router-implementing-missing-resolve-feature-deprecated-defer/</link>
				<pubDate>Sat, 21 May 2016 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2016/05/21/angular2-router-implementing-missing-resolve-feature-deprecated-defer/</guid>
				<description>&lt;p&gt;For the last a couple of months I&amp;rsquo;m working on an Angular 2 based &lt;a href=&#34;https://developers.google.com/web/progressive-web-apps/&#34;&gt;PWA&lt;/a&gt;. The more complex the application gets, the more I appreciate that our choice was Angular! For routing we&amp;rsquo;re using the initial Angular 2 router that is now deprecated. For sure we will migrate to the newest one once it gets stable but until then we have some problems to solve.&lt;/p&gt;&#xA;&lt;p&gt;One of the features that I miss most in both the new and the newest Angular 2 routes is the &lt;code&gt;resolve&lt;/code&gt; functionality which the AngularJS 1.x router and the ui-router offer. In short, this functionality allows your application to load data on navigation events and render the routing component once the data has been successfully downloaded.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Scalable Single-Page Application Architecture</title>
				<link>https://blog.mgechev.com/2016/04/10/scalable-javascript-single-page-app-angular2-application-architecture/</link>
				<pubDate>Sun, 10 Apr 2016 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2016/04/10/scalable-javascript-single-page-app-angular2-application-architecture/</guid>
				<description>&lt;p&gt;&lt;em&gt;In order to have better understanding of the following blog post you should be familiar with the fundamentals of the &lt;a href=&#34;https://en.wikipedia.org/wiki/Software_design_pattern&#34;&gt;object-oriented&lt;/a&gt; and functional programming. I also strongly encourage you to explore the &lt;a href=&#34;http://redux.js.org/&#34;&gt;redux pattern&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;A couple of months ago I started working on the first version of a Silicon Valley-based startup. The project is a single-page application with quite dynamic business requirements. As in most modern single-page applications we have a fat client which encapsulates decent amount of business logic and state.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Static Code Analysis of Angular 2 and TypeScript Projects</title>
				<link>https://blog.mgechev.com/2016/02/29/static-code-analysis-angular-typescript/</link>
				<pubDate>Mon, 29 Feb 2016 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2016/02/29/static-code-analysis-angular-typescript/</guid>
				<description>&lt;p&gt;So far, most of the blog posts I&amp;rsquo;ve written are tutorials; they explain how we can use given technologies, architectures, algorithm etc. For instance:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.mgechev.com/2015/07/18/flux-in-depth-store-network-communication-services&#34;&gt;Flux in Depth. Store and Network Communication.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.mgechev.com/2016/01/23/angular2-viewchildren-contentchildren-difference-viewproviders&#34;&gt;ViewChildren and ContentChildren in Angular 2&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.mgechev.com/2015/03/09/build-learn-your-own-light-lightweight-angularjs&#34;&gt;Build Your own Simplified AngularJS in 200 Lines of JavaScript&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.mgechev.com/2014/02/08/remote-desktop-vnc-client-with-angularjs-and-yeoman/&#34;&gt;Remote Desktop Client with AngularJS and Yeoman&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;em&gt;The code for the current research could be found &lt;a href=&#34;https://github.com/mgechev/ng2lint/tree/master&#34;&gt;here&lt;/a&gt; and &lt;a href=&#34;https://github.com/mgechev/ng2lint/tree/advanced&#34;&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The current post is about an exciting project I am working on in my spare time. A few days ago I &lt;a href=&#34;https://blog.mgechev.com/2016/02/18/angular2-style-guide-best-practices-lint-tslint&#34;&gt;explained my motivation&lt;/a&gt; behind the &lt;a href=&#34;https://github.com/mgechev/angular2-style-guide&#34;&gt;&amp;ldquo;Community-drive Style Guide&amp;rdquo; for Angular 2&lt;/a&gt; that we&amp;rsquo;re working on. I also mentioned that I am planning to build a configurable static-code analyzer, which makes sure given project follows best practices and contains &amp;ldquo;correct&amp;rdquo; Angular 2 code. I called this project &lt;a href=&#34;https://github.com/mgechev/ng2lint&#34;&gt;&lt;code&gt;ng2lint&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Enforcing Best Practices with Static Code Analysis of Angular 2 Projects</title>
				<link>https://blog.mgechev.com/2016/02/18/angular2-style-guide-best-practices-lint-tslint/</link>
				<pubDate>Thu, 18 Feb 2016 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2016/02/18/angular2-style-guide-best-practices-lint-tslint/</guid>
				<description>&lt;p&gt;About two weeks ago I published the initial draft of a &lt;a href=&#34;https://github.com/mgechev/angular2-style-guide&#34;&gt;Community-driven Angular 2 Style Guide&lt;/a&gt;. It was based on:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Patterns I noticed in the Angular 2 source code while contributing to the framework.&lt;/li&gt;&#xA;&lt;li&gt;Suggestions by Miško Hevery during his technical review of my book &amp;ldquo;&lt;a href=&#34;https://www.packtpub.com/web-development/switching-angular-2&#34;&gt;Switching to Angular 2&lt;/a&gt;&amp;rdquo;.&lt;/li&gt;&#xA;&lt;li&gt;My own development experience with Angular 2.&lt;/li&gt;&#xA;&lt;li&gt;AngularJS 1.x common practices which could be applied to Angular 2 applications keeping the transition process smoother.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://blog.mgechev.com/images/ngsg.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>ViewChildren and ContentChildren in Angular</title>
				<link>https://blog.mgechev.com/2016/01/23/angular2-viewchildren-contentchildren-difference-viewproviders/</link>
				<pubDate>Sat, 23 Jan 2016 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2016/01/23/angular2-viewchildren-contentchildren-difference-viewproviders/</guid>
				<description>&lt;p&gt;In this article I&amp;rsquo;m going to explain the difference between the concepts of &lt;strong&gt;view children&lt;/strong&gt; and &lt;strong&gt;content children&lt;/strong&gt; in Angular. We will take a look at how we can pass access these two different kinds of children from their parent component. Along the content we are also going to mention what the difference between the properties &lt;code&gt;providers&lt;/code&gt; and &lt;code&gt;viewProviders&lt;/code&gt; of the &lt;code&gt;@Component&lt;/code&gt; decorator is.&lt;/p&gt;&#xA;&lt;p&gt;You can find the source code of the current article at my &lt;a href=&#34;https://github.com/mgechev/viewchildren-contentchildren-demo/blob/master/src/client/app/app.ts&#34;&gt;GitHub account&lt;/a&gt;. So lets our journey begin!&lt;/p&gt;</description>
			</item>
			<item>
				<title>Dynamically Configuring the Angular&#39;s Router</title>
				<link>https://blog.mgechev.com/2015/12/30/angular2-router-dynamic-route-config-definition-creation/</link>
				<pubDate>Wed, 30 Dec 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/12/30/angular2-router-dynamic-route-config-definition-creation/</guid>
				<description>&lt;div class=&#34;error-box&#34;&gt;&#xA;  &lt;strong&gt;Warning&lt;/strong&gt;: This version of the Angular 2 router is now deprecated! This means that soon the used below APIs will no longer be available.&#xA;&lt;/div&gt;&#xA;&lt;p&gt;A couple of months ago I wrote &lt;a href=&#34;https://blog.mgechev.com/2015/09/30/lazy-loading-components-routes-services-router-angular-2/&#34;&gt;&amp;ldquo;Lazy Loading of Route Components in Angular 2&amp;rdquo;&lt;/a&gt;, where I explained how we can take advantage of the &lt;code&gt;AsyncRoute&lt;/code&gt;s and the &lt;a href=&#34;https://en.wikipedia.org/wiki/Proxy_pattern&#34;&gt;virtual proxy pattern&lt;/a&gt; in Angular 2.&lt;/p&gt;&#xA;&lt;p&gt;This way we can incrementally load the entire application by only requesting the resources required for the individual views. As result we will decrease the initial load time, which will dramatically improve the user&amp;rsquo;s experience.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Angular 2 Hot Loader</title>
				<link>https://blog.mgechev.com/2015/10/26/angular2-hot-loader-hot-loading-tooling/</link>
				<pubDate>Mon, 26 Oct 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/10/26/angular2-hot-loader-hot-loading-tooling/</guid>
				<description>&lt;p&gt;A couple of months ago I watched a few talks from &lt;a href=&#34;https://www.react-europe.org/&#34;&gt;ReactEurope&lt;/a&gt;. I was truly impressed by a few of them and especially by the one by Dan Abramov on redux and his &lt;a href=&#34;https://github.com/gaearon/react-hot-loader&#34;&gt;hot loader&lt;/a&gt;. The tool he shown helps you do something similar to &lt;a href=&#34;http://livereload.com/&#34;&gt;live-reload&lt;/a&gt; with one big difference. When you change the code of any of the components in your react application, the new version of the component is send to the application itself where all its instances are patched so the changes you did to be visible. This way the new, changed implementation of the component is rendered on the screen with all the attached functionality to it. In contrast to live-reload, your application does not need to be refreshed when you make a change in your code. This way the current state of the application (selected page/view, fields of your models/store) can be preserved across updates. Although this looks amazingly awesome, the idea and the implementation behind the hot loading is quite clear, especially after Dan&amp;rsquo;s talk. We will take a look at the basic idea in the implementation below.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Lazy Loading of Route Components in Angular 2</title>
				<link>https://blog.mgechev.com/2015/09/30/lazy-loading-components-routes-services-router-angular-2/</link>
				<pubDate>Wed, 30 Sep 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/09/30/lazy-loading-components-routes-services-router-angular-2/</guid>
				<description>&lt;div class=&#34;error-box&#34;&gt;&#xA;  &lt;strong&gt;Warning&lt;/strong&gt;: This version of the Angular 2 router is now deprecated! This means that soon the used below APIs will no longer be available.&#xA;&lt;/div&gt;&#xA;&lt;p&gt;For the examples in the content below I&amp;rsquo;ve used the &lt;a href=&#34;https://github.com/mgechev/angular2-seed&#34;&gt;angular2-seed&lt;/a&gt; project. The code for the article could be found at my &lt;a href=&#34;https://github.com/mgechev/lazy-loading-routes-angular2&#34;&gt;GitHub account&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This blog post is mostly about performance and more accurately - lazy loading. Before we get started lets make a quick recap of what problem we&amp;rsquo;re about to solve.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Aspect-Oriented Programming in JavaScript</title>
				<link>https://blog.mgechev.com/2015/07/29/aspect-oriented-programming-javascript-aop-js/</link>
				<pubDate>Wed, 29 Jul 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/07/29/aspect-oriented-programming-javascript-aop-js/</guid>
				<description>&lt;p&gt;&lt;em&gt;Note: The following blog post is based on the library &lt;a href=&#34;(https://github.com/mgechev/aspect.js)&#34;&gt;aspect.js&lt;/a&gt;, which can be &lt;a href=&#34;https://github.com/mgechev/aspect.js&#34;&gt;found here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The object-oriented programming paradigm is powerful. We design an OO system by decomposition of the problem domain, following guiding principles concerning the decomposition and the communication between the different modules. The process is structured; it involves logical thinking, understanding of the domain and eventual predictions for the future evolution of the system. Often we&amp;rsquo;re trying to keep our code DRY (&lt;a href=&#34;https://twitter.com/BonzoESC/status/442003113910603776/photo/1&#34;&gt;not always&lt;/a&gt;), highly coherent and loosely coupled. However, in some cases this is just impossible. There are some code snippets we&amp;rsquo;re just blindly copying and pasting all around our code base.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Flux in Depth. Store and Network Communication.</title>
				<link>https://blog.mgechev.com/2015/07/18/flux-in-depth-store-network-communication-services/</link>
				<pubDate>Sat, 18 Jul 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/07/18/flux-in-depth-store-network-communication-services/</guid>
				<description>&lt;p&gt;This is the second, and probably be the last, blog post of the series &amp;ldquo;Flux in Depth&amp;rdquo;. In &lt;a href=&#34;https://blog.mgechev.com/2015/05/15/flux-in-depth-overview-components/&#34;&gt;the first post&lt;/a&gt; we did a quick overview of flux, took a look at the stateless, pure components, immutable data structures and component communication. This time, we&amp;rsquo;re going to introduce the store and how we can communicate with services through the network via HTTP, WebSocket or WebRTC. Since the flux architecture doesn&amp;rsquo;t define a way of communication with external services, here you can find my way of dealing with network communication. If you have any suggestions or opinions, do not hesitate to leave a comment.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Using JSX with TypeScript</title>
				<link>https://blog.mgechev.com/2015/07/05/using-jsx-react-with-typescript/</link>
				<pubDate>Sun, 05 Jul 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/07/05/using-jsx-react-with-typescript/</guid>
				<description>&lt;p&gt;JavaScript is a weird language although, we love it the way it is. However, I&amp;rsquo;ve had quite a painful experience working on big JavaScript projects. It was painful in the same way it gets painful working on huge Ruby, Python, PHP projects.&lt;/p&gt;&#xA;&lt;p&gt;Once you have code base above 10-15k lines of code and you decide to do some refactoring&amp;hellip;well it gets messy. Although &lt;code&gt;grep&lt;/code&gt; and &lt;code&gt;sed&lt;/code&gt; are powerful tools for text manipulation, when you start replacing code with them, you&amp;rsquo;re missing the semantics (or the context) of the snippets you substitute.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Flux in Depth. Overview and Components.</title>
				<link>https://blog.mgechev.com/2015/05/15/flux-in-depth-overview-components/</link>
				<pubDate>Fri, 15 May 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/05/15/flux-in-depth-overview-components/</guid>
				<description>&lt;p&gt;This is the first blog post of the series &amp;ldquo;Flux in Depth&amp;rdquo;. Is this &amp;ldquo;yet the another flux tutorial&amp;rdquo;? What I have seen so far, while researching flux, were mostly &amp;ldquo;how-to&amp;rdquo; tutorials (usually with todo applications), which describe the main components of given flux application and the data flow between them. This is definitely useful for getting a high-level overview of how everything works but in reality there are plenty of other things, which should be taken under consideration. In this series of posts I will try to wire theory with practice and state &lt;em&gt;my own solutions&lt;/em&gt; of problem I face on daily basis. Since these solutions might not be perfect, I&amp;rsquo;d really appreciate giving your opinion in the comments section below.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Even Faster AngularJS Data Structures</title>
				<link>https://blog.mgechev.com/2015/04/20/fast-angular-data-structures-versionable/</link>
				<pubDate>Mon, 20 Apr 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/04/20/fast-angular-data-structures-versionable/</guid>
				<description>&lt;p&gt;This is the last post of the series &amp;ldquo;Boost the Performance of an AngularJS Application Using Immutable Data&amp;rdquo;. I strongly recommend you to take a look at the previous two parts before continue reading this content. You can find them at:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.mgechev.com/2015/03/02/immutability-in-angularjs-immutablejs/&#34;&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.mgechev.com/2015/04/11/immutability-in-angularjs-immutablejs-part-2/&#34;&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://blog.mgechev.com/images/superman-batman-lego.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Before about a month ago, I decided to experiment using immutable data structures in an AngularJS application. The goal behind my decision was quite simple - optimization of the &lt;code&gt;$digest&lt;/code&gt; loop. How immutability could help? Immutable data cannot change after being created. The execution of each operation, which changes the immutable collection (add, delete, set) will create of a new data structure but will leave the initial data unchanged. This way we know that a watched expression, which evaluation results a collection, have changed if and only if its current reference differs from the previous one. This speeds up the change detection of the expression from &lt;code&gt;O(n)&lt;/code&gt; to &lt;code&gt;O(1)&lt;/code&gt;, i.e. instead of watching collection with &lt;code&gt;$watchCollection(expr, fn)&lt;/code&gt;, we can afford &lt;code&gt;$watch(expr, fn, false)&lt;/code&gt;, instead.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Boost the Performance of an AngularJS Application Using Immutable Data - Part 2</title>
				<link>https://blog.mgechev.com/2015/04/11/immutability-in-angularjs-immutablejs-part-2/</link>
				<pubDate>Sat, 11 Apr 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/04/11/immutability-in-angularjs-immutablejs-part-2/</guid>
				<description>&lt;p&gt;A few weeks ago I posted the article &lt;a href=&#34;https://blog.mgechev.com/2015/03/02/immutability-in-angularjs-immutablejs/&#34;&gt;&amp;ldquo;Boost the Performance of an AngularJS Application Using Immutable Data&amp;rdquo;&lt;/a&gt;. It shows how to speedup your AngularJS application when having a lot of bindings to big data collections. The idea behind the optimization is quite simple - create a new collection when the data changes. This way you can reduce the watchers execution from &lt;code&gt;O(n)&lt;/code&gt; to &lt;code&gt;O(1)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In the post I did simple profiling using the built-in &lt;code&gt;Date&lt;/code&gt; but it didn&amp;rsquo;t give enough information in exactly which cases it is more suitable to use immutable data and when you should bet on the standard collections. It also didn&amp;rsquo;t include any information about the garbage collection, although we know that using immutable collections will eventually lead to highly intensive memory management. All the code for the benchmarks and the charts &lt;a href=&#34;https://github.com/mgechev/benchpress-angularjs-immutable&#34;&gt;generation is available in my GitHub account&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Angular2 - First Impressions</title>
				<link>https://blog.mgechev.com/2015/04/06/angular2-first-impressions/</link>
				<pubDate>Mon, 06 Apr 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/04/06/angular2-first-impressions/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://github.com/angular/angular/commits/master?page=24&#34;&gt;On 18th of September 2014&lt;/a&gt; was pushed the initial commit of version 2.0 of the AngularJS framework. A few weeks ago the core team at Google, published AngularJS&amp;rsquo; 2.0 &lt;a href=&#34;https://angular.io/&#34;&gt;website&lt;/a&gt; and gave a couple of talks on &lt;a href=&#34;https://www.youtube.com/watch?list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7&amp;amp;v=QHulaj5ZxbI&#34;&gt;ng-conf&lt;/a&gt; about their new router, change detection, templating, etc. I&amp;rsquo;m passionate about AngularJS since its early versions so I decided give it a try using the &lt;a href=&#34;https://angular.io/docs/js/latest/quickstart.html&#34;&gt;quick start&lt;/a&gt;. In the meantime I and also created an &lt;a href=&#34;https://github.com/mgechev/angular2-seed&#34;&gt;angular2-seed project&lt;/a&gt; for my test, dummy projects. In order to have a better understanding of what is going on (and handle the lack of documentation) I dug inside their source code. I had great time doing this, what I saw was one of the most well written and smartest pieces of software I&amp;rsquo;ve ever read. Soon I&amp;rsquo;m planning to expand my paper &lt;a href=&#34;https://github.com/mgechev/angularjs-in-patterns&#34;&gt;&amp;ldquo;AngularJS in Patterns&amp;rdquo;&lt;/a&gt; with design patterns used inside Angular2.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Build Your own Simplified AngularJS in 200 Lines of JavaScript</title>
				<link>https://blog.mgechev.com/2015/03/09/build-learn-your-own-light-lightweight-angularjs/</link>
				<pubDate>Mon, 09 Mar 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/03/09/build-learn-your-own-light-lightweight-angularjs/</guid>
				<description>&lt;p&gt;My practice proved that there are two good/easy ways to learn a new technology:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Re-implement it by your own&lt;/li&gt;&#xA;&lt;li&gt;See how the concepts you already know fit in it&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In some cases the first approach is too big overhead. For instance, if you want to understand how the &lt;a href=&#34;https://github.com/torvalds/linux&#34;&gt;kernel&lt;/a&gt; works it is far too complex and slow to re-implement it. It might work to implement a light version of it (a model), which abstracts components that are not interesting for your learning purposes.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Persistent State of ReactJS Component</title>
				<link>https://blog.mgechev.com/2015/03/05/persistent-state-reactjs/</link>
				<pubDate>Thu, 05 Mar 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/03/05/persistent-state-reactjs/</guid>
				<description>&lt;p&gt;ReactJS is a framework, by facebook, which adds some well known concepts into the UI development. Each UI could be represented as a state machine but when the state of this state machine could be changed from a lot of places everything gets quite messy, complex and buggy. Given view may be rendered differently with the same model passed as parameter if it depends on some global data. A properly implemented ReactJS component, will be rendered the same way when the same &amp;ldquo;input parameters&amp;rdquo; are passed to it. This is based on the well known idea of the &lt;a href=&#34;https://en.wikipedia.org/wiki/Pure_function&#34;&gt;pure functions&lt;/a&gt; (to be more precise the idea is similar but not the same, because each component may have its own state, which can change).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Boost the Performance of an AngularJS Application Using Immutable Data</title>
				<link>https://blog.mgechev.com/2015/03/02/immutability-in-angularjs-immutablejs/</link>
				<pubDate>Mon, 02 Mar 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/03/02/immutability-in-angularjs-immutablejs/</guid>
				<description>&lt;p&gt;I have affinity to functional programming since my first year in college. During my initial contact with a purely functional programming language (Haskell in my case) I didn&amp;rsquo;t really understand all the advantages it provides, everything was reduced to just writing a cool recursive functions and solving algorithmic problems.&lt;/p&gt;&#xA;&lt;p&gt;Later, when my code was used in production, I started appreciating things like high-order functions, closures, currying, etc. I even wrote a blog post on topic &lt;a href=&#34;https://blog.mgechev.com/2013/01/21/functional-programming-with-javascript/&#34;&gt;&amp;ldquo;Functional programming with JavaScript&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Processing Binary Protocols with Client-Side JavaScript</title>
				<link>https://blog.mgechev.com/2015/02/06/parsing-binary-protocol-data-javascript-typedarrays-blobs/</link>
				<pubDate>Fri, 06 Feb 2015 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2015/02/06/parsing-binary-protocol-data-javascript-typedarrays-blobs/</guid>
				<description>&lt;p&gt;Last couple of weeks I&amp;rsquo;m trying to build high-performance consumption of binary protocol through the browser. The protocol is running over TCP. In the perfect world I&amp;rsquo;d be talking with the remote TCP server, through TCP sockets, connecting directly from the client-side JavaScript and consuming the received binary data.&lt;/p&gt;&#xA;&lt;p&gt;Because of limitations of the client-side API, JavaScript doesn&amp;rsquo;t has access to plain TCP sockets, there&amp;rsquo;s no full happiness. The second best option would be to use intermediate proxy, which:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Multi-User Video Conference with WebRTC</title>
				<link>https://blog.mgechev.com/2014/12/26/multi-user-video-conference-webrtc-angularjs-yeoman/</link>
				<pubDate>Fri, 26 Dec 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/12/26/multi-user-video-conference-webrtc-angularjs-yeoman/</guid>
				<description>&lt;p&gt;This is a tutorial for how to implement a multi-user video conference with &lt;a href=&#34;http://webrtc.org&#34;&gt;WebRTC&lt;/a&gt;, &lt;a href=&#34;http://angularjs.org&#34;&gt;AngularJS&lt;/a&gt; and &lt;a href=&#34;http://yeoman.io/&#34;&gt;Yeoman&lt;/a&gt;. It also includes a detailed explanation of how WebRTC works, how the peer to peer connections are being established and how the &lt;a href=&#34;https://en.wikipedia.org/wiki/Interactive_Connectivity_Establishment&#34;&gt;ICE (Interactive-Connectivity Establishment) framework&lt;/a&gt; is used for NAT traversal.&lt;/p&gt;&#xA;&lt;p&gt;You can find deployed version of the project, we&amp;rsquo;re going to take a look at in this tutorial, at &lt;a href=&#34;https://mgechev-webrtc.herokuapp.com&#34;&gt;Heroku&lt;/a&gt;, the source code can be found &lt;a href=&#34;https://github.com/mgechev/angular-webrtc&#34;&gt;at GitHub&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Asynchronous calls with ES6 generators</title>
				<link>https://blog.mgechev.com/2014/12/21/handling-asynchronous-calls-with-es6-javascript-generators/</link>
				<pubDate>Sun, 21 Dec 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/12/21/handling-asynchronous-calls-with-es6-javascript-generators/</guid>
				<description>&lt;p&gt;ES6 generators have landed in Chrome 39 Beta on 9th of October and are already available in the stable version.&#xA;This means that brand new development practices are already applicable, although for supporting older browsers you might need to fallback to the traceroute compiler.&lt;/p&gt;&#xA;&lt;p&gt;A cool module, which &lt;a href=&#34;https://github.com/tj&#34;&gt;TJ&lt;/a&gt; developed, called &lt;a href=&#34;https://github.com/tj/co&#34;&gt;&lt;code&gt;co&lt;/code&gt;&lt;/a&gt;, is available for quite a while (his initial commit in the &lt;code&gt;co&lt;/code&gt; repository was on 6th of June 2013).&lt;/p&gt;&#xA;&lt;p&gt;A few months ago Jake Archibald wrote an &lt;a href=&#34;http://jakearchibald.com/2014/es7-async-functions/&#34;&gt;article&lt;/a&gt; about the awesomeness of the &lt;code&gt;async&lt;/code&gt; functions in ES7 and how we can &amp;ldquo;emulate&amp;rdquo; them using ES6&amp;rsquo;s generators, using his &lt;code&gt;spawn&lt;/code&gt; function, which has subset of the features of &lt;code&gt;co&lt;/code&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Binary Tree iterator with ES6 generators</title>
				<link>https://blog.mgechev.com/2014/09/12/binary-tree-iterator-with-es6-generators/</link>
				<pubDate>Fri, 12 Sep 2014 19:07:34 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/09/12/binary-tree-iterator-with-es6-generators/</guid>
				<description>&lt;p&gt;ES6 specification is being clarified every passed day! One of the key features of the new version of the language are the &lt;a href=&#34;https://en.wikipedia.org/wiki/Generator_(computer_programming)&#34;&gt;generators&lt;/a&gt;.&#xA;Generators (a.k.a. semicoroutines) will play quite important role after they are being officially released. They could be used to simplify the asynchronous control flow of any JavaScript program (look at &lt;a href=&#34;https://github.com/visionmedia/co&#34;&gt;co&lt;/a&gt;). Another important role is using them for creating iterators.&lt;/p&gt;&#xA;&lt;p&gt;In this blog post we are going to take a look at how could be implemented iterator of binary search tree using the ES6 generators.&lt;/p&gt;</description>
			</item>
			<item>
				<title>WebRTC chat with React.js</title>
				<link>https://blog.mgechev.com/2014/09/03/webrtc-peer-to-peer-chat-with-react/</link>
				<pubDate>Wed, 03 Sep 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/09/03/webrtc-peer-to-peer-chat-with-react/</guid>
				<description>&lt;p&gt;In this blog post I&amp;rsquo;m going to share how could be build WebRTC chat with &lt;a href=&#34;https://facebook.github.io/react/&#34;&gt;React.js&lt;/a&gt;. Before we continue lets describe briefly what React.js and WebRTC are.&lt;/p&gt;&#xA;&lt;p&gt;The application from this tutorial is &lt;a href=&#34;https://github.com/mgechev/ReactChat&#34;&gt;available at GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;reactjs&#34;&gt;React.js&lt;/h4&gt;&#xA;&lt;p&gt;React.js is &lt;a href=&#34;https://en.wikipedia.org/wiki/Reactive_programming&#34;&gt;reactive&lt;/a&gt; JavaScript framework, which helps you to build user interface. Facebook states that we can think of React as the &amp;ldquo;V&amp;rdquo; in MVC. React&amp;rsquo;s main aspect is the state. When the state of the application changes this automatically propagates through the application&amp;rsquo;s components. A React component is a self-contained module, which is composed by one or more other components. Usually the component depends on state, which is being provided by a parent component. May be the explanation seems quite abstract now, but during the tutorial the picture will get much more clear.&lt;/p&gt;</description>
			</item>
			<item>
				<title>AngularJS in Patterns (Part 3)</title>
				<link>https://blog.mgechev.com/2014/07/05/angularjs-in-patterns-part-3/</link>
				<pubDate>Sat, 05 Jul 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/07/05/angularjs-in-patterns-part-3/</guid>
				<description>&lt;blockquote&gt;&#xA;This publication aims to provide a more theoretical overview of some of the AngularJS components in order to show you how the things you are already familiar with (like different Object-Oriented Design Patterns) fit in the picture.&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://blog.mgechev.com/2014/05/08/angularjs-in-patterns-part-1-overview-of-angularjs/&#34;&gt;Link&lt;/a&gt; to the first part of the series.&#xA;&lt;a href=&#34;https://blog.mgechev.com/2014/06/08/angularjs-in-patterns-part-2-services/&#34;&gt;Link&lt;/a&gt; to the second part of the series.&lt;/p&gt;&#xA;&lt;p&gt;This is the last blog post of the series &amp;ldquo;AngularJS in Patterns&amp;rdquo;. You can find the original GitHub repository, which contains all the information at &lt;a href=&#34;https://github.com/mgechev/angularjs-in-patterns&#34;&gt;github.com/mgechev/angularjs-in-patterns&lt;/a&gt;. If you want to be aware of my up-coming work, you can follow me at &lt;a href=&#34;https://github.com/mgechev&#34;&gt;github.com/mgechev&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>AngularJS in Patterns (Part 2). Services.</title>
				<link>https://blog.mgechev.com/2014/06/08/angularjs-in-patterns-part-2-services/</link>
				<pubDate>Sun, 08 Jun 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/06/08/angularjs-in-patterns-part-2-services/</guid>
				<description>&lt;blockquote&gt;&#xA;This publication aims to provide a more theoretical overview of some of the AngularJS components in order to show you how the things you are already familiar with (like different Object-Oriented Design Patterns) fit in the picture.&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://blog.mgechev.com/2014/05/08/angularjs-in-patterns-part-1-overview-of-angularjs/&#34;&gt;Link&lt;/a&gt; to the first part of the series.&lt;/p&gt;&#xA;&lt;p&gt;This blog post continues the series &amp;ldquo;AngularJS in Patterns&amp;rdquo;. You can find the original GitHub repository, which contains all the information at &lt;a href=&#34;https://github.com/mgechev/angularjs-in-patterns&#34;&gt;github.com/mgechev/angularjs-in-patterns&lt;/a&gt;. If you like my work you can follow me at &lt;a href=&#34;https://github.com/mgechev&#34;&gt;github.com/mgechev&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>AngularJS in Patterns (Part 1). Overview of AngularJS</title>
				<link>https://blog.mgechev.com/2014/05/08/angularjs-in-patterns-part-1-overview-of-angularjs/</link>
				<pubDate>Thu, 08 May 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/05/08/angularjs-in-patterns-part-1-overview-of-angularjs/</guid>
				<description>&lt;p&gt;In this series of blog posts I’m going to cover the paper I’m writing at &lt;a href=&#34;https://github.com/mgechev/angularjs-in-patterns&#34;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It aims to provide a bit more theoretical overview of some of the AngularJS components in order to show you how the things you are already familiar with (like different Object-Oriented Design Patterns) fit in the picture.&lt;/p&gt;&#xA;&lt;p&gt;Part one includes only a high level overview of AngularJS, enjoy it.&lt;/p&gt;&#xA;&lt;h1 id=&#34;angularjs-overview&#34;&gt;AngularJS overview&lt;/h1&gt;&#xA;&lt;p&gt;AngularJS is JavaScript framework developed by Google. It intends to provide a solid base for the development of CRUD Single-Page Applications (SPA). SPA is a web application, which once loaded, does not require a full page reload when the user performs any actions with it. This means that all application resources (data, templates, scripts, styles) should be loaded with the initial request or better – the information and resources should be loaded on demand. Since most of the CRUD applications have common characteristics and requirements, AngularJS intends to provide the optimal set of them out-of-the-box. A few important features of AngularJS are:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Singleton in JavaScript</title>
				<link>https://blog.mgechev.com/2014/04/16/singleton-in-javascript/</link>
				<pubDate>Wed, 16 Apr 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/04/16/singleton-in-javascript/</guid>
				<description>&lt;p&gt;Wikipedia describes the singleton design pattern as:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects. The term comes from the mathematical concept of a singleton.&lt;/p&gt;</description>
			</item>
			<item>
				<title>What I get from the JavaScript MV* frameworks</title>
				<link>https://blog.mgechev.com/2014/02/12/what-i-get-from-the-javascript-mv-mvw-frameworks/</link>
				<pubDate>Wed, 12 Feb 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/02/12/what-i-get-from-the-javascript-mv-mvw-frameworks/</guid>
				<description>&lt;p&gt;Why should I use JavaScript MVC, MVVM, MVP or simply MV&lt;strong&gt;W&lt;/strong&gt;(&lt;strong&gt;hatever works for you&lt;/strong&gt;)?&lt;/p&gt;&#xA;&lt;p&gt;When I talk with people, who are beginners/intermediate in JavaScript I’m often asked this question. They are usually people who, until now, have used JavaScript only for making their website “fancier” – adding client-side form validation, creating carousel, checking whether a user already exists with simple Ajax request. When you start building something bigger (+10k lines of JavaScript) I truly believe that there are a few benefits from using such micro-architectural frameworks.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Remote Desktop Client with AngularJS and Yeoman</title>
				<link>https://blog.mgechev.com/2014/02/08/remote-desktop-vnc-client-with-angularjs-and-yeoman/</link>
				<pubDate>Sat, 08 Feb 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/02/08/remote-desktop-vnc-client-with-angularjs-and-yeoman/</guid>
				<description>&lt;p&gt;In this blog post I’m going to show you how to build a VNC client using &lt;a href=&#34;http://angularjs.org/&#34;&gt;AngularJS&lt;/a&gt; and &lt;a href=&#34;http://yeoman.io/&#34;&gt;Yeoman&lt;/a&gt;. The source code used in the post is available at my &lt;a href=&#34;https://github.com/mgechev/angular-vnc&#34;&gt;GitHub&lt;/a&gt;. Click &lt;a href=&#34;#vnc-demo-video&#34;&gt;here&lt;/a&gt; to see the final result.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://blog.mgechev.com/images/legacy/uploads/2014/02/yeoman-vnc-angular.png&#34;&gt;&lt;img src=&#34;https://blog.mgechev.com/images/legacy/uploads/2014/02/yeoman-vnc-angular.png&#34; alt=&#34;yeoman-vnc-angular&#34; width=&#34;600&#34; height=&#34;200&#34; class=&#34;aligncenter size-full wp-image-647&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It seems I have affinity to the remote desktop protocols, because this is my third project at &lt;a href=&#34;https://github.com/mgechev&#34;&gt;GitHub&lt;/a&gt;, which implements one (&lt;a href=&#34;https://github.com/mgechev/js-vnc-demo-project&#34;&gt;VNC client on 200 lines of JavaScript&lt;/a&gt;, &lt;a href=&#34;https://github.com/mgechev/devtools-vnc&#34;&gt;VNC client for Chrome DevTools&lt;/a&gt; and &lt;a href=&#34;https://github.com/mgechev/angular-vnc&#34;&gt;VNC client with AngularJS&lt;/a&gt;).&lt;/p&gt;</description>
			</item>
			<item>
				<title>The magic of $resource (or simply a client-side Active Record)</title>
				<link>https://blog.mgechev.com/2014/02/05/angularjs-resource-active-record-http/</link>
				<pubDate>Wed, 05 Feb 2014 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2014/02/05/angularjs-resource-active-record-http/</guid>
				<description>&lt;p&gt;At first sight AngularJS seems like a magical framework, which does some weird but awesome things like dependency injection, data binding only by setting a single property to the magical object named $scope and many other things.&lt;/p&gt;&#xA;&lt;p&gt;If you look at the source code of Angular you’ll see a lot of smart and simple solutions for these magical problems. In this blog post I’ll describe the magic which stays behind &lt;code&gt;$resource&lt;/code&gt;. I decided to write this blog post because of my recent experience in StackOverflow. One of the most misunderstood components of AngularJS was exactly the &lt;code&gt;$resource&lt;/code&gt; service. &lt;code&gt;$resource&lt;/code&gt; is two levels of abstraction above the XMLHttpRequest object (ok, may be three if we count &lt;code&gt;$httpBackend&lt;/code&gt;). I’ve illustrated the usage of &lt;code&gt;$resource&lt;/code&gt; through example which can be found at &lt;a href=&#34;https://github.com/mgechev/angularjs-resource&#34;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>AngularAOP v0.1.0</title>
				<link>https://blog.mgechev.com/2013/12/04/angularaop-v0-1-0/</link>
				<pubDate>Wed, 04 Dec 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/12/04/angularaop-v0-1-0/</guid>
				<description>&lt;p&gt;In this blog post I’ll introduce you the new way of annotating services included in AngularAOP v0.1.0.&lt;/p&gt;&#xA;&lt;p&gt;First, why we need a new way for annotation? In v0.0.1 the annotations were made in services’ bodies. It was something like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;myApp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;factory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;AwesomeService&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;execute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;d1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;d2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,...,&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;dn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;api&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;cm&#34;&gt;/* definition of our service api */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;execute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;Logger&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;onThrowOf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;execute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;Authorization&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;before&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;api&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;methodPattern&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;/Special|getArticleById/&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;argsPatterns&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/^user$/&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;/^[Ii]d(_num)?$/&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This way of annotating services led to coupling between the services and the API of the AngularAOP’s aspect factory service called &lt;strong&gt;execute&lt;/strong&gt;. By this coupling we weren’t able to reuse our services in new projects which don’t use AngularAOP.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Advanced JavaScript at Sofia University</title>
				<link>https://blog.mgechev.com/2013/10/24/advanced-javascript-in-sofia-university/</link>
				<pubDate>Thu, 24 Oct 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/10/24/advanced-javascript-in-sofia-university/</guid>
				<description>&lt;p&gt;In this blog post I’ll tell few words about the course Advanced JavaScript which Georgi Penkov, Evgeni Kunev and me are leading this semester in &lt;a href=&#34;http://fmi.uni-sofia.bg/&#34; target=&#34;_blank&#34;&gt;Sofia University&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I was included as a lecturer in it after my project for Practical Programming with Perl (&lt;a href=&#34;http://plainvm.mgechev.com/&#34; target=&#34;_blank&#34;&gt;plainvm&lt;/a&gt;) which is created by Georgi Penkov. The idea behind the course is not to concentrate on the syntax of JavaScript but to introduce to the students different modern technologies. It is not concentrated only on the front-end development but there are also few planned lectures about Node.js. My role in this course is more as frontender than as Node.js ninja so I can tell few words about the front-end topics I plan to cover. The program for the course is a bit dynamical. Since we planned it a lot of things in the JavaScript world changed. The JavaScript landscape changes very fast so we should be able to response to these changes as quickly as possible.&lt;/p&gt;</description>
			</item>
			<item>
				<title>AngularJS style guide</title>
				<link>https://blog.mgechev.com/2013/10/06/angularjs-style-guide/</link>
				<pubDate>Sun, 06 Oct 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/10/06/angularjs-style-guide/</guid>
				<description>&lt;p&gt;Today I created a &lt;a href=&#34;https://github.com/mgechev/angularjs-style-guide&#34; target=&#34;_blank&#34;&gt;GitHub repository&lt;/a&gt; which contains a set of good practices and style guides for AngularJS application development.&lt;/p&gt;&#xA;&lt;p&gt;Its main goal is to be community-driven and to concentrate all the best practices for AngularJS development in one place.&lt;/p&gt;&#xA;&lt;p&gt;I’ve collected these guidelines mostly from my own experience and the source code of AngularJS. I guess there are missing things thats why I’ll try to fill the gaps in future. Also, if you find something which can be improved or included feel free to &lt;a href=&#34;https://github.com/mgechev/angularjs-style-guide&#34; target=&#34;_blank&#34;&gt;contribute&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Lazy prefetching of AngularJS partials</title>
				<link>https://blog.mgechev.com/2013/10/01/angularjs-partials-lazy-prefetching-strategy-weighted-directed-graph/</link>
				<pubDate>Tue, 01 Oct 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/10/01/angularjs-partials-lazy-prefetching-strategy-weighted-directed-graph/</guid>
				<description>&lt;p&gt;This blog post is concentrated about web performance. I’ll skip the well known stuff about combining images into sprites, inlining images, DNS pre-fetching, combining and minifying script files, gzipping and so on. There are plenty of articles and tools which will help you about these things. There are also excellent researches on these topics, few of the best I’ve read are these by &lt;a href=&#34;https://www.mobify.com/&#34; target=&#34;_blank&#34;&gt;Mobify&lt;/a&gt;, &lt;a href=&#34;http://shop.oreilly.com/product/0636920025955.do&#34; target=&#34;_blank&#34;&gt;Web Performance Daybook Volume&lt;/a&gt;, &lt;a href=&#34;http://shop.oreilly.com/product/9780596529307.do&#34; target=&#34;_blank&#34;&gt;High Performance Web Sites&lt;/a&gt; and &lt;a href=&#34;https://www.youtube.com/watch?v=PkOBnYxqj3k&amp;list=PLjqQYuhKAW8Bg-HpGPDlbcecgyAVRPiYM&#34; target=&#34;_blank&#34;&gt;Critical rendering path – Crash course on web performance&lt;/a&gt; and many others. I hope HTTP 2.0 will eliminate few of the dirty hacks we all make&amp;hellip;&lt;br&gt;&#xA;I’ll focus on the performance in the Single-Page Applications and especially template prefetching strategy we use in the web application of Brownie Points. I’ll give code samples with AngularJS but these methods can be also applied with Ember.js, Backbone.js (with little more pain) and other MV* frameworks, I guess.&lt;br&gt;&#xA;To find the best approach for your app you should understand it very well and know all the relations between the different pages. One way to do this is by visualising all the relations using UML state machine diagram. It will show you how your pages are connected, triggering of which event will lead to page change (events), based on which conditions the pages will change (guards) and what is done during the transition (actions).&lt;br&gt;&#xA;For illustrating the way this partials pre-fetching strategy works, I’ll use example with a web application which is web interface for revision control system.&lt;br&gt;&#xA;So, we have the following pages:&lt;/p&gt;</description>
			</item>
			<item>
				<title>VNC client on 200 lines of JavaScript</title>
				<link>https://blog.mgechev.com/2013/08/30/vnc-javascript-nodejs/</link>
				<pubDate>Fri, 30 Aug 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/08/30/vnc-javascript-nodejs/</guid>
				<description>&lt;p&gt;In this quick blog post I’ll show you how to create a simple VNC client in about 200 lines of JavaScript.&#xA;For our goal we’re going to use only HTML5 and JavaScript (client and server side).&#xA;The end result will be something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://blog.mgechev.com/images/legacy/uploads/2013/08/js-vnc.png&#34;&gt;&lt;img src=&#34;https://blog.mgechev.com/images/legacy/uploads/2013/08/js-vnc-1024x946.png&#34; alt=&#34;js-vnc&#34; width=&#34;600&#34; height=&#34;554&#34; class=&#34;alignnone size-large wp-image-500&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;So, let’s begin!&lt;/p&gt;&#xA;&lt;p&gt;Our application will have very simple architecture – a proxy server written in Node.js and a client in HTML5 and JavaScript. The Node.js server will stay between the browser and the VNC server. We need it because the client-side JavaScript does not supports TCP sockets so we can’t connect directly to the VNC server. The HTML5 client will have a canvas on which we will draw the frames we receive from the server.&#xA;For VNC server you can use the free version of &lt;a href=&#34;http://www.realvnc.com/&#34;&gt;RealVNC&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Aspect-Oriented Programming with AngularJS</title>
				<link>https://blog.mgechev.com/2013/08/07/aspect-oriented-programming-with-javascript-angularjs/</link>
				<pubDate>Wed, 07 Aug 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/08/07/aspect-oriented-programming-with-javascript-angularjs/</guid>
				<description>&lt;p&gt;In the following blog post I’ll write few words about what is Aspect-Oriented Programming, why I think it will be useful in AngularJS and I’m also going to give you a short tutorial for using a &lt;a title=&#34;GitHub&#34; href=&#34;https://github.com/mgechev/angular-aop&#34; target=&#34;_blank&#34;&gt;simple AOP framework I’ve developed&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;First things first. What is AOP? As we all know OOP is awesome! It gives us many tools for making our development process simpler. Its core principles are Abstraction, Encapsulation, Inheritance and Polymorphism.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Practical programming with JavaScript</title>
				<link>https://blog.mgechev.com/2013/04/24/practical-programming-with-javascript/</link>
				<pubDate>Wed, 24 Apr 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/04/24/practical-programming-with-javascript/</guid>
				<description>&lt;p&gt;Before few months I was invited by Telerik Academy to make a talk about JavaScript. Last Monday Marian Kostadinov, Radoslav Georgiev and me made a whole seminar about the topic. I’m addicted to the Object-Oriented programming so I choose to talk about that. You can find my slides at &lt;a href=&#34;https://blog.mgechev.com/slides/javascript-patterns&#34; target=&#34;_blank&#34;&gt;&lt;a href=&#34;https://blog.mgechev.com/slides/javascript-patterns&#34;&gt;https://blog.mgechev.com/slides/javascript-patterns&lt;/a&gt;&lt;/a&gt; and a video (in Bulgarian) below in the post:&lt;/p&gt;&#xA;&lt;p&gt;It was quite exciting for me to speak about this topic in front of about 200 people. The most amazing thing was that all of them were listening and were interested about JavaScript. I hope that it was useful seminar and all of use learned something new.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Why I should use publish/subscribe in JavaScript</title>
				<link>https://blog.mgechev.com/2013/04/24/why-to-use-publishsubscribe-in-javascript/</link>
				<pubDate>Wed, 24 Apr 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/04/24/why-to-use-publishsubscribe-in-javascript/</guid>
				<description>&lt;p&gt;This post is inspired by &lt;a href=&#34;http://stackoverflow.com/questions/13512949/why-would-one-use-the-publish-subscribe-pattern-in-js-jquery/13513915#13513915&#34; target=&#34;_blank&#34;&gt;my answer at StackOverflow&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So why we should use publish/subscribe? Why it is useful? Is it making our work harder or it makes our application better?&lt;/p&gt;&#xA;&lt;p&gt;And the answer&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;It’s all about loose coupling and single responsibility, which goes hand to hand with MV* (MVC/MVP/MVVM) patterns in JavaScript which are very modern in the last few years.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Loose_coupling&#34; target=&#34;_blank&#34;&gt;Loose coupling&lt;/a&gt; is an Object-oriented principle in which each component of the system knows it’s responsibility and don’t care about the other components (or at least tries to not care about them as much as possible). Loosing coupling is a good thing because you can easily reuse the different modules. You’re not coupled with the interfaces of other modules. Using publish/subscribe you’re only coupled with the publish/subscribe interface which is not a big deal – just two methods. So if you decide to reuse a module in different project you can just copy and paste it and it’ll probably work or at least you won’t need much effort to make it work.&lt;/p&gt;</description>
			</item>
			<item>
				<title>JavaScript, the weird parts</title>
				<link>https://blog.mgechev.com/2013/02/22/javascript-the-weird-parts/</link>
				<pubDate>Fri, 22 Feb 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/02/22/javascript-the-weird-parts/</guid>
				<description>&lt;p&gt;To say that JavaScript is becoming more and more popular is such a typical and boring way to start such an awesome post&amp;hellip;Anyway, JavaScript is becoming more and more popular each day&amp;hellip;There’s client-side JavaScript with awesome API, you can do whatever you wish with it – write 3D games, stream video and audio, process files&amp;hellip;There’s also a server-side JavaScript which is also awesome (I guess awesome will be a common word for this post). JavaScript is exiting language with big expressiveness power. It is object-oriented with many functional elements. It has prototype-based inheritance but if you wish you can implement inheritance in at least three different ways, which have countless subtypes&amp;hellip;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Functional programming with JavaScript</title>
				<link>https://blog.mgechev.com/2013/01/21/functional-programming-with-javascript/</link>
				<pubDate>Mon, 21 Jan 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/01/21/functional-programming-with-javascript/</guid>
				<description>&lt;p&gt;This article is about the functional concepts of JavaScript. Some of them are built-in the languages, others extra implemented but all of them are very common for purely functional languages like Haskell. First I want to tell what I mean with the term purely functional language. These languages are “safe”, they will not make side effect i.e. evaluating an expression won’t change something in the internal state and lead to different result of the same expression when called next time. It seems very strange and useless to “imperative” guys like me, but actually there’s a list of benefits:&lt;/p&gt;</description>
			</item>
			<item>
				<title>plainvm</title>
				<link>https://blog.mgechev.com/2013/01/11/virtualization-into-the-browser/</link>
				<pubDate>Fri, 11 Jan 2013 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2013/01/11/virtualization-into-the-browser/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;http://plainvm.mgechev.com/&#34; target=&#34;_blank&#34;&gt;plainvm&lt;/a&gt; can take the virtualization into different level of usage. To prove this I’ll first ask few rhetorical questions and put their answers&amp;hellip;Which is the programming language which everyone has interpreter for? Java? Actually no! Does iOS supports Java applets for example?! No! Everyone has a browser in his smartphone. Every browser (well may be I should exclude lynx, links&amp;hellip;) has JavaScript interpreter. And what is the common thing between all modern devices (and actually the devices most wide spread) – the browser. Another problem is that you don’t have such a great resources onto your mobile devices to run Windows/Linux/Mac even with double boot (yeah we can argue here about Debian&amp;hellip;probably). We can use remote desktop via VNC/RDP but we have to install extra software and we will have access to a single machine not a whole cluster (well actually we can&amp;hellip;I agree we can switch through different sessions, we can also become crazy).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Looking for performance? Probably you should NOT use [].sort (V8)</title>
				<link>https://blog.mgechev.com/2012/11/24/javascript-sorting-performance-quicksort-v8/</link>
				<pubDate>Sat, 24 Nov 2012 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2012/11/24/javascript-sorting-performance-quicksort-v8/</guid>
				<description>&lt;p&gt;A few days ago, I’ve created a &lt;a title=&#34;Algorithms implemented in JavaScript&#34; href=&#34;https://github.com/mgechev/javascript-algorithms&#34; target=&#34;_blank&#34;&gt;GitHub repository&lt;/a&gt;. It’s main goal was to collect different algorithms with implementations in JavaScript. I started with basic ones – sorting (insertion, selection, bubble sort..). After that I implemented few “more advance” like marge, quick and heap sort. It was interesting to me how much slower my implementation will be compared to the default sort. It was so interesting because of:&lt;/p&gt;</description>
			</item>
			<item>
				<title>JavaScript image scaling</title>
				<link>https://blog.mgechev.com/2012/11/02/javascript-html5-scale-image/</link>
				<pubDate>Fri, 02 Nov 2012 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2012/11/02/javascript-html5-scale-image/</guid>
				<description>&lt;p&gt;I haven’t wrote here for a while so I decided to write about something more practical. Actually the idea for the post come from one my response in &lt;a title=&#34;StackOverflow&#34; href=&#34;http://stackoverflow.com/questions/13177698/select-an-image-and-manipulate-it-in-javascript-no-form-submission/13178084#13178084&#34; target=&#34;_blank&#34;&gt;stackoverflow&lt;/a&gt;. The post is connected with pure client side image scaling. While you’re reading the example I hope that you’ll see how powerful is the HTML5 API and how with few lines of code you can do something which in other technologies is much more complex.&lt;br&gt;&#xA;So firstly I’ll post the source code with the example in JSFiddle, after that I’m going to explain everything step by step.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Caching CSS with localStorage</title>
				<link>https://blog.mgechev.com/2012/09/04/caching-css-in-the-localstorage/</link>
				<pubDate>Tue, 04 Sep 2012 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2012/09/04/caching-css-in-the-localstorage/</guid>
				<description>&lt;p&gt;Since HTML5 became wide supported the most popular aspects I hear about were it’s canvas, WebSockets and localStorage. I’ve got very close experience with the first two of the mentioned but the localStorage was somehow unknown for me since a month. I’ve researched the topic. Actually it’s quite interesting and useful as you might guess. Using localStorage you can save different kinds of data locally into key-value pairs. The data lives on your local machine until it’s deleted (cleared). The localStorage allows you to use more storage than cookies and have no expiration interval (the expiration completely depends on the user). As you might guess again the data stored into the localStorage is saved on the hard drive. May be you know that it’s very expensive to take data from the hard drive because of the mechanical movements required for buffering the data. The localStorage size depends on the implementation. In Chrome, Firefox, Opera and Safari you can use 5 MBs. Actually it’s enough for caching all the CSS and JavaScript of your webpage (I really hope so).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Self-invoking functions in JavaScript (or Immediately Invoked Function Expressions)</title>
				<link>https://blog.mgechev.com/2012/08/29/self-invoking-functions-in-javascript-or-immediately-invoked-function-expression/</link>
				<pubDate>Wed, 29 Aug 2012 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2012/08/29/self-invoking-functions-in-javascript-or-immediately-invoked-function-expression/</guid>
				<description>&lt;p&gt;There are a lot of interesting things in the syntax of JavaScript, one of which is the definition of self-executing (self-invoking) functions. Here&amp;rsquo;s how we can defined such function:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-JavaScript&#34; data-lang=&#34;JavaScript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// body of the function&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The anonymous function above will be invoked right after it has been defined. The benefit of self-invoking functions is that they enable us to execute code once without cluttering the global namespace (without declaring any globals).&#xA;For example, if we have a web page in which we want to attach event listeners to DOM elements and other initialization work, self-invoking functions would be the best tool for the job!&lt;/p&gt;</description>
			</item>
			<item>
				<title>HTML5 image editor</title>
				<link>https://blog.mgechev.com/2012/04/25/html5-image-editor/</link>
				<pubDate>Wed, 25 Apr 2012 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2012/04/25/html5-image-editor/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://blog.mgechev.com/images/legacy/uploads/2012/04/html5editor.png&#34;&gt;&lt;img class=&#34;alignleft size-medium wp-image-122&#34; title=&#34;html5editor&#34; src=&#34;https://blog.mgechev.com/images/legacy/uploads/2012/04/html5editor-300x190.png&#34; alt=&#34;&#34; width=&#34;300&#34; height=&#34;190&#34; /&gt;&lt;/a&gt;As you see HTML5 is everywhere (of course I exclude IE&amp;hellip;or just before version 10). Web site used for quick image composition or edition is something very useful for the “modern web person”. There are few such services. Most of them use Flash. Nothing against it but&amp;hellip;it’s too heavy for me&amp;hellip;unnecessarily heavy. For all that stuff you can use HTML5 canvas. I also found some HTML5 image editors but their functionality was very limited. There is a feature which is very important and you cant find it in any of them. It’s frequently used in Adobe Photoshop and that’s why I decided to implement editor with that functionality – multiple layers. With multiple layers you can do whatever you want. You can combine different images change their color balances, contrast, blur&amp;hellip;etc. I’ve started this editor a few weeks ago and I’m almost ready with it’s base functionality (layers manipulations). It’s open source, of course. Distributed under the terms of the General Public License. As you may be noticed in my older blog posts I’m fan of jQuery. Of course my use of jQuery is limited because I’m looking for best performance. More detailed look at the editor can be made in it’s &lt;a href=&#34;https://github.com/mgechev/image-editor&#34; title=&#34;Image editor&#34;&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Carousel Gallery</title>
				<link>https://blog.mgechev.com/2012/02/16/carousel-gallery/</link>
				<pubDate>Thu, 16 Feb 2012 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2012/02/16/carousel-gallery/</guid>
				<description>&lt;p&gt;And one post in English&amp;hellip;For few days I’m developing one jQuery UI plugin. It’s picture gallery which I’ve seen in flash but not in JavaScript, that’s why I decided to fix this. The gallery is a set of rotating pictures and difference ways of handling the perspective. There’s nothing complicated in it just little analytic geometry. I haven’t used any canvases or SVG because I’ve wanted the biggest possible browser compatibility. Of course there’re are drawbacks from this. There are a lot of computations I don’t have hardware acceleration and it works slow in the old version of few browsers. Currently I’m developing webpage for the gallery. Here’s a screenshot of it: &lt;a href=&#34;http://carousel.mgechev.com/&#34; target=&#34;_blank&#34;&gt;&lt;img class=&#34;aligncenter size-full wp-image-96&#34; title=&#34;jQCarousel&#34; src=&#34;https://blog.mgechev.com/images/legacy/uploads/2012/02/gallery-logo.png&#34; alt=&#34;&#34; width=&#34;800&#34; height=&#34;279&#34; /&gt;&lt;/a&gt;&lt;br&gt;&#xA;If you’re interested in the project you can see it’s source or fork it at &lt;a title=&#34;jQCarousel GitHub&#34; href=&#34;https://github.com/mgechev/jqcarousel&#34; target=&#34;_blank&#34;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Color animation plugin for jQuery</title>
				<link>https://blog.mgechev.com/2012/01/16/color-animation-plugin-for-jquery/</link>
				<pubDate>Mon, 16 Jan 2012 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2012/01/16/color-animation-plugin-for-jquery/</guid>
				<description>&lt;p&gt;Hi! I haven’t wrote since a long time but there’s so much code and so little time&amp;hellip;It’s bad that the biggest part of the code is not open source but what can we do&amp;hellip;Last few hours I developed a JavaScript plugin for color animation. Of course for few hours I cant make something with great quality so it’s a little bit unstable (I think) but it works and it’s also valid for the JSLint standards. It uses easy algorithm. I think of the RGB color representation as a three dimensional space with coordinates in the range [0, 255]. The user is sets object with specific color (doesn’t matter background, font&amp;hellip;btw that’s still not fully tested) which is actually a point in this three dimensional space. The target is another point in the 3D space so I just move from the first to the second point. I spoke enough. Let’s look at the code:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Sound notification in web page</title>
				<link>https://blog.mgechev.com/2011/11/01/cross-browser-sound-notifications/</link>
				<pubDate>Tue, 01 Nov 2011 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2011/11/01/cross-browser-sound-notifications/</guid>
				<description>&lt;p&gt;Few days ago I was creating a system in which it was necessary to implement a sound notification feature. Well it’s not very hard task but of course you have to be careful with the browser compatibility. At first my source was something like that:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-JavaScript&#34; data-lang=&#34;JavaScript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;playSound&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;config&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;soundNotify&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;html&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;lt;embed src=&amp;#34;&amp;#39;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;config&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;soundFile&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;.wav&amp;#34; hidden=true autostart=true loop=false&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Actually in my Linux it was working pretty well (I tried it mainly in Chrome).&lt;br&gt;&#xA;After that I decided to try it in a different environment (OS, browser&amp;hellip;). Well I started the app in Google Chrome installed on Windows 7. It was working again :). After that&amp;hellip;IE&amp;hellip;and yes it wasn’t working (the browser asked me to start an add-on but this stinks&amp;hellip;). Well IE has a tag for background sound. So I added:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Ajax without jQuery for beginners</title>
				<link>https://blog.mgechev.com/2011/07/21/ajax-jquery-beginners/</link>
				<pubDate>Thu, 21 Jul 2011 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2011/07/21/ajax-jquery-beginners/</guid>
				<description>&lt;p&gt;Before years I was writing all the code by my own, without additional libraries (including jQuery). For beginner developer it’s a good strategy. When you use &lt;strong&gt;$.ajax&lt;/strong&gt; it’s all that easy:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-JavaScript&#34; data-lang=&#34;JavaScript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ajax&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;any/url/for/the/request&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;get&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;success&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;alert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;But you can’t get the main idea.&lt;br&gt;&#xA;Many developers don’t have an idea how to write this without a library. In their opinion AJAX without library a hard, near impossible task. Well the truth is that it’s not so hard&amp;hellip;there are just some incompatibilities between the different browsers but you can deal with all of them in few lines of code. First for creating the HTTP request you have to create new XMLHttpRequest (for most browsers). Of course, in Internet Explorer you have to do something slightly different&amp;hellip;In Internet Explorer under version 7 you have to create special kind of ActiveX Object which has different versions – MSXML2.XMLHttp.5.0, MSXML2.XMLHttp.4.0, MSXML2.XMLHttp.3.0, MSXML2.XMLHttp, Microsoft.XMLHttp. For our goals we want to use the newest version of the XMLHttp object. Here is a function which creates object which we can use for out request:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Blogger image resize</title>
				<link>https://blog.mgechev.com/2011/07/17/blogger-image-resize/</link>
				<pubDate>Sun, 17 Jul 2011 00:00:00 +0000</pubDate>
				<guid>https://blog.mgechev.com/2011/07/17/blogger-image-resize/</guid>
				<description>&lt;p&gt;That’s my second post here and the first one which is going to have any sense. Today a friend of mine was fighting with Google’s blog system&amp;hellip;He was posting some data with images in it. When he was setting width and height of images in the html editor they were being resized later after he post the article. When he tried to put any CSS restriction about picture’s width the effect was – picture flattened (because blogger was setting the picture height). I looked at the source for few minutes, stopped the JavaScript because I thought that it is the problem but there was no result&amp;hellip;So I wrote a tiny script which deals with the problem. And here is it:&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
