Add a "Get started with wp-scripts" doc to the Getting Started section - #55372
Conversation
|
Flaky tests detected in b2ee650. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6552253827
|
|
I only skimmed the document, but everything reads great. Excellent job! See also my note in #55373 (comment). |
apeatling
left a comment
There was a problem hiding this comment.
Nice work, we need more docs like this!
|
@juanmaguitar I have added a callout for the new |
|
|
||
| The [`@wordpress/scripts`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) package, commonly referred to as `wp-scripts`, is a set of configuration files and scripts that primarily aims to standardize and simplify the development process of WordPress projects that require a JavaScript build step. | ||
|
|
||
| A JavaScript build step refers to the process of transforming, bundling, and optimizing JavaScript source code and related assets into a format suitable for production environments. These build steps often take modern JavaScript (ESNext and JSX) and convert it to a version compatible with most browsers. They can also bundle multiple files into one, minify the code to reduce file size and perform various other tasks to optimize the code. |
There was a problem hiding this comment.
We can simplify these explanations about the Build process once we craft "Fundamentals of Block Development > The Build process" according to #54124
|
|
||
| The package abstracts away much of the initial setup, configuration, and boilerplate code associated with JavaScript development for modern WordPress. You can then focus on building blocks and Block Editor extensions. | ||
|
|
||
| ## Quick start |
There was a problem hiding this comment.
I would simplify this whole article by assuming blocks are going to be created using "create-block" so I would remove any references about how to install it and focus this introduction on how to use it and the things that are being taken care of by this script.
I think the handbook should reinforce the idea of using create-block + wp-scripts + wp-env as the "trinity" of official tools recommended for Block Development
There was a problem hiding this comment.
It would be enough just adding a callout highlighting the idea of how create-block already incorporates wp-script with already prepared scripts so no additional installation is needed for wp-scripts is needed when creating a block with create-block
Fixes #54961
What?
This PR adds a getting started guide for
wp-scripts. This package is one of the best tools for building projects for the Block Editor. It's used heavily throughout the Block Editor Handbook in examples and is fundamental to thecreate-blockpackage. Having a primer on the subject in the Getting Started section will help new developers get oriented.