经济学人最新社论
This is the editorial from our latest JavaScript newsletter, you can subscribe here.
这是我们最新JavaScript新闻通讯的社论,您可以在此处订阅 。
Hey everyone, welcome to a brand new year on SitePoint JavaScript. I hope you had a great break (for those of you that took one) and are ready to start off 2017 with a bang.
大家好,欢迎来到SitePoint JavaScript全新的一年。 我希望您能度过一个伟大的假期(对于那些度过一个假期的人),并准备在2017年开始大爆炸。
2016 was a crazy year for JavaScript! We saw an ever increasing adoption of ES6 and the rise of progressive web apps. Also, Yarn emerged as a competitor to npm and JavaScript fatigue fatigue became a thing. In case you missed any of this, or you’d simply like to reminisce on the year just passed, we’ve got you covered. Craig Buckler looks at these events and more in his post JavaScript: 2016 in Review. It’s well worth a read.
对于JavaScript来说,2016年是疯狂的一年! 我们看到ES6的采用率在不断增长,并且渐进式Web应用程序也正在兴起。 同样,Yarn成为npm的竞争对手,JavaScript疲劳也成为了疲劳。 如果您错过了其中任何一个,或者只是想回想刚刚过去的一年,我们已经为您服务。 克雷格·巴克勒(Craig Buckler)在他的JavaScript:2016 in Review中对这些事件进行了更多研究。 值得一读。
Looking forward to 2017 I wonder two things. Will this year be as crazy as the last? And where should I focus my learning efforts in the coming 365 days? The answer to the first question is “almost definitely”, but the answer to the second is somewhat more complicated. Knowing what to learn depends rather a lot on your situation, for example are you looking for a new job? Do you want to become more productive in your current one? Or do you want to check out a couple of new technologies to get a feel for how they stack up against those you already know?
展望2017年,我想知道两件事。 今年会和去年一样疯狂吗? 在接下来的365天里,我应该把学习重点放在哪里? 第一个问题的答案是“几乎可以肯定”,但是第二个问题的答案则有些复杂。 知道学习什么在很大程度上取决于您的情况,例如,您是否正在寻找新工作? 您想在当前的工作中提高生产力吗? 还是您想查看一些新技术,以了解它们如何与您已经知道的技术相提并论?
If you’re in that last group, we’ve got you covered there, too. Tim Severien started 2017 by taking a look at three libraries that are worth keeping an eye on in this coming year. I’d encourage you to give that post a read and let Tim know if you agree with his choices (spoiler: one of them is Vue.js).
如果您属于最后一组,我们也可以为您服务。 蒂姆·塞韦里安(Tim Severien)从2017年开始,考察了来年值得关注的三个图书馆 。 我鼓励您阅读该文章,并让Tim知道您是否同意他的选择(破坏者:Vue.js就是其中之一)。
As for me, I decided that one of my goals for 2017 would be to cut back on my use of jQuery. This isn’t because I’ve suddenly jumped on the anti-jQuery bandwagon. I haven’t. Rather because jQuery was so awesome when it first came on the scene, that today I often use it without thinking. I don’t stop and consider what browsers can do natively.
对于我来说,我决定2017年的目标之一是减少对jQuery的使用。 这不是因为我突然跳上了反jQuery的潮流。 我没有 而是因为jQuery首次出现时是如此的出色,以至于今天我经常不加思索地使用它。 我不会停下来考虑一下浏览器可以做什么。
And actually, this jQuery diet is working out quite well. For example, I recently needed to select an element’s closest parent element, which was an anchor tag. In jQuery that’d be no problem, you’d do $el.closest("a") but in vanilla JS I was unsure. So I hit youmightnotneedjquery.com, entered “closest” as the search term and got back zero results. Hmm … not ideal.
实际上,这种jQuery饮食效果很好。 例如,我最近需要选择一个元素的最接近的父元素,即锚标记。 在jQuery中这没问题,您可以执行$el.closest("a")但是在普通JS中我不确定。 因此,我点击了youmightnotneedjquery.com ,输入“ closest”作为搜索词,并返回了零结果。 嗯……不理想。
I had a go at putting together my own solution and came up with this:
我可以自行整理解决方案,并提出了以下解决方案:
while (el.parentNode.tagName !== 'A') { el = el.parentNode; }Which worked, but was kinda ugly. I then googled a bit and found that both Firefox and Chrome implement element.closest() natively. This was all I needed. Job done!
哪个可行,但有点丑陋。 然后我在Google上搜索了一下,发现Firefox和Chrome都本地实现了element.closest() 。 这就是我所需要的。 任务完成!
Obviously, replacing jQuery with experimental browser features isn’t an option all the time. If you’re worried about compatibility for older browsers, then using it is a no-brainer. And spending minutes googling what would have taken seconds in jQuery isn’t exactly productive. But even today, websites download many KB of JavaScript, to do what has been part of the standard DOM for years. Incorporating this change into the way I work will force me to become more familiar with what modern browsers are capable of — a worthy goal for 2017.
显然,始终没有用实验性浏览器功能替换jQuery的选择。 如果您担心与旧版浏览器的兼容性,那么使用它就很容易了。 花几分钟的时间来搜索jQuery需要花几秒钟的时间并不是很有效。 但是即使到了今天,网站也下载了许多KBJavaScript,以执行多年来作为标准DOM的一部分。 将这种变化纳入我的工作方式将迫使我更加熟悉现代浏览器的功能-这是2017年的目标。
But what about you? Where will you be concentrating your energies for the next 365 days? Do you intend to learn a new framework (if so which one)? Will you be giving Node a try? Or maybe your goal is to attend a meetup or contribute to open source.
那你呢 在接下来的365天中,您将把精力集中在哪里? 您打算学习一种新的框架(如果是这样的话)? 您会尝试Node吗? 也许您的目标是参加聚会或为开源做贡献。
Whatever it is (or isn’t), I’d love to hear about it in the comments below.
不管它是什么(或不是),我都想在下面的评论中听到。
翻译自: https://www.sitepoint.com/what-do-you-want-to-learn-in-2017/
经济学人最新社论
相关资源:jdk-8u281-windows-x64.exe