[wp-trac] [WordPress Trac] #51966: npm/grunt watch/build task names are inconsistent and unintuitive

WordPress Trac noreply at wordpress.org
Fri Dec 11 10:51:20 UTC 2020


#51966: npm/grunt watch/build task names are inconsistent and unintuitive
-----------------------------------+-------------------------------
 Reporter:  iandunn                |       Owner:  (none)
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Build/Test Tools       |     Version:  5.1
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  javascript, docs
-----------------------------------+-------------------------------

Comment (by atimmer):

 **Recalling our thinking**
 I spend some time remembering what we were trying to do. The reason for
 building to `src` was that we identified that for some WordPress
 contributors, having to run a watch task to make PHP changes would be a
 non-starter. I now think that we made a mistake, but that it might have
 been right within the thinking of that time. Having `build` & `src` is too
 confusing, I even have trouble recalling how it works, which is not a good
 sign.

 So fundamentally, a proper solution would have one folder to run from.

 **Different approaches**
 This 'proper solution' results in a philosophical conflict. The WordPress
 PHP has long had a philosophy of zero-installs. Cloning the repository
 means it works. The JavaScript world has long had a philosophy of having a
 build step before it works. I used to be a sole proponent of lean and mean
 repositories. Only commit the absolute necessities and have a build step
 producing pristine artifacts that can be run.

 My current understanding is that both are a tradeoff with different
 qualities. The package manager Yarn has recognised this and supports zero-
 installs very well now: https://yarnpkg.com/features/pnp#fixing-
 node_modules. "The generated .pnp.js file can be committed to your
 repository as part of the [https://yarnpkg.com/features/zero-installs
 Zero-Installs] effort, removing the need to run yarn install in the first
 place."

 It is not for me to say, but I have a feeling that zero-installs fit
 better with WordPress's philosophies. Zero-installs are decidedly more
 accessible as they require less tooling on the part of a new contributor.
 But it might be that that ship has sailed with Gutenberg.

 **Band-aid**
 Having said all that, I think @azaozz's proposal is a proper band-aid as
 long as the performance is acceptable. So 👍🏻 for simply doing that.

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


More information about the wp-trac mailing list