this post was submitted on 15 Oct 2024
10 points (100.0% liked)

JavaScript

1956 readers
38 users here now

founded 1 year ago
MODERATORS
 

In PHP ecosystem there is a tool called Rector. It helps a lot in automated refactoring. It helps a lot in updating from a bad design pattern to another, update code to match a given framework updates, etc.

Maybe we could create a similar tool for client side Javascript to migrate away from jQuery to vanilla Javascript. Websites youmightnotneedjquery.com have a good collections of vanilla JS alternatives to jQuery.

While one could do it manually, on larger code bases, it is extremely tedious.

Maybe such tool exists and I am unaware of it?

At first, I thought about having such transformation as an optimization step in the bundler, but this is unnecessarily redundant and might cause a lot of troubles.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 11 hours ago

I believe https://github.com/facebook/jscodeshift is trying to be that tool for the typescript/js world. Doesn't have a mod for removing jquery but should be super doable.