[wp-trac] [WordPress Trac] #57487: Add support for "development mode"

WordPress Trac noreply at wordpress.org
Sat Jan 28 00:42:32 UTC 2023


#57487: Add support for "development mode"
-------------------------+-----------------------------
 Reporter:  azaozz       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+-----------------------------

Comment (by flixos90):

 Spotting this ticket with some delay, I have provided the more concrete
 use-case that at least partially led to this ticket in #57573, which is
 maybe a duplicate, maybe not (depending on approach to take).

 Reading through the conversation here, it seems we are mixing up
 environment and development mode, which I think is diverging a bit from
 the original intent. Yes, there is some overlap: `WP_ENVIRONMENT_TYPE` is
 for the environment, and to a degree it's possible to infer or guess
 certain things on the development mode. For example, if
 `WP_ENVIRONMENT_TYPE` is "development" or "local", it is ''likely'' that
 this environment is being used for development. However just ''likely'',
 not ''guaranteed'', as @azaozz has pointed out with an example above. So I
 think we should decouple the two topics - development mode and environment
 type are not the same.

 For example, when you develop, you may be develop a plugin, or a theme, or
 contribute to core. Or maybe even something a bit more obscure like
 develop a drop-in. [55138], [55148], and [55155] are great examples for
 something where we need a way to signify whether a theme is being
 developed or not, because only if a theme is being developed the code
 should behave differently and not cache. If a plugin is being developed
 for example, the code should behave the same it would on a regular
 production site and use the cache.

 This leads me to think we need something closer to maybe a
 `WP_DEVELOPMENT_MODE` constant, which for example could be set to
 something like `core`, `plugin`, `theme`. By default it could be either
 not set, or an empty string, signifying that no particular development
 mode at all should be used.

 Curious about your thoughts on this.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57487#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list