Skip to content

Add a "Get started with wp-scripts" doc to the Getting Started section - #55372

Merged
ndiego merged 5 commits into
trunkfrom
docs/add-get-started-with-wp-scripts-doc
Oct 18, 2023
Merged

Add a "Get started with wp-scripts" doc to the Getting Started section#55372
ndiego merged 5 commits into
trunkfrom
docs/add-get-started-with-wp-scripts-doc

Conversation

@ndiego

@ndiego ndiego commented Oct 15, 2023

Copy link
Copy Markdown
Member

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 the create-block package. Having a primer on the subject in the Getting Started section will help new developers get oriented.

@ndiego ndiego added the [Type] Developer Documentation Documentation for developers label Oct 15, 2023
@ndiego ndiego self-assigned this Oct 15, 2023
@github-actions

github-actions Bot commented Oct 15, 2023

Copy link
Copy Markdown

Flaky tests detected in b2ee650.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6552253827
📝 Reported issues:

@gziolo

gziolo commented Oct 16, 2023

Copy link
Copy Markdown
Member

I only skimmed the document, but everything reads great. Excellent job!

See also my note in #55373 (comment).

@apeatling apeatling left a comment

Copy link
Copy Markdown
Contributor

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!

@ndiego

ndiego commented Oct 17, 2023

Copy link
Copy Markdown
Member Author

@juanmaguitar I have added a callout for the new create-block doc. Let me know what you think.


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.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

@ndiego
ndiego enabled auto-merge (squash) October 17, 2023 20:08
@ndiego
ndiego merged commit f35837b into trunk Oct 18, 2023
@ndiego
ndiego deleted the docs/add-get-started-with-wp-scripts-doc branch October 18, 2023 11:19
@github-actions github-actions Bot added this to the Gutenberg 16.9 milestone Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Developer Documentation Documentation for developers

4 participants