Decision Avoid using jQuery
acceptedjQuery is an unnecessary dependency for modern browsers.
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.