-
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
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-block
package. Having a primer on the subject in the Getting Started section will help new developers get oriented.