Yoast / wordpress-develop-mirror

WordPress development sync to develop patches against.
https://make.wordpress.org/core/
5 stars 3 forks source link

Try: JS source directory approach #85

Closed omarreiss closed 6 years ago

omarreiss commented 6 years ago

⚠️ Still a work in progress. ⚠️

The idea behind this is to move all JS source to a src/js/ dir and build the distributed JS files from there. This is by far the most work of the three approaches I have in mind for bundling JS in WordPress core, but it also seems to me to be the most future friendly. I think it would also allow us some freedom to reorganize the code a bit and make things more modular.

One nice thing I've found while trying this out, is that a ton of JS dependencies can be managed straight through NPM, which is a much more transparent way to manage the dependencies (many aren't up-to-date!). There are over 50 scripts that we ship from the following packages.

package_json_ ___wp_mirror

There are also a bunch of JS dependencies which are not on NPM or even maintained anymore. I've moved those into src/js/wp-vendor to create a clear distinction between the WP native scripts and the dependencies. For each of those dependencies, I've also documented where the source van be found in the Webpack config. This might not be the best place, but the advantage is that those dependencies are nicely grouped there.

webpack_config_dev_js_ ___wp_mirror

Still todo:

omarreiss commented 6 years ago

replaced by #89