![]() TC39 is talking JavaScript decorators (again)
Decorate all the things Later this month, The Fellowship of the Spec (TC39) is set to discuss a new Stage 2 proposal for decorators for JavaScript classes. If you’re not familiar, Decorators are a proposal for extending JavaScript classes. Wait, haven’t I heard this song before? You definitely have. The TC gang have been discussing different iterations of JavaScript decorators on and off for 5 years now. Naturally, some developers got tired of waiting, so they went ahead and incorporated them into various JS frameworks and libraries (looking at you, MobX). Babel 7, TypeScript, and Angular all feature decorators that are based on previously-rejected TC39 proposals, everythingisfine.gif. So what’s different this time? This latest proposal is simpler and more limited in scope than previous versions of decorators. According to the proposal’s README, these decorators will “always simply wrap what they are decorating, rather than performing other transformations.” In theory, this should make it easier to avoid overusing decorators and abstracting away too much of your codebase (a common complaint when using decorators in TypeScript and other frameworks). The bottom lineIt seems likely that some form of decorators will be added to the ECMAScript standard in the near future, if only to provide greater consistency throughout the JavaScript ecosystem. Some developers will hate that because they’ve had bad experiences with decorators in the past, and others will welcome it after years of Playwright releases a major, minor update
Another playwright interested in headless execution To test or not to test… that is (always) the question. Playwright released v1.4 last week, and despite no major breaking changes, this was a pretty big update for Microsoft’s popular Node.js testing library thanks to the addition of three new, highly-requested features. Here’s the breakdown:
The bottom lineWhen some of the founding members of the Puppeteer team moved over to Microsoft last year and launched Playwright, it was easy to see the similarities between the two libraries. Some developers even dubbed Playwright the “cross-browser Puppeteer”, since that was Playwright’s only real distinguishing feature. But the new features and functionality in this latest release should help Playwright to differentiate itself among the many other testing and browser automation tools out there. Cool bits
🔥 Tip - Get the current URL in JavaScript
Simple enough. If you’re using JavaScript in the browser you can get the full current URL by using Let’s assume this is the current URL we’re on
These are all the properties that
|