It is possible to replace AngularJS (the only external library) with regular blur/focus/change handler as @xem shows — without affecting the line counts — but the separation of concerns between view, logic and worker would be less clear.
The DOM-only version had to construct its own view in JS, and use an additional #_A1 encoding to fill in calculated values into display, while the AngularJS version is declarative in that regard.
Which works fine in a CSS-only environment. But a lot of the time these properties are being set in JS, which is going to be very difficult to predict.
Is there a way to make this a JS-only interface or property, then? Heck, the article made it sound like using it directly in stylesheets would often be a bad idea anyway.
I generally try to not manipulate properties directly through javascript, rather declaring a class for the purpose. Doesn't seem like an unreasonable requirement for proper performance? (I mean, compared to having stuff like `will-change`)
It is an unreasonable requirement in places, though. Before now I've made things like swipable elements that track the user's touch - i.e., you touch down, pull your finger left and the box follows you. That's not possible to do in pure CSS.
An other common mistake when you begin with promise:
var result = promise.then(identity, function (error) { console.log(error); })
Oops, you just recovered your promise with undefined. result will always be successful. Yes if you don't throw again (or return a new failure promise) in your error callback it will make the resulting promise successful.
I haven't checked if this behaviour is the same on the DOM Promise API but it is on Q (which is the most popular JS lib for Promises).
as a proof: https://glsl.io/transition/a830822b23e846e25d2d
see that there is already some warnings ;-)