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

WordPress Trac noreply at wordpress.org
Thu Apr 5 08:04:14 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 pento):

 Here's a brief outline of what I'm currently thinking for this:

 - There are a handful of bugs that I'm still running into, @omarreiss has
 the list, and is working through them.
 - We still need to maintain the `build` folder, as the place where the
 built version of WordPress lands. The build process also modifies PHP
 files, so we wouldn't be able to use the `src` folder as the place where
 `wordpress.zip` is created from.
 - I'm okay with moving CSS around, ''if'' there's an argument for it to be
 moved. Moving the JavaScript makes sense, particularly with our JS
 development practices moving to a modern, modular style. I'm not sure that
 the same argument applies to CSS, though. Either way, I think there needs
 to be a larger discussion on that, adding it onto this ticket will just
 hold it up longer. @omarreiss has done an amazing job keeping the patch up
 to date, lets not burden him further. 🙂 This ticket is going to require
 several follow up tickets, so a discussion of how we manage CSS files can
 quite easily fit into there.

 On the topic of follow ups! Taken by itself, this change makes developing
 for WordPress harder. Moving to a compiled methodology for ''all''
 contributions is a big shift for WordPress, and this change doesn't have
 the polish we need to be presenting to encourage new contributors. So,
 while I'm fine with this reorganisation landing in `trunk`, there are
 several other changes that I think will be necessary.

 - Better, opinionated dev environment documentation. We currently offer a
 variety of options, but don't really give people a "if you're not sure, do
 this" document. Rather than encouraging contributors to choose a tool
 (particular non-technical contributors who have no way to evaluate those
 tools), we should be doing it for them. Decisions, not options. 😉 This is
 particular important, as `grunt watch` has awful performance in any
 environment that uses a VM and shared folders. Choosing the wrong
 development environment can give a terrible experience.
 - Automated development environment setup scripts. The
 [https://github.com/WordPress/gutenberg/blob/master/bin/setup-local-env.sh
 Gutenberg setup script] walks the user through setting up their
 development environment. It would obviously need to be written to work on
 Windows, too, before it was a valid option for Core. That will be fun. 🙂
 - Modernising build tools. We currently use a little bit of webpack, and a
 whole lot of Grunt. This reorg adds a little more webpack usage, and
 Gutenberg will add a whole lot more. I believe we can standardise
 everything on webpack, reducing the number of tools we rely on.

 So, while `trunk` will be a little harder to work with after this change
 lands, the aim is to rapidly iterate on the experience, so we ultimately
 end up with a simpler, friendlier, more modern development environment
 that welcomes a wider range of contributors.

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


More information about the wp-trac mailing list