Best practice javascript/jquery

Hi Meules,

You are not prohibited from using a JS library - but there are some benefits from relying on vanilla JS:

  • It’s easier to meet the performance requirements if the theme is not relying on a library which might have unnecessary JS
  • If merchants encounter bugs in your theme, it will be easier to troubleshoot problems if you’ve written the JS yourself
  • JS libraries will likely have unoptimised code, which again could negatively impact performance.

There’s a really great article here that a theme partner wrote on their experiences optimising and rewriting their theme / removing jQuery, which will likely answer a lot of your questions.

1 Like