The reduce ({...spread}) anti-pattern
I thought this was a really interesting examination of the performance penalties of using ({...spread}) in JavaScript. Link: The reduce ({…spread}) anti-pattern
I thought this was a really interesting examination of the performance penalties of using ({...spread}) in JavaScript. Link: The reduce ({…spread}) anti-pattern
An in depth exploration of how far you can get with using JSDoc (and the TypeScript compiler) without resorting to writing TypeScript or having a build step in your project. Link: JSDoc typings: all the benefits of TypeScript, with none of the drawbacks
It’s understandable to think that JavaScript frameworks and their communities are eating the web because places like Twitter are awash with very loud voices from said communities. Always remember that although a subset of the JavaScript community can be very loud, they represent a paltry portion of the web as a whole. This means that when they say something like “CSS sucks” — what they mean is “CSS sucks for a small subset of less than 1 percent of the web”. ...
There is a common misuse of JavaScript’s type coercion that I see in code reviews. It’s the terse use of two exclamation marks to convert a truthy value to a Boolean value. Here’s an example: const someValue = "I like apple pie"; const userLikesPie = !!someValue; // userLikesPie is now `true` I think this is a misuse for two reasons: ...
“Considered harmful” has always been good link bait. I am not trying to start a flamewar, but merely express my concerns over the recent decisions of the jQuery team to actively endorse plugins that deserves no special treatment from any other plugins out there. If you have different opinions, please do respond in the comments or write a blog post expressing them. ...
For quite a while, I have been working on a large web application for a client. For publish/subscribe style messaging in the web frontend, we use jQuery custom events triggered on the body element. This is quite a neat trick to ensure loose coupling of modules, since you’re really just tracking what the user does, and not what module happened to generate the message. ...
Tomorrow I will be attending dConstruct 2010, which I am very excited about. I flew in a day early, so I could get some time to enjoy Brighton. One of the first stops has been The Skiff, “a nice little place to work in the middle of Brighton”. The Skiff is indeed a very nice place: very few interruptions and very friendly people. While sitting at my visitors desk, I’ve managed to finally finish a little JavaScript library, that has been a very long time in the making: FailFast. All it took was tidying up the documentation and writing the last few missing unit tests. ...
Earlier this week, Microsoft posted an article with details on udpates to the native JSON implementation in IE8. Because of the new ECMAScript specification changes, some customers have reported issues. These issues are caused by deviations between the native JSON feature in Internet Explorer 8 and the final specification. An update is now available to address these customer issues and improve JSON interoperability of Internet Explorer 8. This update enables JSON interoperability of Internet Explorer 8 to keep in conformance with the new “ECMAScript, fifth edition” standard specification. ...
Currently working on a project that has well defined use of “namespaces” and structured use folders for its JavaScript files. I wanted to investigate the options for combining and minifying JavaScript files. I need a tool that: can be run from command line (my team uses many different editors and IDEs) will work on both Windows and Unix based platforms does not require huge, obscure configuration files can merge sources recursively has an acceptable software license (MIT / Apache / BSD) is thorougly tested is extensible can work with any JavaScript framework I settled for trying out Juicer and Sprockets, since both tools met the requirements and were the only high-quality tools on my radar. ...
Behaviours To encapsulate complex javascript behaviour on websites, I have been using Dan Webb’s Low Pro library for several years. Low Pro allows you to create self-contained Behavior classes, which avoids polluting the global namespace with variables and makes for very easy re-use of code. I’ve previously given a little introduction to Low Pro for Prototype at a local Meetup event, where I show an example of creating your own behaviours. ...