Avoid using jQuery

jQuery is an unnecessary dependency for modern browsers.

Status
accepted
Date
Contributors
Adam Varn, Andrew Berry, Andy Blum, Chris DeLuca, Claire Ristow, Javier Reartes, Mateu Aguiló Bosch, Pauline Judge
Topics
front-end javascript

Decision

Avoid using jQuery. Use standard JavaScript alternatives instead.

Exceptions

If a required project dependency itself depends on jQuery, it is fine to include that dependency. If the only way to interface with that dependency’s API is through jQuery, then that is acceptable.

Consequences

JavaScript code will be more resilient to change; web platform native technologies like core JavaScript rarely if ever make backwards incompatible changes. A user library like jQuery can and has made updates that require API refactors.

Replicating jQuery's parseHTML() method is the latest addition to core JavaScript. However, that alternative, parseUnsafeHTML(), has wide browser support, back to Safari 17.4, so should be generally safe to use.

Additional Resources

Search Decisions