惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
Martin Fowler
Martin Fowler
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
V
Vulnerabilities – Threatpost
云风的 BLOG
云风的 BLOG
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
量子位
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
Intezer
Scott Helme
Scott Helme
A
About on SuperTechFans
博客园 - 司徒正美
Hacker News: Ask HN
Hacker News: Ask HN
The GitHub Blog
The GitHub Blog
Forbes - Security
Forbes - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Spread Privacy
Spread Privacy
T
Tailwind CSS Blog
S
Security Affairs
宝玉的分享
宝玉的分享

Chip Cullen

The need for importance, and AI: Chip Cullen An updated Colorosetta: Chip Cullen The Return of the Font Combinator!: Chip Cullen Changing the number of an item in an ordered list: Chip Cullen My pizza dough recipe as of May 2025: Chip Cullen Gonna try to be a bit more personal: Chip Cullen How I built dynamic social media images in Eleventy using Cloudinary: Chip Cullen My current approach to AI : Chip Cullen Lessons Learned Surviving a Major Product Launch: Chip Cullen How to Build a Drop Down Menu with Modern CSS: Chip Cullen How to stop page scrolling when you have an open dialog element: Chip Cullen Distraction Driven Development: Chip Cullen How I learned to code: the art of letting go: Chip Cullen In praise of the switch statement: Chip Cullen Project stuck? Think about how you’re breaking it down & question everything: Chip Cullen So how did the onboarding experiment go?: Chip Cullen Ideas for an Onboarding Checklist: Chip Cullen I really like Post Mortems: Chip Cullen Raise Red Flags Early: Chip Cullen How to mock fetch requests in React Testing Librarty tests: Chip Cullen Running a Structured Meeting: Chip Cullen Adding the View Transitions API to my personal site: Chip Cullen A Lightweight Way to Read GraphQL Data: Chip Cullen How to make a color changing favicon: Chip Cullen Using a Pros/Cons list to help navigate technical discussions: Chip Cullen How to use variable fonts from Google Fonts: Chip Cullen A new website: now on Eleventy!: Chip Cullen How to Truncate Type at More Than One Line with Just CSS: Chip Cullen Colorosetta: the VS Code Extension!: Chip Cullen Using CSS Custom Properties and Logical Properties Together: Chip Cullen Browser Dev Tools: Element Inspector Popover: Chip Cullen The Link with rel=preload is a Seperate Thing: Chip Cullen How to have Dark & Light Mode Images that also works with User Choice: Chip Cullen Don’t use Viewport Units for Font Size on their own: Chip Cullen A little known Media Query: Aspect Ratio: Chip Cullen Meta thinking: Managing Decisions: Chip Cullen Give Your To-Do's Context: Chip Cullen Say What the Impact is when Reporting Issues: Chip Cullen Firefighting 101: How to Manage Breakages: Chip Cullen How to Deal With Large Pieces of Technical Debt: Chip Cullen Make Your Request Clear: Chip Cullen Analytics events, HTML classes, and protecting against refactoring: Chip Cullen New tool: ColoRosetta: Chip Cullen What width and height attributes should you use with responsive images?: Chip Cullen Django 3.1 gotcha: Referrer Policy has a new default, and it might break iframes and links: Chip Cullen A Javascript Component Pattern: Chip Cullen CSS min(), max() and clamp() Functions: Chip Cullen Pointer Events and Inline Elements in Chrome: Chip Cullen Resolving a github repo and a new Create React App: Chip Cullen How to POST *Data* with the Fetch API: Chip Cullen The Contrast Triangle: Chip Cullen Advice on interviewing for Junior Developers: Chip Cullen Life Lessons Learned From Running a Marathon: How to do something really hard: Chip Cullen A (Brief) intro to Search Engine Structured Data: Chip Cullen Javascript Fallback Values on Variables and Booleans - a hard lesson: Chip Cullen Alfred Tip: Quickly Access Common URLs: Chip Cullen Responsive Images in Hugo - by Laura Kalbag: Chip Cullen Making a Gatsby Site with Multiple Content Types: Chip Cullen How to Create and Use Fixtures in Cypress Tests: Chip Cullen Fixing the 'Bad Interpreter' Error from AWS and Python 3.7: Chip Cullen Creating a Canonical Tag in a Django Template: Chip Cullen Responsive spacing with viewport and ch units: Chip Cullen Welcome to my New Design - 2019: Chip Cullen Django Templates: Block and If statements don’t work like you might expect: Chip Cullen Books I Read in 2018: Chip Cullen Lifehack: 4 ways to help tame common email noise: Chip Cullen How to make better Pull Requests: Adding Steps to Test: Chip Cullen The unsung develpment tool: Spreadsheets: Chip Cullen Troubleshooting Adding and Removing EventListeners: with Arguments, Debounced, and in a React Class: Chip Cullen How to Fake the Window Object in Jest and Enzyme: Chip Cullen Migrating From Wordpress to Hugo: Chip Cullen Background Repeat and its Possibilities: Chip Cullen Getting Started With Front End Tests: a Mindset: Chip Cullen Migrating a Blog - An Opportunity for a Content Inventory: Chip Cullen Moving to Hugo: Chip Cullen JavaScript events: .target vs .currentTarget: Chip Cullen Things I wish I knew when starting with Python: Chip Cullen Leading Ampersands for modifiers in Sass: An anti-pattern: Chip Cullen How to get rid of the "You have mail" message in your terminal: Chip Cullen Why three typefaces rule the web, and what you can do about it: Chip Cullen You shouldn't worry about Section 508 - it's Section 504: Chip Cullen Looping Video Backgrounds: pointers and pitfalls: Chip Cullen How to “preview” a click event tag in the Google Tag Manager console: Chip Cullen Moving on from a technology, or: life after Drupal: Chip Cullen Don’t be a dumb developer: Chip Cullen Two level breadcrumbs with CSS :only-child: Chip Cullen Simplicity comes with experience: Chip Cullen Do the least amount possible: Chip Cullen SVGs vs. Icon Fonts: Two points in favor of Icon Fonts: Chip Cullen Accessible links without underlines: Chip Cullen The Strategic Job Hunt: Chip Cullen Surviving Getting Laid Off: Chip Cullen How to structure your typography in Sass: Chip Cullen Layer Cake: A Responsive Design Layout Pattern: Chip Cullen Creativity is yet to come in Web Design: Chip Cullen Front End Testing with Wraith: A Step by Step Recipe: Chip Cullen Where to begin? How I start a visual design for the web: Chip Cullen If you could only have five Google Fonts: Chip Cullen Why SVG is so cool (or: what happens when you're late to the party on something): Chip Cullen How to apply classes to elements with CKEditor 4, in Drupal 7: Chip Cullen
How We Removed jQuery from a large app: Chip Cullen
2021-02-26 · via Chip Cullen

Last month my team at work accomplished paying off the single biggest piece of technical debt I have ever been a part of - we removed jQuery from PBS.org.

PBS.org is a sprawling application that uses Python/Django on the backend, and a mix of front end technologies. Among those front end technologies was extensive use of jQuery that touched every page of the site, and was still actively used in many components.

Why remove jQuery?

This is not a slam on jQuery. It's a wonderful library if it solves your problem. If you are productive with it, keep using it! To be honest, I have a soft spot for it - I first made things happen with JavaScript because of jQuery.

However, we had moved on as a team with how we built front end components. Our code had evolved into being either "with jQuery" or "without". We have long wanted to standardize on the later.

What are the benefits?

  • Removal of a hefty asset which was loaded on every page of our site
  • A more consistent code base. No longer will we have a mix of $.ajax and fetch

What were the biggest organizational challenges?

As ever, time was the constraint. We've wanted to do this for years, but the reality was that this was going to take a concerted effort of several weeks. We needed organizational buy-in, and got it when our product manager gave us a window of time to clear up some technical debt before feature work resumed.

In the end, this effort took us six weeks, which included the holidays. During the time that we were working, we were pretty focused on just this.

How did we approach this?

This was a large, messy, sprawling, problem. In order to make an actionable plan, though, I first needed to perform an audit of where we used jQuery.

I made a spreadsheet with every result for the string jQuery or $ in our site, and made note of which files they were used in. I then went file by file and tried to figure out in what way jQuery was being used. I made note of whether or not jQuery-dependent libraries were being employed, or what methods were being prominently used.

What was the overall landscape of jQuery usage?

  • We had imported jQuery in 47 files
  • There were two libraries still in use that still required jQuery
  • Lots of jQuery methods in use, such as .ajax, .isPlainObject, .trigger etc
  • Lots of the usual DOM manipulation and class toggling

What was the plan of attack?

1. Remove the libraries that relied on jQuery

Slick Carousel had been used in all of our carousels at one time, but over time we've built new carousels using react and had in those cases used react-based carousel libraries. One of my team members set about replacing our remaining slick usage with a vanilla JS based library, Splide.

We also had been using qTip for our popovers, but found a vanilla JS library to replace that, which was comparatively simple.

2. Have a standardized replacement for some of the trickier methods

For replacing .ajax we standardized on using .fetch across the site. This took a while to do, as we had made extensive use of .ajax, and the syntax adjustment to a promise was not a straight find-and-replace.

.trigger was also a method that we relied on - that is, triggering a custom event. However, this one turned out to not be that much of a lift, as vanilla JS custom events are pretty straight forward.

.isPlainObject was replaced by a method from lodash.

3. Replacing basic DOM manipulation

At this point I made stand alone tickets for each file in our project to do the grunt work of removing basic DOM manipulation. I did a lot of this work so that my team members could focus on the more challenging work that I've already mentioned.

I'm not gonna lie - this was drudge work.

For a lot of this, the site youmightnotneedjquery.com was invaluable (though it isn't HTTPS).

One cool thing I learned: jQuery's .closest method has a drop-in equivalent in plain JavaScript.

4. Bonus: trying for typescript conversion

All along we were also trying to migrate as many files as we could to TypeScript. All of our new files are authored in TypeScript, so this was a chance to update old ones. Our success here was mixed - sometimes we could do the conversion easily. Other times the file was so complex that we didn't want to attempt it.

To be totally honest - a lot of the time the jQuery removal was maybe 15% of the time spent - the other 85% of the time was spent with making TypeScript happy.

5. Last step - removing the package from our build & templates

The above work was released to production as it was done, piece by piece.

This was the happy, final task - namely, removing the package from our dependencies, and removing it from our template files. (We had included jQuery as a page-level asset across our HTML, with app-specific code loaded after).

What was the aftermath?

I'd love to say that the clouds parted and the sky opened in song, but alas the rollout of this removal was pretty quiet. We did get a lot more Sentry issues because we no longer had jQuery there to check if something was defined (or it failed quietly).

I was hoping to see an improvement in our Lighthouse score, but sadly that really didn't change much. I am surprised, our JS footprint had is greatly reduced.

I hope this insight on how we approached this helps you, if you're looking at tackling any large-scale deprecation.