neve icon indicating copy to clipboard operation
neve copied to clipboard

evaluate the js impact on the default/common theme setup

Open ineagu opened this issue 3 years ago • 3 comments

Description:

When I install Neve, with all the default settings, we are loading frontend.js, however there is no need for anything like that, if I disable js from browser the site continues to work well.

I think we can have a huge gain if we eliminate js completely for the default settings and load it when really required.

How to reproduce:

  1. Install Neve & activate
  2. Disable js and check the site

Expected behaviour:

That we are loading the minimum required for the site to work.

Current behaviour:

We are loading stuff like: https://github.com/Codeinwp/neve/blob/787137f4537079c6284e85cbfad0a93b15abcbf6/assets/js/src/frontend/blog.js, which seems to be only for certain, not common cases.

Reference:

Technical info

  • WordPress version: 5.7.2
  • Theme version: 2.9

@selul

ineagu avatar Jun 04 '21 14:06 ineagu

here is a sample site: https://perpetualdrawer.tastewp.com/, not sure for how long it stays live

ineagu avatar Jun 04 '21 14:06 ineagu

one instance that I know where we need js is mobile menu

selul avatar Jun 04 '21 15:06 selul

@selul right. I was checking it on desktop, I guess we can investigate if there is any chance to do it, since might be useful. Not sure if we can load conditionally like :

if (window.matchMedia("(max-width: 480px)").matches) { document.write('

ineagu avatar Jun 04 '21 16:06 ineagu