[wp-trac] [WordPress Trac] #43055: Reorganize Core JS / introduce build step

WordPress Trac noreply at wordpress.org
Wed Jan 10 09:52:21 UTC 2018


#43055: Reorganize Core JS / introduce build step
------------------------------+-------------------------
 Reporter:  omarreiss         |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  5.0
Component:  Build/Test Tools  |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  dev-feedback      |     Focuses:  javascript
------------------------------+-------------------------

Comment (by omarreiss):

 @jorbin thanks a lot for these points!

 1) Absolutely, will look into it!
 2) Yes, was planning on this, but forgot about it again. I think we
 should. Will do the work.
 3) I can definitely prepare a make/core post based on everything I've
 written up so far. I think @pento or @adamsilverstein would be likely
 candidates to eventually commit this.
 4) Absolutely, I will work on docs explaining the process for managing
 dependencies, the build process, the directory structure and a process for
 extracting code from existing `_enqueues` scripts for reuse (some kind of
 boyscout principle). Then I think it would be good to have a README.md in
 `src/js` referencing this documentation.
 5) I can add a draft for this to the dependency management documentation.
 We can always figure out later where this should end up eventually.
 6) I would be in favor of that. When I discussed this with @pento he was
 also thinking along those lines. The most compelling argument I read
 against only running from `build` is that PHP changes will also need to be
 built in order to take effect. I can imagine that to be an undesireable
 barrier. There is also something to say for `/build` not really being a
 development build, but more of a distribution artifact. To me it seems
 like a good balance to allow building the JS to `src` as well but just
 adding the JS build dirs to `.gitignore` so that they don't get included
 in the source. That's still pretty much all-in if you ask me and makes the
 impact on dev platforms like VVV minimal. They basically only need to add
 `npm install && grunt build` to their provision scripts. In other words:
 maximum gain with almost zero cost.

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


More information about the wp-trac mailing list