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
There are times where it is beneficial to load unminified assets within a theme. In order to facilitate this, WordPress core uses the SCRIPT_DEBUG constant. More on that in the official documentation.
Since Understrap is already including the source files (at it should) this PR makes it possible to define SCRIPT_DEBUG to load the source files
Who will benefit?
Primarily developers working locally, or in other setups where they it is beneficial to not load the minified versions of scripts.
Benefits and risks
The benefit is that s brings Understrap more inline with best practices around provide the option to load full versions of assets. Of course the risk is if someone leaves the constant set on production it could have performance implications. But the risk is pretty small.
Proposed solution
If SCRIPT_DEBUG is defined as true, then load the full scripts in inc/enqueue.php. The alternative would be an Understrap unique constant or setting, but since this is a dev feature relying on core makes sense to me here.
Examples
Yes, this is common both WordPress Core and many other themes, frameworks, and plugins.
Priority/Severity
Low (anything else e.g., trivial, minor improvements)
The text was updated successfully, but these errors were encountered:
I agree with this with one caveat: often (and more often since we've migrated away from gulp) the issue is with the minification itself, so the non-minified scripts work, but the minified scripts don't. So if you're not testing minified scripts on your local, you're not testing what'll eventually be deployed.
I still think we should do this, but something to keep in mind that this adds another thing for developers to keep an eye on.
Problem Statement
There are times where it is beneficial to load unminified assets within a theme. In order to facilitate this, WordPress core uses the
SCRIPT_DEBUG
constant. More on that in the official documentation.Since Understrap is already including the source files (at it should) this PR makes it possible to define
SCRIPT_DEBUG
to load the source filesWho will benefit?
Primarily developers working locally, or in other setups where they it is beneficial to not load the minified versions of scripts.
Benefits and risks
The benefit is that s brings Understrap more inline with best practices around provide the option to load full versions of assets. Of course the risk is if someone leaves the constant set on production it could have performance implications. But the risk is pretty small.
Proposed solution
If
SCRIPT_DEBUG
is defined as true, then load the full scripts ininc/enqueue.php
. The alternative would be an Understrap unique constant or setting, but since this is a dev feature relying on core makes sense to me here.Examples
Yes, this is common both WordPress Core and many other themes, frameworks, and plugins.
Priority/Severity
The text was updated successfully, but these errors were encountered: