Open mAAdhaTTah opened 6 years ago
Here are the options for Assets\Register:
Rely 100% on SCRIPT_DEBUG
and remove the set_debug
method. This takes control away from the developer completely as to whether minified or unminified scripts get served, but it does match WordPress' behavior and is considered best practice. I would not be opposed to imposing this opinion on framework consumers, but note that it does mean that developers would be required to provide both minified and unminified scripts, or at least .js
and .min.js
versions of all their assets, as they can no longer know in advance which scripts will be required.
Rely 100% on set_debug
, allowing the developer to determine for themselves whether and how the assets are put into debug mode. While I use SCRIPT_DEBUG
myself in conjunction with set_debug
, others may prefer to do it with WP_DEBUG
, their own constant (e.g. PF_DEBUG
), or even a database option. Using set_debug
allows them this control. We also have some additional options for this:
set_debug
defaults to true
, which means developers are not required to ship minified scripts and can use .js
by default.set_debug
defaults to false
, which means developers are required to ship minified scripts.Feasibly, I've also considered setting "debug mode" at the application level, but that might be too coarse of an API for this use case.
@AramZS Thoughts?
See https://github.com/PressForward/pressforward/pull/991