当它濒临死亡时,我学习了jQuery

黄逸清
2023-12-01

I learned it because I had to, but I am glad I’ve crossed paths with it.

我学会了它是因为我必须这样做,但我很高兴自己走了一条路。

等等...为什么要死了? (Wait… Why is it dying?)

#1 The frameworks that people use now are no longer dependent on Jquery— Think React, Vue, and Angular, none of them do. Bootstrap even released Bootstrap 5 Alpha this year in 2020, where they replaced jQuery with Vanilla Javascript.

#1 人们现在使用的框架不再依赖于Jquery -Think React,Vue和Angular,它们都没有。 Bootstrap甚至于今年在2020年发布了Bootstrap 5 Alpha ,他们用Vanilla Javascript取代了jQuery。

#2 Javascript is becoming more robust as it maturesOne of the primary reasons why people use jQuery is because of the ease of selecting DOM elements and manipulating them. Now, Javascript has come up with Selectors API which includes the likes of document.querySelector and document.querySelectorAll, making DOM manipulation as easy.

#2 Java变得越来越成熟变得越来越健壮。人们使用jQuery的主要原因之一是因为选择DOM元素和操作它们都很容易。 现在,JavaScript提供了Selectors API ,该API包括document.querySelectordocument.querySelectorAll之类的东西 ,使DOM操作变得简单。

Another fundamental reason why people use jQuery is because of the AJAX calls. Javascript has a native Fetch option now which can work with async/await for whatever use cases you have. This also makes AJAX calls as easy.

人们使用jQuery的另一个基本原因是AJAX调用。 Javascript现在具有本机Fetch选项,无论您有什么用例,它都可以与async / await一起使用。 这也使AJAX调用变得容易。

#3 Common jQuery animations are achievable without jQueryjQuery common methods like show(), hide(), slideUp(), slideDown() can easily be recreated using CSS transitions.

#3无需jQuery就可以实现常见的jQuery动画,可以使用CSS过渡轻松地创建show(),hide(),slideUp(),slideDown()之类的jQuery通用方法。

Fun fact, jQuery is so deep in the grave somebody wrote documentation for its death.

有趣的是,jQuery深陷其中,有人为它的死而编写了文档

为什么我为自己走过道路感到高兴? (Why am I glad I’ve crossed paths with it?)

I started off my web development journey from one of those modern web frameworks — ReactJS — but I never saw it as an advanced state from anything else.

我从一个现代Web框架之一ReactJS开始了Web开发之旅,但是我从来没有将它视为其他任何高级状态

It’s like meeting a friend who is very capable and savvy in almost everything, only realizing where he/she got it from after meeting his/her parents

这就像遇到一个在几乎所有事情上都很有才干和精明的朋友,只是在见到父母之后才意识到自己从哪里得到的

While it is indeed dying, it is not dead. If it’s dead, I would not have learned it because “I had to”. Matter-of-fact is that jQuery is used by 76.0% of all the websites. This is because the frameworks that used to be popular (Bootstrap and the likes) were mostly built on top of jQuery.

虽然确实快要死了,但它还没有死。 如果它死了,我将不会学到它,因为“我必须”。 实际上,所有网站中有76.0%使用jQuery。 这是因为曾经很流行的框架( Bootstrap等 )大多建立在jQuery之上。

Just because it is not as popular as the past does not mean that it is not usable

仅仅因为它不如过去流行,并不意味着它不可用

We can learn through jQuery and Javascript’s progression. Both jQuery and Javascript had a few major releases with key improvements — we should learn how each version made our lives as a developer better.

我们可以通过jQuery和Javascript的发展来学习。 jQuery和Javascript都有一些主要的版本,并进行了重要改进-我们应该学习每个版本如何使我们作为开发人员的生活变得更好。

您是否仍应使用或学习jQuery? (Should you still use or learn jQuery?)

Yes and no.

是的,没有。

Yes because there is no harm to learning jQuery because you will appreciate modern frameworks more when you come to that.

是的,因为学习jQuery无害,因为您会更欣赏现代框架。

Yes because there is a good chance you will be handled jQuery code if you’re maintaining legacy code.

是的,因为如果您要维护旧版代码,很有可能会处理jQuery代码。

Yes because it has a way gentler learning curve if you are starting with that, compared to if you start with Javascript (with so much to learn! I am still learning, too).

是的,因为从Java入手开始,与从Java入手(有很多东西要学! 我还在学习 )相比,它的学习曲线更柔和。

No, because I do not think that it is worth the overhead to use it in a new project when there are better alternatives.

不,因为我认为当有更好的选择时,在新项目中使用它并不值得开销。

Regardless of whether jQuery eventually dies,

不管jQuery是否最终死亡,

Nice to meet you, jQuery. I am happy we’ve met.

很高兴认识您,jQuery。 很高兴我们见了面。

I will always remember jQuery fondly because it has played a huge part in the past and inspired the frameworks today to be what it is.

我将永远怀念jQuery,因为它在过去起了很大的作用,并启发了当今的框架。

翻译自: https://medium.com/the-innovation/i-learned-jquery-when-it-is-on-the-verge-of-death-121d088a542a

 类似资料: