-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: Document the build process (Webpack) #8982
Comments
Our experience is that understanding and using JS build tools is the biggest initial barrier to getting WordPress Devs (with experience in PHP & jQuery) working with React in WordPress. They need to get our build tools working on their local dev environment before starting to learn how we are writing our React based WordPress plugin. It's a big step for them & we've written a lot of very specific detailed documentation to help them through this process. I'm also myself still working hard to understand the Gutenberg JS build tools (especially webpack but also babel). I've followed the package.json & webpack.config.js files in Gutenberg for some time. I've often struggled to find explanations for much of what I see there. These files also got increasingly complex over time & I've not found explanations for most of the changes. It would be great if others like me could use the Gutenberg JS build tools as a starting or reference point for our projects. We currently use an ejected version of create-react-app but are increasingly referring to and adding parts from the Gutenberg build process which help us deal better with using React within WordPress. Documentation of this area would hopefully allow me to understand:
|
Highlighting this as it makes for a good argument that inline code documentation (i.e. comments) could, in some instances, serve better than a single separate document in order to reduce the "distance" between the code itself and the explanation of what it's intending to implement. |
The converse of that^ is that there are no good, straightforward recipes/cookbooks available. |
We should make sure we document how one can take advantage of global variables to do some advanced work:
|
We have some great progress on this one now that we abstracted webpack behind
|
I created a follow-up issue for this part: #14492. |
Our build process, specifically the Webpack build, implements a fair bit of "magic" in order to define globals on the
wp
namespace, and to update import references to leverage these globals. We should document how this process works to educate those who might be interested in interfacing, modifying, or extending those behaviors.https://github.com/WordPress/gutenberg/blob/master/webpack.config.js
Open questions:
cc @adamsilverstein @BE-Webdesign
The text was updated successfully, but these errors were encountered: