Rename Refactoring for JavaScript Code

.

One of the common refactoring activities is variable renaming. Many respectable IDEs have such a language-aware renaming feature. In some other cases, this is carried out via a simple search and replace. Manual search replace is error-prone and hence why a syntactically-correct rename refactoring tool can be useful. We have seen how identifier highlighting is… Read more »

JavaScript Variable Scope and Highlight

.

An interesting feature of many programmer’s editors is identifier highlighting. It makes easy to spot where a particular variable or function is used. With JavaScript as the language, highlighting is also useful since some JavaScript beginners are often confused by JavaScript function-level scope and its related effect of variable hoisting. Implementing such a highlighting feature… Read more »

CSS Preload Scanner in WebKit

.

In WebKit world, preload scanner refers to a side parser which kicks in if the main HTML parser is halted by a blocking script loading. Because this preload scanner can see what other resources (e.g. stylesheets, images, inputs) are to be fetched, it can trigger the associated network requests as early as possible, without waiting… Read more »

Automagic Removal of JavaScript Logging

.

When writing a large JavaScript application, it is quite often that console.log and other debugging statements are sprinkled here and there. Obviously, at one point those extraneous statements need to be removed for the production version or even when the code needs to be checked in into the source repository. There are many different ways… Read more »

Spring 2013 Conferences

.

Spring is in the air! Time for me to hit the road and give some tech talks. For HTML5 Developer Conference in San Francisco, April 1-2, I’ll try to show a 30,000-foot WebKit overview to those who are new to the wonderful world of browser rendering. WebKit Rendering: Overview for HTML5 Developers is the official… Read more »

ECMAScript 6 and Method Definitions

.

Using an object literal populated with some member functions is a common practice in any serious JavaScript applications. This is also useful for all kind of frameworks, in particular to setup object prototypes. The upcoming ECMAScript 6 introduces method definition, a nice shorthand which eliminates the need to use function when using that pattern. Before… Read more »