News roundup: 11-11-11! insertAdjacentHTML, classes in JavaScript?, twilight of Flash and Silverlight, Yahoo! Cocktails

Listen to the podcast for November 11, 2011

insertAdjacentHTML

Mozilla has a nice overview of insertAdjacentHTML, a DOM function that’s intended to supplement innerHTML. It’s a bit less destructive and plays nicely with content that’s already in the DOM. For instance, whereas innerHTML completely blows away whatever is inside the container element, insertAdjacentHTML has handy positioning features (beforebegin, afterbegin, beforeend, afterend) that allows the newly inserted content to work around existing content.

Classes in JavaScript?

While there will always be a clamour for “keep your Java out of my JavaScript!”, it seems that classes might be finally coming to the next iteration of JavaScript. To be fair, classes aren’t specific to Java, but come from C++ and other languages that implement more of a classical inheritance paradigm which a lot of non-frontend folks are probably most familiar with.

There’s a problem, however, as JavaScript uses a different paradigm, that of prototypal inheritance. It seems that any implementation of classes would then have to be simply “sugar” on top of the prototypal model.

There’s also a problem with backwards compatibility. If we introduce new class keywords (”class”, “extends”, etc.), older implementations of JavaScript will not recognize the syntax and will fail.

There been some discussion recently over how exactly classes should look in JavaScript. It seems like it’s going to happen one way or another, it’s just a matter of time. So let’s at least do it well, right?

Here’s an awkward proposal from Mozilla’s es-discuss mailing list, which uses a really strange syntax (<| !?). Yehuda Katz also offered up his own version.

The creator of CoffeeScript, Jeremy Ashkenas, also weighed into the debate with his own succinct version, which garnered a lot of attention. In response to Jeremy’s proposal, Brenden Eich offered his own modification.

Finally, Nicholas Zakas offered a summary of Jeremy’s proposal and offered his own backwards-compatible version.

Twilight of Flash and Silverlight

Interesting news this week as Adobe laid off hundred of folks to make room for more of a focus on HTML5 technologies. It also announced plans to cease development of mobile Flash.

In related news, Microsoft may halt development on Silverlight. This wouldn’t come as a surprise, as Microsoft has also been shifting more towards HTML5 and its related open web technologies, away from more proprietary technologies.

Yahoo! Cocktails

Yahoo! recently announced Livestand, another Flipboard clone for iPad. It’s actually surprisingly well-polished and worth a look. Most of it is powered by web technologies in web views, which is pretty impressive.

The backing technologies include YUI3 and Node.js for the middle tier, which Yahoo calls Cocktails. Cocktails is made up of a variety of technologies, notably what Yahoo! calls Mojito (the Node.js MVC) and Manhattan (the cloud hosting environment).

From what I understand, Yahoo is planning on open-sourcing Cocktails, so it will be interesting to see if it’s successfully adopted anywhere else outside of Yahoo!.

Libraries and Frameworks

Mulberry is a new mobile framework from Toura (check it out on Github)

benchmark.js is a multi-platform benchmarking library that supports high-resolution timers

zappa is a CoffeeScript-optimized interface to Express and Socket.IO

JSBoy – JavaScript Gameboy Color Emulator

*[data-markdown] – a very simple markdown-to-HTML script by Paul Irish

flatiron is an unobtrusive framework initiative for Node.js, aiming to let developers put together the building blocks of their applications as they see fit

Moment.js is a lightweight library for date parsing, manipulating, and formatting

Notifier.js is a Growl-like notifier for webpages (requires jQuery)

Tidbits

Building a slimmer jQuery (heads up: live() is now deprecated)

The trap of the performance sweet spot – the tradeoff of performance for code readability

JavaScriptCore, the WebKit JS implementation – a fascinating exploration of JavaScriptCore compared to other JS engines. A dense read but interesting if you’re interested in lower-level stuff.

Terse JavaScript 101 – part 2

jQuery now has a standards team to represent the jQuery community to standards bodies and browser vendors

David Flanagan is working on dom.js at Mozilla – an implementation of the browser DOM in JavaScript

WebGL Inspector: An advanced WebGL debugging toolkit

Optimizing Vector Usage in JavaScript (and other high-level languages, too)

What are some bad jQuery practices to avoid? (Quora)

Nodefest Tokyo summary (Japanese)

Boulderdash in JavaScript

How to Scrape Web Pages with Node.js and jQuery

How One Missing “var” Ruined our Launch (or, as someone on Twitter phrased it, “The dangers of brogramming”). Run JSLint/JSHint, people!

Andrew Hedges has a test page for the new JavaScript fullscreen API

Enabling & Using WebGL on iOS – if you hack at it hard enough, you can use WebGL in web views on iOS (or with iAd)

Backbone.js Resources

IE10 has HTML5 history! (pushState, replaceState, etc)

Facebook Acquires Team Behind HTML5 App Platform Strobe; SproutCore Lives On

Paul Hayes has whipped up a polyfill for media query list listeners, events that fire when media queries are matched. It seems like the most common use case is a screen rotation, in which case it’s probably easier just to tie into the onresize event, but in the case of more complicated media queries, this is for you!

Function.prototype.notifier (Web Reflection) – for monitoring the lifecyle of functions

IE10 is by far the best-performing browser in test262 (official ECMAScript compliance test) – only 6 fails, compared to Firefox 8’s 164 fails and Chrome 16’s 415 fails!

Organizing your application using Modules (require.js)

Mozilla’s wiki for their JoystickAPI

Releases

jQuery 1.7

vows 0.5.13

Node 0.6.0

AmplifyJS 1.1.0

Popcorn.js 1.0

RightJS 2.3.0

Hydra.js 1.2.0

jQuery Mobile 1.0 will be out soon!

Multimedia

(book) Eloquent JavaScript is now on GitHub

(audio) NodeUp episodes five and six have been released

(video) JSConf.eu Video Roundup (Badass JavaScript)

(video) Wakanday 2011 videos are starting to surface

(video) SPLASH 2011: Brendan Eich – JavaScript Today and Tomorrow (interview)

(audio) The JavaScript Show Episode 21: jQuery 1.7, jQuery Conference 2012, Node Toolbox

(video) Node.js and you by Simeon Bateman

GitHub Most Watched This Week (JavaScript)

twitter / bootstrap
dglittle / smiler-slider
zurb / foundation
joyent / node
TapQuo / Lungo.js

Upcoming Events

(see more upcoming JavaScript events listed on Lanyrd)

Full Frontal JavaScript Conference (November 11, 2011 in Brighton, UK)
jQuery Summit 2011 (November 15-16, 2011 online)
W3Conf (November 15-16, 2011 in Seattle, WA, USA)
Copenhagen JS (November 17, 2011 in Copenhagen, Denmark)
indieconf 2011 (November 19, 2011 in North Carolina, US)
LyonJS (November 21, 2011 in Lyon, France)
London JS: Web Components & HTML5 (November 25, 2011 in London, England)
jQuery UK 2012 (February 10, 2012)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit
  • TwitThis
  • Simpy
  • StumbleUpon

Leave a Reply




© webdevpublishing 2011