You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that at least as of version 3.17.0 of the plugin, it loads hooks.min.js and i18n.min.js on the front end of wordpress. I can't see why these js files would be necessary for it to run, and if they are, can you please explain how they weren't needed before.
To Reproduce
Install version 3.17.0 of the plugin.
See the files hooks.min.js and i18n.min.js load on the front end, when logged out.
Expected behavior
I assume this files are only needed when logged in in wp-admin
Environment
Plugin version 3.17.0
WP version 6.7.1
Additional context
Loading unnecessary JS slows the web page down.
The text was updated successfully, but these errors were encountered:
The hooks.js script was introduced in wp-parsely 3.2 (released March 29, 2022) through this PR. This is a result of us including the @wordpress/hooks package as a dependency in our loader.js script, so JS hooks can be used as mentioned in the PR.
In this and some subsequent versions, hooks.js needed to inject a polyfill script.
When we released wp-parsely 3.11, hooks.js started injecting i18n.js instead of the polyfill.
Are these scripts needed?
loader.js is needed to disable autotracking when the "Disable Autotracking" setting is on, as well as when the website uses wp-parsely JS hooks. These are operations that take place on the front-end. hooks.js and i18n.js are loaded as dependencies of loader.js.
Considerations for the future
We could attempt to decouple the "Disable Autotracking" setting from the loader, and give a setting to disable JS hooks when they aren't being used. This would prevent the extra scripts from being included. This is a possible pathway, but it hasn't been tested.
Describe the bug
I noticed that at least as of version 3.17.0 of the plugin, it loads hooks.min.js and i18n.min.js on the front end of wordpress. I can't see why these js files would be necessary for it to run, and if they are, can you please explain how they weren't needed before.
To Reproduce
Expected behavior
I assume this files are only needed when logged in in wp-admin
Environment
Plugin version 3.17.0
WP version 6.7.1
Additional context
Loading unnecessary JS slows the web page down.
The text was updated successfully, but these errors were encountered: