My Plan to Embrace JS And Move Beyound JQuery

Embrace Pure JavaScript


This time last year I know Only a bit about web development with only basic Markup and HTML knowledge. 

I know that my Progress is not as fast as I thought it would be. I only got to understand and develop in HTML, CSS, a little bit of PHP and JavaScript with some extended libraries like jQuery and Vanilla. 

I strongly base on jQuery library at the start of my journey. jQuery played a central role in my web development. It is so short and simple, but recently it got me that I decided to stop coding new scripts in jQuery and even have plans for removing it entirely from my site.

Coding in JavaScript is still a challenge for me and jQuery has always made it so simple. But I have to step up. And I have my reasons.

The First is that I want to challenge myself further and not to depend on JQuery

jQuery, as always been a game-changer for simplifying JavaScript development. Credit to whosoever made it I'm not a Computer Science boy.


Why I'm Moving Away from jQuery:

Performance:

I have given my first reason, but that should have not been enough to drop down a life saver entirely. I also thought of other considerations which the first was performance.

Native JavaScript execution is often faster and more efficient than using jQuery. With modern browsers optimizing JavaScript engines, there's less need for a library to handle basic tasks. 

And the need for a library to handle basic tasks is now unnecessary and slow. It's like Mum who wants to take the remote on the table in front of her and she still has to make a call when she could just stretch or use voice command. 🀷🏾‍♂️


Reduced Dependencies:

You really don't have to depend on a call these days. Using native JavaScript and not depending on any library would reduce the number of external dependencies. 

Fewer dependencies mean fewer requests, which can lead to faster load times for the site. 


ES6+ Features:

I just got to know of this and I don't understand much of it but I want to explore this Features. 

From what I've learnt, modern JavaScript (ECMAScript 6 and beyond) offers powerful features that simplify coding. 

Features like arrow functions, promises, and async/await make it easier to write clean and maintainable code. Hehe I have overused the 'async feature. It's nice it's also helps site sleep and performance.

These native JavaScript capabilities made many of the tasks previously handled by jQuery achievable without the need for a library.


Compatibility:

Native JavaScript is universally supported across all browsers, eliminating concerns about jQuery version compatibility or needing to include multiple versions. This site user jQuery 1, 2and 3. Loading them all falls the performance and speed.


Reduced Overhead: 

Removing jQuery and other libraries can lead to smaller file sizes, reducing the amount of data users need to download and improving page load times.


Maintenance: 

Code written in base JavaScript is often easier to maintain, as it relies on standardized language features and browser capabilities. This would be an advantage on Blogger because you have to understand your template to freely make changes.


My Transition Plan:

Transitioning away from jQuery isn't a quick task, especially the fact that this site heavily relies on it.

It looks like it would take alot of work as I might require to do a rebuild. This template depends on jQuery 1.5 and other widgets are built on version 2 and my newly added functions on version 3 so using both scripts.

I had to include version 2 library, version 1 script and also a version 3 migrate script tag.

What do i know? whenever I remove the Older script tags some widgets cease to work. So I left them and they load everytime.

<!-- jquery js-->

'<script src='https://code.jquery.com/jquery-1.0.js'/>

'<script src='https://code.jquery.com/jquery-2.2.2.js'/>

'<script src='https://code.jquery.com/jquery-3.7.0.js'/>

<script src='https://code.jquery.com/jquery-migrate-3.4.1.js'/>'

That's the mess on this site. Hehe you can assist please πŸ™πŸΎ 

Another reason to move awayπŸ’ƒπŸΎ


πŸ’ƒπŸΎ I want to Join the League to Embrace Vanilla JavaScript too

With the rise of modern JavaScript, web developers are increasingly embracing "vanilla JavaScript." This term simply refers to using plain, unadulterated JavaScript without the assistance of libraries like jQuery. 


 Here's a brief overview of my plan:

You can follow this if you also want to remove dependents of jQuery on your site

Assessment:

I'm currently evaluating the extent to which my site relies on jQuery. This is helping me to identify what needs to be replaced or updated. I already got those.

Gradual Replacement:

I'm not rushing the removal of jQuery. Instead, I'm replacing jQuery-based code with native JavaScript when I update or add new features.

Testing:

 It's crucial to thoroughly test the site after each replacement to ensure that existing functionality isn't disrupted. 

I have opened another playground site for this.

Rebuilding:

 For more extensive changes, I might consider a site restructure to eliminate jQuery entirely. This process includes recoding or redesigning components that depend on jQuery. Or remake the site template.


Conclusion:

While jQuery was once a go-to solution, the evolution of web standards and JavaScript itself has made it less relevant. 

By gradually moving away from jQuery and embracing modern JavaScript, I'm working to ensure my site is both faster and more future-proof. 

The transition might take time, but it's a worthwhile investment in the long run.

Happy Coding πŸ€—




Please write your comments or send a webmention
Dark/Light
A+
A-

Additional Widgets

Profile Picture

S David Prince

Typically replies in minutes

Profile Picture

Hi there πŸ‘‹

Leave a message

or Chat with DeePee

Start chat with:
Translate

Explore: Navigation